diff --git a/eng/pipelines/patch-release.yml b/eng/pipelines/patch-release.yml index d9559a5bd310..d97acf7c949a 100644 --- a/eng/pipelines/patch-release.yml +++ b/eng/pipelines/patch-release.yml @@ -4,16 +4,44 @@ extends: template: /eng/pipelines/templates/stages/archetype-sdk-client-patch.yml parameters: artifacts: - - name: azure-sdk-template + - name: azure-communication-email groupId: com.azure - safeName: azuresdktemplate - ServiceDirectory: template - - name: azure-sdk-template-two + safeName: azurecommunicationemail + ServiceDirectory: communication + - name: azure-communication-jobrouter groupId: com.azure - safeName: azuresdktemplatetwo - ServiceDirectory: template - - name: azure-sdk-template-three + safeName: azurecommunicationjobrouterclient + ServiceDirectory: communication + - name: azure-communication-identity groupId: com.azure - safeName: azuresdktemplatethree - ServiceDirectory: template + safeName: azurecommunicationidentity + ServiceDirectory: communication + - name: azure-ai-contentsafety + groupId: com.azure + safeName: azureaicontentsafety + ServiceDirectory: contentsafety + - name: azure-communication-sms + groupId: com.azure + safeName: azurecommunicationsms + ServiceDirectory: communication + - name: azure-communication-common + groupId: com.azure + safeName: azurecommunicationcommon + ServiceDirectory: communication + - name: azure-communication-messages + groupId: com.azure + safeName: azurecommunicationmessages + ServiceDirectory: communication + - name: azure-communication-rooms + groupId: com.azure + safeName: azurecommunicationrooms + ServiceDirectory: communication + - name: azure-communication-callautomation + groupId: com.azure + safeName: azurecommunicationcallautomation + ServiceDirectory: communication + - name: azure-communication-phonenumbers + groupId: com.azure + safeName: azurecommunicationphonenumbers + ServiceDirectory: communication diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 828aee337bbd..532982b95a2c 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -37,7 +37,7 @@ com.azure:azure-sdk-all;1.0.0;1.0.0 com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 com.azure:azure-ai-anomalydetector;3.0.0-beta.5;3.0.0-beta.6 -com.azure:azure-ai-contentsafety;1.0.1;1.1.0-beta.1 +com.azure:azure-ai-contentsafety;1.0.1;1.0.2 com.azure:azure-ai-documentintelligence;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-ai-documenttranslator;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-ai-formrecognizer;4.1.6;4.2.0-beta.1 @@ -67,19 +67,19 @@ 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.1.3;1.2.0-beta.1 +com.azure:azure-communication-callautomation;1.1.3;1.1.4 com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-communication-chat;1.5.0;1.6.0-beta.1 -com.azure:azure-communication-common;1.3.1;1.4.0-beta.1 +com.azure:azure-communication-common;1.3.1;1.3.2 com.azure:azure-communication-common-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-communication-email;1.0.11;1.1.0-beta.1 -com.azure:azure-communication-identity;1.5.3;1.6.0-beta.1 -com.azure:azure-communication-jobrouter;1.1.2;2.0.0-beta.1 -com.azure:azure-communication-messages;1.0.1;1.1.0-beta.1 +com.azure:azure-communication-email;1.0.11;1.0.12 +com.azure:azure-communication-identity;1.5.3;1.5.4 +com.azure:azure-communication-jobrouter;1.1.2;1.1.3 +com.azure:azure-communication-messages;1.0.1;1.0.2 com.azure:azure-communication-networktraversal;1.1.0;1.2.0-beta.1 -com.azure:azure-communication-phonenumbers;1.1.11;1.2.0-beta.4 -com.azure:azure-communication-rooms;1.0.9;1.1.0 -com.azure:azure-communication-sms;1.1.22;1.2.0-beta.1 +com.azure:azure-communication-phonenumbers;1.1.11;1.1.12 +com.azure:azure-communication-rooms;1.0.9;1.1.1 +com.azure:azure-communication-sms;1.1.22;1.1.23 com.azure:azure-containers-containerregistry;1.2.6;1.3.0-beta.1 com.azure:azure-containers-containerregistry-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core;1.48.0;1.49.0-beta.1 diff --git a/sdk/communication/azure-communication-callautomation/CHANGELOG.md b/sdk/communication/azure-communication-callautomation/CHANGELOG.md index f545d11da069..d404bef80d02 100644 --- a/sdk/communication/azure-communication-callautomation/CHANGELOG.md +++ b/sdk/communication/azure-communication-callautomation/CHANGELOG.md @@ -1,16 +1,13 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.1.4 (2024-04-23) -- Introduced `TeamsRecordingStateChanged` and `TeamsComplianceRecordingStateChanged` events. - -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. +- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. ## 1.1.3 (2024-03-20) @@ -19,9 +16,7 @@ #### Dependency Updates -- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. ## 1.1.2 (2024-02-20) @@ -43,7 +38,6 @@ - Upgraded `azure-communication-common` from `1.2.14` to version `1.2.15`. - Upgraded `azure-core` from `1.44.0` to version `1.45.1`. - ## 1.1.0 (2023-11-23) ### Features Added @@ -57,16 +51,6 @@ - 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 @@ -102,6 +86,16 @@ - Upgraded `azure-core` from `1.41.0` to version `1.42.0`. +## 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.2 (2023-07-25) ### Other Changes diff --git a/sdk/communication/azure-communication-callautomation/README.md b/sdk/communication/azure-communication-callautomation/README.md index 423261a65673..0d4f449af808 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.1.0 + 1.1.4 ``` [//]: # ({x-version-update-end}) @@ -41,54 +41,7 @@ This is the restart of Call Automation Service. It is renamed to Call Automation ## Examples -### Handle Mid-Connection events with CallAutomation's EventProcessor -To easily handle mid-connection events, Call Automation's SDK provides easier way to handle these events. -Take a look at `CallAutomationEventProcessor`. This will ensure correlation between call and events more easily. -```Java -@RestController -public class ActionController { - // Controller implementation... - - @RequestMapping(value = "/api/events", method = POST) - public ResponseEntity handleCallEvents(@RequestBody String requestBody) { - try { - CallAutomationAsyncClient client = getCallAutomationAsyncClient(); - client.getEventProcessor().processEvents(requestBody); - - return new ResponseEntity<>(HttpStatus.OK); - } catch (Exception e) { - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - } -} -``` -`processEvents` is required for EventProcessor to work. -After event is being consumed by EventProcessor, you can start using its feature. - -See below for example: where you are making a call with `CreateCall`, and wait for `CallConnected` event of the call. - -```Java -public class commandClass { - // Class implementation... - - public void createCallCommand() { - CallAutomationAsyncClient client = getCallAutomationAsyncClient(); // Should be the same instance as the one used in the example above. - String callbackUrl = ""; - CallInvite callInvite = new CallInvite(new CommunicationUserIdentifier("")); - CreateCallResult result = client.createCall(callInvite, callbackUrl).block(); - - try { - // This will wait until CallConnected event is arrived or Timesout! - CreateCallEventResult eventResult = result.waitForEventProcessorAsync(Duration.ofSeconds(30)).block(); - CallConnected returnedEvent = eventResult.successResult(); - } catch (Exception e) { - // Timeout exception happend! - // Call likely was never answered. - } - } -} -``` -If timeout was not set when calling "waitForEventProcessorAsync", the default timeout is 4 minutes. +To be determined. ## Troubleshooting @@ -107,7 +60,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. ## Next steps - - [Call Automation Overview][overview] - [Incoming Call Concept][incomingcall] - [Build a customer interaction workflow using Call Automation][build1] @@ -135,4 +87,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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 +[cognitive_integration]: https://learn.microsoft.com/azure/communication-services/concepts/call-automation/azure-communication-services-azure-cognitive-services-integration diff --git a/sdk/communication/azure-communication-callautomation/assets.json b/sdk/communication/azure-communication-callautomation/assets.json deleted file mode 100644 index ec0e7a17712f..000000000000 --- a/sdk/communication/azure-communication-callautomation/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "java", - "TagPrefix": "java/communication/azure-communication-callautomation", - "Tag": "java/communication/azure-communication-callautomation_bde5640047" -} \ 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 26e7dd407fd8..4599b6ecf020 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.2.0-beta.1 + 1.1.4 Microsoft Azure client library for Call Automation service @@ -40,8 +40,8 @@ src/main src/test - 0.75 - 0.62 + 0.70 + 0.65 false @@ -110,6 +110,12 @@ 1.3 test + + org.mockito + mockito-core + 4.11.0 + test + io.projectreactor reactor-test @@ -122,12 +128,6 @@ 1.11.20 test - - com.azure - azure-core-http-vertx - 1.0.0-beta.17 - test - com.azure azure-identity @@ -185,21 +185,4 @@ - - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.0.0-beta.12 - test - - - - 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 c757a03ffc1e..cf9b6ee6be14 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationAsyncClient.java @@ -5,7 +5,6 @@ import com.azure.communication.callautomation.implementation.AzureCommunicationCallAutomationServiceImpl; import com.azure.communication.callautomation.implementation.CallConnectionsImpl; -import com.azure.communication.callautomation.implementation.CallDialogsImpl; import com.azure.communication.callautomation.implementation.CallMediasImpl; import com.azure.communication.callautomation.implementation.CallRecordingsImpl; import com.azure.communication.callautomation.implementation.accesshelpers.CallConnectionPropertiesConstructorProxy; @@ -18,25 +17,16 @@ import com.azure.communication.callautomation.implementation.models.CommunicationIdentifierModel; import com.azure.communication.callautomation.implementation.models.CommunicationUserIdentifierModel; import com.azure.communication.callautomation.implementation.models.CreateCallRequestInternal; -import com.azure.communication.callautomation.implementation.models.CustomCallingContext; -import com.azure.communication.callautomation.implementation.models.MediaStreamingAudioChannelTypeInternal; -import com.azure.communication.callautomation.implementation.models.MediaStreamingConfigurationInternal; -import com.azure.communication.callautomation.implementation.models.MediaStreamingContentTypeInternal; -import com.azure.communication.callautomation.implementation.models.MediaStreamingTransportTypeInternal; import com.azure.communication.callautomation.implementation.models.RedirectCallRequestInternal; import com.azure.communication.callautomation.implementation.models.RejectCallRequestInternal; -import com.azure.communication.callautomation.implementation.models.TranscriptionConfigurationInternal; -import com.azure.communication.callautomation.implementation.models.TranscriptionTransportTypeInternal; import com.azure.communication.callautomation.models.AnswerCallOptions; import com.azure.communication.callautomation.models.AnswerCallResult; import com.azure.communication.callautomation.models.CallInvite; 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; -import com.azure.communication.callautomation.models.TranscriptionOptions; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.core.annotation.ReturnType; @@ -52,10 +42,8 @@ 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; @@ -76,21 +64,17 @@ public final class CallAutomationAsyncClient { private final AzureCommunicationCallAutomationServiceImpl azureCommunicationCallAutomationServiceInternal; private final CallRecordingsImpl callRecordingsInternal; private final CallMediasImpl callMediasInternal; - private final CallDialogsImpl callDialogsInternal; private final ClientLogger logger; private final ContentDownloader contentDownloader; private final HttpPipeline httpPipelineInternal; private final String resourceUrl; private final CommunicationUserIdentifierModel sourceIdentity; - private final CallAutomationEventProcessor eventProcessor; - CallAutomationAsyncClient(AzureCommunicationCallAutomationServiceImpl callServiceClient, CommunicationUserIdentifier sourceIdentity, CallAutomationEventProcessor eventProcessor) { + CallAutomationAsyncClient(AzureCommunicationCallAutomationServiceImpl callServiceClient, CommunicationUserIdentifier sourceIdentity) { this.callConnectionsInternal = callServiceClient.getCallConnections(); this.azureCommunicationCallAutomationServiceInternal = callServiceClient; this.callRecordingsInternal = callServiceClient.getCallRecordings(); this.callMediasInternal = callServiceClient.getCallMedias(); - this.callDialogsInternal = callServiceClient.getCallDialogs(); - this.eventProcessor = eventProcessor; this.logger = new ClientLogger(CallAutomationAsyncClient.class); this.contentDownloader = new ContentDownloader(callServiceClient.getEndpoint(), callServiceClient.getHttpPipeline()); this.httpPipelineInternal = callServiceClient.getHttpPipeline(); @@ -98,14 +82,7 @@ public final class CallAutomationAsyncClient { this.sourceIdentity = sourceIdentity == null ? null : CommunicationUserIdentifierConverter.convert(sourceIdentity); } - /** - * Get the event processor for handling events. - * @return {@link CallAutomationEventProcessor} as event processor - */ - public CallAutomationEventProcessor getEventProcessor() { - return eventProcessor; - } - + //region Pre-call Actions /** * Get Source Identity that is used for create and answer call * @return {@link CommunicationUserIdentifier} represent source @@ -114,7 +91,6 @@ public CommunicationUserIdentifier getSourceIdentity() { return sourceIdentity == null ? null : CommunicationUserIdentifierConverter.convert(sourceIdentity); } - //region Pre-call Actions /** * Create a call connection request from a source identity to a target identity. * @@ -186,8 +162,6 @@ private Mono> getCreateCallResponseMono(Context conte context = context == null ? Context.NONE : context; return azureCommunicationCallAutomationServiceInternal.createCallWithResponseAsync( createCallRequestInternal, - UUID.randomUUID(), - OffsetDateTime.now(), context) .map(response -> { try { @@ -206,7 +180,7 @@ private Mono> getCreateCallResponseMono(Context conte } private CreateCallRequestInternal getCreateCallRequestInternal(CreateCallOptions createCallOptions) { - List targetsModel = new LinkedList(); + List targetsModel = new LinkedList<>(); targetsModel.add(CommunicationIdentifierConverter.convert(createCallOptions.getCallInvite().getTargetParticipant())); CallIntelligenceOptionsInternal callIntelligenceOptionsInternal = null; @@ -215,7 +189,7 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateCallOptions callIntelligenceOptionsInternal.setCognitiveServicesEndpoint(createCallOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint()); } - CreateCallRequestInternal request = new CreateCallRequestInternal() + return new CreateCallRequestInternal() .setSourceCallerIdNumber(PhoneNumberIdentifierConverter.convert(createCallOptions.getCallInvite().getSourceCallerIdNumber())) .setSourceDisplayName(createCallOptions.getCallInvite().getSourceDisplayName()) .setSource(sourceIdentity) @@ -223,28 +197,6 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateCallOptions .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().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) { - MediaStreamingConfigurationInternal streamingConfigurationInternal = - getMediaStreamingConfigurationInternal(createCallOptions.getMediaStreamingConfiguration()); - request.setMediaStreamingConfiguration(streamingConfigurationInternal); - } - - if (createCallOptions.getTranscriptionConfiguration() != null) { - TranscriptionConfigurationInternal transcriptionConfigurationInternal = - getTranscriptionConfigurationInternal(createCallOptions.getTranscriptionConfiguration()); - request.setTranscriptionConfiguration(transcriptionConfigurationInternal); - } - - return request; } private CreateCallRequestInternal getCreateCallRequestInternal(CreateGroupCallOptions createCallGroupOptions) { @@ -257,7 +209,7 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateGroupCallOp callIntelligenceOptionsInternal.setCognitiveServicesEndpoint(createCallGroupOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint()); } - CreateCallRequestInternal request = new CreateCallRequestInternal() + return new CreateCallRequestInternal() .setSourceCallerIdNumber(PhoneNumberIdentifierConverter.convert(createCallGroupOptions.getSourceCallIdNumber())) .setSourceDisplayName(createCallGroupOptions.getSourceDisplayName()) .setSource(sourceIdentity) @@ -265,53 +217,6 @@ private CreateCallRequestInternal getCreateCallRequestInternal(CreateGroupCallOp .setCallbackUri(createCallGroupOptions.getCallbackUrl()) .setCallIntelligenceOptions(callIntelligenceOptionsInternal) .setOperationContext(createCallGroupOptions.getOperationContext()); - - if (createCallGroupOptions.getCustomContext().getSipHeaders() != null || createCallGroupOptions.getCustomContext().getVoipHeaders() != null) { - CustomCallingContext customContext = new CustomCallingContext(); - customContext.setSipHeaders(createCallGroupOptions.getCustomContext().getSipHeaders()); - customContext.setVoipHeaders(createCallGroupOptions.getCustomContext().getVoipHeaders()); - request.setCustomCallingContext(customContext); - } - - if (createCallGroupOptions.getMediaStreamingConfiguration() != null) { - MediaStreamingConfigurationInternal streamingConfigurationInternal = - getMediaStreamingConfigurationInternal(createCallGroupOptions.getMediaStreamingConfiguration()); - request.setMediaStreamingConfiguration(streamingConfigurationInternal); - } - - if (createCallGroupOptions.getTranscriptionConfiguration() != null) { - TranscriptionConfigurationInternal transcriptionConfigurationInternal = - getTranscriptionConfigurationInternal(createCallGroupOptions.getTranscriptionConfiguration()); - request.setTranscriptionConfiguration(transcriptionConfigurationInternal); - } - - return request; - } - - private MediaStreamingConfigurationInternal getMediaStreamingConfigurationInternal( - MediaStreamingOptions mediaStreamingOptions) { - return new MediaStreamingConfigurationInternal() - .setTransportUrl(mediaStreamingOptions.getTransportUrl()) - .setAudioChannelType( - MediaStreamingAudioChannelTypeInternal.fromString( - mediaStreamingOptions.getAudioChannelType().toString())) - .setContentType( - MediaStreamingContentTypeInternal.fromString( - mediaStreamingOptions.getContentType().toString())) - .setTransportType( - MediaStreamingTransportTypeInternal.fromString( - mediaStreamingOptions.getTransportType().toString())); - } - - private TranscriptionConfigurationInternal getTranscriptionConfigurationInternal( - TranscriptionOptions transcriptionOptions) { - return new TranscriptionConfigurationInternal() - .setTransportUrl(transcriptionOptions.getTransportUrl()) - .setTransportType( - TranscriptionTransportTypeInternal.fromString( - transcriptionOptions.getTransportType().toString())) - .setLocale(transcriptionOptions.getLocale()) - .setStartTranscription(transcriptionOptions.getStartTranscription()); } /** @@ -346,13 +251,12 @@ Mono> answerCallWithResponseInternal(AnswerCallOption Context context) { try { context = context == null ? Context.NONE : context; - + AnswerCallRequestInternal request = new AnswerCallRequestInternal() .setIncomingCallContext(answerCallOptions.getIncomingCallContext()) .setCallbackUri(answerCallOptions.getCallbackUrl()) .setAnsweredBy(sourceIdentity) - .setOperationContext(answerCallOptions.getOperationContext()) - .setSourceCallerIdNumber(PhoneNumberIdentifierConverter.convert(answerCallOptions.getSourceCallerIdNumber())); + .setOperationContext(answerCallOptions.getOperationContext()); if (answerCallOptions.getCallIntelligenceOptions() != null && answerCallOptions.getCallIntelligenceOptions().getCognitiveServicesEndpoint() != null) { CallIntelligenceOptionsInternal callIntelligenceOptionsInternal = new CallIntelligenceOptionsInternal(); @@ -360,31 +264,15 @@ Mono> answerCallWithResponseInternal(AnswerCallOption request.setCallIntelligenceOptions(callIntelligenceOptionsInternal); } - if (answerCallOptions.getMediaStreamingConfiguration() != null) { - MediaStreamingConfigurationInternal mediaStreamingConfigurationInternal = - getMediaStreamingConfigurationInternal(answerCallOptions.getMediaStreamingConfiguration()); - request.setMediaStreamingConfiguration(mediaStreamingConfigurationInternal); - } - - if (answerCallOptions.getTranscriptionConfiguration() != null) { - TranscriptionConfigurationInternal transcriptionConfigurationInternal = - getTranscriptionConfigurationInternal(answerCallOptions.getTranscriptionConfiguration()); - request.setTranscriptionConfiguration(transcriptionConfigurationInternal); - } - return azureCommunicationCallAutomationServiceInternal.answerCallWithResponseAsync( request, - UUID.randomUUID(), - OffsetDateTime.now(), context) .map(response -> { try { CallConnectionAsync callConnectionAsync = getCallConnectionAsync(response.getValue().getCallConnectionId()); - AnswerCallResult result = new AnswerCallResult(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 AnswerCallResult(CallConnectionPropertiesConstructorProxy.create(response.getValue()), + new CallConnection(callConnectionAsync), callConnectionAsync)); } catch (URISyntaxException e) { throw logger.logExceptionAsError(new RuntimeException(e)); } @@ -430,19 +318,9 @@ Mono> redirectCallWithResponseInternal(RedirectCallOptions redire .setIncomingCallContext(redirectCallOptions.getIncomingCallContext()) .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().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); + request, + context); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -487,8 +365,6 @@ Mono> rejectCallWithResponseInternal(RejectCallOptions rejectCall return azureCommunicationCallAutomationServiceInternal.rejectCallWithResponseAsync( request, - UUID.randomUUID(), - OffsetDateTime.now(), context); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -504,7 +380,7 @@ Mono> rejectCallWithResponseInternal(RejectCallOptions rejectCall * @return a CallContentAsync. */ public CallConnectionAsync getCallConnectionAsync(String callConnectionId) { - return new CallConnectionAsync(callConnectionId, callConnectionsInternal, callMediasInternal, callDialogsInternal, eventProcessor); + return new CallConnectionAsync(callConnectionId, callConnectionsInternal, callMediasInternal); } //endregion diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClient.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClient.java index 231cb1a37e00..a341c7b5b1e1 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClient.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClient.java @@ -40,14 +40,7 @@ public final class CallAutomationClient { this.callAutomationAsyncClient = callAutomationAsyncClient; } - /** - * Get the event processor for handling events. - * @return {@link CallAutomationEventProcessor} as event processor - */ - public CallAutomationEventProcessor getEventProcessor() { - return callAutomationAsyncClient.getEventProcessor(); - } - + //region Pre-call Actions /** * Get Source Identity that is used for create and answer call * @return {@link CommunicationUserIdentifier} represent source @@ -56,7 +49,6 @@ public CommunicationUserIdentifier getSourceIdentity() { return callAutomationAsyncClient.getSourceIdentity(); } - //region Pre-call Actions /** * Create a call connection request from a source identity to a target identity. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClientBuilder.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClientBuilder.java index 29f921a5af51..2d46f17b47a9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClientBuilder.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationClientBuilder.java @@ -5,7 +5,6 @@ import com.azure.communication.callautomation.implementation.AzureCommunicationCallAutomationServiceImpl; import com.azure.communication.callautomation.implementation.AzureCommunicationCallAutomationServiceImplBuilder; -import com.azure.communication.callautomation.implementation.CustomBearerTokenAuthenticationPolicy; import com.azure.communication.callautomation.implementation.CustomHmacAuthenticationPolicy; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.common.implementation.CommunicationConnectionString; @@ -71,7 +70,6 @@ public final class CallAutomationClientBuilder implements private final ClientLogger logger = new ClientLogger(CallAutomationClientBuilder.class); private String connectionString; private String endpoint; - private String pmaEndpoint; private String hostName; private AzureKeyCredential azureKeyCredential; private TokenCredential tokenCredential; @@ -105,17 +103,6 @@ public CallAutomationClientBuilder endpoint(String endpoint) { return this; } - /** - * Set pma endpoint override of the service. - * - * @param pmaEndpoint url of the service. - * @return CallAutomationClientBuilder object. - */ - public CallAutomationClientBuilder pmaEndpoint(String pmaEndpoint) { - this.pmaEndpoint = Objects.requireNonNull(pmaEndpoint, "'pmaEndpoint' cannot be null."); - return this; - } - /** * Sets the {@link HttpPipeline} to use for the service client. * @@ -323,7 +310,7 @@ public CallAutomationClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { * and {@link #retryPolicy(RetryPolicy)} have been set. */ public CallAutomationAsyncClient buildAsyncClient() { - return new CallAutomationAsyncClient(createServiceImpl(), sourceIdentity, new CallAutomationEventProcessor()); + return new CallAutomationAsyncClient(createServiceImpl(), sourceIdentity); } /** @@ -346,8 +333,7 @@ private AzureCommunicationCallAutomationServiceImpl createServiceImpl() { boolean isTokenCredentialSet = tokenCredential != null; boolean isCustomEndpointUsed; - String customEndpointEnabled = Configuration.getGlobalConfiguration().get("COMMUNICATION_CUSTOM_ENDPOINT_ENABLED", - "false"); + String customEndpointEnabled = "false"; isCustomEndpointUsed = Objects.equals(customEndpointEnabled, "true"); if (!(isConnectionStringSet && isEndpointSet && isCustomEndpointUsed)) { @@ -400,12 +386,7 @@ private AzureCommunicationCallAutomationServiceImpl createServiceImpl() { } AzureCommunicationCallAutomationServiceImplBuilder clientBuilder = new AzureCommunicationCallAutomationServiceImplBuilder(); - - if (pmaEndpoint != null) { - clientBuilder.endpoint(pmaEndpoint).pipeline(builderPipeline); - } else { - clientBuilder.endpoint(endpoint).pipeline(builderPipeline); - } + clientBuilder.endpoint(endpoint).pipeline(builderPipeline); return clientBuilder.buildClient(); } @@ -431,11 +412,8 @@ private List createHttpPipelineAuthPolicies(boolean isCustom List pipelinePolicies = new ArrayList<>(); if (tokenCredential != null) { - if (pmaEndpoint != null) { - pipelinePolicies.add(new CustomBearerTokenAuthenticationPolicy(tokenCredential, endpoint, "https://communication.azure.com//.default")); - } else { - pipelinePolicies.add(new BearerTokenAuthenticationPolicy(tokenCredential, "https://communication.azure.com//.default")); - } + pipelinePolicies.add(new BearerTokenAuthenticationPolicy(tokenCredential, + "https://communication.azure.com//.default")); Map httpHeaders = new HashMap<>(); httpHeaders.put("x-ms-host", hostName); pipelinePolicies.add(new AddHeadersPolicy(new HttpHeaders(httpHeaders))); 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 a9a96b00a4c0..ddf0d7d80265 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 @@ -5,7 +5,6 @@ import com.azure.communication.callautomation.models.events.AddParticipantFailed; import com.azure.communication.callautomation.models.events.AddParticipantSucceeded; -import com.azure.communication.callautomation.models.events.AnswerFailed; import com.azure.communication.callautomation.models.events.CallAutomationEventBase; import com.azure.communication.callautomation.models.events.CallConnected; import com.azure.communication.callautomation.models.events.CallDisconnected; @@ -16,16 +15,6 @@ import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionStopped; import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneFailed; import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneReceived; -import com.azure.communication.callautomation.models.events.CreateCallFailed; -import com.azure.communication.callautomation.models.events.DialogCompleted; -import com.azure.communication.callautomation.models.events.DialogConsent; -import com.azure.communication.callautomation.models.events.DialogFailed; -import com.azure.communication.callautomation.models.events.DialogHangup; -import com.azure.communication.callautomation.models.events.DialogLanguageChange; -import com.azure.communication.callautomation.models.events.DialogSensitivityUpdate; -import com.azure.communication.callautomation.models.events.DialogStarted; -import com.azure.communication.callautomation.models.events.DialogTransfer; -import com.azure.communication.callautomation.models.events.HoldFailed; import com.azure.communication.callautomation.models.events.ParticipantsUpdated; import com.azure.communication.callautomation.models.events.PlayCanceled; import com.azure.communication.callautomation.models.events.PlayCompleted; @@ -36,15 +25,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.TeamsComplianceRecordingStateChanged; -import com.azure.communication.callautomation.models.events.TeamsRecordingStateChanged; -import com.azure.communication.callautomation.models.events.TranscriptionFailed; -import com.azure.communication.callautomation.models.events.TranscriptionResumed; -import com.azure.communication.callautomation.models.events.TranscriptionStarted; -import com.azure.communication.callautomation.models.events.TranscriptionStopped; import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; -import com.azure.communication.callautomation.models.events.TranscriptionUpdated; import com.azure.core.models.CloudEvent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.core.JsonProcessingException; @@ -67,13 +49,12 @@ public final class CallAutomationEventParser { * Returns a list of events from request's body. * * @param requestBody Body of the event request. - * @throws RuntimeException Any exceptions occurs at runtime. + * @throws RuntimeException Any exception occurs at runtime. * @return a list of CallAutomationEventBase */ public static List parseEvents(String requestBody) { List callAutomationBaseEvents; callAutomationBaseEvents = parseCloudEventList(requestBody); - return callAutomationBaseEvents; } @@ -154,42 +135,6 @@ private static CallAutomationEventBase parseSingleCloudEvent(String data, String 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")) { - ret = mapper.convertValue(eventData, DialogStarted.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.DialogCompleted")) { - ret = mapper.convertValue(eventData, DialogCompleted.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.DialogFailed")) { - ret = mapper.convertValue(eventData, DialogFailed.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.DialogConsent")) { - ret = mapper.convertValue(eventData, DialogConsent.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.DialogHangup")) { - ret = mapper.convertValue(eventData, DialogHangup.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.DialogLanguageChange")) { - ret = mapper.convertValue(eventData, DialogLanguageChange.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.DialogTransfer")) { - ret = mapper.convertValue(eventData, DialogTransfer.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.DialogSensitivityUpdate")) { - ret = mapper.convertValue(eventData, DialogSensitivityUpdate.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.TeamsComplianceRecordingStateChanged")) { - ret = mapper.convertValue(eventData, TeamsComplianceRecordingStateChanged.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.TeamsRecordingStateChanged")) { - ret = mapper.convertValue(eventData, TeamsRecordingStateChanged.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionStarted")) { - ret = mapper.convertValue(eventData, TranscriptionStarted.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionFailed")) { - ret = mapper.convertValue(eventData, TranscriptionFailed.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionResumed")) { - ret = mapper.convertValue(eventData, TranscriptionResumed.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionStopped")) { - ret = mapper.convertValue(eventData, TranscriptionStopped.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.TranscriptionUpdated")) { - ret = mapper.convertValue(eventData, TranscriptionUpdated.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.AnswerFailed")) { - ret = mapper.convertValue(eventData, AnswerFailed.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.CreateCallFailed")) { - ret = mapper.convertValue(eventData, CreateCallFailed.class); - } else if (Objects.equals(eventType, "Microsoft.Communication.HoldFailed")) { - ret = mapper.convertValue(eventData, HoldFailed.class); } return ret; } catch (RuntimeException e) { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventProcessor.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventProcessor.java deleted file mode 100644 index 63e3437adb6c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventProcessor.java +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.communication.callautomation.implementation.eventprocessor.EventAwaiter; -import com.azure.communication.callautomation.implementation.eventprocessor.EventAwaiterOngoing; -import com.azure.communication.callautomation.implementation.eventprocessor.EventAwaiterSingleTime; -import com.azure.communication.callautomation.implementation.eventprocessor.EventBacklog; -import com.azure.communication.callautomation.implementation.eventprocessor.EventWithBacklogId; -import com.azure.communication.callautomation.implementation.eventprocessor.OngoingEventAwaiterKey; -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; -import com.azure.communication.callautomation.models.events.CallDisconnected; -import com.azure.core.util.logging.ClientLogger; -import reactor.core.publisher.Mono; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Consumer; -import java.util.function.Predicate; - -/** - * Call Automation's EventProcessor for incoming events for ease of use. - */ -public final class CallAutomationEventProcessor { - private final EventBacklog eventBacklog; - private final HashSet eventAwaiters; - private static final ClientLogger LOGGER = new ClientLogger(CallAutomationEventProcessor.class); - private static final int DEFAULT_EVENT_AWAITER_EXPIRATION_SECONDS = 240; - - // Key: Map entry of ConnectionId and Event class, Value: ongoingEventAwaiter - // Used to keep track of all ongoing event awaiters. - private final ConcurrentHashMap, EventAwaiterOngoing> ongoingEventAwaiters; - - /** - * Constructor of the event processor - */ - CallAutomationEventProcessor() { - eventBacklog = new EventBacklog(); - eventAwaiters = new HashSet<>(); - ongoingEventAwaiters = new ConcurrentHashMap<>(); - } - - /** - * Process incoming events. Pass incoming events to get it processed to have other method like WaitForEventProcessor to function. - * @param requestBody Incoming event request's body in string. - */ - public void processEvents(String requestBody) { - List receivedEvents = CallAutomationEventParser.parseEvents(requestBody); - if (receivedEvents.isEmpty()) { - return; - } - processEvents(receivedEvents); - } - - /** - * Process incoming events. Pass incoming events to get it processed to have other method like WaitForEventProcessor to function. - * @param events Incoming event in a list that after CallAutomationEventParser processing. - */ - public void processEvents(List events) { - // Note: There will always be only 1 event coming from the service - CallAutomationEventBase receivedEvent = events.get(0); - String backlogEventId = UUID.randomUUID().toString(); - EventWithBacklogId receivedEventWithBacklogId = eventBacklog.addEvent(backlogEventId, receivedEvent); - - // Each event awaiter should be notified and check if this is the event it is looking for. - eventAwaiters.forEach(eventAwaiter -> { - eventAwaiter.onEventsReceived(receivedEventWithBacklogId); - }); - - // If this call is about to disconnect, remove all related items in memory - if (receivedEvent instanceof CallDisconnected) { - // remove the event from eventBacklog - eventBacklog.removeEvent(backlogEventId); - // remove from ongoingevent list - removeFromOngoingEvent(receivedEvent.getCallConnectionId()); - } - } - - /** - * Wait for matching incoming event. This is blocking Call. Returns the event once it arrives in ProcessEvent method. - * @param connectionId Call connection id of the call. - * @param operationContext OperationContext of the method. - * @param eventType The event type that is being waited. - * @return Returns the event once matching event arrives. - * @param Any CallAutomation events. - */ - public TEvent waitForEventProcessor(String connectionId, String operationContext, Class eventType) { - return waitForEventProcessorAsync(connectionId, operationContext, eventType).block(); - } - - /** - * Wait for matching incoming event. This is blocking Call. Returns the event once it arrives in ProcessEvent method. - * @param connectionId Call connection id of the call. - * @param operationContext OperationContext of the method. - * @param eventType The event type that is being waited. - * @param timeout The timeout duration for the event to arrive. - * @return Returns the event once matching event arrives. - * @param Any CallAutomation events. - */ - public TEvent waitForEventProcessor(String connectionId, String operationContext, Class eventType, Duration timeout) { - return waitForEventProcessorAsync(connectionId, operationContext, eventType, timeout).block(); - } - - /** - * Wait for matching incoming event. This is blocking Call. Returns the event once it arrives in ProcessEvent method. - * @param predicate Predicate for waiting on event. - * @return Returns the event once matching event arrives. - */ - public CallAutomationEventBase waitForEventProcessor(Predicate predicate) { - return waitForEventProcessorAsync(predicate).block(); - } - - /** - * Wait for matching incoming event. This is blocking Call. Returns the event once it arrives in ProcessEvent method. - * @param predicate Predicate for waiting on event. - * @param timeout The timeout duration for the event to arrive. - * @return Returns the event once matching event arrives. - */ - public CallAutomationEventBase waitForEventProcessor(Predicate predicate, Duration timeout) { - return waitForEventProcessorAsync(predicate, timeout).block(); - } - - /** - * Wait for matching incoming event. Returns the event once it arrives in ProcessEvent method. - * @param connectionId Call connection id of the call. - * @param operationContext OperationContext of the method. - * @param eventType The event type that is being waited. - * @return Returns the event once matching event arrives. - * @param Any CallAutomation events. - */ - @SuppressWarnings("unchecked") - public Mono waitForEventProcessorAsync(String connectionId, String operationContext, Class eventType) { - return waitForEventProcessorAsync(connectionId, operationContext, eventType, Duration.ofSeconds(DEFAULT_EVENT_AWAITER_EXPIRATION_SECONDS)); - } - - /** - * Wait for matching incoming event. Returns the event once it arrives in ProcessEvent method. - * @param connectionId Call connection id of the call. - * @param operationContext OperationContext of the method. - * @param eventType The event type that is being waited. - * @param timeout The timeout duration for the event to arrive. - * @return Returns the event once matching event arrives. - * @param Any CallAutomation events. - */ - @SuppressWarnings("unchecked") - public Mono waitForEventProcessorAsync(String connectionId, String operationContext, Class eventType, Duration timeout) { - Mono ret = waitForEventProcessorAsync(event -> (Objects.equals(event.getCallConnectionId(), connectionId) || Objects.isNull(connectionId)) - && (Objects.equals(event.getOperationContext(), operationContext) || Objects.isNull(operationContext)) - && event.getClass() == eventType, timeout); - - return ret.map(event -> event == null ? null : (TEvent) event); - } - - /** - * Wait for matching incoming event. Returns the event once it arrives in ProcessEvent method. - * @param predicate Predicate for waiting on event. - * @return Returns the event once matching event arrives. - * @throws RuntimeException all checked exceptions if the logic fails. - */ - public Mono waitForEventProcessorAsync(Predicate predicate) { - return waitForEventProcessorAsync(predicate, Duration.ofSeconds(DEFAULT_EVENT_AWAITER_EXPIRATION_SECONDS)); - } - - /** - * Wait for matching incoming event. Returns the event once it arrives in ProcessEvent method. - * @param predicate Predicate for waiting on event. - * @param timeout The timeout duration for the event to arrive. - * @return Returns the event once matching event arrives. - * @throws RuntimeException all checked exceptions if the logic fails. - */ - public Mono waitForEventProcessorAsync(Predicate predicate, Duration timeout) { - // Initialize awaiter - EventAwaiterSingleTime eventAwaiterSingleTime = new EventAwaiterSingleTime(predicate); - - try { - // Queue it into the subscriber list. - eventAwaiters.add(eventAwaiterSingleTime); - - EventWithBacklogId eventWithBacklogId = eventBacklog.tryGetAndRemoveMatchedEvent(predicate); - - if (eventWithBacklogId == null) { - // If event comes to backlog later before the awaiter expires, ret will get that event, otherwise a timeout exception will throw. - Mono futureEventWithBacklogId = eventAwaiterSingleTime.getEventWithBacklogId().timeout(timeout); - futureEventWithBacklogId.subscribe(event -> { - eventBacklog.removeEvent(event.getBackLogEventId()); - // Remove the awaiter since the event is found or the awaiter is expired. - eventAwaiters.remove(eventAwaiterSingleTime); - eventAwaiterSingleTime.close(); - }); - return futureEventWithBacklogId.map(EventWithBacklogId::getEvent); - } else { - // Remove the awaiter since the event is found or the awaiter is expired. - eventAwaiters.remove(eventAwaiterSingleTime); - eventAwaiterSingleTime.close(); - return Mono.just(eventWithBacklogId.getEvent()); - } - } catch (Exception e) { - if (!eventAwaiterSingleTime.isDisposed()) { - eventAwaiters.remove(eventAwaiterSingleTime); - eventAwaiterSingleTime.close(); - } - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - /** - * Attach Ongoing EventProcessor for specific event. - * @param callConnectionId The call connection id of the call. - * @param eventProcessor EventProcessor to be fired when the specified event arrives. - * @param eventType The event type that is being waited. - * @param Any CallAutomation events. - */ - public void attachOngoingEventProcessor(String callConnectionId, Consumer eventProcessor, Class eventType) { - EventAwaiterOngoing eventAwaiterOngoing = new EventAwaiterOngoing<>(eventType, callConnectionId, eventProcessor); - - try { - // Queue it into the subscriber list. - eventAwaiters.add(eventAwaiterOngoing); - ongoingEventAwaiters.put(new OngoingEventAwaiterKey<>(callConnectionId, eventType), eventAwaiterOngoing); - } catch (Exception e) { - if (!eventAwaiterOngoing.isDisposed()) { - OngoingEventAwaiterKey removalKey = ongoingEventAwaiters.searchKeys(1, key -> { - if (Objects.equals(key.getCallConnectionId(), callConnectionId) && key.getClazz() == eventType) { - return key; - } - return null; - }); - - if (removalKey != null) { - ongoingEventAwaiters.remove(removalKey); - eventAwaiters.remove(eventAwaiterOngoing); - } - } - } - } - - /** - * Detach Ongoing EventProcessor for specific event. - * @param callConnectionId The call connection id of the call. - * @param eventType The event type that is being waited. - * @param Any CallAutomation events. - */ - public void detachOngoingEventProcessor(String callConnectionId, Class eventType) { - removeFromOngoingEvent(callConnectionId, eventType); - } - private void removeFromOngoingEvent(String connectionId) { - removeFromOngoingEvent(connectionId, null); - } - private void removeFromOngoingEvent(String connectionId, Class clazz) { - if (clazz == null) { - // Remove all matching connectionId - List> keysToRemove = new ArrayList<>(); - ongoingEventAwaiters.forEachKey(1, key -> { - if (Objects.equals(key.getCallConnectionId(), connectionId)) { - keysToRemove.add(key); - } - }); - keysToRemove.forEach(key -> { - EventAwaiterOngoing awaiterOngoingToBeRemoved = ongoingEventAwaiters.remove(key); - eventAwaiters.remove(awaiterOngoingToBeRemoved); - }); - } else { - OngoingEventAwaiterKey removalKey = ongoingEventAwaiters.searchKeys(1, key -> { - if (Objects.equals(key.getCallConnectionId(), connectionId) && key.getClazz() == clazz) { - return key; - } - return null; - }); - - if (removalKey != null) { - EventAwaiterOngoing awaiterOngoingToBeRemoved = ongoingEventAwaiters.remove(removalKey); - eventAwaiters.remove(awaiterOngoingToBeRemoved); - } - } - } -} 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 cae499022b2f..b7d8909bd122 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,7 +9,6 @@ * Versions of CallAutomation service supported by this client library. */ public enum CallAutomationServiceVersion implements ServiceVersion { - /** * Service version {@code 2023-03-06}. */ @@ -18,12 +17,7 @@ public enum CallAutomationServiceVersion implements ServiceVersion { /** * Service version {@code 2023-10-15}. */ - V2023_10_15("2023-10-15"), - - /** - * Service version {@code 2023-10-03-preview}. - */ - V2023_10_03_PREVIEW("2023-10-03-preview"); + V2023_10_15("2023-10-15"); private final String version; @@ -45,6 +39,6 @@ public String getVersion() { * @return The latest {@link CallAutomationServiceVersion} object. */ public static CallAutomationServiceVersion getLatest() { - return V2023_10_03_PREVIEW; + return V2023_10_15; } } 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 c6dd8e2514c7..3206c9dd8ab1 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 @@ -16,8 +16,6 @@ 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.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; @@ -236,37 +234,15 @@ public MuteParticipantResult muteParticipant(CommunicationIdentifier targetParti /** * 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 MuteParticipantResult object. + * @param options - MuteParticipantOptions configuration options. + * @param context Context + * @return Response with result of muting a participant from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response muteParticipantWithResponse(MuteParticipantOptions options, Context context) { return callConnectionAsync.muteParticipantWithResponseInternal(options, context).block(); } - /** - * Unmutes participant in the call. - * - * @param targetParticipant - Participant to be unmuted. Only ACS Users are currently supported. - * @return An UnmuteParticipantResult object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UnmuteParticipantResult unmuteParticipant(CommunicationIdentifier targetParticipant) { - return callConnectionAsync.unmuteParticipant(targetParticipant).block(); - } - - /** - * 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 UnmuteParticipantResult object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response unmuteParticipantWithResponse(UnmuteParticipantOptions options, Context context) { - return callConnectionAsync.unmuteParticipantWithResponseInternal(options, context).block(); - } /** * Cancel add participant operation request. @@ -306,15 +282,5 @@ public CallMedia getCallMedia() { return new CallMedia(callConnectionAsync.getCallMediaAsync()); } - /*** - * Returns an object of CallDialog - * - * @return a CallDialogAsync. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CallDialog getCallDialog() { - return new CallDialog(callConnectionAsync.getCallDialogAsync()); - } - //endregion } 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 44ad8c818db7..4e2eac46c27d 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 @@ -4,7 +4,6 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.implementation.CallConnectionsImpl; -import com.azure.communication.callautomation.implementation.CallDialogsImpl; import com.azure.communication.callautomation.implementation.CallMediasImpl; import com.azure.communication.callautomation.implementation.accesshelpers.AddParticipantResponseConstructorProxy; import com.azure.communication.callautomation.implementation.accesshelpers.CallConnectionPropertiesConstructorProxy; @@ -12,7 +11,6 @@ import com.azure.communication.callautomation.implementation.accesshelpers.MuteParticipantsResponseConstructorProxy; import com.azure.communication.callautomation.implementation.accesshelpers.RemoveParticipantResponseConstructorProxy; import com.azure.communication.callautomation.implementation.accesshelpers.TransferCallResponseConstructorProxy; -import com.azure.communication.callautomation.implementation.accesshelpers.UnmuteParticipantsResponseConstructorProxy; import com.azure.communication.callautomation.implementation.converters.CallParticipantConverter; import com.azure.communication.callautomation.implementation.converters.CommunicationIdentifierConverter; import com.azure.communication.callautomation.implementation.converters.PhoneNumberIdentifierConverter; @@ -22,22 +20,20 @@ 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.AddParticipantOptions; import com.azure.communication.callautomation.models.AddParticipantResult; -import com.azure.communication.callautomation.models.CallConnectionProperties; -import com.azure.communication.callautomation.models.CallInvite; import com.azure.communication.callautomation.models.CallParticipant; import com.azure.communication.callautomation.models.CancelAddParticipantOperationOptions; import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; +import com.azure.communication.callautomation.models.AddParticipantOptions; +import com.azure.communication.callautomation.models.CallConnectionProperties; +import com.azure.communication.callautomation.models.CallInvite; import com.azure.communication.callautomation.models.MuteParticipantOptions; import com.azure.communication.callautomation.models.MuteParticipantResult; import com.azure.communication.callautomation.models.RemoveParticipantOptions; 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.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,9 +50,7 @@ import reactor.core.publisher.Mono; import java.net.URISyntaxException; -import java.time.OffsetDateTime; import java.util.Collections; -import java.util.UUID; import static com.azure.core.util.FluxUtil.monoError; import static com.azure.core.util.FluxUtil.withContext; @@ -68,20 +62,15 @@ public final class CallConnectionAsync { private final String callConnectionId; private final CallConnectionsImpl callConnectionInternal; private final CallMediasImpl callMediasInternal; - private final CallDialogsImpl callDialogsInternal; - private final CallAutomationEventProcessor eventProcessor; private final ClientLogger logger; CallConnectionAsync( String callConnectionId, CallConnectionsImpl callConnectionInternal, - CallMediasImpl contentsInternal, - CallDialogsImpl dialogsInternal, CallAutomationEventProcessor eventProcessor) { + CallMediasImpl contentsInternal) { this.callConnectionId = callConnectionId; this.callConnectionInternal = callConnectionInternal; this.callMediasInternal = contentsInternal; - this.callDialogsInternal = dialogsInternal; - this.eventProcessor = eventProcessor; this.logger = new ClientLogger(CallConnectionAsync.class); } @@ -158,8 +147,6 @@ Mono> hangUpWithResponseInternal(boolean isForEveryone, Context c return (isForEveryone ? callConnectionInternal.terminateCallWithResponseAsync( callConnectionId, - UUID.randomUUID(), - OffsetDateTime.now(), context) : callConnectionInternal.hangupCallWithResponseAsync(callConnectionId, context)); } catch (RuntimeException ex) { @@ -217,10 +204,10 @@ Mono> getParticipantWithResponseInternal(Communication public PagedFlux listParticipants() { try { return new PagedFlux<>( - () -> withContext(context -> this.callConnectionInternal.getParticipantsSinglePageAsync( - callConnectionId, context)), + () -> withContext(context -> this.callConnectionInternal.getParticipantsSinglePageAsync( + callConnectionId, context)), nextLink -> withContext(context -> this.callConnectionInternal.getParticipantsNextSinglePageAsync( - nextLink, context))) + nextLink, context))) .mapPage(CallParticipantConverter::convert); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(logger, ex)); @@ -249,11 +236,11 @@ PagedFlux listParticipantsWithContext(Context context) { public Mono transferCallToParticipant(CommunicationIdentifier targetParticipant) { if (targetParticipant instanceof CommunicationUserIdentifier) { - return transferCallToParticipantWithResponse(new TransferCallToParticipantOptions((CommunicationUserIdentifier) targetParticipant)).flatMap(FluxUtil::toMono); + return transferCallToParticipantWithResponse(new TransferCallToParticipantOptions(targetParticipant)).flatMap(FluxUtil::toMono); } else if (targetParticipant instanceof PhoneNumberIdentifier) { - return transferCallToParticipantWithResponse(new TransferCallToParticipantOptions((PhoneNumberIdentifier) targetParticipant)).flatMap(FluxUtil::toMono); + return transferCallToParticipantWithResponse(new TransferCallToParticipantOptions(targetParticipant)).flatMap(FluxUtil::toMono); } else if (targetParticipant instanceof MicrosoftTeamsUserIdentifier) { - return transferCallToParticipantWithResponse(new TransferCallToParticipantOptions((MicrosoftTeamsUserIdentifier) targetParticipant)).flatMap(FluxUtil::toMono); + return transferCallToParticipantWithResponse(new TransferCallToParticipantOptions(targetParticipant)).flatMap(FluxUtil::toMono); } else { throw logger.logExceptionAsError(new IllegalArgumentException("targetParticipant type is invalid.")); } @@ -294,16 +281,9 @@ Mono> transferCallToParticipantWithResponseInternal } return callConnectionInternal.transferToParticipantWithResponseAsync( - callConnectionId, - request, - UUID.randomUUID(), - OffsetDateTime.now(), - context) - .map(response -> { - TransferCallResult result = TransferCallResponseConstructorProxy.create(response.getValue()); - result.setEventProcessor(eventProcessor, callConnectionId, result.getOperationContext()); - return new SimpleResponse<>(response, result); - }); + callConnectionId, + request, + context).map(response -> new SimpleResponse<>(response, TransferCallResponseConstructorProxy.create(response.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -359,16 +339,10 @@ Mono> addParticipantWithResponseInternal(AddParti } return callConnectionInternal.addParticipantWithResponseAsync( - callConnectionId, - request, - UUID.randomUUID(), - OffsetDateTime.now(), - context - ).map(response -> { - AddParticipantResult result = AddParticipantResponseConstructorProxy.create(response.getValue()); - result.setEventProcessor(eventProcessor, callConnectionId, result.getOperationContext()); - return new SimpleResponse<>(response, result); - }); + callConnectionId, + request, + context + ).map(response -> new SimpleResponse<>(response, AddParticipantResponseConstructorProxy.create(response.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -412,13 +386,7 @@ Mono> removeParticipantWithResponseInternal(Re return callConnectionInternal.removeParticipantWithResponseAsync( callConnectionId, request, - UUID.randomUUID(), - OffsetDateTime.now(), - context).map(response -> { - RemoveParticipantResult result = RemoveParticipantResponseConstructorProxy.create(response.getValue()); - result.setEventProcessor(eventProcessor, callConnectionId, result.getOperationContext()); - return new SimpleResponse<>(response, result); - }); + context).map(response -> new SimpleResponse<>(response, RemoveParticipantResponseConstructorProxy.create(response.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -426,23 +394,19 @@ Mono> removeParticipantWithResponseInternal(Re /** * Mutes a participant in the call. - * * @param targetParticipant - Participant to be muted. Only ACS Users are currently supported. * @return A MuteParticipantResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono muteParticipant(CommunicationIdentifier targetParticipant) { - return muteParticipantWithResponseInternal( - new MuteParticipantOptions(targetParticipant), - null) - .flatMap(FluxUtil::toMono); + return muteParticipantWithResponse(new MuteParticipantOptions(targetParticipant)).flatMap(FluxUtil::toMono); } /** * Mutes a participant in the call. * - * @param options - Options for the request. - * @return Response containing the MuteParticipantResult object. + * @param options - MuteParticipantOptions configuration options. + * @return Response with result of muting a participant from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> muteParticipantWithResponse(MuteParticipantOptions options) { @@ -457,56 +421,14 @@ Mono> muteParticipantWithResponseInternal(MutePa .setOperationContext(options.getOperationContext()); return callConnectionInternal.muteWithResponseAsync( - callConnectionId, - request, - UUID.randomUUID(), - OffsetDateTime.now(), - context).map(internalResponse -> new SimpleResponse<>(internalResponse, MuteParticipantsResponseConstructorProxy.create(internalResponse.getValue()))); + callConnectionId, + request, + context).map(internalResponse -> new SimpleResponse<>(internalResponse, MuteParticipantsResponseConstructorProxy.create(internalResponse.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); } } - /** - * Unmutes participant in the call. - * @param targetParticipant - Participant to be unmuted. Only ACS Users are currently supported. - * @return An UnmuteParticipantResult object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unmuteParticipant(CommunicationIdentifier targetParticipant) { - return unmuteParticipantWithResponseInternal( - new UnmuteParticipantOptions(targetParticipant), - null) - .flatMap(FluxUtil::toMono); - } - - /** - * Unmute participants in the call. - * @param unmuteParticipantOptions - Options for the request. - * @return a Response containing the UnmuteParticipantResult object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unmuteParticipantWithResponse(UnmuteParticipantOptions unmuteParticipantOptions) { - return withContext(context -> unmuteParticipantWithResponseInternal(unmuteParticipantOptions, context)); - } - - Mono> unmuteParticipantWithResponseInternal(UnmuteParticipantOptions unmuteParticipantOptions, Context context) { - try { - context = context == null ? Context.NONE : context; - UnmuteParticipantsRequestInternal request = new UnmuteParticipantsRequestInternal() - .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); - } - } /** * Cancel add participant operation request. @@ -524,7 +446,7 @@ public Mono cancelAddParticipantOperation(S /** * Cancel add participant operation request. * - * @param cancelAddParticipantOperationOptions Options bag for cancelAddParticipantOperationOptions. + * @param cancelAddParticipantOperationOptions Options bag for cancelAddParticipant. * @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. @@ -546,18 +468,13 @@ Mono> cancelAddParticipantOperatio return callConnectionInternal.cancelAddParticipantWithResponseAsync( callConnectionId, request, - UUID.randomUUID(), - OffsetDateTime.now(), - context).map(response -> { - CancelAddParticipantOperationResult result = CancelAddParticipantResponseConstructorProxy.create(response.getValue()); - result.setEventProcessor(eventProcessor, callConnectionId, result.getOperationContext()); - return new SimpleResponse<>(response, result); - }); + context).map(response -> new SimpleResponse<>(response, CancelAddParticipantResponseConstructorProxy.create(response.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); } } + //region Content management Actions /*** * Returns an object of CallContentAsync @@ -568,15 +485,5 @@ Mono> cancelAddParticipantOperatio public CallMediaAsync getCallMediaAsync() { return new CallMediaAsync(callConnectionId, callMediasInternal); } - - /*** - * Returns an object of CallDialogAsync - * - * @return a CallDialogAsync. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CallDialogAsync getCallDialogAsync() { - return new CallDialogAsync(callConnectionId, callDialogsInternal); - } //endregion } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallDialog.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallDialog.java deleted file mode 100644 index d0dee1bfa4db..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallDialog.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.core.util.Context; -import com.azure.communication.callautomation.models.DialogStateResult; -import com.azure.communication.callautomation.models.StartDialogOptions; -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; - -/** - * CallDialog. - */ -public final class CallDialog { - - /** - * Instance of CallDialogAsync. - */ - private final CallDialogAsync callDialogAsync; - - /** - * Constructor. - * - * @param callDialogAsync callDialogAsync - */ - CallDialog(CallDialogAsync callDialogAsync) { - this.callDialogAsync = callDialogAsync; - } - - /** - * Start Dialog - * - * @param options A {@link StartDialogOptions} object containing different options for startDialog. - * @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 for successful startDialog request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DialogStateResult startDialog(StartDialogOptions options) { - return callDialogAsync.startDialog(options).block(); - } - - /** - * Start Dialog - * - * @param options A {@link StartDialogOptions} object containing different options for startDialog. - * @param context The context to associate with this operation. - * @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 for successful startDialog request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startDialogWithResponse(StartDialogOptions options, Context context) { - return callDialogAsync.startDialogWithResponseInternal(options, context).block(); - } - - /** - * Stop Dialog - * - * @param dialogId The dialog id. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopDialog(String dialogId) { - callDialogAsync.stopDialog(dialogId).block(); - } - - /** - * Stop Dialog - * - * @param dialogId The dialog id. - * @param context The context to associate with this operation. - * @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 for successful stopDialog request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopDialogWithResponse(String dialogId, Context context) { - return callDialogAsync.stopDialogWithResponseInternal(dialogId, context).block(); - } -} 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 deleted file mode 100644 index a7448cb3c8ad..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallDialogAsync.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.communication.callautomation.implementation.CallDialogsImpl; -import com.azure.communication.callautomation.implementation.accesshelpers.DialogStateResponseConstructorProxy; -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; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import reactor.core.publisher.Mono; - -import static com.azure.core.util.FluxUtil.monoError; -import static com.azure.core.util.FluxUtil.withContext; - -/** - * CallDialogAsync. - */ -public final class CallDialogAsync { - - private final CallDialogsImpl dialogsInternal; - private final String callConnectionId; - private final ClientLogger logger; - - /** - * Constructor. - * - * @param callConnectionId callConnectionId the id of the call connection - * @param callDialogInternal Internal implementation of CallDialog - */ - CallDialogAsync(String callConnectionId, CallDialogsImpl callDialogInternal) { - this.callConnectionId = callConnectionId; - this.dialogsInternal = callDialogInternal; - this.logger = new ClientLogger(CallDialogAsync.class); - } - - /** - * Start Dialog - * - * @param startDialogOptions startDialog options - * @return Response for successful startDialog request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startDialog(StartDialogOptions startDialogOptions) { - return startDialogWithResponse(startDialogOptions) - .flatMap(response -> Mono.just(response.getValue())); - } - - /** - * Start Dialog - * - * @param startDialogOptions startDialog options - * @return Response for successful startDialog request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startDialogWithResponse(StartDialogOptions startDialogOptions) { - return withContext(context -> startDialogWithResponseInternal(startDialogOptions, context)); - } - - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> startDialogWithResponseInternal(StartDialogOptions startDialogOptions, Context context) { - try { - context = context == null ? Context.NONE : context; - - 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() - .setDialog(baseDialog) - .setOperationContext(startDialogOptions.getOperationContext()); - - return dialogsInternal.startDialogWithResponseAsync(callConnectionId, startDialogOptions.getDialogId(), requestInternal, context). - map(response -> new SimpleResponse<>(response, DialogStateResponseConstructorProxy.create(response.getValue()))); - } catch (RuntimeException e) { - return monoError(logger, e); - } - } - - /** - * Stop Dialog - * - * @param dialogId The dialog id. - * @return Response for successful stopDialog request. - */ - public Mono stopDialog(String dialogId) { - return stopDialogWithResponse(dialogId).then(); - } - - /** - * Sop Dialog - * - * @param dialogId The dialog id. - * @return Response for successful stopDialog request. - */ - public Mono> stopDialogWithResponse(String dialogId) { - return withContext(context -> stopDialogWithResponseInternal(dialogId, context)); - } - - Mono> stopDialogWithResponseInternal(String dialogId, Context context) { - try { - context = context == null ? Context.NONE : 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 1a67f9104943..1a13c480d5af 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 @@ -6,21 +6,17 @@ 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.HoldOptions; import com.azure.communication.callautomation.models.PlayOptions; +import com.azure.communication.callautomation.models.PlaySource; import com.azure.communication.callautomation.models.PlayToAllOptions; import com.azure.communication.callautomation.models.SendDtmfTonesOptions; import com.azure.communication.callautomation.models.SendDtmfTonesResult; -import com.azure.communication.callautomation.models.StartHoldMusicOptions; -import com.azure.communication.callautomation.models.StartTranscriptionOptions; -import com.azure.communication.callautomation.models.StopTranscriptionOptions; -import com.azure.communication.callautomation.models.PlaySource; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.core.exception.HttpResponseException; import java.util.List; @@ -166,7 +162,7 @@ public SendDtmfTonesResult sendDtmfTones(List tones, CommunicationIden return callMediaAsync.sendDtmfTones(tones, targetParticipant).block(); } - /** + /** * Sends Dtmf tones * * @param options SendDtmfTones configuration options @@ -218,167 +214,4 @@ public void stopContinuousDtmfRecognition(CommunicationIdentifier targetParticip public Response stopContinuousDtmfRecognitionWithResponse(ContinuousDtmfRecognitionOptions options, Context context) { return callMediaAsync.stopContinuousDtmfRecognitionWithResponseInternal(options, context).block(); } - - /** - * Holds participant in call. - * @param targetParticipant the target. - * @param playSourceInfo audio to play. - * @return Response for successful operation. - * @deprecated This operations is deprecated, please use Hold instead. - */ - @Deprecated - @ServiceMethod(returns = ReturnType.SINGLE) - public Void startHoldMusic(CommunicationIdentifier targetParticipant, - PlaySource playSourceInfo) { - return callMediaAsync.startHoldMusic(targetParticipant, playSourceInfo).block(); - } - - /** - * Holds participant in call. - * @param options - Different options to pass to the request. - * @param context Context - * @return Response for successful operation. - * @deprecated This operations is deprecated, please use HoldWithResponse instead - */ - @Deprecated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startHoldMusicWithResponse(StartHoldMusicOptions options, - Context context) { - return callMediaAsync.startHoldMusicWithResponseInternal(options, context).block(); - } - - /** - * Removes hold from participant in call. - * @param targetParticipant the target. - * @return Response for successful operation. - * @deprecated This operations is deprecated, please use Unhold instead. - */ - @Deprecated - @ServiceMethod(returns = ReturnType.SINGLE) - public Void stopHoldMusic(CommunicationIdentifier targetParticipant) { - return callMediaAsync.stopHoldMusic(targetParticipant).block(); - } - - /** - * Removes hold from participant in call. - * @param targetParticipant the target. - * @param operationContext operational context. - * @param context Context. - * @return Response for successful operation. - * @deprecated This operations is deprecated, please use UnholdWithResponse instead. - */ - @Deprecated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopHoldMusicWithResponse(CommunicationIdentifier targetParticipant, - String operationContext, - Context context) { - return callMediaAsync.stopHoldMusicWithResponseInternal(targetParticipant, operationContext, context).block(); - } - - /** - * Holds participant in call. - * @param targetParticipant the target. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Void hold(CommunicationIdentifier targetParticipant) { - return callMediaAsync.hold(targetParticipant).block(); - } - - /** - * Holds participant in call. - * @param options - Different options to pass to the request. - * @param context Context - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response holdWithResponse(HoldOptions options, - Context context) { - return callMediaAsync.holdWithResponseInternal(options, context).block(); - } - - /** - * Removes hold from participant in call. - * @param targetParticipant the target. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Void unhold(CommunicationIdentifier targetParticipant) { - return callMediaAsync.unhold(targetParticipant).block(); - } - - /** - * Removes hold from participant in call. - * @param targetParticipant the target. - * @param operationContext operational context. - * @param context Context. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response unholdWithResponse(CommunicationIdentifier targetParticipant, - String operationContext, - Context context) { - return callMediaAsync.unholdWithResponseInternal(targetParticipant, operationContext, context).block(); - } - - /** - * Starts transcription in the call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startTranscription() { - callMediaAsync.startTranscription().block(); - } - - /** - * Starts transcription in the call. - * - * @param options Options for the Start Transcription operation. - * @param context Context - * @return Response for successful start transcription request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startTranscriptionWithResponse(StartTranscriptionOptions options, Context context) { - return callMediaAsync.startTranscriptionWithResponseInternal(options, context).block(); - } - - /** - * Stops transcription in the call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopTranscription() { - callMediaAsync.stopTranscription().block(); - } - - /** - * Stops transcription in the call. - * - * @param options Options for the Stop Transcription operation. - * @param context Context - * @return Response for successful stop transcription request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopTranscriptionWithResponse(StopTranscriptionOptions options, Context context) { - return callMediaAsync.stopTranscriptionWithResponseInternal(options, context).block(); - } - - /** - * Updates transcription language in the call. - * @param locale Defines new locale for transcription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateTranscription(String locale) { - callMediaAsync.updateTranscription(locale).block(); - } - - /** - * Updates transcription language in the call. - * - * @param locale Defines new locale for transcription. - * @param context Context - * @return Response for successful update transcription request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTranscriptionWithResponse(String locale, Context context) { - return callMediaAsync.updateTranscriptionWithResponseInternal(locale, context).block(); - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMediaAsync.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallMediaAsync.java index daea9447e81e..1e2ca78a534e 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 @@ -10,7 +10,7 @@ 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.HoldRequest; +import com.azure.communication.callautomation.implementation.models.VoiceKindInternal; import com.azure.communication.callautomation.implementation.models.PlayOptionsInternal; import com.azure.communication.callautomation.implementation.models.PlayRequest; import com.azure.communication.callautomation.implementation.models.PlaySourceInternal; @@ -22,14 +22,7 @@ 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.StartTranscriptionRequestInternal; -import com.azure.communication.callautomation.implementation.models.StopHoldMusicRequestInternal; -import com.azure.communication.callautomation.implementation.models.StopTranscriptionRequestInternal; import com.azure.communication.callautomation.implementation.models.TextSourceInternal; -import com.azure.communication.callautomation.implementation.models.UnholdRequest; -import com.azure.communication.callautomation.implementation.models.UpdateTranscriptionRequestInternal; -import com.azure.communication.callautomation.implementation.models.VoiceKindInternal; import com.azure.communication.callautomation.models.CallMediaRecognizeChoiceOptions; import com.azure.communication.callautomation.models.CallMediaRecognizeDtmfOptions; import com.azure.communication.callautomation.models.CallMediaRecognizeOptions; @@ -38,18 +31,14 @@ 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.HoldOptions; import com.azure.communication.callautomation.models.PlayOptions; import com.azure.communication.callautomation.models.PlaySource; 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.StartTranscriptionOptions; -import com.azure.communication.callautomation.models.StopTranscriptionOptions; import com.azure.communication.callautomation.models.TextSource; +import com.azure.communication.callautomation.models.SendDtmfTonesResult; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; @@ -62,10 +51,9 @@ import reactor.core.publisher.Mono; import java.time.Duration; -import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Collections; import java.util.List; -import java.util.UUID; import java.util.stream.Collectors; import static com.azure.core.util.FluxUtil.monoError; @@ -128,6 +116,7 @@ public Mono playToAll(List playSources) { PlayToAllOptions options = new PlayToAllOptions(playSources); return playToAllWithResponse(options).flatMap(FluxUtil::toMono); } + /** * Play to all participants * @@ -193,6 +182,7 @@ Mono> recognizeWithResponseInternal(CallMediaRecognizeOptions rec if (recognizeOptions instanceof CallMediaRecognizeDtmfOptions) { RecognizeRequest recognizeRequest = getRecognizeRequestFromDtmfConfiguration(recognizeOptions); return contentsInternal.recognizeWithResponseAsync(callConnectionId, recognizeRequest, context); + } else if (recognizeOptions instanceof CallMediaRecognizeChoiceOptions) { RecognizeRequest recognizeRequest = getRecognizeRequestFromChoiceConfiguration(recognizeOptions); return contentsInternal.recognizeWithResponseAsync(callConnectionId, recognizeRequest, context); @@ -256,17 +246,12 @@ Mono> playWithResponseInternal(PlayOptions options, Context conte Mono> playToAllWithResponseInternal(PlayToAllOptions options, Context context) { try { - PlayToAllOptions playOptions = new PlayToAllOptions(options.getPlaySources()); + PlayOptions playOptions = new PlayOptions(options.getPlaySources(), Collections.emptyList()); playOptions.setLoop(options.isLoop()); - playOptions.setInterruptCallMediaOperation(options.isInterruptCallMediaOperation()); playOptions.setOperationContext(options.getOperationContext()); playOptions.setOperationCallbackUrl(options.getOperationCallbackUrl()); - return withContext(contextValue -> { - contextValue = context == null ? contextValue : context; - PlayRequest request = getPlayToAllRequest(options); - return contentsInternal.playWithResponseAsync(callConnectionId, request, contextValue); - }); + return playWithResponseInternal(playOptions, context); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -308,39 +293,6 @@ PlayRequest getPlayRequest(PlayOptions options) { throw logger.logExceptionAsError(new IllegalArgumentException(options.getPlaySources().getClass().getCanonicalName())); } - - PlayRequest getPlayToAllRequest(PlayToAllOptions options) { - 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 (!playSourcesInternal.isEmpty()) { - PlayRequest request = new PlayRequest() - .setPlaySources(playSourcesInternal); - - request.setPlayOptions(new PlayOptionsInternal().setLoop(options.isLoop()) - .setInterruptCallMediaOperation(options.isInterruptCallMediaOperation())); - request.setOperationContext(options.getOperationContext()); - request.setOperationCallbackUri(options.getOperationCallbackUrl()); - - return request; - } - - throw logger.logExceptionAsError(new IllegalArgumentException(options.getPlaySources().getClass().getCanonicalName())); - } private PlaySourceInternal getPlaySourceInternalFromFileSource(FileSource playSource) { FileSourceInternal fileSourceInternal = new FileSourceInternal().setUri(playSource.getUrl()); @@ -373,7 +325,6 @@ private PlaySourceInternal getPlaySourceInternalFromTextSource(TextSource playSo private PlaySourceInternal getPlaySourceInternalFromSsmlSource(SsmlSource playSource) { SsmlSourceInternal ssmlSourceInternal = new SsmlSourceInternal().setSsmlText(playSource.getSsmlText()); - if (playSource.getCustomVoiceEndpointId() != null) { ssmlSourceInternal.setCustomVoiceEndpointId(playSource.getCustomVoiceEndpointId()); } @@ -438,15 +389,13 @@ private RecognizeRequest getRecognizeRequestFromDtmfConfiguration(CallMediaRecog PlaySourceInternal playSourceInternal = getPlaySourceInternalFromRecognizeOptions(recognizeOptions); - RecognizeRequest recognizeRequest = new RecognizeRequest() + return new RecognizeRequest() .setRecognizeInputType(RecognizeInputTypeInternal.fromString(recognizeOptions.getRecognizeInputType().toString())) .setInterruptCallMediaOperation(recognizeOptions.isInterruptCallMediaOperation()) .setPlayPrompt(playSourceInternal) .setRecognizeOptions(recognizeOptionsInternal) .setOperationContext(recognizeOptions.getOperationContext()) .setOperationCallbackUri(recognizeOptions.getOperationCallbackUrl()); - - return recognizeRequest; } private RecognizeRequest getRecognizeRequestFromChoiceConfiguration(CallMediaRecognizeOptions recognizeOptions) { @@ -464,7 +413,6 @@ private RecognizeRequest getRecognizeRequestFromChoiceConfiguration(CallMediaRec recognizeOptionsInternal.setSpeechLanguage(choiceRecognizeOptions.getSpeechLanguage()); } } - if (choiceRecognizeOptions.getSpeechRecognitionModelEndpointId() != null) { if (!choiceRecognizeOptions.getSpeechRecognitionModelEndpointId().isEmpty()) { recognizeOptionsInternal.setSpeechRecognitionModelEndpointId(choiceRecognizeOptions.getSpeechRecognitionModelEndpointId()); @@ -473,15 +421,13 @@ private RecognizeRequest getRecognizeRequestFromChoiceConfiguration(CallMediaRec PlaySourceInternal playSourceInternal = getPlaySourceInternalFromRecognizeOptions(recognizeOptions); - RecognizeRequest recognizeRequest = new RecognizeRequest() + return new RecognizeRequest() .setRecognizeInputType(RecognizeInputTypeInternal.fromString(choiceRecognizeOptions.getRecognizeInputType().toString())) .setInterruptCallMediaOperation(choiceRecognizeOptions.isInterruptCallMediaOperation()) .setPlayPrompt(playSourceInternal) .setRecognizeOptions(recognizeOptionsInternal) .setOperationContext(recognizeOptions.getOperationContext()) .setOperationCallbackUri(recognizeOptions.getOperationCallbackUrl()); - - return recognizeRequest; } private RecognizeRequest getRecognizeRequestFromSpeechConfiguration(CallMediaRecognizeOptions recognizeOptions) { @@ -496,13 +442,11 @@ private RecognizeRequest getRecognizeRequestFromSpeechConfiguration(CallMediaRec recognizeOptionsInternal.setInitialSilenceTimeoutInSeconds((int) speechRecognizeOptions.getInitialSilenceTimeout().getSeconds()); - if (speechRecognizeOptions.getSpeechLanguage() != null) { if (!speechRecognizeOptions.getSpeechLanguage().isEmpty()) { recognizeOptionsInternal.setSpeechLanguage(speechRecognizeOptions.getSpeechLanguage()); } } - if (speechRecognizeOptions.getSpeechRecognitionModelEndpointId() != null) { if (!speechRecognizeOptions.getSpeechRecognitionModelEndpointId().isEmpty()) { recognizeOptionsInternal.setSpeechRecognitionModelEndpointId(speechRecognizeOptions.getSpeechRecognitionModelEndpointId()); @@ -511,15 +455,13 @@ private RecognizeRequest getRecognizeRequestFromSpeechConfiguration(CallMediaRec PlaySourceInternal playSourceInternal = getPlaySourceInternalFromRecognizeOptions(recognizeOptions); - RecognizeRequest recognizeRequest = new RecognizeRequest() + return new RecognizeRequest() .setRecognizeInputType(RecognizeInputTypeInternal.fromString(speechRecognizeOptions.getRecognizeInputType().toString())) .setInterruptCallMediaOperation(speechRecognizeOptions.isInterruptCallMediaOperation()) .setPlayPrompt(playSourceInternal) .setRecognizeOptions(recognizeOptionsInternal) .setOperationContext(recognizeOptions.getOperationContext()) .setOperationCallbackUri(recognizeOptions.getOperationCallbackUrl()); - - return recognizeRequest; } private RecognizeRequest getRecognizeRequestFromSpeechOrDtmfConfiguration(CallMediaRecognizeOptions recognizeOptions) { @@ -540,6 +482,7 @@ private RecognizeRequest getRecognizeRequestFromSpeechOrDtmfConfiguration(CallMe .setTargetParticipant(CommunicationIdentifierConverter.convert(speechOrDtmfRecognizeOptions.getTargetParticipant())); recognizeOptionsInternal.setInitialSilenceTimeoutInSeconds((int) speechOrDtmfRecognizeOptions.getInitialSilenceTimeout().getSeconds()); + if (speechOrDtmfRecognizeOptions.getSpeechLanguage() != null) { if (!speechOrDtmfRecognizeOptions.getSpeechLanguage().isEmpty()) { recognizeOptionsInternal.setSpeechLanguage(speechOrDtmfRecognizeOptions.getSpeechLanguage()); @@ -553,23 +496,23 @@ private RecognizeRequest getRecognizeRequestFromSpeechOrDtmfConfiguration(CallMe PlaySourceInternal playSourceInternal = getPlaySourceInternalFromRecognizeOptions(recognizeOptions); - RecognizeRequest recognizeRequest = new RecognizeRequest() + return new RecognizeRequest() .setRecognizeInputType(RecognizeInputTypeInternal.fromString(speechOrDtmfRecognizeOptions.getRecognizeInputType().toString())) .setInterruptCallMediaOperation(speechOrDtmfRecognizeOptions.isInterruptCallMediaOperation()) .setPlayPrompt(playSourceInternal) .setRecognizeOptions(recognizeOptionsInternal) .setOperationContext(recognizeOptions.getOperationContext()) .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) @@ -623,8 +566,6 @@ Mono> sendDtmfTonesWithResponseInternal(SendDtmfTo return contentsInternal.sendDtmfTonesWithResponseAsync( callConnectionId, requestInternal, - UUID.randomUUID(), - OffsetDateTime.now(), context ).map(response -> new SimpleResponse<>(response, SendDtmfTonesResponseConstructorProxy.create(response.getValue()))); } catch (RuntimeException e) { @@ -632,6 +573,7 @@ Mono> sendDtmfTonesWithResponseInternal(SendDtmfTo } } + /** * Starts continuous Dtmf recognition. * @param targetParticipant the target participant @@ -695,265 +637,4 @@ Mono> stopContinuousDtmfRecognitionWithResponseInternal(Continuou } } - /** - * Holds participant in call. - * @param targetParticipant the target. - * @param playSourceInfo audio to play. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startHoldMusic(CommunicationIdentifier targetParticipant, - PlaySource playSourceInfo) { - return startHoldMusicWithResponseInternal( - new StartHoldMusicOptions(targetParticipant, playSourceInfo), - Context.NONE).then(); - } - - /** - * Holds participant in call. - * @param options - Different options to pass to the request. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startHoldMusicWithResponse(StartHoldMusicOptions options) { - return withContext(context -> startHoldMusicWithResponseInternal( - options, context)); - } - - Mono> startHoldMusicWithResponseInternal(StartHoldMusicOptions options, Context context) { - try { - context = context == null ? Context.NONE : context; - - StartHoldMusicRequestInternal request = new StartHoldMusicRequestInternal() - .setTargetParticipant(CommunicationIdentifierConverter.convert(options.getTargetParticipant())) - .setPlaySourceInfo(convertPlaySourceToPlaySourceInternal(options.getPlaySourceInfo())) - .setOperationContext(options.getOperationContext()); - - return contentsInternal - .startHoldMusicWithResponseAsync(callConnectionId, request, context); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } - } - - /** - * Removes hold from participant in call. - * @param targetParticipant the target. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopHoldMusic(CommunicationIdentifier targetParticipant) { - return stopHoldMusicWithResponse(targetParticipant, null).then(); - } - - /** - * Holds participant in call. - * @param targetParticipant the target. - * @param operationContext Operational context. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopHoldMusicWithResponse(CommunicationIdentifier targetParticipant, - String operationContext) { - return withContext(context -> stopHoldMusicWithResponseInternal(targetParticipant, operationContext, context)); - } - - Mono> stopHoldMusicWithResponseInternal(CommunicationIdentifier targetParticipant, - String operationContext, - Context context) { - try { - context = context == null ? Context.NONE : context; - StopHoldMusicRequestInternal request = new StopHoldMusicRequestInternal() - .setTargetParticipant(CommunicationIdentifierConverter.convert(targetParticipant)) - .setOperationContext(operationContext); - - return contentsInternal - .stopHoldMusicWithResponseAsync(callConnectionId, request, context); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } - } - - /** - * Holds participant in call. - * @param targetParticipant the target. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono hold(CommunicationIdentifier targetParticipant) { - return holdInternal(targetParticipant, Context.NONE).then(); - } - - Mono> holdInternal(CommunicationIdentifier targetParticipant, Context context) { - try { - context = context == null ? Context.NONE : context; - HoldRequest request = new HoldRequest() - .setTargetParticipant(CommunicationIdentifierConverter.convert(targetParticipant)); - - return contentsInternal - .holdWithResponseAsync(callConnectionId, request, context); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } - } - - /** - * Holds participant in call. - * @param options - Different options to pass to the request. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> holdWithResponse(HoldOptions options) { - return withContext(context -> holdWithResponseInternal( - options, context)); - } - - Mono> holdWithResponseInternal(HoldOptions options, Context context) { - try { - context = context == null ? Context.NONE : context; - HoldRequest request = new HoldRequest() - .setTargetParticipant(CommunicationIdentifierConverter.convert(options.getTargetParticipant())) - .setPlaySourceInfo(convertPlaySourceToPlaySourceInternal(options.getPlaySourceInfo())) - .setOperationContext(options.getOperationContext()); - - return contentsInternal - .holdWithResponseAsync(callConnectionId, request, context); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } - } - - /** - * Removes hold from participant in call. - * @param targetParticipant the target. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unhold(CommunicationIdentifier targetParticipant) { - return unholdWithResponse(targetParticipant, null).then(); - } - - /** - * Holds participant in call. - * @param targetParticipant the target. - * @param operationContext Operational context. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unholdWithResponse(CommunicationIdentifier targetParticipant, - String operationContext) { - return withContext(context -> unholdWithResponseInternal(targetParticipant, operationContext, context)); - } - - Mono> unholdWithResponseInternal(CommunicationIdentifier targetParticipant, - String operationContext, - Context context) { - try { - context = context == null ? Context.NONE : context; - UnholdRequest request = new UnholdRequest() - .setTargetParticipant(CommunicationIdentifierConverter.convert(targetParticipant)) - .setOperationContext(operationContext); - - return contentsInternal - .unholdWithResponseAsync(callConnectionId, request, context); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } - } - - /** - * Starts transcription in the call. - * - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startTranscription() { - return startTranscriptionWithResponseAsync(null).then(); - } - - /** - * Starts transcription in the call with options. - * - * @param options Options for the Start Transcription operation. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startTranscriptionWithResponseAsync(StartTranscriptionOptions options) { - return withContext(context -> startTranscriptionWithResponseInternal(options, context)); - } - - Mono> startTranscriptionWithResponseInternal(StartTranscriptionOptions options, Context context) { - try { - context = context == null ? Context.NONE : context; - StartTranscriptionRequestInternal request = new StartTranscriptionRequestInternal(); - if (options != null) { - request.setLocale(options.getLocale()); - request.setOperationContext(options.getOperationContext()); - } - return contentsInternal - .startTranscriptionWithResponseAsync(callConnectionId, request, context); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } - } - - /** - * Stops transcription in the call. - * - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopTranscription() { - return stopTranscriptionWithResponseAsync(null).then(); - } - - /** - * Stops transcription in the call with options. - * - * @param options Options for the Stop Transcription operation. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTranscriptionWithResponseAsync(StopTranscriptionOptions options) { - return withContext(context -> stopTranscriptionWithResponseInternal(options, context)); - } - - Mono> stopTranscriptionWithResponseInternal(StopTranscriptionOptions options, Context context) { - try { - context = context == null ? Context.NONE : context; - StopTranscriptionRequestInternal request = new StopTranscriptionRequestInternal(); - if (options != null) { - request.setOperationContext(options.getOperationContext()); - } - return contentsInternal - .stopTranscriptionWithResponseAsync(callConnectionId, request, context); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } - } - - /** - * Updates transcription language - * - * @param locale Defines new locale for transcription. - * @return Response for successful operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTranscription(String locale) { - return withContext(context -> updateTranscriptionWithResponseInternal(locale, context)).then(); - } - - Mono> updateTranscriptionWithResponseInternal(String locale, Context context) { - try { - context = context == null ? Context.NONE : context; - UpdateTranscriptionRequestInternal request = new UpdateTranscriptionRequestInternal(); - request.setLocale(locale); - return contentsInternal - .updateTranscriptionWithResponseAsync(callConnectionId, request, context); - } catch (RuntimeException ex) { - return monoError(logger, ex); - } - } - - } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecording.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecording.java index 7bc5eb9b3616..acd9b4298536 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecording.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecording.java @@ -8,11 +8,11 @@ import com.azure.communication.callautomation.models.StartRecordingOptions; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpRange; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; -import com.azure.core.exception.HttpResponseException; import java.io.OutputStream; import java.nio.file.Path; 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 897c6518eea2..49f9037bdf17 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 @@ -6,18 +6,14 @@ import com.azure.communication.callautomation.implementation.CallRecordingsImpl; import com.azure.communication.callautomation.implementation.accesshelpers.RecordingStateResponseConstructorProxy; import com.azure.communication.callautomation.implementation.converters.CommunicationIdentifierConverter; -import com.azure.communication.callautomation.implementation.models.BlobStorageInternal; import com.azure.communication.callautomation.implementation.models.CallLocatorInternal; import com.azure.communication.callautomation.implementation.models.CallLocatorKindInternal; import com.azure.communication.callautomation.implementation.models.ChannelAffinityInternal; import com.azure.communication.callautomation.implementation.models.CommunicationIdentifierModel; -import com.azure.communication.callautomation.implementation.models.ExternalStorageInternal; import com.azure.communication.callautomation.implementation.models.RecordingChannelInternal; import com.azure.communication.callautomation.implementation.models.RecordingContentInternal; import com.azure.communication.callautomation.implementation.models.RecordingFormatInternal; -import com.azure.communication.callautomation.implementation.models.RecordingStorageTypeInternal; import com.azure.communication.callautomation.implementation.models.StartCallRecordingRequestInternal; -import com.azure.communication.callautomation.models.BlobStorage; import com.azure.communication.callautomation.models.CallLocator; import com.azure.communication.callautomation.models.CallLocatorKind; import com.azure.communication.callautomation.models.ChannelAffinity; @@ -52,12 +48,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 +116,6 @@ Mono> startWithResponseInternal(StartRecordingOpt return callRecordingsInternal .startRecordingWithResponseAsync( request, - UUID.randomUUID(), - OffsetDateTime.now(), contextValue) .map(response -> new SimpleResponse<>(response, RecordingStateResponseConstructorProxy.create(response.getValue())) @@ -159,9 +151,6 @@ private StartCallRecordingRequestInternal getStartCallRecordingRequest(StartReco if (options.getRecordingChannel() != null) { request.setRecordingChannelType(RecordingChannelInternal.fromString(options.getRecordingChannel().toString())); } - if (options.getPauseOnStart() != null) { - request.setPauseOnStart(options.getPauseOnStart()); - } if (options.getRecordingStateCallbackUrl() != null) { request.setRecordingStateCallbackUri(options.getRecordingStateCallbackUrl()); } @@ -177,16 +166,6 @@ private StartCallRecordingRequestInternal getStartCallRecordingRequest(StartReco .collect(Collectors.toList()); request.setChannelAffinity(channelAffinityInternals); } - if (options.getExternalStorage() != null) { - ExternalStorageInternal externalStorageInternal = new ExternalStorageInternal() - .setStorageType(RecordingStorageTypeInternal.fromString(options.getExternalStorage().getStorageType().toString())); - - if (options.getExternalStorage() instanceof BlobStorage) { - externalStorageInternal.setBlobStorage(getBlobStorageInternalFromBlobStorage((BlobStorage) options.getExternalStorage())); - } - - request.setExternalStorage(externalStorageInternal); - } return request; } @@ -577,10 +556,6 @@ private URL getUrlToSignRequestWith(String url) { } } - private BlobStorageInternal getBlobStorageInternalFromBlobStorage(BlobStorage blobStorage) { - return new BlobStorageInternal().setContainerUri(blobStorage.getContainerUrl()); - } - private ChannelAffinityInternal getChannelAffinityInternal(ChannelAffinity channelAffinity) { ChannelAffinityInternal channelAffinityInternal = new ChannelAffinityInternal(); CommunicationIdentifierModel communicationIdentifierModel = CommunicationIdentifierConverter.convert(channelAffinity.getParticipant()); 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 451c612f9662..e91c5a4a2644 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; @@ -114,18 +113,6 @@ public CallMediasImpl getCallMedias() { return this.callMedias; } - /** 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. */ private final CallRecordingsImpl callRecordings; @@ -146,9 +133,7 @@ public CallRecordingsImpl getCallRecordings() { */ AzureCommunicationCallAutomationServiceImpl(String endpoint, String apiVersion) { this( - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(), + new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion); @@ -181,7 +166,6 @@ public CallRecordingsImpl getCallRecordings() { this.apiVersion = apiVersion; this.callConnections = new CallConnectionsImpl(this); this.callMedias = new CallMediasImpl(this); - this.callDialogs = new CallDialogsImpl(this); this.callRecordings = new CallRecordingsImpl(this); this.service = RestProxy.create( @@ -203,10 +187,10 @@ public interface AzureCommunicationCallAutomationServiceService { 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Post("/calling/callConnections:answer") @@ -215,10 +199,10 @@ Mono> createCall( 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Post("/calling/callConnections:redirect") @@ -227,10 +211,10 @@ Mono> answerCall( 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Post("/calling/callConnections:reject") @@ -239,10 +223,10 @@ Mono> redirectCall( 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); } @@ -250,36 +234,26 @@ Mono> rejectCall( * 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) { + CreateCallRequestInternal createCallRequest) { 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.createCall( this.getEndpoint(), this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, createCallRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -287,36 +261,25 @@ public Mono> createCallWithResponseAs * 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) { + CreateCallRequestInternal createCallRequest, Context context) { 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 service.createCall( this.getEndpoint(), this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, createCallRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -324,352 +287,210 @@ public Mono> createCallWithResponseAs * 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(); - } - }); + 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 using the IncomingCallContext from Event Grid. + * 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) { + AnswerCallRequestInternal answerCallRequest) { 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.answerCall( this.getEndpoint(), this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, answerCallRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } /** - * Answer a call using the IncomingCallContext from Event Grid. + * 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) { + AnswerCallRequestInternal answerCallRequest, Context context) { 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 service.answerCall( this.getEndpoint(), this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, answerCallRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } /** - * Answer a call using the IncomingCallContext from Event Grid. + * 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 using the IncomingCallContext from Event Grid. + * 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(); - } - }); + AnswerCallRequestInternal answerCallRequest, Context context) { + return answerCallWithResponseAsync(answerCallRequest, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Answer a call using the IncomingCallContext from Event Grid. + * 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 using the IncomingCallContext from Event Grid. + * 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); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return FluxUtil.withContext( context -> service.redirectCall( this.getEndpoint(), this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, redirectCallRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -677,36 +498,25 @@ public Mono> redirectCallWithResponseAsync( * 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) { + RedirectCallRequestInternal redirectCallRequest, Context context) { 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 service.redirectCall( this.getEndpoint(), this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, redirectCallRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -714,144 +524,82 @@ public Mono> redirectCallWithResponseAsync( * 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); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return FluxUtil.withContext( context -> service.rejectCall( this.getEndpoint(), this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, rejectCallRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -859,36 +607,25 @@ public Mono> rejectCallWithResponseAsync( * 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) { + RejectCallRequestInternal rejectCallRequest, Context context) { 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 service.rejectCall( this.getEndpoint(), this.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, rejectCallRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -896,105 +633,56 @@ public Mono> rejectCallWithResponseAsync( * 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 83fd9474f153..677c6381728e 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,182 +4,225 @@ 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 { - private static final String SDK_NAME = "name"; +public final class AzureCommunicationCallAutomationServiceImplBuilder + implements HttpTrait, + ConfigurationTrait, + AzureKeyCredentialTrait, + EndpointTrait { + @Generated private static final String SDK_NAME = "name"; - private static final String SDK_VERSION = "version"; + @Generated private static final String SDK_VERSION = "version"; - private final Map properties = new HashMap<>(); + @Generated private static final Map PROPERTIES = new HashMap<>(); + + @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. - */ - public AzureCommunicationCallAutomationServiceImplBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + /** {@inheritDoc}. */ + @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. - */ - public AzureCommunicationCallAutomationServiceImplBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; + /** {@inheritDoc}. */ + @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. - */ - public AzureCommunicationCallAutomationServiceImplBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + /** {@inheritDoc}. */ + @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. - */ - public AzureCommunicationCallAutomationServiceImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; + /** {@inheritDoc}. */ + @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. - */ - public AzureCommunicationCallAutomationServiceImplBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + /** {@inheritDoc}. */ + @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. */ - private Configuration configuration; + @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. + */ + @Generated private AzureKeyCredential azureKeyCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public AzureCommunicationCallAutomationServiceImplBuilder credential(AzureKeyCredential azureKeyCredential) { + this.azureKeyCredential = azureKeyCredential; + return this; + } + + /* + * The service endpoint */ - private HttpLogOptions httpLogOptions; + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public AzureCommunicationCallAutomationServiceImplBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Api Version + */ + @Generated private String apiVersion; /** - * Sets The logging configuration for HTTP requests and responses. + * Sets Api Version. * - * @param httpLogOptions the httpLogOptions value. + * @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. + * Sets The serializer to serialize an object into a string. * - * @param retryPolicy the retryPolicy value. + * @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. + * Sets The retry policy that will attempt to retry failed requests, if applicable. * - * @param customPolicy The custom Http pipeline policy to add. + * @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; } @@ -188,42 +231,57 @@ public AzureCommunicationCallAutomationServiceImplBuilder addPolicy(HttpPipeline * * @return an instance of AzureCommunicationCallAutomationServiceImpl. */ + @Generated public AzureCommunicationCallAutomationServiceImpl buildClient() { - if (apiVersion == null) { - this.apiVersion = "2023-10-03-preview"; - } - if (pipeline == null) { - this.pipeline = createHttpPipeline(); - } - if (serializerAdapter == null) { - this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter(); - } + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localApiVersion = (apiVersion != null) ? apiVersion : "2023-10-15"; + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter(); AzureCommunicationCallAutomationServiceImpl client = - new AzureCommunicationCallAutomationServiceImpl(pipeline, serializerAdapter, endpoint, apiVersion); + 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(); - } + 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) + .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 674302078c1a..23da6c9925f9 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 @@ -18,8 +18,6 @@ import com.azure.communication.callautomation.implementation.models.RemoveParticipantResponseInternal; import com.azure.communication.callautomation.implementation.models.TransferCallResponseInternal; import com.azure.communication.callautomation.implementation.models.TransferToParticipantRequestInternal; -import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsRequestInternal; -import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; @@ -100,9 +98,9 @@ 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Post("/calling/callConnections/{callConnectionId}:transferToParticipant") @@ -112,10 +110,10 @@ 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Get("/calling/callConnections/{callConnectionId}/participants") @@ -135,10 +133,10 @@ 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Post("/calling/callConnections/{callConnectionId}/participants:remove") @@ -148,10 +146,10 @@ 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Post("/calling/callConnections/{callConnectionId}/participants:mute") @@ -161,23 +159,10 @@ Mono> mute( @HostParam("endpoint") String endpoint, @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, @BodyParam("application/json") MuteParticipantsRequestInternal muteParticipantsRequest, @HeaderParam("Accept") String accept, - Context context); - - @Post("/calling/callConnections/{callConnectionId}/participants:unmute") - @ExpectedResponses({200}) - @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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Post("/calling/callConnections/{callConnectionId}/participants:cancelAddParticipant") @@ -187,10 +172,10 @@ 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, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Get("/calling/callConnections/{callConnectionId}/participants/{participantRawId}") @@ -221,7 +206,8 @@ Mono> getParticipantsNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call. + * @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) { @@ -244,7 +230,8 @@ public Mono> getCallWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call. + * @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( @@ -261,19 +248,11 @@ public Mono> getCallWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call. + * @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())); } /** @@ -284,48 +263,40 @@ public Mono getCallAsync(String callConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call. + * @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 the detail properties of an ongoing call. * * @param callConnectionId The call connection id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detail properties of an ongoing call. + * @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 the detail properties of an ongoing call. * * @param callConnectionId The call connection id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the detail properties of an ongoing call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCallWithResponse(String callConnectionId, Context context) { - return getCallWithResponseAsync(callConnectionId, context).block(); + public CallConnectionPropertiesInternal getCall(String callConnectionId) { + return getCallWithResponse(callConnectionId, Context.NONE).getValue(); } /** @@ -336,7 +307,7 @@ public Response getCallWithResponse(String cal * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException 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) { @@ -360,7 +331,7 @@ public Mono> hangupCallWithResponseAsync(String callConnectionId) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> hangupCallWithResponseAsync(String callConnectionId, Context context) { @@ -377,11 +348,11 @@ public Mono> hangupCallWithResponseAsync(String callConnectionId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the 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()); } /** @@ -393,11 +364,11 @@ public Mono hangupCallAsync(String callConnectionId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the 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()); } /** @@ -405,13 +376,15 @@ public Mono hangupCallAsync(String callConnectionId, Context context) { * 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(); } /** @@ -419,49 +392,38 @@ public void hangupCall(String callConnectionId) { * 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); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return FluxUtil.withContext( context -> service.terminateCall( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -469,36 +431,24 @@ public Mono> terminateCallWithResponseAsync( * 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); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return service.terminateCall( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -506,102 +456,57 @@ public Mono> terminateCallWithResponseAsync( * 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); } /** @@ -609,38 +514,28 @@ public Response terminateCallWithResponse( * * @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) { + String callConnectionId, TransferToParticipantRequestInternal transferToParticipantRequest) { 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.transferToParticipant( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, transferToParticipantRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -649,38 +544,29 @@ public Mono> transferToParticipantWithRes * * @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) { 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 service.transferToParticipant( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, transferToParticipantRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -689,35 +575,16 @@ public Mono> transferToParticipantWithRes * * @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(); - } - }); + String callConnectionId, TransferToParticipantRequestInternal transferToParticipantRequest) { + return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -725,41 +592,19 @@ public Mono transferToParticipantAsync( * * @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(); - } - }); + return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -767,28 +612,18 @@ public Mono transferToParticipantAsync( * * @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( + public Response transferToParticipantWithResponse( String callConnectionId, TransferToParticipantRequestInternal transferToParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return transferToParticipantAsync( - callConnectionId, transferToParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + Context context) { + return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest, context).block(); } /** @@ -796,44 +631,26 @@ public TransferCallResponseInternal transferToParticipant( * * @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. + * Get participants from a call. * * @param callConnectionId The call connection Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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) { @@ -858,14 +675,14 @@ public Mono> getParticipantsSinglePageAsy } /** - * Get participants from a call. Recording and transcription bots are omitted from this list. + * Get participants from a call. * * @param callConnectionId The call connection Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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( @@ -885,13 +702,13 @@ public Mono> getParticipantsSinglePageAsy } /** - * Get participants from a call. Recording and transcription bots are omitted from this list. + * Get participants from a call. * * @param callConnectionId The call connection Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participants from a call. + * @return participants from a call as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux getParticipantsAsync(String callConnectionId) { @@ -901,14 +718,14 @@ public PagedFlux getParticipantsAsync(String callConnec } /** - * Get participants from a call. Recording and transcription bots are omitted from this list. + * Get participants from a call. * * @param callConnectionId The call connection Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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) { @@ -918,13 +735,42 @@ public PagedFlux getParticipantsAsync(String callConnec } /** - * Get participants from a call. Recording and transcription bots are omitted from this list. + * Get participants from a call. + * + * @param callConnectionId The call connection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws CommunicationErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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. + * + * @param callConnectionId The call connection Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws CommunicationErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return participants from a call along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getParticipantsSinglePage(String callConnectionId, Context context) { + return getParticipantsSinglePageAsync(callConnectionId, context).block(); + } + + /** + * Get participants from a call. * * @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 PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getParticipants(String callConnectionId) { @@ -932,14 +778,14 @@ public PagedIterable getParticipants(String callConnect } /** - * Get participants from a call. Recording and transcription bots are omitted from this list. + * Get participants from a call. * * @param callConnectionId The call connection Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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) { @@ -951,38 +797,28 @@ public PagedIterable getParticipants(String callConnect * * @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) { + 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, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -991,38 +827,27 @@ public Mono> addParticipantWithResponse * * @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) { + String callConnectionId, AddParticipantRequestInternal addParticipantRequest, Context context) { 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 service.addParticipant( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, addParticipantRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -1031,35 +856,16 @@ public Mono> addParticipantWithResponse * * @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(); - } - }); + String callConnectionId, AddParticipantRequestInternal addParticipantRequest) { + return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1067,41 +873,17 @@ public Mono addParticipantAsync( * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for adding participants to the call. + * @return the response payload for adding participants to the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono addParticipantAsync( - String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return addParticipantWithResponseAsync( - callConnectionId, - addParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, AddParticipantRequestInternal addParticipantRequest, Context context) { + return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1109,28 +891,16 @@ public Mono addParticipantAsync( * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for adding participants to the call. + * @return the response payload for adding participants to the call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AddParticipantResponseInternal addParticipant( - String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return addParticipantAsync( - callConnectionId, addParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response addParticipantWithResponse( + String callConnectionId, AddParticipantRequestInternal addParticipantRequest, Context context) { + return addParticipantWithResponseAsync(callConnectionId, addParticipantRequest, context).block(); } /** @@ -1138,34 +908,15 @@ public AddParticipantResponseInternal addParticipant( * * @param callConnectionId The call connection Id. * @param addParticipantRequest The request payload for adding participant to the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response payload for adding participants to the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response addParticipantWithResponse( - String callConnectionId, - AddParticipantRequestInternal addParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return addParticipantWithResponseAsync( - callConnectionId, - addParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public AddParticipantResponseInternal addParticipant( + String callConnectionId, AddParticipantRequestInternal addParticipantRequest) { + return addParticipantWithResponse(callConnectionId, addParticipantRequest, Context.NONE).getValue(); } /** @@ -1173,38 +924,28 @@ public Response addParticipantWithResponse( * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call. + * @return the response payload for removing participants of the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> removeParticipantWithResponseAsync( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + String callConnectionId, RemoveParticipantRequestInternal removeParticipantRequest) { 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.removeParticipant( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, removeParticipantRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -1213,38 +954,27 @@ public Mono> removeParticipantWithRe * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call. + * @return the response payload for removing participants of the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> removeParticipantWithResponseAsync( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + String callConnectionId, RemoveParticipantRequestInternal removeParticipantRequest, Context context) { 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 service.removeParticipant( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, removeParticipantRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -1253,35 +983,16 @@ public Mono> removeParticipantWithRe * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call. + * @return the response payload for removing participants of the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono removeParticipantAsync( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return removeParticipantWithResponseAsync( - callConnectionId, removeParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, RemoveParticipantRequestInternal removeParticipantRequest) { + return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1289,41 +1000,17 @@ public Mono removeParticipantAsync( * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call. + * @return the response payload for removing participants of the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono removeParticipantAsync( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return removeParticipantWithResponseAsync( - callConnectionId, - removeParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, RemoveParticipantRequestInternal removeParticipantRequest, Context context) { + return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1331,28 +1018,16 @@ public Mono removeParticipantAsync( * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for removing participants of the call. + * @return the response payload for removing participants of the call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RemoveParticipantResponseInternal removeParticipant( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return removeParticipantAsync( - callConnectionId, removeParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response removeParticipantWithResponse( + String callConnectionId, RemoveParticipantRequestInternal removeParticipantRequest, Context context) { + return removeParticipantWithResponseAsync(callConnectionId, removeParticipantRequest, context).block(); } /** @@ -1360,34 +1035,15 @@ public RemoveParticipantResponseInternal removeParticipant( * * @param callConnectionId The call connection id. * @param removeParticipantRequest The participant to be removed from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response payload for removing participants of the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response removeParticipantWithResponse( - String callConnectionId, - RemoveParticipantRequestInternal removeParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return removeParticipantWithResponseAsync( - callConnectionId, - removeParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public RemoveParticipantResponseInternal removeParticipant( + String callConnectionId, RemoveParticipantRequestInternal removeParticipantRequest) { + return removeParticipantWithResponse(callConnectionId, removeParticipantRequest, Context.NONE).getValue(); } /** @@ -1395,38 +1051,28 @@ public Response removeParticipantWithResponse * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call. + * @return the result payload for muting participants from the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> muteWithResponseAsync( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + String callConnectionId, MuteParticipantsRequestInternal muteParticipantsRequest) { final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); + String repeatabilityRequestId = UUID.randomUUID().toString(); + String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); return FluxUtil.withContext( context -> service.mute( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, muteParticipantsRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -1435,38 +1081,27 @@ public Mono> muteWithResponseAsync( * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call. + * @return the result payload for muting participants from the call along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> muteWithResponseAsync( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + String callConnectionId, MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { 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 service.mute( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, muteParticipantsRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -1475,35 +1110,16 @@ public Mono> muteWithResponseAsync( * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call. + * @return the result payload for muting participants from the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono muteAsync( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return muteWithResponseAsync( - callConnectionId, muteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, MuteParticipantsRequestInternal muteParticipantsRequest) { + return muteWithResponseAsync(callConnectionId, muteParticipantsRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1511,41 +1127,17 @@ public Mono muteAsync( * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call. + * @return the result payload for muting participants from the call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono muteAsync( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return muteWithResponseAsync( - callConnectionId, - muteParticipantsRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { + return muteWithResponseAsync(callConnectionId, muteParticipantsRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1553,27 +1145,16 @@ public Mono muteAsync( * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result payload for muting participants from the call. + * @return the result payload for muting participants from the call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MuteParticipantsResultInternal mute( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return muteAsync(callConnectionId, muteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response muteWithResponse( + String callConnectionId, MuteParticipantsRequestInternal muteParticipantsRequest, Context context) { + return muteWithResponseAsync(callConnectionId, muteParticipantsRequest, context).block(); } /** @@ -1581,255 +1162,15 @@ public MuteParticipantsResultInternal mute( * * @param callConnectionId The call connection id. * @param muteParticipantsRequest The participants to be muted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result payload for muting participants from the call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response muteWithResponse( - String callConnectionId, - MuteParticipantsRequestInternal muteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return muteWithResponseAsync( - callConnectionId, - muteParticipantsRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); - } - - /** - * Unmute participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unmuteParticipantsRequest The participants to be unmuted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unmuteWithResponseAsync( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return FluxUtil.withContext( - context -> - service.unmute( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - unmuteParticipantsRequest, - accept, - context)); - } - - /** - * Unmute participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unmuteParticipantsRequest The participants to be unmuted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unmuteWithResponseAsync( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - final String accept = "application/json"; - DateTimeRfc1123 repeatabilityFirstSentConverted = - repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent); - return service.unmute( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, - unmuteParticipantsRequest, - accept, - context); - } - - /** - * Unmute participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unmuteParticipantsRequest The participants to be unmuted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unmuteAsync( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return unmuteWithResponseAsync( - callConnectionId, unmuteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Unmute participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unmuteParticipantsRequest The participants to be unmuted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unmuteAsync( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return unmuteWithResponseAsync( - callConnectionId, - unmuteParticipantsRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Unmute participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unmuteParticipantsRequest The participants to be unmuted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UnmuteParticipantsResponseInternal unmute( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return unmuteAsync(callConnectionId, unmuteParticipantsRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); - } - - /** - * Unmute participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unmuteParticipantsRequest The participants to be unmuted from the call. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for unmuting participants from the call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response unmuteWithResponse( - String callConnectionId, - UnmuteParticipantsRequestInternal unmuteParticipantsRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return unmuteWithResponseAsync( - callConnectionId, - unmuteParticipantsRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public MuteParticipantsResultInternal mute( + String callConnectionId, MuteParticipantsRequestInternal muteParticipantsRequest) { + return muteWithResponse(callConnectionId, muteParticipantsRequest, Context.NONE).getValue(); } /** @@ -1837,38 +1178,28 @@ public Response unmuteWithResponse( * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request. + * @return response payload for cancel add participant request along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> cancelAddParticipantWithResponseAsync( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + String callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest) { 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.cancelAddParticipant( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, cancelAddParticipantRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -1877,38 +1208,27 @@ public Mono> cancelAddParticipantWithResp * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request. + * @return response payload for cancel add participant request along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> cancelAddParticipantWithResponseAsync( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + String callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { 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 service.cancelAddParticipant( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, cancelAddParticipantRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -1917,35 +1237,16 @@ public Mono> cancelAddParticipantWithResp * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request. + * @return response payload for cancel add participant request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAddParticipantAsync( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return cancelAddParticipantWithResponseAsync( - callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest) { + return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1953,41 +1254,17 @@ public Mono cancelAddParticipantAsync( * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request. + * @return response payload for cancel add participant request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAddParticipantAsync( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return cancelAddParticipantWithResponseAsync( - callConnectionId, - cancelAddParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { + return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1995,28 +1272,16 @@ public Mono cancelAddParticipantAsync( * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response payload for cancel add participant request. + * @return response payload for cancel add participant request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CancelAddParticipantResponse cancelAddParticipant( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return cancelAddParticipantAsync( - callConnectionId, cancelAddParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response cancelAddParticipantWithResponse( + String callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest, Context context) { + return cancelAddParticipantWithResponseAsync(callConnectionId, cancelAddParticipantRequest, context).block(); } /** @@ -2024,34 +1289,15 @@ public CancelAddParticipantResponse cancelAddParticipant( * * @param callConnectionId The call connection Id. * @param cancelAddParticipantRequest Cancellation request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response payload for cancel add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAddParticipantWithResponse( - String callConnectionId, - CancelAddParticipantRequest cancelAddParticipantRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return cancelAddParticipantWithResponseAsync( - callConnectionId, - cancelAddParticipantRequest, - repeatabilityRequestID, - repeatabilityFirstSent, - context) - .block(); + public CancelAddParticipantResponse cancelAddParticipant( + String callConnectionId, CancelAddParticipantRequest cancelAddParticipantRequest) { + return cancelAddParticipantWithResponse(callConnectionId, cancelAddParticipantRequest, Context.NONE).getValue(); } /** @@ -2062,7 +1308,7 @@ public Response cancelAddParticipantWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call. + * @return participant from a call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getParticipantWithResponseAsync( @@ -2088,7 +1334,7 @@ public Mono> getParticipantWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call. + * @return participant from a call along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getParticipantWithResponseAsync( @@ -2111,19 +1357,12 @@ public Mono> getParticipantWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call. + * @return participant from a call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getParticipantAsync(String callConnectionId, String participantRawId) { return getParticipantWithResponseAsync(callConnectionId, participantRawId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2135,20 +1374,13 @@ public Mono getParticipantAsync(String callConnectionId * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call. + * @return participant from a call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getParticipantAsync( String callConnectionId, String participantRawId, Context context) { return getParticipantWithResponseAsync(callConnectionId, participantRawId, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2156,14 +1388,16 @@ public Mono getParticipantAsync( * * @param callConnectionId The call connection Id. * @param participantRawId Raw id of the participant to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return participant from a call. + * @return participant from a call along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CallParticipantInternal getParticipant(String callConnectionId, String participantRawId) { - return getParticipantAsync(callConnectionId, participantRawId).block(); + public Response getParticipantWithResponse( + String callConnectionId, String participantRawId, Context context) { + return getParticipantWithResponseAsync(callConnectionId, participantRawId, context).block(); } /** @@ -2171,26 +1405,26 @@ public CallParticipantInternal getParticipant(String callConnectionId, String pa * * @param callConnectionId The call connection Id. * @param participantRawId Raw id of the participant to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return participant from a call. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getParticipantWithResponse( - String callConnectionId, String participantRawId, Context context) { - return getParticipantWithResponseAsync(callConnectionId, participantRawId, context).block(); + public CallParticipantInternal getParticipant(String callConnectionId, String participantRawId) { + return getParticipantWithResponse(callConnectionId, participantRawId, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for getting participants of the call. + * @return the response payload for getting participants of the call along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getParticipantsNextSinglePageAsync(String nextLink) { @@ -2211,12 +1445,14 @@ public Mono> getParticipantsNextSinglePag /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response payload for getting participants of the call. + * @return the response payload for getting participants of the call along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getParticipantsNextSinglePageAsync( @@ -2233,4 +1469,35 @@ public Mono> getParticipantsNextSinglePag res.getValue().getNextLink(), null)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws CommunicationErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for getting participants of the call along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getParticipantsNextSinglePage(String nextLink) { + return getParticipantsNextSinglePageAsync(nextLink).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws CommunicationErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for getting participants of the call along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getParticipantsNextSinglePage(String nextLink, Context context) { + return getParticipantsNextSinglePageAsync(nextLink, context).block(); + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallDialogsImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallDialogsImpl.java deleted file mode 100644 index e4bc8a758087..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallDialogsImpl.java +++ /dev/null @@ -1,477 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation; - -import com.azure.communication.callautomation.implementation.models.CommunicationErrorResponseException; -import com.azure.communication.callautomation.implementation.models.DialogStateResponse; -import com.azure.communication.callautomation.implementation.models.StartDialogRequestInternal; -import com.azure.communication.callautomation.implementation.models.UpdateDialogRequest; -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CallDialogs. */ -public final class CallDialogsImpl { - /** The proxy service used to perform REST calls. */ - private final CallDialogsService service; - - /** The service client containing this operation class. */ - private final AzureCommunicationCallAutomationServiceImpl client; - - /** - * Initializes an instance of CallDialogsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CallDialogsImpl(AzureCommunicationCallAutomationServiceImpl client) { - this.service = - RestProxy.create(CallDialogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureCommunicationCallAutomationServiceCallDialogs to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "AzureCommunicationCa") - public interface CallDialogsService { - @Put("/calling/callConnections/{callConnectionId}/dialogs/{dialogId}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> startDialog( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @PathParam("dialogId") String dialogId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StartDialogRequestInternal startDialogRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Delete("/calling/callConnections/{callConnectionId}/dialogs/{dialogId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> stopDialog( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @PathParam("dialogId") String dialogId, - @QueryParam("operationCallbackUri") String operationCallbackUri, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Patch("/calling/callConnections/{callConnectionId}/dialogs/{dialogId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> updateDialog( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @PathParam("dialogId") String dialogId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateDialogRequest updateDialogRequest, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Start a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param startDialogRequest The start dialog request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startDialogWithResponseAsync( - String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.startDialog( - this.client.getEndpoint(), - callConnectionId, - dialogId, - this.client.getApiVersion(), - startDialogRequest, - accept, - context)); - } - - /** - * Start a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param startDialogRequest The start dialog request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startDialogWithResponseAsync( - String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest, Context context) { - final String accept = "application/json"; - return service.startDialog( - this.client.getEndpoint(), - callConnectionId, - dialogId, - this.client.getApiVersion(), - startDialogRequest, - accept, - context); - } - - /** - * Start a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param startDialogRequest The start dialog request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startDialogAsync( - String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest) { - return startDialogWithResponseAsync(callConnectionId, dialogId, startDialogRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Start a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param startDialogRequest The start dialog request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startDialogAsync( - String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest, Context context) { - return startDialogWithResponseAsync(callConnectionId, dialogId, startDialogRequest, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Start a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param startDialogRequest The start dialog request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DialogStateResponse startDialog( - String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest) { - return startDialogAsync(callConnectionId, dialogId, startDialogRequest).block(); - } - - /** - * Start a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param startDialogRequest The start dialog request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startDialogWithResponse( - String callConnectionId, String dialogId, StartDialogRequestInternal startDialogRequest, Context context) { - return startDialogWithResponseAsync(callConnectionId, dialogId, startDialogRequest, context).block(); - } - - /** - * Stop a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param operationCallbackUri Operation callback URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopDialogWithResponseAsync( - String callConnectionId, String dialogId, String operationCallbackUri) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.stopDialog( - this.client.getEndpoint(), - callConnectionId, - dialogId, - operationCallbackUri, - this.client.getApiVersion(), - accept, - context)); - } - - /** - * Stop a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param operationCallbackUri Operation callback URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopDialogWithResponseAsync( - String callConnectionId, String dialogId, String operationCallbackUri, Context context) { - final String accept = "application/json"; - return service.stopDialog( - this.client.getEndpoint(), - callConnectionId, - dialogId, - operationCallbackUri, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Stop a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param operationCallbackUri Operation callback URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopDialogAsync(String callConnectionId, String dialogId, String operationCallbackUri) { - return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param operationCallbackUri Operation callback URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopDialogAsync( - String callConnectionId, String dialogId, String operationCallbackUri, Context context) { - return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param operationCallbackUri Operation callback URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopDialog(String callConnectionId, String dialogId, String operationCallbackUri) { - stopDialogAsync(callConnectionId, dialogId, operationCallbackUri).block(); - } - - /** - * Stop a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param operationCallbackUri Operation callback URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopDialogWithResponse( - String callConnectionId, String dialogId, String operationCallbackUri, Context context) { - return stopDialogWithResponseAsync(callConnectionId, dialogId, operationCallbackUri, context).block(); - } - - /** - * Update a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param updateDialogRequest The update dialog request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateDialogWithResponseAsync( - String callConnectionId, String dialogId, UpdateDialogRequest updateDialogRequest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.updateDialog( - this.client.getEndpoint(), - callConnectionId, - dialogId, - this.client.getApiVersion(), - updateDialogRequest, - accept, - context)); - } - - /** - * Update a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param updateDialogRequest The update dialog request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateDialogWithResponseAsync( - String callConnectionId, String dialogId, UpdateDialogRequest updateDialogRequest, Context context) { - final String accept = "application/json"; - return service.updateDialog( - this.client.getEndpoint(), - callConnectionId, - dialogId, - this.client.getApiVersion(), - updateDialogRequest, - accept, - context); - } - - /** - * Update a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param updateDialogRequest The update dialog request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateDialogAsync( - String callConnectionId, String dialogId, UpdateDialogRequest updateDialogRequest) { - return updateDialogWithResponseAsync(callConnectionId, dialogId, updateDialogRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Update a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param updateDialogRequest The update dialog request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateDialogAsync( - String callConnectionId, String dialogId, UpdateDialogRequest updateDialogRequest, Context context) { - return updateDialogWithResponseAsync(callConnectionId, dialogId, updateDialogRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Update a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param updateDialogRequest The update dialog request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateDialog(String callConnectionId, String dialogId, UpdateDialogRequest updateDialogRequest) { - updateDialogAsync(callConnectionId, dialogId, updateDialogRequest).block(); - } - - /** - * Update a dialog. - * - * @param callConnectionId The call connection id. - * @param dialogId The dialog id. - * @param updateDialogRequest The update dialog request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateDialogWithResponse( - String callConnectionId, String dialogId, UpdateDialogRequest updateDialogRequest, Context context) { - return updateDialogWithResponseAsync(callConnectionId, dialogId, updateDialogRequest, context).block(); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallMediasImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallMediasImpl.java index 29ac30783634..d98b12c785da 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallMediasImpl.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallMediasImpl.java @@ -6,17 +6,10 @@ import com.azure.communication.callautomation.implementation.models.CommunicationErrorResponseException; import com.azure.communication.callautomation.implementation.models.ContinuousDtmfRecognitionRequestInternal; -import com.azure.communication.callautomation.implementation.models.HoldRequest; import com.azure.communication.callautomation.implementation.models.PlayRequest; import com.azure.communication.callautomation.implementation.models.RecognizeRequest; import com.azure.communication.callautomation.implementation.models.SendDtmfTonesRequestInternal; import com.azure.communication.callautomation.implementation.models.SendDtmfTonesResultInternal; -import com.azure.communication.callautomation.implementation.models.StartHoldMusicRequestInternal; -import com.azure.communication.callautomation.implementation.models.StartTranscriptionRequestInternal; -import com.azure.communication.callautomation.implementation.models.StopHoldMusicRequestInternal; -import com.azure.communication.callautomation.implementation.models.StopTranscriptionRequestInternal; -import com.azure.communication.callautomation.implementation.models.UnholdRequest; -import com.azure.communication.callautomation.implementation.models.UpdateTranscriptionRequestInternal; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; @@ -75,28 +68,6 @@ Mono> play( @HeaderParam("Accept") String accept, Context context); - @Post("/calling/callConnections/{callConnectionId}:startTranscription") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> startTranscription( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StartTranscriptionRequestInternal startTranscriptionRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Post("/calling/callConnections/{callConnectionId}:stopTranscription") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> stopTranscription( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopTranscriptionRequestInternal stopTranscriptionRequest, - @HeaderParam("Accept") String accept, - Context context); - @Post("/calling/callConnections/{callConnectionId}:cancelAllMediaOperations") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) @@ -149,65 +120,10 @@ Mono> sendDtmfTones( @HostParam("endpoint") String endpoint, @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, @BodyParam("application/json") SendDtmfTonesRequestInternal sendDtmfTonesRequest, @HeaderParam("Accept") String accept, - Context context); - - @Post("/calling/callConnections/{callConnectionId}:updateTranscription") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> updateTranscription( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateTranscriptionRequestInternal updateTranscriptionRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Post("/calling/callConnections/{callConnectionId}:hold") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> hold( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HoldRequest holdRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Post("/calling/callConnections/{callConnectionId}:unhold") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> unhold( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UnholdRequest unholdRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Post("/calling/callConnections/{callConnectionId}:startHoldMusic") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> startHoldMusic( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StartHoldMusicRequestInternal startHoldMusicRequest, - @HeaderParam("Accept") String accept, - Context context); - - @Post("/calling/callConnections/{callConnectionId}:stopHoldMusic") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> stopHoldMusic( - @HostParam("endpoint") String endpoint, - @PathParam("callConnectionId") String callConnectionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopHoldMusicRequestInternal stopHoldMusicRequest, - @HeaderParam("Accept") String accept, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); } @@ -219,7 +135,7 @@ Mono> stopHoldMusic( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> playWithResponseAsync(String callConnectionId, PlayRequest playRequest) { @@ -244,7 +160,7 @@ public Mono> playWithResponseAsync(String callConnectionId, PlayR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> playWithResponseAsync( @@ -262,11 +178,11 @@ public Mono> playWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono playAsync(String callConnectionId, PlayRequest playRequest) { - return playWithResponseAsync(callConnectionId, playRequest).flatMap((Response res) -> Mono.empty()); + return playWithResponseAsync(callConnectionId, playRequest).flatMap(ignored -> Mono.empty()); } /** @@ -278,12 +194,11 @@ public Mono playAsync(String callConnectionId, PlayRequest playRequest) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono playAsync(String callConnectionId, PlayRequest playRequest, Context context) { - return playWithResponseAsync(callConnectionId, playRequest, context) - .flatMap((Response res) -> Mono.empty()); + return playWithResponseAsync(callConnectionId, playRequest, context).flatMap(ignored -> Mono.empty()); } /** @@ -291,13 +206,15 @@ public Mono playAsync(String callConnectionId, PlayRequest playRequest, Co * * @param callConnectionId The call connection id. * @param playRequest play request payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void play(String callConnectionId, PlayRequest playRequest) { - playAsync(callConnectionId, playRequest).block(); + public Response playWithResponse(String callConnectionId, PlayRequest playRequest, Context context) { + return playWithResponseAsync(callConnectionId, playRequest, context).block(); } /** @@ -305,745 +222,497 @@ public void play(String callConnectionId, PlayRequest playRequest) { * * @param callConnectionId The call connection id. * @param playRequest play request payload. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response playWithResponse(String callConnectionId, PlayRequest playRequest, Context context) { - return playWithResponseAsync(callConnectionId, playRequest, context).block(); + public void play(String callConnectionId, PlayRequest playRequest) { + playWithResponse(callConnectionId, playRequest, Context.NONE); } /** - * Starts transcription in the call. + * Cancel all media operations in a call. * * @param callConnectionId The call connection id. - * @param startTranscriptionRequest The startTranscriptionRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startTranscriptionWithResponseAsync( - String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest) { + public Mono> cancelAllMediaOperationsWithResponseAsync(String callConnectionId) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.startTranscription( + service.cancelAllMediaOperations( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - startTranscriptionRequest, accept, context)); } /** - * Starts transcription in the call. + * Cancel all media operations in a call. * * @param callConnectionId The call connection id. - * @param startTranscriptionRequest The startTranscriptionRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startTranscriptionWithResponseAsync( - String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest, Context context) { + public Mono> cancelAllMediaOperationsWithResponseAsync(String callConnectionId, Context context) { final String accept = "application/json"; - return service.startTranscription( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - startTranscriptionRequest, - accept, - context); + return service.cancelAllMediaOperations( + this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, context); } /** - * Starts transcription in the call. + * Cancel all media operations in a call. * * @param callConnectionId The call connection id. - * @param startTranscriptionRequest The startTranscriptionRequest parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startTranscriptionAsync( - String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest) { - return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest) - .flatMap((Response res) -> Mono.empty()); + public Mono cancelAllMediaOperationsAsync(String callConnectionId) { + return cancelAllMediaOperationsWithResponseAsync(callConnectionId).flatMap(ignored -> Mono.empty()); } /** - * Starts transcription in the call. + * Cancel all media operations in a call. * * @param callConnectionId The call connection id. - * @param startTranscriptionRequest The startTranscriptionRequest parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startTranscriptionAsync( - String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest, Context context) { - return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest, context) - .flatMap((Response res) -> Mono.empty()); + public Mono cancelAllMediaOperationsAsync(String callConnectionId, Context context) { + return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).flatMap(ignored -> Mono.empty()); } /** - * Starts transcription in the call. + * Cancel all media operations in a call. * * @param callConnectionId The call connection id. - * @param startTranscriptionRequest The startTranscriptionRequest parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void startTranscription( - String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest) { - startTranscriptionAsync(callConnectionId, startTranscriptionRequest).block(); + public Response cancelAllMediaOperationsWithResponse(String callConnectionId, Context context) { + return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).block(); } /** - * Starts transcription in the call. + * Cancel all media operations in a call. * * @param callConnectionId The call connection id. - * @param startTranscriptionRequest The startTranscriptionRequest parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startTranscriptionWithResponse( - String callConnectionId, StartTranscriptionRequestInternal startTranscriptionRequest, Context context) { - return startTranscriptionWithResponseAsync(callConnectionId, startTranscriptionRequest, context).block(); + public void cancelAllMediaOperations(String callConnectionId) { + cancelAllMediaOperationsWithResponse(callConnectionId, Context.NONE); } /** - * Stops transcription in the call. + * Recognize media from call. * * @param callConnectionId The call connection id. - * @param stopTranscriptionRequest stop transcription request payload. + * @param recognizeRequest The media recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTranscriptionWithResponseAsync( - String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest) { + public Mono> recognizeWithResponseAsync(String callConnectionId, RecognizeRequest recognizeRequest) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.stopTranscription( + service.recognize( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - stopTranscriptionRequest, + recognizeRequest, accept, context)); } /** - * Stops transcription in the call. + * Recognize media from call. * * @param callConnectionId The call connection id. - * @param stopTranscriptionRequest stop transcription request payload. + * @param recognizeRequest The media recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTranscriptionWithResponseAsync( - String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest, Context context) { + public Mono> recognizeWithResponseAsync( + String callConnectionId, RecognizeRequest recognizeRequest, Context context) { final String accept = "application/json"; - return service.stopTranscription( + return service.recognize( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - stopTranscriptionRequest, + recognizeRequest, accept, context); } /** - * Stops transcription in the call. + * Recognize media from call. * * @param callConnectionId The call connection id. - * @param stopTranscriptionRequest stop transcription request payload. + * @param recognizeRequest The media recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopTranscriptionAsync( - String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest) { - return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest) - .flatMap((Response res) -> Mono.empty()); + public Mono recognizeAsync(String callConnectionId, RecognizeRequest recognizeRequest) { + return recognizeWithResponseAsync(callConnectionId, recognizeRequest).flatMap(ignored -> Mono.empty()); } /** - * Stops transcription in the call. + * Recognize media from call. * * @param callConnectionId The call connection id. - * @param stopTranscriptionRequest stop transcription request payload. + * @param recognizeRequest The media recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopTranscriptionAsync( - String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest, Context context) { - return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest, context) - .flatMap((Response res) -> Mono.empty()); + public Mono recognizeAsync(String callConnectionId, RecognizeRequest recognizeRequest, Context context) { + return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).flatMap(ignored -> Mono.empty()); } /** - * Stops transcription in the call. + * Recognize media from call. * * @param callConnectionId The call connection id. - * @param stopTranscriptionRequest stop transcription request payload. + * @param recognizeRequest The media recognize request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stopTranscription(String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest) { - stopTranscriptionAsync(callConnectionId, stopTranscriptionRequest).block(); + public Response recognizeWithResponse( + String callConnectionId, RecognizeRequest recognizeRequest, Context context) { + return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).block(); } /** - * Stops transcription in the call. + * Recognize media from call. * * @param callConnectionId The call connection id. - * @param stopTranscriptionRequest stop transcription request payload. - * @param context The context to associate with this operation. + * @param recognizeRequest The media recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopTranscriptionWithResponse( - String callConnectionId, StopTranscriptionRequestInternal stopTranscriptionRequest, Context context) { - return stopTranscriptionWithResponseAsync(callConnectionId, stopTranscriptionRequest, context).block(); + public void recognize(String callConnectionId, RecognizeRequest recognizeRequest) { + recognizeWithResponse(callConnectionId, recognizeRequest, Context.NONE); } /** - * Cancel all media operations in a call. + * Start continuous Dtmf recognition by subscribing to tones. * * @param callConnectionId The call connection id. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAllMediaOperationsWithResponseAsync(String callConnectionId) { + public Mono> startContinuousDtmfRecognitionWithResponseAsync( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.cancelAllMediaOperations( + service.startContinuousDtmfRecognition( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), + continuousDtmfRecognitionRequest, accept, context)); } /** - * Cancel all media operations in a call. + * Start continuous Dtmf recognition by subscribing to tones. * * @param callConnectionId The call connection id. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAllMediaOperationsWithResponseAsync(String callConnectionId, Context context) { + public Mono> startContinuousDtmfRecognitionWithResponseAsync( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { final String accept = "application/json"; - return service.cancelAllMediaOperations( - this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), accept, context); + return service.startContinuousDtmfRecognition( + this.client.getEndpoint(), + callConnectionId, + this.client.getApiVersion(), + continuousDtmfRecognitionRequest, + accept, + context); } /** - * Cancel all media operations in a call. + * Start continuous Dtmf recognition by subscribing to tones. * * @param callConnectionId The call connection id. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAllMediaOperationsAsync(String callConnectionId) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId) - .flatMap((Response res) -> Mono.empty()); + public Mono startContinuousDtmfRecognitionAsync( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + return startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest) + .flatMap(ignored -> Mono.empty()); } /** - * Cancel all media operations in a call. + * Start continuous Dtmf recognition by subscribing to tones. * * @param callConnectionId The call connection id. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAllMediaOperationsAsync(String callConnectionId, Context context) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context) - .flatMap((Response res) -> Mono.empty()); + public Mono startContinuousDtmfRecognitionAsync( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { + return startContinuousDtmfRecognitionWithResponseAsync( + callConnectionId, continuousDtmfRecognitionRequest, context) + .flatMap(ignored -> Mono.empty()); } /** - * Cancel all media operations in a call. + * Start continuous Dtmf recognition by subscribing to tones. * * @param callConnectionId The call connection id. + * @param continuousDtmfRecognitionRequest The continuous recognize request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelAllMediaOperations(String callConnectionId) { - cancelAllMediaOperationsAsync(callConnectionId).block(); + public Response startContinuousDtmfRecognitionWithResponse( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { + return startContinuousDtmfRecognitionWithResponseAsync( + callConnectionId, continuousDtmfRecognitionRequest, context) + .block(); } /** - * Cancel all media operations in a call. + * Start continuous Dtmf recognition by subscribing to tones. * * @param callConnectionId The call connection id. - * @param context The context to associate with this operation. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAllMediaOperationsWithResponse(String callConnectionId, Context context) { - return cancelAllMediaOperationsWithResponseAsync(callConnectionId, context).block(); + public void startContinuousDtmfRecognition( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + startContinuousDtmfRecognitionWithResponse(callConnectionId, continuousDtmfRecognitionRequest, Context.NONE); } /** - * Recognize media from call. + * Stop continuous Dtmf recognition by unsubscribing to tones. * * @param callConnectionId The call connection id. - * @param recognizeRequest The media recognize request. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> recognizeWithResponseAsync(String callConnectionId, RecognizeRequest recognizeRequest) { + public Mono> stopContinuousDtmfRecognitionWithResponseAsync( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.recognize( + service.stopContinuousDtmfRecognition( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - recognizeRequest, + continuousDtmfRecognitionRequest, accept, context)); } /** - * Recognize media from call. + * Stop continuous Dtmf recognition by unsubscribing to tones. * * @param callConnectionId The call connection id. - * @param recognizeRequest The media recognize request. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> recognizeWithResponseAsync( - String callConnectionId, RecognizeRequest recognizeRequest, Context context) { + public Mono> stopContinuousDtmfRecognitionWithResponseAsync( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { final String accept = "application/json"; - return service.recognize( + return service.stopContinuousDtmfRecognition( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - recognizeRequest, + continuousDtmfRecognitionRequest, accept, context); } /** - * Recognize media from call. + * Stop continuous Dtmf recognition by unsubscribing to tones. * * @param callConnectionId The call connection id. - * @param recognizeRequest The media recognize request. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono recognizeAsync(String callConnectionId, RecognizeRequest recognizeRequest) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest) - .flatMap((Response res) -> Mono.empty()); + public Mono stopContinuousDtmfRecognitionAsync( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + return stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest) + .flatMap(ignored -> Mono.empty()); } /** - * Recognize media from call. + * Stop continuous Dtmf recognition by unsubscribing to tones. * * @param callConnectionId The call connection id. - * @param recognizeRequest The media recognize request. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono recognizeAsync(String callConnectionId, RecognizeRequest recognizeRequest, Context context) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context) - .flatMap((Response res) -> Mono.empty()); + public Mono stopContinuousDtmfRecognitionAsync( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { + return stopContinuousDtmfRecognitionWithResponseAsync( + callConnectionId, continuousDtmfRecognitionRequest, context) + .flatMap(ignored -> Mono.empty()); } /** - * Recognize media from call. + * Stop continuous Dtmf recognition by unsubscribing to tones. * * @param callConnectionId The call connection id. - * @param recognizeRequest The media recognize request. + * @param continuousDtmfRecognitionRequest The continuous recognize request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void recognize(String callConnectionId, RecognizeRequest recognizeRequest) { - recognizeAsync(callConnectionId, recognizeRequest).block(); + public Response stopContinuousDtmfRecognitionWithResponse( + String callConnectionId, + ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, + Context context) { + return stopContinuousDtmfRecognitionWithResponseAsync( + callConnectionId, continuousDtmfRecognitionRequest, context) + .block(); } /** - * Recognize media from call. + * Stop continuous Dtmf recognition by unsubscribing to tones. * * @param callConnectionId The call connection id. - * @param recognizeRequest The media recognize request. - * @param context The context to associate with this operation. + * @param continuousDtmfRecognitionRequest The continuous recognize request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response recognizeWithResponse( - String callConnectionId, RecognizeRequest recognizeRequest, Context context) { - return recognizeWithResponseAsync(callConnectionId, recognizeRequest, context).block(); + public void stopContinuousDtmfRecognition( + String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + stopContinuousDtmfRecognitionWithResponse(callConnectionId, continuousDtmfRecognitionRequest, Context.NONE); } /** - * Start continuous Dtmf recognition by subscribing to tones. + * Send dtmf tones. * * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. + * @param sendDtmfTonesRequest The send dtmf tones request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startContinuousDtmfRecognitionWithResponseAsync( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { + public Mono> sendDtmfTonesWithResponseAsync( + String callConnectionId, SendDtmfTonesRequestInternal sendDtmfTonesRequest) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.startContinuousDtmfRecognition( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - continuousDtmfRecognitionRequest, - accept, - context)); - } - - /** - * Start continuous Dtmf recognition by subscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startContinuousDtmfRecognitionWithResponseAsync( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - final String accept = "application/json"; - return service.startContinuousDtmfRecognition( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - continuousDtmfRecognitionRequest, - accept, - context); - } - - /** - * Start continuous Dtmf recognition by subscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startContinuousDtmfRecognitionAsync( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - return startContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Start continuous Dtmf recognition by subscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startContinuousDtmfRecognitionAsync( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - return startContinuousDtmfRecognitionWithResponseAsync( - callConnectionId, continuousDtmfRecognitionRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Start continuous Dtmf recognition by subscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startContinuousDtmfRecognition( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - startContinuousDtmfRecognitionAsync(callConnectionId, continuousDtmfRecognitionRequest).block(); - } - - /** - * Start continuous Dtmf recognition by subscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startContinuousDtmfRecognitionWithResponse( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - return startContinuousDtmfRecognitionWithResponseAsync( - callConnectionId, continuousDtmfRecognitionRequest, context) - .block(); - } - - /** - * Stop continuous Dtmf recognition by unsubscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopContinuousDtmfRecognitionWithResponseAsync( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.stopContinuousDtmfRecognition( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - continuousDtmfRecognitionRequest, - accept, - context)); - } - - /** - * Stop continuous Dtmf recognition by unsubscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopContinuousDtmfRecognitionWithResponseAsync( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - final String accept = "application/json"; - return service.stopContinuousDtmfRecognition( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - continuousDtmfRecognitionRequest, - accept, - context); - } - - /** - * Stop continuous Dtmf recognition by unsubscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopContinuousDtmfRecognitionAsync( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - return stopContinuousDtmfRecognitionWithResponseAsync(callConnectionId, continuousDtmfRecognitionRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop continuous Dtmf recognition by unsubscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopContinuousDtmfRecognitionAsync( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - return stopContinuousDtmfRecognitionWithResponseAsync( - callConnectionId, continuousDtmfRecognitionRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Stop continuous Dtmf recognition by unsubscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopContinuousDtmfRecognition( - String callConnectionId, ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest) { - stopContinuousDtmfRecognitionAsync(callConnectionId, continuousDtmfRecognitionRequest).block(); - } - - /** - * Stop continuous Dtmf recognition by unsubscribing to tones. - * - * @param callConnectionId The call connection id. - * @param continuousDtmfRecognitionRequest The continuous recognize request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopContinuousDtmfRecognitionWithResponse( - String callConnectionId, - ContinuousDtmfRecognitionRequestInternal continuousDtmfRecognitionRequest, - Context context) { - return stopContinuousDtmfRecognitionWithResponseAsync( - callConnectionId, continuousDtmfRecognitionRequest, context) - .block(); - } - - /** - * Send dtmf tones. - * - * @param callConnectionId The call connection id. - * @param sendDtmfTonesRequest The send dtmf tones request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendDtmfTonesWithResponseAsync( - String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - 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.sendDtmfTones( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, sendDtmfTonesRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -1052,38 +721,26 @@ public Mono> sendDtmfTonesWithResponseAsyn * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> sendDtmfTonesWithResponseAsync( - String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + String callConnectionId, SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { 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 service.sendDtmfTones( this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, sendDtmfTonesRequest, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -1092,35 +749,16 @@ public Mono> sendDtmfTonesWithResponseAsyn * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono sendDtmfTonesAsync( - String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return sendDtmfTonesWithResponseAsync( - callConnectionId, sendDtmfTonesRequest, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, SendDtmfTonesRequestInternal sendDtmfTonesRequest) { + return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1128,37 +766,17 @@ public Mono sendDtmfTonesAsync( * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono sendDtmfTonesAsync( - String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return sendDtmfTonesWithResponseAsync( - callConnectionId, sendDtmfTonesRequest, repeatabilityRequestID, repeatabilityFirstSent, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String callConnectionId, SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { + return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1166,28 +784,16 @@ public Mono sendDtmfTonesAsync( * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SendDtmfTonesResultInternal sendDtmfTones( - String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return sendDtmfTonesAsync( - callConnectionId, sendDtmfTonesRequest, repeatabilityRequestID, repeatabilityFirstSent) - .block(); + public Response sendDtmfTonesWithResponse( + String callConnectionId, SendDtmfTonesRequestInternal sendDtmfTonesRequest, Context context) { + return sendDtmfTonesWithResponseAsync(callConnectionId, sendDtmfTonesRequest, context).block(); } /** @@ -1195,589 +801,14 @@ public SendDtmfTonesResultInternal sendDtmfTones( * * @param callConnectionId The call connection id. * @param sendDtmfTonesRequest The send dtmf tones request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendDtmfTonesWithResponse( - String callConnectionId, - SendDtmfTonesRequestInternal sendDtmfTonesRequest, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return sendDtmfTonesWithResponseAsync( - callConnectionId, sendDtmfTonesRequest, repeatabilityRequestID, repeatabilityFirstSent, context) - .block(); - } - - /** - * API to change transcription language. - * - * @param callConnectionId The call connection id. - * @param updateTranscriptionRequest The UpdateTranscription request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTranscriptionWithResponseAsync( - String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.updateTranscription( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - updateTranscriptionRequest, - accept, - context)); - } - - /** - * API to change transcription language. - * - * @param callConnectionId The call connection id. - * @param updateTranscriptionRequest The UpdateTranscription request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateTranscriptionWithResponseAsync( - String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest, Context context) { - final String accept = "application/json"; - return service.updateTranscription( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - updateTranscriptionRequest, - accept, - context); - } - - /** - * API to change transcription language. - * - * @param callConnectionId The call connection id. - * @param updateTranscriptionRequest The UpdateTranscription request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTranscriptionAsync( - String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest) { - return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * API to change transcription language. - * - * @param callConnectionId The call connection id. - * @param updateTranscriptionRequest The UpdateTranscription request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTranscriptionAsync( - String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest, Context context) { - return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * API to change transcription language. - * - * @param callConnectionId The call connection id. - * @param updateTranscriptionRequest The UpdateTranscription request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateTranscription( - String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest) { - updateTranscriptionAsync(callConnectionId, updateTranscriptionRequest).block(); - } - - /** - * API to change transcription language. - * - * @param callConnectionId The call connection id. - * @param updateTranscriptionRequest The UpdateTranscription request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTranscriptionWithResponse( - String callConnectionId, UpdateTranscriptionRequestInternal updateTranscriptionRequest, Context context) { - return updateTranscriptionWithResponseAsync(callConnectionId, updateTranscriptionRequest, context).block(); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param holdRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> holdWithResponseAsync(String callConnectionId, HoldRequest holdRequest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.hold( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - holdRequest, - accept, - context)); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param holdRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> holdWithResponseAsync( - String callConnectionId, HoldRequest holdRequest, Context context) { - final String accept = "application/json"; - return service.hold( - this.client.getEndpoint(), callConnectionId, this.client.getApiVersion(), holdRequest, accept, context); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param holdRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono holdAsync(String callConnectionId, HoldRequest holdRequest) { - return holdWithResponseAsync(callConnectionId, holdRequest).flatMap((Response res) -> Mono.empty()); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param holdRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono holdAsync(String callConnectionId, HoldRequest holdRequest, Context context) { - return holdWithResponseAsync(callConnectionId, holdRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param holdRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void hold(String callConnectionId, HoldRequest holdRequest) { - holdAsync(callConnectionId, holdRequest).block(); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param holdRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response holdWithResponse(String callConnectionId, HoldRequest holdRequest, Context context) { - return holdWithResponseAsync(callConnectionId, holdRequest, context).block(); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unholdRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unholdWithResponseAsync(String callConnectionId, UnholdRequest unholdRequest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.unhold( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - unholdRequest, - accept, - context)); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unholdRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> unholdWithResponseAsync( - String callConnectionId, UnholdRequest unholdRequest, Context context) { - final String accept = "application/json"; - return service.unhold( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - unholdRequest, - accept, - context); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unholdRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unholdAsync(String callConnectionId, UnholdRequest unholdRequest) { - return unholdWithResponseAsync(callConnectionId, unholdRequest).flatMap((Response res) -> Mono.empty()); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unholdRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unholdAsync(String callConnectionId, UnholdRequest unholdRequest, Context context) { - return unholdWithResponseAsync(callConnectionId, unholdRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unholdRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void unhold(String callConnectionId, UnholdRequest unholdRequest) { - unholdAsync(callConnectionId, unholdRequest).block(); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param unholdRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response unholdWithResponse(String callConnectionId, UnholdRequest unholdRequest, Context context) { - return unholdWithResponseAsync(callConnectionId, unholdRequest, context).block(); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param startHoldMusicRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startHoldMusicWithResponseAsync( - String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.startHoldMusic( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - startHoldMusicRequest, - accept, - context)); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param startHoldMusicRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startHoldMusicWithResponseAsync( - String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { - final String accept = "application/json"; - return service.startHoldMusic( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - startHoldMusicRequest, - accept, - context); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param startHoldMusicRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startHoldMusicAsync( - String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { - return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param startHoldMusicRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startHoldMusicAsync( - String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { - return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param startHoldMusicRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startHoldMusic(String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest) { - startHoldMusicAsync(callConnectionId, startHoldMusicRequest).block(); - } - - /** - * Hold participant from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param startHoldMusicRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startHoldMusicWithResponse( - String callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequest, Context context) { - return startHoldMusicWithResponseAsync(callConnectionId, startHoldMusicRequest, context).block(); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param stopHoldMusicRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopHoldMusicWithResponseAsync( - String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.stopHoldMusic( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - stopHoldMusicRequest, - accept, - context)); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param stopHoldMusicRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopHoldMusicWithResponseAsync( - String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { - final String accept = "application/json"; - return service.stopHoldMusic( - this.client.getEndpoint(), - callConnectionId, - this.client.getApiVersion(), - stopHoldMusicRequest, - accept, - context); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param stopHoldMusicRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopHoldMusicAsync(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { - return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param stopHoldMusicRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopHoldMusicAsync( - String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { - return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param stopHoldMusicRequest The participants to be hold from the call. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopHoldMusic(String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest) { - stopHoldMusicAsync(callConnectionId, stopHoldMusicRequest).block(); - } - - /** - * Unhold participants from the call using identifier. - * - * @param callConnectionId The call connection id. - * @param stopHoldMusicRequest The participants to be hold from the call. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopHoldMusicWithResponse( - String callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequest, Context context) { - return stopHoldMusicWithResponseAsync(callConnectionId, stopHoldMusicRequest, context).block(); + public SendDtmfTonesResultInternal sendDtmfTones( + String callConnectionId, SendDtmfTonesRequestInternal sendDtmfTonesRequest) { + return sendDtmfTonesWithResponse(callConnectionId, sendDtmfTonesRequest, Context.NONE).getValue(); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallRecordingsImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallRecordingsImpl.java index 756dbdcb2f6b..982e98581177 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallRecordingsImpl.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallRecordingsImpl.java @@ -62,10 +62,10 @@ public interface CallRecordingsService { Mono> startRecording( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID, - @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent, @BodyParam("application/json") StartCallRecordingRequestInternal startCallRecording, @HeaderParam("Accept") String accept, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); @Get("/calling/recordings/{recordingId}") @@ -113,36 +113,26 @@ Mono> resumeRecording( * Start recording the call. * * @param startCallRecording The request body of start call recording request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> startRecordingWithResponseAsync( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { + StartCallRecordingRequestInternal startCallRecording) { 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.startRecording( this.client.getEndpoint(), this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, startCallRecording, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context)); } @@ -150,36 +140,25 @@ public Mono> startRecordingWithResponse * Start recording the call. * * @param startCallRecording The request body of start call recording request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> startRecordingWithResponseAsync( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { + StartCallRecordingRequestInternal startCallRecording, Context context) { 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 service.startRecording( this.client.getEndpoint(), this.client.getApiVersion(), - repeatabilityRequestID, - repeatabilityFirstSentConverted, startCallRecording, accept, + repeatabilityRequestId, + repeatabilityFirstSent, context); } @@ -187,123 +166,62 @@ public Mono> startRecordingWithResponse * Start recording the call. * * @param startCallRecording The request body of start call recording request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startRecordingAsync( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return startRecordingWithResponseAsync(startCallRecording, repeatabilityRequestID, repeatabilityFirstSent) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + StartCallRecordingRequestInternal startCallRecording) { + return startRecordingWithResponseAsync(startCallRecording).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Start recording the call. * * @param startCallRecording The request body of start call recording request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startRecordingAsync( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return startRecordingWithResponseAsync( - startCallRecording, repeatabilityRequestID, repeatabilityFirstSent, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + StartCallRecordingRequestInternal startCallRecording, Context context) { + return startRecordingWithResponseAsync(startCallRecording, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Start recording the call. * * @param startCallRecording The request body of start call recording request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RecordingStateResponseInternal startRecording( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent) { - return startRecordingAsync(startCallRecording, repeatabilityRequestID, repeatabilityFirstSent).block(); + public Response startRecordingWithResponse( + StartCallRecordingRequestInternal startCallRecording, Context context) { + return startRecordingWithResponseAsync(startCallRecording, context).block(); } /** * Start recording the call. * * @param startCallRecording The request body of start call recording request. - * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the - * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate - * response without the server executing the request multiple times. The value of the Repeatability-Request-Id - * is an opaque string representing a client-generated unique identifier for the request. It is a version 4 - * (random) UUID. - * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent - * header must also be specified. The value should be the date and time at which the request was first created, - * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startRecordingWithResponse( - StartCallRecordingRequestInternal startCallRecording, - UUID repeatabilityRequestID, - OffsetDateTime repeatabilityFirstSent, - Context context) { - return startRecordingWithResponseAsync( - startCallRecording, repeatabilityRequestID, repeatabilityFirstSent, context) - .block(); + public RecordingStateResponseInternal startRecording(StartCallRecordingRequestInternal startCallRecording) { + return startRecordingWithResponse(startCallRecording, Context.NONE).getValue(); } /** @@ -313,7 +231,7 @@ public Response startRecordingWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties. + * @return call recording properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRecordingPropertiesWithResponseAsync(String recordingId) { @@ -332,7 +250,7 @@ public Mono> getRecordingPropertiesWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties. + * @return call recording properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRecordingPropertiesWithResponseAsync( @@ -349,19 +267,11 @@ public Mono> getRecordingPropertiesWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties. + * @return call recording properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getRecordingPropertiesAsync(String recordingId) { - return getRecordingPropertiesWithResponseAsync(recordingId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getRecordingPropertiesWithResponseAsync(recordingId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -372,49 +282,42 @@ public Mono getRecordingPropertiesAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties. + * @return call recording properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getRecordingPropertiesAsync(String recordingId, Context context) { return getRecordingPropertiesWithResponseAsync(recordingId, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get call recording properties. * * @param recordingId The recording id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return call recording properties. + * @return call recording properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RecordingStateResponseInternal getRecordingProperties(String recordingId) { - return getRecordingPropertiesAsync(recordingId).block(); + public Response getRecordingPropertiesWithResponse( + String recordingId, Context context) { + return getRecordingPropertiesWithResponseAsync(recordingId, context).block(); } /** * Get call recording properties. * * @param recordingId The recording id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return call recording properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRecordingPropertiesWithResponse( - String recordingId, Context context) { - return getRecordingPropertiesWithResponseAsync(recordingId, context).block(); + public RecordingStateResponseInternal getRecordingProperties(String recordingId) { + return getRecordingPropertiesWithResponse(recordingId, Context.NONE).getValue(); } /** @@ -424,7 +327,7 @@ public Response getRecordingPropertiesWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stopRecordingWithResponseAsync(String recordingId) { @@ -443,7 +346,7 @@ public Mono> stopRecordingWithResponseAsync(String recordingId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stopRecordingWithResponseAsync(String recordingId, Context context) { @@ -459,11 +362,11 @@ public Mono> stopRecordingWithResponseAsync(String recordingId, C * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopRecordingAsync(String recordingId) { - return stopRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); + return stopRecordingWithResponseAsync(recordingId).flatMap(ignored -> Mono.empty()); } /** @@ -474,39 +377,39 @@ public Mono stopRecordingAsync(String recordingId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopRecordingAsync(String recordingId, Context context) { - return stopRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); + return stopRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> Mono.empty()); } /** * Stop recording the call. * * @param recordingId The recording id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stopRecording(String recordingId) { - stopRecordingAsync(recordingId).block(); + public Response stopRecordingWithResponse(String recordingId, Context context) { + return stopRecordingWithResponseAsync(recordingId, context).block(); } /** * Stop recording the call. * * @param recordingId The recording id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopRecordingWithResponse(String recordingId, Context context) { - return stopRecordingWithResponseAsync(recordingId, context).block(); + public void stopRecording(String recordingId) { + stopRecordingWithResponse(recordingId, Context.NONE); } /** @@ -516,7 +419,7 @@ public Response stopRecordingWithResponse(String recordingId, Context cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> pauseRecordingWithResponseAsync(String recordingId) { @@ -535,7 +438,7 @@ public Mono> pauseRecordingWithResponseAsync(String recordingId) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> pauseRecordingWithResponseAsync(String recordingId, Context context) { @@ -551,11 +454,11 @@ public Mono> pauseRecordingWithResponseAsync(String recordingId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono pauseRecordingAsync(String recordingId) { - return pauseRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); + return pauseRecordingWithResponseAsync(recordingId).flatMap(ignored -> Mono.empty()); } /** @@ -566,39 +469,39 @@ public Mono pauseRecordingAsync(String recordingId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono pauseRecordingAsync(String recordingId, Context context) { - return pauseRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); + return pauseRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> Mono.empty()); } /** * Pause recording the call. * * @param recordingId The recording id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void pauseRecording(String recordingId) { - pauseRecordingAsync(recordingId).block(); + public Response pauseRecordingWithResponse(String recordingId, Context context) { + return pauseRecordingWithResponseAsync(recordingId, context).block(); } /** * Pause recording the call. * * @param recordingId The recording id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response pauseRecordingWithResponse(String recordingId, Context context) { - return pauseRecordingWithResponseAsync(recordingId, context).block(); + public void pauseRecording(String recordingId) { + pauseRecordingWithResponse(recordingId, Context.NONE); } /** @@ -608,7 +511,7 @@ public Response pauseRecordingWithResponse(String recordingId, Context con * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> resumeRecordingWithResponseAsync(String recordingId) { @@ -627,7 +530,7 @@ public Mono> resumeRecordingWithResponseAsync(String recordingId) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> resumeRecordingWithResponseAsync(String recordingId, Context context) { @@ -643,11 +546,11 @@ public Mono> resumeRecordingWithResponseAsync(String recordingId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono resumeRecordingAsync(String recordingId) { - return resumeRecordingWithResponseAsync(recordingId).flatMap((Response res) -> Mono.empty()); + return resumeRecordingWithResponseAsync(recordingId).flatMap(ignored -> Mono.empty()); } /** @@ -658,38 +561,38 @@ public Mono resumeRecordingAsync(String recordingId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono resumeRecordingAsync(String recordingId, Context context) { - return resumeRecordingWithResponseAsync(recordingId, context).flatMap((Response res) -> Mono.empty()); + return resumeRecordingWithResponseAsync(recordingId, context).flatMap(ignored -> Mono.empty()); } /** * Resume recording the call. * * @param recordingId The recording id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void resumeRecording(String recordingId) { - resumeRecordingAsync(recordingId).block(); + public Response resumeRecordingWithResponse(String recordingId, Context context) { + return resumeRecordingWithResponseAsync(recordingId, context).block(); } /** * Resume recording the call. * * @param recordingId The recording id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response resumeRecordingWithResponse(String recordingId, Context context) { - return resumeRecordingWithResponseAsync(recordingId, context).block(); + public void resumeRecording(String recordingId) { + resumeRecordingWithResponse(recordingId, Context.NONE); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/Constants.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/Constants.java index 3b01def16f54..e2568110b0d9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/Constants.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/Constants.java @@ -4,7 +4,7 @@ package com.azure.communication.callautomation.implementation; /*** - * Constants to be used by Call Automation. + * Constants to be used by CallingServer. */ public final class Constants { public static final int KB = 1024; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CustomBearerTokenAuthenticationPolicy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CustomBearerTokenAuthenticationPolicy.java deleted file mode 100644 index 3b44e3a9dda2..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CustomBearerTokenAuthenticationPolicy.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation; - -import com.azure.core.credential.AccessToken; -import com.azure.core.credential.TokenCredential; -import com.azure.core.credential.TokenRequestContext; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpPipelineNextSyncPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.util.logging.ClientLogger; -import reactor.core.publisher.Mono; -import java.util.Objects; - -/** - * The pipeline policy that applies a token credential to an HTTP request with "Bearer" scheme. - */ -public class CustomBearerTokenAuthenticationPolicy implements HttpPipelinePolicy { - private static final ClientLogger LOGGER = new ClientLogger(CustomBearerTokenAuthenticationPolicy.class); - private static final String BEARER = "Bearer"; - private static final HttpHeaderName X_FORWARDED_HOST = HttpHeaderName.fromString("X-FORWARDED-HOST"); - - private final String[] scopes; - private final String acsEndpoint; - private final TokenCredential tokenCredential; - - /** - * Creates BearerTokenAuthenticationPolicy. - * - * @param credential the token credential to authenticate the request - * @param acsEndpoint endpoint of the ACS resource - * @param scopes the scopes of authentication the credential should get token for - */ - public CustomBearerTokenAuthenticationPolicy(TokenCredential credential, String acsEndpoint, String... scopes) { - Objects.requireNonNull(credential); - this.scopes = scopes; - this.acsEndpoint = acsEndpoint; - this.tokenCredential = credential; - } - - /** - * Executed before sending the initial request and authenticates the request. - * - * @param context The request context. - * @return A {@link Mono} containing {@link Void} - */ - public Mono authorizeRequest(HttpPipelineCallContext context) { - if (this.scopes == null) { - return Mono.empty(); - } - return setAuthorizationHeaderHelper(context, new TokenRequestContext().addScopes(this.scopes), false); - } - - /** - * Synchronously executed before sending the initial request and authenticates the request. - * - * @param context The request context. - */ - public void authorizeRequestSync(HttpPipelineCallContext context) { - setAuthorizationHeaderHelperSync(context, new TokenRequestContext().addScopes(scopes), false); - } - - /** - * Handles the authentication challenge in the event a 401 response with a WWW-Authenticate authentication challenge - * header is received after the initial request and returns appropriate {@link TokenRequestContext} to be used for - * re-authentication. - * - * @param context The request context. - * @param response The Http Response containing the authentication challenge header. - * @return A {@link Mono} containing {@link TokenRequestContext} - */ - public Mono authorizeRequestOnChallenge(HttpPipelineCallContext context, HttpResponse response) { - return Mono.just(false); - } - - /** - * Handles the authentication challenge in the event a 401 response with a WWW-Authenticate authentication challenge - * header is received after the initial request and returns appropriate {@link TokenRequestContext} to be used for - * re-authentication. - * - * @param context The request context. - * @param response The Http Response containing the authentication challenge header. - * @return A boolean indicating if containing the {@link TokenRequestContext} for re-authentication - */ - public boolean authorizeRequestOnChallengeSync(HttpPipelineCallContext context, HttpResponse response) { - return false; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - if (!"https".equals(context.getHttpRequest().getUrl().getProtocol())) { - return Mono.error(new RuntimeException("token credentials require a URL using the HTTPS protocol scheme")); - } - addHeaders(context.getHttpRequest().getHeaders()); - - HttpPipelineNextPolicy nextPolicy = next.clone(); - - return authorizeRequest(context) - .then(Mono.defer(next::process)) - .flatMap(httpResponse -> { - String authHeader = httpResponse.getHeaderValue(HttpHeaderName.WWW_AUTHENTICATE); - if (httpResponse.getStatusCode() == 401 && authHeader != null) { - return authorizeRequestOnChallenge(context, httpResponse).flatMap(retry -> { - if (retry) { - // Both Netty and OkHttp expect the requestBody to be closed after the response has been read. - // Failure to do so results in memory leak. - // In case of StreamResponse (or other scenarios where we do not eagerly read the response) - // the response body may not be consumed. - // This can cause potential leaks in the scenarios like above, where the policy - // may intercept the response and it may never be read. - // Forcing the read here - so that the memory can be released. - return httpResponse.getBody().ignoreElements() - .then(nextPolicy.process()); - } else { - return Mono.just(httpResponse); - } - }); - } - return Mono.just(httpResponse); - }); - } - - @Override - public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next) { - if (!"https".equals(context.getHttpRequest().getUrl().getProtocol())) { - throw LOGGER.logExceptionAsError( - new RuntimeException("token credentials require a URL using the HTTPS protocol scheme")); - } - addHeaders(context.getHttpRequest().getHeaders()); - - HttpPipelineNextSyncPolicy nextPolicy = next.clone(); - - authorizeRequestSync(context); - HttpResponse httpResponse = next.processSync(); - String authHeader = httpResponse.getHeaderValue(HttpHeaderName.WWW_AUTHENTICATE); - if (httpResponse.getStatusCode() == 401 && authHeader != null) { - if (authorizeRequestOnChallengeSync(context, httpResponse)) { - // Both Netty and OkHttp expect the requestBody to be closed after the response has been read. - // Failure to do so results in memory leak. - // In case of StreamResponse (or other scenarios where we do not eagerly read the response) - // the response body may not be consumed. - // This can cause potential leaks in the scenarios like above, where the policy - // may intercept the response and it may never be read. - // Forcing the read here - so that the memory can be released. - return nextPolicy.processSync(); - } else { - return httpResponse; - } - } - return httpResponse; - } - - /** - * Authorizes the request with the bearer token acquired using the specified {@code tokenRequestContext} - * - * @param context the HTTP pipeline context. - * @param tokenRequestContext the token request context to be used for token acquisition. - * @return a {@link Mono} containing {@link Void} - */ - public Mono setAuthorizationHeader(HttpPipelineCallContext context, TokenRequestContext tokenRequestContext) { - return setAuthorizationHeaderHelper(context, tokenRequestContext, true); - } - - /** - * Authorizes the request with the bearer token acquired using the specified {@code tokenRequestContext} - * - * @param context the HTTP pipeline context. - * @param tokenRequestContext the token request context to be used for token acquisition. - */ - public void setAuthorizationHeaderSync(HttpPipelineCallContext context, TokenRequestContext tokenRequestContext) { - setAuthorizationHeaderHelperSync(context, tokenRequestContext, true); - } - - private Mono setAuthorizationHeaderHelper(HttpPipelineCallContext context, - TokenRequestContext tokenRequestContext, boolean checkToForceFetchToken) { - return tokenCredential.getToken(tokenRequestContext).flatMap(token1 -> { - setAuthorizationHeader(context.getHttpRequest().getHeaders(), token1.getToken()); - return Mono.empty(); - }); - } - - private void setAuthorizationHeaderHelperSync(HttpPipelineCallContext context, - TokenRequestContext tokenRequestContext, boolean checkToForceFetchToken) { - AccessToken token = tokenCredential.getTokenSync(tokenRequestContext); - setAuthorizationHeader(context.getHttpRequest().getHeaders(), token.getToken()); - } - - private static void setAuthorizationHeader(HttpHeaders headers, String token) { - headers.set(HttpHeaderName.AUTHORIZATION, BEARER + " " + token); - } - - private void addHeaders(HttpHeaders headers) { - if (acsEndpoint != null) { - headers.set(X_FORWARDED_HOST, acsEndpoint); - } - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CustomHmacAuthenticationPolicy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CustomHmacAuthenticationPolicy.java index ad8f716364be..196364be214e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CustomHmacAuthenticationPolicy.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CustomHmacAuthenticationPolicy.java @@ -2,20 +2,6 @@ // Licensed under the MIT License. package com.azure.communication.callautomation.implementation; -import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.util.logging.ClientLogger; -import reactor.core.Exceptions; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; import java.net.URL; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -25,20 +11,41 @@ import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; +import java.util.Arrays; import java.util.Base64; +import java.util.HashMap; import java.util.Locale; +import java.util.Map; import java.util.Objects; +import java.util.stream.Collectors; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.http.HttpPipelineCallContext; +import com.azure.core.http.HttpPipelineNextPolicy; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.policy.HttpPipelinePolicy; + +import com.azure.core.util.logging.ClientLogger; +import reactor.core.Exceptions; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; /** * HttpPipelinePolicy to append CommunicationClient required headers */ public final class CustomHmacAuthenticationPolicy implements HttpPipelinePolicy { - private static final ClientLogger LOGGER = new ClientLogger(CustomHmacAuthenticationPolicy.class); - private static final HttpHeaderName X_FORWARDED_HOST = HttpHeaderName.fromString("X-FORWARDED-HOST"); - private static final HttpHeaderName X_MS_DATE_HEADER = HttpHeaderName.fromString("x-ms-date"); - private static final HttpHeaderName X_MS_STRING_TO_SIGN_HEADER - = HttpHeaderName.fromString("x-ms-hmac-string-to-sign-base64"); - private static final HttpHeaderName CONTENT_HASH_HEADER = HttpHeaderName.fromString("x-ms-content-sha256"); + private static final String X_MS_DATE_HEADER = "x-ms-date"; + private static final String X_MS_STRING_TO_SIGN_HEADER = "x-ms-hmac-string-to-sign-base64"; + private static final String HOST_HEADER = "host"; + private static final String CONTENT_HASH_HEADER = "x-ms-content-sha256"; + // Order of the headers are important here for generating correct signature + private static final String[] SIGNED_HEADERS = new String[]{X_MS_DATE_HEADER, HOST_HEADER, CONTENT_HASH_HEADER}; + + private static final String AUTHORIZATIONHEADERNAME = "Authorization"; + private static final String HMACSHA256FORMAT = "HMAC-SHA256 SignedHeaders=%s&Signature=%s"; // Previously DateTimeFormatter.RFC_1123_DATE_TIME was being used. There // was an issue with the day of month part. RFC_1123_DATE_TIME does not @@ -51,6 +58,7 @@ public final class CustomHmacAuthenticationPolicy implements HttpPipelinePolicy private final AzureKeyCredential credential; private final String acsResource; + private final ClientLogger logger = new ClientLogger(CustomHmacAuthenticationPolicy.class); /** * Created with a non-null client credential @@ -69,7 +77,7 @@ public Mono process(HttpPipelineCallContext context, HttpPipelineN ? Flux.just(ByteBuffer.allocate(0)) : context.getHttpRequest().getBody(); - if (!"https".equals(context.getHttpRequest().getUrl().getProtocol())) { + if ("http".equals(context.getHttpRequest().getUrl().getProtocol())) { return Mono.error( new RuntimeException("AzureKeyCredential requires a URL using the HTTPS protocol scheme")); } @@ -80,17 +88,13 @@ public Mono process(HttpPipelineCallContext context, HttpPipelineN .map(alternativeUrl -> (URL) alternativeUrl) .orElse(context.getHttpRequest().getUrl()); - return contents.collect(() -> { - try { - return MessageDigest.getInstance("SHA-256"); - } catch (NoSuchAlgorithmException e) { - throw LOGGER.logExceptionAsError(Exceptions.propagate(e)); - } - }, MessageDigest::update) - .flatMap(messageDigest -> { - addAuthenticationHeaders(acsResource, hostnameToSignWith, - context.getHttpRequest().getHttpMethod().toString(), messageDigest, - context.getHttpRequest().getHeaders()); + return appendAuthorizationHeaders( + hostnameToSignWith, + context.getHttpRequest().getHttpMethod().toString(), + contents) + .flatMap(headers -> { + headers.entrySet().forEach( + header -> context.getHttpRequest().setHeader(header.getKey(), header.getValue())); return next.process(); }); @@ -99,20 +103,38 @@ public Mono process(HttpPipelineCallContext context, HttpPipelineN } } - private void addAuthenticationHeaders(String acsResource, URL url, String httpMethod, - MessageDigest messageDigest, HttpHeaders headers) { + private Mono> appendAuthorizationHeaders(URL url, String httpMethod, Flux contents) { + return contents.collect(() -> { + try { + return MessageDigest.getInstance("SHA-256"); + } catch (NoSuchAlgorithmException e) { + throw logger.logExceptionAsError(Exceptions.propagate(e)); + } + }, MessageDigest::update) + .map(messageDigest -> addAuthenticationHeaders(url, httpMethod, messageDigest)); + } + + private Map addAuthenticationHeaders(final URL url, + final String httpMethod, + final MessageDigest messageDigest) { + final Map headers = new HashMap<>(); + final String contentHash = Base64.getEncoder().encodeToString(messageDigest.digest()); - headers.set(X_FORWARDED_HOST, acsResource); - headers.set(HttpHeaderName.HOST, acsResource); - headers.set(CONTENT_HASH_HEADER, contentHash); - String xMsDate = OffsetDateTime.now(ZoneOffset.UTC).format(HMAC_DATETIMEFORMATTER_PATTERN); - headers.set(X_MS_DATE_HEADER, xMsDate); - addSignatureHeader(url, httpMethod, headers, xMsDate, acsResource, contentHash); + headers.put("X_FORWARDED_HOST", acsResource); + headers.put(HOST_HEADER, acsResource); + headers.put(CONTENT_HASH_HEADER, contentHash); + String utcNow = OffsetDateTime.now(ZoneOffset.UTC) + .format(HMAC_DATETIMEFORMATTER_PATTERN); + headers.put(X_MS_DATE_HEADER, utcNow); + addSignatureHeader(url, httpMethod, headers); + return headers; } - private void addSignatureHeader(URL url, String httpMethod, HttpHeaders headers, String xMsDate, String host, - String xMsContentSha256) { - String signedHeaderValues = xMsDate + ";" + host + ";" + xMsContentSha256; + private void addSignatureHeader(final URL url, final String httpMethod, final Map httpHeaders) { + final String signedHeaderNames = String.join(";", SIGNED_HEADERS); + final String signedHeaderValues = Arrays.stream(SIGNED_HEADERS) + .map(httpHeaders::get) + .collect(Collectors.joining(";")); String pathAndQuery = url.getPath(); if (url.getQuery() != null) { @@ -130,15 +152,13 @@ private void addSignatureHeader(URL url, String httpMethod, HttpHeaders headers, sha256HMAC = Mac.getInstance("HmacSHA256"); sha256HMAC.init(new SecretKeySpec(key, "HmacSHA256")); } catch (NoSuchAlgorithmException | InvalidKeyException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); + throw logger.logExceptionAsError(new RuntimeException(e)); } final String signature = Base64.getEncoder().encodeToString(sha256HMAC.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8))); - String authorization = "HMAC-SHA256 SignedHeaders=x-ms-date;host;x-ms-content-sha256&Signature=" + signature; - headers.set(HttpHeaderName.AUTHORIZATION, authorization); - headers.set(X_MS_STRING_TO_SIGN_HEADER, - Base64.getEncoder().encodeToString(stringToSign.getBytes(StandardCharsets.UTF_8))); + httpHeaders.put(AUTHORIZATIONHEADERNAME, String.format(HMACSHA256FORMAT, signedHeaderNames, signature)); + httpHeaders.put(X_MS_STRING_TO_SIGN_HEADER, Base64.getEncoder().encodeToString(stringToSign.getBytes(StandardCharsets.UTF_8))); } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/DialogStateResponseConstructorProxy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/DialogStateResponseConstructorProxy.java deleted file mode 100644 index 2df513af8dc5..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/DialogStateResponseConstructorProxy.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.accesshelpers; - -import com.azure.communication.callautomation.implementation.models.DialogStateResponse; -import com.azure.communication.callautomation.models.DialogStateResult; - -/** - * Helper class to access private values of {@link DialogStateResult} across package boundaries. - */ -public final class DialogStateResponseConstructorProxy { - private static DialogStateResponseConstructorProxy.DialogStateResponseConstructorAccessor accessor; - - private DialogStateResponseConstructorProxy() { } - - /** - * Type defining the methods to set the non-public properties of a {@link DialogStateResponseConstructorProxy.DialogStateResponseConstructorAccessor} - * instance. - */ - public interface DialogStateResponseConstructorAccessor { - /** - * Creates a new instance of {@link DialogStateResult} backed by an internal instance of - * {@link DialogStateResult}. - * - * @param internalResponse The internal response. - * @return A new instance of {@link DialogStateResult}. - */ - DialogStateResult create(DialogStateResponse internalResponse); - } - - /** - * The method called from {@link DialogStateResult} to set it's accessor. - * - * @param accessor The accessor. - */ - public static void setAccessor(final DialogStateResponseConstructorProxy.DialogStateResponseConstructorAccessor accessor) { - DialogStateResponseConstructorProxy.accessor = accessor; - } - - /** - * Creates a new instance of {@link DialogStateResult} backed by an internal instance of - * {@link DialogStateResult}. - * - * @param internalResponse The internal response. - * @return A new instance of {@link DialogStateResult}. - */ - public static DialogStateResult create(DialogStateResponse internalResponse) { - // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the - // application accesses BlobDownloadHeaders which triggers the accessor to be configured. So, if the accessor - // is null this effectively pokes the class to set up the accessor. - if (accessor == null) { - new DialogStateResult(); - } - - assert accessor != null; - return accessor.create(internalResponse); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/MuteParticipantsResponseConstructorProxy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/MuteParticipantsResponseConstructorProxy.java index 160e4e8ac3c1..b18d3e71386e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/MuteParticipantsResponseConstructorProxy.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/MuteParticipantsResponseConstructorProxy.java @@ -7,7 +7,7 @@ import com.azure.communication.callautomation.models.MuteParticipantResult; /** - * Helper class to access private values of {@link MuteParticipantsResultInternal} across package boundaries. + * Helper class to access private values of {@link MuteParticipantResult} across package boundaries. */ public final class MuteParticipantsResponseConstructorProxy { private static MuteParticipantsResponseConstructorAccessor accessor; @@ -21,7 +21,7 @@ private MuteParticipantsResponseConstructorProxy() { } public interface MuteParticipantsResponseConstructorAccessor { /** * Creates a new instance of {@link MuteParticipantResult} backed by an internal instance of - * {@link MuteParticipantsResultInternal}. + * {@link MuteParticipantResult}. * * @param internalResponse The internal response. * @return A new instance of {@link MuteParticipantResult}. @@ -40,7 +40,7 @@ public static void setAccessor(final MuteParticipantsResponseConstructorAccessor /** * Creates a new instance of {@link MuteParticipantResult} backed by an internal instance of - * {@link MuteParticipantsResultInternal}. + * {@link MuteParticipantResult}. * * @param internalResponse The internal response. * @return A new instance of {@link MuteParticipantResult}. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/UnmuteParticipantsResponseConstructorProxy.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/UnmuteParticipantsResponseConstructorProxy.java deleted file mode 100644 index 21e63abc4d7b..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/accesshelpers/UnmuteParticipantsResponseConstructorProxy.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.accesshelpers; - -import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal; -import com.azure.communication.callautomation.models.UnmuteParticipantResult; - -/** - * Helper class to access private values of {@link UnmuteParticipantResult} across package boundaries. - */ -public final class UnmuteParticipantsResponseConstructorProxy { - private static UnmuteParticipantsResponseConstructorAccessor accessor; - - private UnmuteParticipantsResponseConstructorProxy() { } - - /** - * Type defining the methods to set the non-public properties of a {@link UnmuteParticipantsResponseConstructorAccessor} - * instance. - */ - public interface UnmuteParticipantsResponseConstructorAccessor { - /** - * Creates a new instance of {@link UnmuteParticipantResult} backed by an internal instance of - * {@link UnmuteParticipantsResponseInternal}. - * - * @param internalResponse The internal response. - * @return A new instance of {@link UnmuteParticipantResult}. - */ - UnmuteParticipantResult create(UnmuteParticipantsResponseInternal internalResponse); - } - - /** - * The method called from {@link UnmuteParticipantResult} to set it's accessor. - * - * @param accessor The accessor. - */ - public static void setAccessor(final UnmuteParticipantsResponseConstructorAccessor accessor) { - UnmuteParticipantsResponseConstructorProxy.accessor = accessor; - } - - /** - * Creates a new instance of {@link UnmuteParticipantResult} backed by an internal instance of - * {@link UnmuteParticipantsResponseInternal}. - * - * @param internalResponse The internal response. - * @return A new instance of {@link UnmuteParticipantResult}. - */ - public static UnmuteParticipantResult create(UnmuteParticipantsResponseInternal internalResponse) { - // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the - // application accesses BlobDownloadHeaders which triggers the accessor to be configured. So, if the accessor - // is null this effectively pokes the class to set up the accessor. - if (accessor == null) { - new UnmuteParticipantResult(); - } - - assert accessor != null; - return accessor.create(internalResponse); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/CallParticipantConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/CallParticipantConverter.java index 753548565e2b..72eeef1c96cc 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/CallParticipantConverter.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/CallParticipantConverter.java @@ -21,7 +21,7 @@ public static CallParticipant convert(CallParticipantInternal acsCallParticipant } return new CallParticipant(CommunicationIdentifierConverter.convert(acsCallParticipantDto.getIdentifier()), - acsCallParticipantDto.isMuted(), acsCallParticipantDto.isOnHold()); + acsCallParticipantDto.isMuted()); } private CallParticipantConverter() { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioDataConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingAudioDataConverter.java similarity index 93% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioDataConverter.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingAudioDataConverter.java index 3fa4e220b419..486ca2d105d7 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioDataConverter.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingAudioDataConverter.java @@ -5,8 +5,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; -/** The AudioDataInternal model. */ -public final class AudioDataConverter { +/** The MediaStreamingAudioInternal model. */ +public final class MediaStreamingAudioDataConverter { /* * The audio data. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioMetadataConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingMetadataConverter.java similarity index 93% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioMetadataConverter.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingMetadataConverter.java index 9fd8cf23cd36..14d605a6e9f8 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/AudioMetadataConverter.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/MediaStreamingMetadataConverter.java @@ -5,9 +5,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; -/** The Audio - * MetadataInternal model. */ -public final class AudioMetadataConverter { +/** The MediaStreamingMetadataInternal model. */ +public final class MediaStreamingMetadataConverter { /* * The mediaSubscriptionId. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionDataConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionDataConverter.java deleted file mode 100644 index 41a5343a813e..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionDataConverter.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.converters; - -import com.azure.communication.callautomation.models.streaming.transcription.Word; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * The TranscriptionDataInternal model. - */ -public final class TranscriptionDataConverter { - - /* - * The display form of the recognized word - */ - @JsonProperty(value = "text") - private String text; - - /* - * The format of text - */ - @JsonProperty(value = "format") - private String format; - - /* - * Confidence of recognition of the whole phrase, from 0.0 (no confidence) to 1.0 (full confidence) - */ - @JsonProperty(value = "confidence") - private double confidence; - - /* - * The position of this payload - */ - @JsonProperty(value = "offset") - private long offset; - - /* - * Duration in ticks. 1 tick = 100 nanoseconds. - */ - @JsonProperty(value = "duration") - private long duration; - - - /* - * TThe result for each word of the phrase - */ - @JsonProperty(value = "words") - private List words; - - /* - * The participantId. - */ - @JsonProperty(value = "participantRawID") - private String participantRawID; - - /* - * Status of the result of transcription - */ - @JsonProperty(value = "resultStatus") - private String resultStatus; - - /** - * Get the text property. - * - * @return the text value. - */ - public String getText() { - return text; - } - - /** - * Get the format property. - * - * @return the format value. - */ - public String getFormat() { - return format; - } - - /** - * Get the confidence property. - * - * @return the confidence value. - */ - public double getConfidence() { - return confidence; - } - - /** - * Get the duration property. - * - * @return the duration value. - */ - public long getDuration() { - return duration; - } - /** - * Get the offset property. - * - * @return the offset value. - */ - public long getOffset() { - return offset; - } - - /** - * Get the words property. - * - * @return the words value. - */ - public List getWords() { - return words; - } - - /** - * Get the participantRawID property. - * - * @return the participantRawID value. - */ - public String getParticipantRawID() { - return participantRawID; - } - - - /** - * Get the resultStatus property. - * - * @return the resultStatus value. - */ - public String getResultStatus() { - return resultStatus; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionMetadataConverter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionMetadataConverter.java deleted file mode 100644 index 41ddb4b39425..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/converters/TranscriptionMetadataConverter.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.converters; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionMetadataInternal model. - */ -public final class TranscriptionMetadataConverter { - - /* - * Transcription Subscription Id. - */ - @JsonProperty(value = "subscriptionId") - private String transcriptionSubscriptionId; - - /* - * The target locale in which the translated text needs to be - */ - @JsonProperty(value = "locale") - private String locale; - - /* - * call connection Id. - */ - @JsonProperty(value = "callConnectionId") - private String callConnectionId; - - /* - * correlation Id - */ - @JsonProperty(value = "correlationId") - private String correlationId; - - /** - * Get the transcriptionSubscriptionId property. - * - * @return the transcriptionSubscriptionId value. - */ - public String getTranscriptionSubscriptionId() { - return transcriptionSubscriptionId; - } - - /** - * Get the locale property. - * - * @return the locale value. - */ - public String getLocale() { - return locale; - } - - /** - * Get the callConnectionId property. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return callConnectionId; - } - - /** - * Get the correlationId property. - * - * @return the correlationId value. - */ - public String getCorrelationId() { - return correlationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiter.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiter.java deleted file mode 100644 index f13c5a31dc23..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiter.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.eventprocessor; - -/** - * Abstract class for event awaiters. - */ -public abstract class EventAwaiter implements AutoCloseable { - private boolean disposed = false; - - @Override - public void close() { - disposed = true; - } - - public boolean isDisposed() { - return disposed; - } - - public abstract void onEventsReceived(EventWithBacklogId event); -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiterOngoing.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiterOngoing.java deleted file mode 100644 index e1d38c0b3aeb..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiterOngoing.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.eventprocessor; - -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; - -import java.util.Objects; -import java.util.function.Consumer; - -/** - * Event awaiter for ongoing rules. - */ -public final class EventAwaiterOngoing extends EventAwaiter { - private final String callConnectionId; - private final Consumer eventProcessor; - private final Class clazz; - - public EventAwaiterOngoing(Class clazz, String callConnectionId, Consumer eventProcessor) { - super(); - this.clazz = clazz; - this.callConnectionId = callConnectionId; - this.eventProcessor = eventProcessor; - } - - @Override - @SuppressWarnings("unchecked") - public void onEventsReceived(EventWithBacklogId event) { - if (event.getEvent().getClass() == clazz - && Objects.equals(event.getEvent().getCallConnectionId(), callConnectionId)) { - eventProcessor.accept((TEvent) event.getEvent()); - } - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiterSingleTime.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiterSingleTime.java deleted file mode 100644 index a6577fe99b3a..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventAwaiterSingleTime.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.eventprocessor; - -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; -import reactor.core.publisher.Mono; -import reactor.core.publisher.Sinks; - -import java.util.function.Predicate; - -/** - * A class that represents an event awaiter that will only wait for a single event. - */ -public final class EventAwaiterSingleTime extends EventAwaiter { - private final Predicate predicate; - private final Sinks.One task; - - public EventAwaiterSingleTime(Predicate predicate) { - super(); - this.predicate = predicate; - this.task = Sinks.one(); - } - - @Override - public void onEventsReceived(EventWithBacklogId event) { - if (predicate.test(event.getEvent())) { - task.tryEmitValue(event); - } - } - - public Mono getEventWithBacklogId() { - return task.asMono(); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventBacklog.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventBacklog.java deleted file mode 100644 index 7d44939567e1..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventBacklog.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.eventprocessor; - -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; - -import java.util.Map.Entry; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Predicate; - -/** - * Event backlog that saves event for cases where events arrive earlier than the response of the method call. - */ -public final class EventBacklog { - private static final long DEFAULT_BACKLOG_EVENT_TIMEOUT_SECONDS = 5; - private static final int MAXIMUM_EVENTBACKLOGS_AT_ONCE = 10000; - private final long expiringTimeout; - - // Key: Backlog event ID, Value: Event - private final ConcurrentHashMap eventBacklog; - - public EventBacklog() { - this(DEFAULT_BACKLOG_EVENT_TIMEOUT_SECONDS); - } - - public EventBacklog(long expiringTimeout) { - this.expiringTimeout = expiringTimeout; - eventBacklog = new ConcurrentHashMap<>(); - } - - public EventWithBacklogId addEvent(String backlogEventId, CallAutomationEventBase eventToBeSaved) { - if (eventBacklog.size() >= MAXIMUM_EVENTBACKLOGS_AT_ONCE) { - return null; - } - - // Add the event into the backlog. - eventBacklog.put(backlogEventId, eventToBeSaved); - - // Remove the event after a preset timeout. - new Timer().schedule(new TimerTask() { - @Override - public void run() { - eventBacklog.remove(backlogEventId); - } - }, expiringTimeout * 1000); - - return new EventWithBacklogId(backlogEventId, eventToBeSaved); - } - - public EventWithBacklogId tryGetAndRemoveMatchedEvent(Predicate predicate) { - Entry searchResult = eventBacklog.searchEntries(1, (entry) -> { - return predicate.test(entry.getValue()) ? entry : null; - }); - - if (searchResult != null && eventBacklog.remove(searchResult.getKey(), searchResult.getValue())) { - return new EventWithBacklogId(searchResult.getKey(), searchResult.getValue()); - } else { - return null; - } - } - - public EventWithBacklogId removeEvent(String backlogEventId) { - return backlogEventId != null ? new EventWithBacklogId(backlogEventId, eventBacklog.remove(backlogEventId)) : null; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventWithBacklogId.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventWithBacklogId.java deleted file mode 100644 index 0ab989bf340d..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/EventWithBacklogId.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.eventprocessor; - -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; - -/** - * Container that holds a CallAutomation event and its backlog id. - */ -public final class EventWithBacklogId { - private final CallAutomationEventBase event; - private final String backLogEventId; - - EventWithBacklogId(String backLogEventId, CallAutomationEventBase event) { - this.backLogEventId = backLogEventId; - this.event = event; - } - - /** - * Get the backLogEventId property: The backlog event id. - * - * @return the backLogEventId value. - */ - public String getBackLogEventId() { - return backLogEventId; - } - - /** - * Get the event property: The event. - * - * @return the event value. - */ - public CallAutomationEventBase getEvent() { - return event; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/OngoingEventAwaiterKey.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/OngoingEventAwaiterKey.java deleted file mode 100644 index d0d24c59a6a4..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/OngoingEventAwaiterKey.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.implementation.eventprocessor; - -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; - -/** - * Container class to hold the call connection ID and the class of the event, used as a key for the ongoing event awaiters. - */ -public class OngoingEventAwaiterKey { - private final String callConnectionId; - private final Class clazz; - - public OngoingEventAwaiterKey(String callConnectionId, Class clazz) { - this.clazz = clazz; - this.callConnectionId = callConnectionId; - } - - /** - * Get the callConnectionId property: The call connection id. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return callConnectionId; - } - - /** - * Get the clazz property: The class of the event. - * - * @return the clazz value. - */ - public Class getClazz() { - return clazz; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/package-info.java deleted file mode 100644 index a969729aa04f..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/eventprocessor/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** Package containing the implementations for eventProcessor. null. */ -package com.azure.communication.callautomation.implementation.eventprocessor; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantRequestInternal.java index 7cb288591f84..2cbec6f3f2a7 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantRequestInternal.java @@ -11,18 +11,15 @@ @Fluent public final class AddParticipantRequestInternal { /* - * The source caller Id, a phone number, that's shown to the PSTN - * participant being invited. + * The source caller Id, a phone number, that's shown to the PSTN participant being invited. * Required only when inviting a PSTN participant. */ @JsonProperty(value = "sourceCallerIdNumber") private PhoneNumberIdentifierModel sourceCallerIdNumber; /* - * (Optional) The display name of the source that is associated with this - * invite operation when - * adding a PSTN participant or teams user. Note: Will not update the - * display name in the roster. + * (Optional) The display name of the source that is associated with this invite operation when + * adding a PSTN participant or teams user. Note: Will not update the display name in the roster. */ @JsonProperty(value = "sourceDisplayName") private String sourceDisplayName; @@ -41,26 +38,27 @@ public final class AddParticipantRequestInternal { private Integer invitationTimeoutInSeconds; /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. + * Used by customers when calling mid-call actions to correlate the request to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; + /* + * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be + * used. + */ + @JsonProperty(value = "operationCallbackUri") + private String operationCallbackUri; + /* * Used by customer to send custom calling context to targets */ @JsonProperty(value = "customCallingContext") private CustomCallingContext customCallingContext; - /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. - */ - @JsonProperty(value = "operationCallbackUri") - private String operationCallbackUri; + /** Creates an instance of AddParticipantRequestInternal class. */ + public AddParticipantRequestInternal() {} /** * Get the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN participant @@ -170,26 +168,6 @@ public AddParticipantRequestInternal setOperationContext(String operationContext return this; } - /** - * Get the customCallingContext property: Used by customer to send custom calling context to targets. - * - * @return the customCallingContext value. - */ - public CustomCallingContext getCustomCallingContext() { - return this.customCallingContext; - } - - /** - * Set the customCallingContext property: Used by customer to send custom calling context to targets. - * - * @param customCallingContext the customCallingContext value to set. - * @return the AddParticipantRequestInternal object itself. - */ - public AddParticipantRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { - this.customCallingContext = customCallingContext; - return this; - } - /** * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI @@ -213,4 +191,24 @@ public AddParticipantRequestInternal setOperationCallbackUri(String operationCal this.operationCallbackUri = operationCallbackUri; return this; } + + /** + * Get the customCallingContext property: Used by customer to send custom calling context to targets. + * + * @return the customCallingContext value. + */ + public CustomCallingContext getCustomCallingContext() { + return this.customCallingContext; + } + + /** + * Set the customCallingContext property: Used by customer to send custom calling context to targets. + * + * @param customCallingContext the customCallingContext value to set. + * @return the AddParticipantRequestInternal object itself. + */ + public AddParticipantRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { + this.customCallingContext = customCallingContext; + return this; + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantResponseInternal.java index 8f07f98fa8cc..4e9432355c9f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AddParticipantResponseInternal.java @@ -28,6 +28,9 @@ public final class AddParticipantResponseInternal { @JsonProperty(value = "invitationId") private String invitationId; + /** Creates an instance of AddParticipantResponseInternal class. */ + public AddParticipantResponseInternal() {} + /** * Get the participant property: List of current participants in the call. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerCallRequestInternal.java index d0c3c28ceb90..89b3ac751205 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerCallRequestInternal.java @@ -28,18 +28,6 @@ public final class AnswerCallRequestInternal { @JsonProperty(value = "operationContext") private String operationContext; - /* - * Media Streaming Configuration. - */ - @JsonProperty(value = "mediaStreamingConfiguration") - private MediaStreamingConfigurationInternal mediaStreamingConfiguration; - - /* - * Live Transcription Configuration. - */ - @JsonProperty(value = "transcriptionConfiguration") - private TranscriptionConfigurationInternal transcriptionConfiguration; - /* * AI options for the call. */ @@ -52,14 +40,8 @@ public final class AnswerCallRequestInternal { @JsonProperty(value = "answeredBy") private CommunicationUserIdentifierModel answeredBy; - /* - * The source caller Id, a phone number, that's will be used when inviting - * a pstn target. - * Required only when transferring call to PSTN, if this is an incoming - * voip call. - */ - @JsonProperty(value = "sourceCallerIdNumber") - private PhoneNumberIdentifierModel sourceCallerIdNumber; + /** Creates an instance of AnswerCallRequestInternal class. */ + public AnswerCallRequestInternal() {} /** * Get the incomingCallContext property: The context associated with the call. @@ -121,48 +103,6 @@ public AnswerCallRequestInternal setOperationContext(String operationContext) { return this; } - /** - * Get the mediaStreamingConfiguration property: Media Streaming Configuration. - * - * @return the mediaStreamingConfiguration value. - */ - public MediaStreamingConfigurationInternal getMediaStreamingConfiguration() { - return this.mediaStreamingConfiguration; - } - - /** - * Set the mediaStreamingConfiguration property: Media Streaming Configuration. - * - * @param mediaStreamingConfiguration the mediaStreamingConfiguration value to set. - * @return the AnswerCallRequestInternal object itself. - */ - public AnswerCallRequestInternal setMediaStreamingConfiguration( - MediaStreamingConfigurationInternal mediaStreamingConfiguration) { - this.mediaStreamingConfiguration = mediaStreamingConfiguration; - return this; - } - - /** - * Get the transcriptionConfiguration property: Live Transcription Configuration. - * - * @return the transcriptionConfiguration value. - */ - public TranscriptionConfigurationInternal getTranscriptionConfiguration() { - return this.transcriptionConfiguration; - } - - /** - * Set the transcriptionConfiguration property: Live Transcription Configuration. - * - * @param transcriptionConfiguration the transcriptionConfiguration value to set. - * @return the AnswerCallRequestInternal object itself. - */ - public AnswerCallRequestInternal setTranscriptionConfiguration( - TranscriptionConfigurationInternal transcriptionConfiguration) { - this.transcriptionConfiguration = transcriptionConfiguration; - return this; - } - /** * Get the callIntelligenceOptions property: AI options for the call. * @@ -203,26 +143,4 @@ public AnswerCallRequestInternal setAnsweredBy(CommunicationUserIdentifierModel this.answeredBy = answeredBy; return this; } - - /** - * Get the sourceCallerIdNumber property: The source caller Id, a phone number, that's will be used when inviting a - * pstn target. Required only when transferring call to PSTN, if this is an incoming voip call. - * - * @return the sourceCallerIdNumber value. - */ - public PhoneNumberIdentifierModel getSourceCallerIdNumber() { - return this.sourceCallerIdNumber; - } - - /** - * Set the sourceCallerIdNumber property: The source caller Id, a phone number, that's will be used when inviting a - * pstn target. Required only when transferring call to PSTN, if this is an incoming voip call. - * - * @param sourceCallerIdNumber the sourceCallerIdNumber value to set. - * @return the AnswerCallRequestInternal object itself. - */ - public AnswerCallRequestInternal setSourceCallerIdNumber(PhoneNumberIdentifierModel sourceCallerIdNumber) { - this.sourceCallerIdNumber = sourceCallerIdNumber; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerFailed.java deleted file mode 100644 index e60950317168..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AnswerFailed.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** AnswerFailed event. */ -@Immutable -public final class AnswerFailed { - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) - private String operationContext; - - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /** - * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. - */ - public String getServerCallId() { - return this.serverCallId; - } - - /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @return the correlationId value. - */ - public String getCorrelationId() { - return this.correlationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java deleted file mode 100644 index 585b697a00d2..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialog.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Azure Open AI Dialog. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("AzureOpenAI") -@Immutable -public final class AzureOpenAIDialog extends BaseDialog {} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialogUpdate.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialogUpdate.java deleted file mode 100644 index de236d030a11..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/AzureOpenAIDialogUpdate.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Azure Open AI Dialog for UpdateDialog API Call. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("AzureOpenAI") -@Immutable -public final class AzureOpenAIDialogUpdate extends DialogUpdateBase {} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java deleted file mode 100644 index 289dcaa83a41..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BaseDialog.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; - -/** The BaseDialog model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = BaseDialog.class) -@JsonTypeName("BaseDialog") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AzureOpenAI", value = AzureOpenAIDialog.class), - @JsonSubTypes.Type(name = "PowerVirtualAgents", value = PowerVirtualAgentsDialog.class) -}) -@Fluent -public class BaseDialog { - /* - * Dialog context. - */ - @JsonProperty(value = "context", required = true) - private Map context; - - /** - * Get the context property: Dialog context. - * - * @return the context value. - */ - public Map getContext() { - return this.context; - } - - /** - * Set the context property: Dialog context. - * - * @param context the context value to set. - * @return the BaseDialog object itself. - */ - public BaseDialog setContext(Map context) { - this.context = context; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BlobStorageInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BlobStorageInternal.java deleted file mode 100644 index 1fca59710f5b..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/BlobStorageInternal.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Used to specify Blob container url to recording storage. */ -@Fluent -public final class BlobStorageInternal { - /* - * Url of a container or a location within a container - */ - @JsonProperty(value = "containerUri", required = true) - private String containerUri; - - /** - * Get the containerUri property: Url of a container or a location within a container. - * - * @return the containerUri value. - */ - public String getContainerUri() { - return this.containerUri; - } - - /** - * Set the containerUri property: Url of a container or a location within a container. - * - * @param containerUri the containerUri value to set. - * @return the BlobStorageInternal object itself. - */ - public BlobStorageInternal setContainerUri(String containerUri) { - this.containerUri = containerUri; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionPropertiesInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionPropertiesInternal.java index f09163b663c3..c54713ec1f38 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionPropertiesInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionPropertiesInternal.java @@ -42,20 +42,7 @@ public final class CallConnectionPropertiesInternal { private String callbackUri; /* - * SubscriptionId for media streaming - */ - @JsonProperty(value = "mediaSubscriptionId") - private String mediaSubscriptionId; - - /* - * SubscriptionId for transcription - */ - @JsonProperty(value = "dataSubscriptionId") - private String dataSubscriptionId; - - /* - * The source caller Id, a phone number, that's shown to the PSTN - * participant being invited. + * The source caller Id, a phone number, that's shown to the PSTN participant being invited. * Required only when calling a PSTN callee. */ @JsonProperty(value = "sourceCallerIdNumber") @@ -80,18 +67,13 @@ public final class CallConnectionPropertiesInternal { private String correlationId; /* - * Identity of the answering entity. Only populated when identity is - * provided in the request. + * Identity of the answering entity. Only populated when identity is provided in the request. */ @JsonProperty(value = "answeredBy") private CommunicationUserIdentifierModel answeredBy; - /* - * Identity of the original Pstn target of an incoming Call. Only populated - * when the original target is a Pstn number. - */ - @JsonProperty(value = "answeredFor") - private PhoneNumberIdentifierModel answeredFor; + /** Creates an instance of CallConnectionPropertiesInternal class. */ + public CallConnectionPropertiesInternal() {} /** * Get the callConnectionId property: The call connection id. @@ -194,46 +176,6 @@ public CallConnectionPropertiesInternal setCallbackUri(String callbackUri) { return this; } - /** - * Get the mediaSubscriptionId property: SubscriptionId for media streaming. - * - * @return the mediaSubscriptionId value. - */ - public String getMediaSubscriptionId() { - return this.mediaSubscriptionId; - } - - /** - * Set the mediaSubscriptionId property: SubscriptionId for media streaming. - * - * @param mediaSubscriptionId the mediaSubscriptionId value to set. - * @return the CallConnectionPropertiesInternal object itself. - */ - public CallConnectionPropertiesInternal setMediaSubscriptionId(String mediaSubscriptionId) { - this.mediaSubscriptionId = mediaSubscriptionId; - return this; - } - - /** - * Get the dataSubscriptionId property: SubscriptionId for transcription. - * - * @return the dataSubscriptionId value. - */ - public String getDataSubscriptionId() { - return this.dataSubscriptionId; - } - - /** - * Set the dataSubscriptionId property: SubscriptionId for transcription. - * - * @param dataSubscriptionId the dataSubscriptionId value to set. - * @return the CallConnectionPropertiesInternal object itself. - */ - public CallConnectionPropertiesInternal setDataSubscriptionId(String dataSubscriptionId) { - this.dataSubscriptionId = dataSubscriptionId; - return this; - } - /** * Get the sourceCallerIdNumber property: The source caller Id, a phone number, that's shown to the PSTN participant * being invited. Required only when calling a PSTN callee. @@ -337,26 +279,4 @@ public CallConnectionPropertiesInternal setAnsweredBy(CommunicationUserIdentifie this.answeredBy = answeredBy; return this; } - - /** - * Get the answeredFor property: Identity of the original Pstn target of an incoming Call. Only populated when the - * original target is a Pstn number. - * - * @return the answeredFor value. - */ - public PhoneNumberIdentifierModel getAnsweredFor() { - return this.answeredFor; - } - - /** - * Set the answeredFor property: Identity of the original Pstn target of an incoming Call. Only populated when the - * original target is a Pstn number. - * - * @param answeredFor the answeredFor value to set. - * @return the CallConnectionPropertiesInternal object itself. - */ - public CallConnectionPropertiesInternal setAnsweredFor(PhoneNumberIdentifierModel answeredFor) { - this.answeredFor = answeredFor; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionStateModelInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionStateModelInternal.java index db1e3f9b57df..4fc5defe0369 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionStateModelInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallConnectionStateModelInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CallConnectionStateModelInternal. */ +/** The state of the call connection. */ public final class CallConnectionStateModelInternal extends ExpandableStringEnum { /** Static value unknown for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal UNKNOWN = fromString("unknown"); @@ -31,6 +31,14 @@ public final class CallConnectionStateModelInternal extends ExpandableStringEnum /** Static value disconnected for CallConnectionStateModelInternal. */ public static final CallConnectionStateModelInternal DISCONNECTED = fromString("disconnected"); + /** + * Creates a new instance of CallConnectionStateModelInternal value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CallConnectionStateModelInternal() {} + /** * Creates or finds a CallConnectionStateModelInternal from its string representation. * @@ -42,7 +50,11 @@ public static CallConnectionStateModelInternal fromString(String name) { return fromString(name, CallConnectionStateModelInternal.class); } - /** @return known CallConnectionStateModelInternal values. */ + /** + * Gets known CallConnectionStateModelInternal values. + * + * @return known CallConnectionStateModelInternal values. + */ public static Collection values() { return values(CallConnectionStateModelInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptions.java deleted file mode 100644 index 53ec32082eda..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptions.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** AI options for the call. */ -@Fluent -public final class CallIntelligenceOptions { - /* - * The identifier of the Cognitive Service resource assigned to this call. - */ - @JsonProperty(value = "cognitiveServicesEndpoint") - private String cognitiveServicesEndpoint; - - /** Creates an instance of CallIntelligenceOptions class. */ - public CallIntelligenceOptions() {} - - /** - * Get the cognitiveServicesEndpoint property: The identifier of the Cognitive Service resource assigned to this - * call. - * - * @return the cognitiveServicesEndpoint value. - */ - public String getCognitiveServicesEndpoint() { - return this.cognitiveServicesEndpoint; - } - - /** - * Set the cognitiveServicesEndpoint property: The identifier of the Cognitive Service resource assigned to this - * call. - * - * @param cognitiveServicesEndpoint the cognitiveServicesEndpoint value to set. - * @return the CallIntelligenceOptions object itself. - */ - public CallIntelligenceOptions setCognitiveServicesEndpoint(String cognitiveServicesEndpoint) { - this.cognitiveServicesEndpoint = cognitiveServicesEndpoint; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java index 5fecccb31a02..a99cf3ffa129 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallIntelligenceOptionsInternal.java @@ -16,6 +16,9 @@ public final class CallIntelligenceOptionsInternal { @JsonProperty(value = "cognitiveServicesEndpoint") private String cognitiveServicesEndpoint; + /** Creates an instance of CallIntelligenceOptionsInternal class. */ + public CallIntelligenceOptionsInternal() {} + /** * Get the cognitiveServicesEndpoint property: The identifier of the Cognitive Service resource assigned to this * call. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorInternal.java index 847ccfe1bf76..5b9c36458ae8 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorInternal.java @@ -28,6 +28,9 @@ public final class CallLocatorInternal { @JsonProperty(value = "kind") private CallLocatorKindInternal kind; + /** Creates an instance of CallLocatorInternal class. */ + public CallLocatorInternal() {} + /** * Get the groupCallId property: The group call id. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorKindInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorKindInternal.java index 5e413597d618..f42c10832cdd 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorKindInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallLocatorKindInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CallLocatorKindInternal. */ +/** The call locator kind. */ public final class CallLocatorKindInternal extends ExpandableStringEnum { /** Static value groupCallLocator for CallLocatorKindInternal. */ public static final CallLocatorKindInternal GROUP_CALL_LOCATOR = fromString("groupCallLocator"); @@ -16,6 +16,14 @@ public final class CallLocatorKindInternal extends ExpandableStringEnum values() { return values(CallLocatorKindInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallParticipantInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallParticipantInternal.java index d2b630793232..9c67f4b0cf19 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallParticipantInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallParticipantInternal.java @@ -22,11 +22,8 @@ public final class CallParticipantInternal { @JsonProperty(value = "isMuted") private Boolean isMuted; - /* - * Is participant on hold. - */ - @JsonProperty(value = "isOnHold") - private Boolean isOnHold; + /** Creates an instance of CallParticipantInternal class. */ + public CallParticipantInternal() {} /** * Get the identifier property: Communication identifier of the participant. @@ -67,24 +64,4 @@ public CallParticipantInternal setIsMuted(Boolean isMuted) { this.isMuted = isMuted; return this; } - - /** - * Get the isOnHold property: Is participant on hold. - * - * @return the isOnHold value. - */ - public Boolean isOnHold() { - return this.isOnHold; - } - - /** - * Set the isOnHold property: Is participant on hold. - * - * @param isOnHold the isOnHold value to set. - * @return the CallParticipantInternal object itself. - */ - public CallParticipantInternal setIsOnHold(Boolean isOnHold) { - this.isOnHold = isOnHold; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallRejectReasonInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallRejectReasonInternal.java index 5cb7dc57aa9e..d416a2061560 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallRejectReasonInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CallRejectReasonInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CallRejectReasonInternal. */ +/** The rejection reason. */ public final class CallRejectReasonInternal extends ExpandableStringEnum { /** Static value none for CallRejectReasonInternal. */ public static final CallRejectReasonInternal NONE = fromString("none"); @@ -19,6 +19,14 @@ public final class CallRejectReasonInternal extends ExpandableStringEnum values() { return values(CallRejectReasonInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantFailed.java new file mode 100644 index 000000000000..a1372df3710f --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantFailed.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Failed cancel add participant event. */ +@Fluent +public final class CancelAddParticipantFailed { + /* + * Call connection ID. + */ + @JsonProperty(value = "callConnectionId") + private String callConnectionId; + + /* + * Server call ID. + */ + @JsonProperty(value = "serverCallId") + private String serverCallId; + + /* + * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /* + * Used by customers when calling mid-call actions to correlate the request to the response event. + */ + @JsonProperty(value = "operationContext") + private String operationContext; + + /* + * Contains the resulting SIP code/sub-code and message from NGC services. + */ + @JsonProperty(value = "resultInformation") + private ResultInformation resultInformation; + + /* + * Invitation ID used to cancel the request. + */ + @JsonProperty(value = "invitationId") + private String invitationId; + + /** Creates an instance of CancelAddParticipantFailed class. */ + public CancelAddParticipantFailed() {} + + /** + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. + */ + public String getCallConnectionId() { + return this.callConnectionId; + } + + /** + * Set the callConnectionId property: Call connection ID. + * + * @param callConnectionId the callConnectionId value to set. + * @return the CancelAddParticipantFailed object itself. + */ + public CancelAddParticipantFailed setCallConnectionId(String callConnectionId) { + this.callConnectionId = callConnectionId; + return this; + } + + /** + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. + */ + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Set the serverCallId property: Server call ID. + * + * @param serverCallId the serverCallId value to set. + * @return the CancelAddParticipantFailed object itself. + */ + public CancelAddParticipantFailed setServerCallId(String serverCallId) { + this.serverCallId = serverCallId; + return this; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @param correlationId the correlationId value to set. + * @return the CancelAddParticipantFailed object itself. + */ + public CancelAddParticipantFailed setCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. + * + * @return the operationContext value. + */ + public String getOperationContext() { + return this.operationContext; + } + + /** + * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. + * + * @param operationContext the operationContext value to set. + * @return the CancelAddParticipantFailed object itself. + */ + public CancelAddParticipantFailed setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Set the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. + * + * @param resultInformation the resultInformation value to set. + * @return the CancelAddParticipantFailed object itself. + */ + public CancelAddParticipantFailed setResultInformation(ResultInformation resultInformation) { + this.resultInformation = resultInformation; + return this; + } + + /** + * Get the invitationId property: Invitation ID used to cancel the request. + * + * @return the invitationId value. + */ + public String getInvitationId() { + return this.invitationId; + } + + /** + * Set the invitationId property: Invitation ID used to cancel the request. + * + * @param invitationId the invitationId value to set. + * @return the CancelAddParticipantFailed object itself. + */ + public CancelAddParticipantFailed setInvitationId(String invitationId) { + this.invitationId = invitationId; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantRequest.java index d5dc9122b965..ff33aedd4548 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantRequest.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantRequest.java @@ -17,21 +17,22 @@ public final class CancelAddParticipantRequest { private String invitationId; /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. + * Used by customers when calling mid-call actions to correlate the request to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. + * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be + * used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; + /** Creates an instance of CancelAddParticipantRequest class. */ + public CancelAddParticipantRequest() {} + /** * Get the invitationId property: Invitation ID used to add a participant. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantResponse.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantResponse.java index 864ff38d0bd0..a888ef476adb 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantResponse.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CancelAddParticipantResponse.java @@ -22,6 +22,9 @@ public final class CancelAddParticipantResponse { @JsonProperty(value = "operationContext") private String operationContext; + /** Creates an instance of CancelAddParticipantResponse class. */ + public CancelAddParticipantResponse() {} + /** * Get the invitationId property: Invitation ID used to cancel the add participant action. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChannelAffinityInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChannelAffinityInternal.java index b37390bef792..cb8c53d0cac3 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChannelAffinityInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChannelAffinityInternal.java @@ -11,20 +11,21 @@ @Fluent public final class ChannelAffinityInternal { /* - * Channel number to which bitstream from a particular participant will be - * written. + * Channel number to which bitstream from a particular participant will be written. */ @JsonProperty(value = "channel") private Integer channel; /* - * The identifier for the participant whose bitstream will be written to - * the channel + * The identifier for the participant whose bitstream will be written to the channel * represented by the channel number. */ @JsonProperty(value = "participant", required = true) private CommunicationIdentifierModel participant; + /** Creates an instance of ChannelAffinityInternal class. */ + public ChannelAffinityInternal() {} + /** * Get the channel property: Channel number to which bitstream from a particular participant will be written. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChoiceResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChoiceResultInternal.java index f5a782746b19..84c1499ca9f1 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChoiceResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ChoiceResultInternal.java @@ -18,12 +18,15 @@ public final class ChoiceResultInternal { /* * Phrases are set to the value if choice is selected via phrase detection. - * If Dtmf input is recognized, then Label will be the identifier for the - * choice detected and phrases will be set to null + * If Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set + * to null */ @JsonProperty(value = "recognizedPhrase") private String recognizedPhrase; + /** Creates an instance of ChoiceResultInternal class. */ + public ChoiceResultInternal() {} + /** * Get the label property: Label is the primary identifier for the choice detected. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CollectTonesResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CollectTonesResultInternal.java deleted file mode 100644 index a6a19aa3dd55..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CollectTonesResultInternal.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The CollectTonesResultInternal model. */ -@Immutable -public final class CollectTonesResultInternal { - /* - * The tones property. - */ - @JsonProperty(value = "tones", access = JsonProperty.Access.WRITE_ONLY) - private List tones; - - /** - * Get the tones property: The tones property. - * - * @return the tones value. - */ - public List getTones() { - return this.tones; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationCloudEnvironmentModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationCloudEnvironmentModel.java index 07a1b2042c1c..f3da6f4fdc61 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationCloudEnvironmentModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationCloudEnvironmentModel.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CommunicationCloudEnvironmentModel. */ +/** The cloud that the identifier belongs to. */ public final class CommunicationCloudEnvironmentModel extends ExpandableStringEnum { /** Static value public for CommunicationCloudEnvironmentModel. */ public static final CommunicationCloudEnvironmentModel PUBLIC = fromString("public"); @@ -19,6 +19,14 @@ public final class CommunicationCloudEnvironmentModel extends ExpandableStringEn /** Static value gcch for CommunicationCloudEnvironmentModel. */ public static final CommunicationCloudEnvironmentModel GCCH = fromString("gcch"); + /** + * Creates a new instance of CommunicationCloudEnvironmentModel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommunicationCloudEnvironmentModel() {} + /** * Creates or finds a CommunicationCloudEnvironmentModel from its string representation. * @@ -30,7 +38,11 @@ public static CommunicationCloudEnvironmentModel fromString(String name) { return fromString(name, CommunicationCloudEnvironmentModel.class); } - /** @return known CommunicationCloudEnvironmentModel values. */ + /** + * Gets known CommunicationCloudEnvironmentModel values. + * + * @return known CommunicationCloudEnvironmentModel values. + */ public static Collection values() { return values(CommunicationCloudEnvironmentModel.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationError.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationError.java index ee390d3e598f..a55b89f1b4f9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationError.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationError.java @@ -41,6 +41,9 @@ public final class CommunicationError { @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) private CommunicationError innerError; + /** Creates an instance of CommunicationError class. */ + public CommunicationError() {} + /** * Get the code property: The error code. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponse.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponse.java index 4403b761aa54..e47142efcd05 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponse.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponse.java @@ -16,6 +16,9 @@ public final class CommunicationErrorResponse { @JsonProperty(value = "error", required = true) private CommunicationError error; + /** Creates an instance of CommunicationErrorResponse class. */ + public CommunicationErrorResponse() {} + /** * Get the error property: The Communication Services error. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponseException.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponseException.java index d591a9a16cff..07cb34629ebf 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponseException.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationErrorResponseException.java @@ -31,6 +31,7 @@ public CommunicationErrorResponseException( super(message, response, value); } + /** {@inheritDoc} */ @Override public CommunicationErrorResponse getValue() { return (CommunicationErrorResponse) super.getValue(); diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModel.java index 000446247b27..65b1a63529ab 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModel.java @@ -44,11 +44,8 @@ public final class CommunicationIdentifierModel { @JsonProperty(value = "microsoftTeamsUser") private MicrosoftTeamsUserIdentifierModel microsoftTeamsUser; - /* - * The Microsoft Teams application. - */ - @JsonProperty(value = "microsoftTeamsApp") - private MicrosoftTeamsAppIdentifierModel microsoftTeamsApp; + /** Creates an instance of CommunicationIdentifierModel class. */ + public CommunicationIdentifierModel() {} /** * Get the kind property: The identifier kind. Only required in responses. @@ -149,24 +146,4 @@ public CommunicationIdentifierModel setMicrosoftTeamsUser(MicrosoftTeamsUserIden this.microsoftTeamsUser = microsoftTeamsUser; return this; } - - /** - * Get the microsoftTeamsApp property: The Microsoft Teams application. - * - * @return the microsoftTeamsApp value. - */ - public MicrosoftTeamsAppIdentifierModel getMicrosoftTeamsApp() { - return this.microsoftTeamsApp; - } - - /** - * Set the microsoftTeamsApp property: The Microsoft Teams application. - * - * @param microsoftTeamsApp the microsoftTeamsApp value to set. - * @return the CommunicationIdentifierModel object itself. - */ - public CommunicationIdentifierModel setMicrosoftTeamsApp(MicrosoftTeamsAppIdentifierModel microsoftTeamsApp) { - this.microsoftTeamsApp = microsoftTeamsApp; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModelKind.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModelKind.java index 9364240c7283..74091e1452fe 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModelKind.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationIdentifierModelKind.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CommunicationIdentifierModelKind. */ +/** The identifier kind, for example 'communicationUser' or 'phoneNumber'. */ public final class CommunicationIdentifierModelKind extends ExpandableStringEnum { /** Static value unknown for CommunicationIdentifierModelKind. */ public static final CommunicationIdentifierModelKind UNKNOWN = fromString("unknown"); @@ -22,8 +22,13 @@ public final class CommunicationIdentifierModelKind extends ExpandableStringEnum /** Static value microsoftTeamsUser for CommunicationIdentifierModelKind. */ public static final CommunicationIdentifierModelKind MICROSOFT_TEAMS_USER = fromString("microsoftTeamsUser"); - /** Static value microsoftTeamsApp for CommunicationIdentifierModelKind. */ - public static final CommunicationIdentifierModelKind MICROSOFT_TEAMS_APP = fromString("microsoftTeamsApp"); + /** + * Creates a new instance of CommunicationIdentifierModelKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommunicationIdentifierModelKind() {} /** * Creates or finds a CommunicationIdentifierModelKind from its string representation. @@ -36,7 +41,11 @@ public static CommunicationIdentifierModelKind fromString(String name) { return fromString(name, CommunicationIdentifierModelKind.class); } - /** @return known CommunicationIdentifierModelKind values. */ + /** + * Gets known CommunicationIdentifierModelKind values. + * + * @return known CommunicationIdentifierModelKind values. + */ public static Collection values() { return values(CommunicationIdentifierModelKind.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationUserIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationUserIdentifierModel.java index 181bfb121ae4..53f5bd8ec0f9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationUserIdentifierModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CommunicationUserIdentifierModel.java @@ -16,6 +16,9 @@ public final class CommunicationUserIdentifierModel { @JsonProperty(value = "id", required = true) private String id; + /** Creates an instance of CommunicationUserIdentifierModel class. */ + public CommunicationUserIdentifierModel() {} + /** * Get the id property: The Id of the communication user. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequest.java similarity index 53% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdRequest.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequest.java index 8a86093e5ad0..572c57959e2e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnholdRequest.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequest.java @@ -7,25 +7,23 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The request payload for holding participant from the call. */ +/** The ContinuousDtmfRecognitionRequest model. */ @Fluent -public final class UnholdRequest { +public final class ContinuousDtmfRecognitionRequest { /* - * Participants to be hold from the call. - * Only ACS Users are supported. + * Defines options for recognition. */ @JsonProperty(value = "targetParticipant", required = true) private CommunicationIdentifierModel targetParticipant; /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. + * The value to identify context of the operation. */ @JsonProperty(value = "operationContext") private String operationContext; /** - * Get the targetParticipant property: Participants to be hold from the call. Only ACS Users are supported. + * Get the targetParticipant property: Defines options for recognition. * * @return the targetParticipant value. */ @@ -34,19 +32,18 @@ public CommunicationIdentifierModel getTargetParticipant() { } /** - * Set the targetParticipant property: Participants to be hold from the call. Only ACS Users are supported. + * Set the targetParticipant property: Defines options for recognition. * * @param targetParticipant the targetParticipant value to set. - * @return the UnholdRequest object itself. + * @return the ContinuousDtmfRecognitionRequest object itself. */ - public UnholdRequest setTargetParticipant(CommunicationIdentifierModel targetParticipant) { + public ContinuousDtmfRecognitionRequest setTargetParticipant(CommunicationIdentifierModel targetParticipant) { this.targetParticipant = targetParticipant; return this; } /** - * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. + * Get the operationContext property: The value to identify context of the operation. * * @return the operationContext value. */ @@ -55,13 +52,12 @@ public String getOperationContext() { } /** - * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. + * Set the operationContext property: The value to identify context of the operation. * * @param operationContext the operationContext value to set. - * @return the UnholdRequest object itself. + * @return the ContinuousDtmfRecognitionRequest object itself. */ - public UnholdRequest setOperationContext(String operationContext) { + public ContinuousDtmfRecognitionRequest setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequestInternal.java index f822115fb8fa..0a9014475fdc 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionRequestInternal.java @@ -23,14 +23,16 @@ public final class ContinuousDtmfRecognitionRequestInternal { private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. + * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be + * used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; + /** Creates an instance of ContinuousDtmfRecognitionRequestInternal class. */ + public ContinuousDtmfRecognitionRequestInternal() {} + /** * Get the targetParticipant property: Defines options for recognition. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionToneReceived.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionToneReceived.java new file mode 100644 index 000000000000..346c19e5a0c7 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ContinuousDtmfRecognitionToneReceived.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ContinuousDtmfRecognitionToneReceived model. */ +@Fluent +public final class ContinuousDtmfRecognitionToneReceived { + /* + * The sequence id which can be used to determine if the same tone was played multiple times or if any tones were + * missed. + */ + @JsonProperty(value = "sequenceId", access = JsonProperty.Access.WRITE_ONLY) + private Integer sequenceId; + + /* + * The tone property. + */ + @JsonProperty(value = "tone") + private DtmfToneInternal tone; + + /* + * Call connection ID. + */ + @JsonProperty(value = "callConnectionId") + private String callConnectionId; + + /* + * Server call ID. + */ + @JsonProperty(value = "serverCallId") + private String serverCallId; + + /* + * Correlation ID for event to call correlation. Also called ChainId or skype chain ID. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /* + * Contains the resulting SIP code, sub-code and message. + */ + @JsonProperty(value = "resultInformation") + private ResultInformation resultInformation; + + /* + * Used by customers when calling mid-call actions to correlate the request to the response event. + */ + @JsonProperty(value = "operationContext") + private String operationContext; + + /** Creates an instance of ContinuousDtmfRecognitionToneReceived class. */ + public ContinuousDtmfRecognitionToneReceived() {} + + /** + * Get the sequenceId property: The sequence id which can be used to determine if the same tone was played multiple + * times or if any tones were missed. + * + * @return the sequenceId value. + */ + public Integer getSequenceId() { + return this.sequenceId; + } + + /** + * Get the tone property: The tone property. + * + * @return the tone value. + */ + public DtmfToneInternal getTone() { + return this.tone; + } + + /** + * Set the tone property: The tone property. + * + * @param tone the tone value to set. + * @return the ContinuousDtmfRecognitionToneReceived object itself. + */ + public ContinuousDtmfRecognitionToneReceived setTone(DtmfToneInternal tone) { + this.tone = tone; + return this; + } + + /** + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. + */ + public String getCallConnectionId() { + return this.callConnectionId; + } + + /** + * Set the callConnectionId property: Call connection ID. + * + * @param callConnectionId the callConnectionId value to set. + * @return the ContinuousDtmfRecognitionToneReceived object itself. + */ + public ContinuousDtmfRecognitionToneReceived setCallConnectionId(String callConnectionId) { + this.callConnectionId = callConnectionId; + return this; + } + + /** + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. + */ + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Set the serverCallId property: Server call ID. + * + * @param serverCallId the serverCallId value to set. + * @return the ContinuousDtmfRecognitionToneReceived object itself. + */ + public ContinuousDtmfRecognitionToneReceived setServerCallId(String serverCallId) { + this.serverCallId = serverCallId; + return this; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId or skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId or skype chain + * ID. + * + * @param correlationId the correlationId value to set. + * @return the ContinuousDtmfRecognitionToneReceived object itself. + */ + public ContinuousDtmfRecognitionToneReceived setCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Set the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @param resultInformation the resultInformation value to set. + * @return the ContinuousDtmfRecognitionToneReceived object itself. + */ + public ContinuousDtmfRecognitionToneReceived setResultInformation(ResultInformation resultInformation) { + this.resultInformation = resultInformation; + return this; + } + + /** + * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. + * + * @return the operationContext value. + */ + public String getOperationContext() { + return this.operationContext; + } + + /** + * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. + * + * @param operationContext the operationContext value to set. + * @return the ContinuousDtmfRecognitionToneReceived object itself. + */ + public ContinuousDtmfRecognitionToneReceived setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallFailed.java deleted file mode 100644 index c6ee046d6e87..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallFailed.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The CreateCallFailed event. */ -@Immutable -public final class CreateCallFailed { - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) - private String operationContext; - - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /** - * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. - */ - public String getServerCallId() { - return this.serverCallId; - } - - /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @return the correlationId value. - */ - public String getCorrelationId() { - return this.correlationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java index e7779e2d62dc..15f9083e62a5 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java @@ -18,8 +18,7 @@ public final class CreateCallRequestInternal { private List targets; /* - * The source caller Id, a phone number, that's shown to the PSTN - * participant being invited. + * The source caller Id, a phone number, that's shown to the PSTN participant being invited. * Required only when calling a PSTN callee. */ @JsonProperty(value = "sourceCallerIdNumber") @@ -49,29 +48,14 @@ public final class CreateCallRequestInternal { @JsonProperty(value = "callbackUri", required = true) private String callbackUri; - /* - * Media Streaming Configuration. - */ - @JsonProperty(value = "mediaStreamingConfiguration") - private MediaStreamingConfigurationInternal mediaStreamingConfiguration; - - /* - * Live Transcription Configuration. - */ - @JsonProperty(value = "transcriptionConfiguration") - private TranscriptionConfigurationInternal transcriptionConfiguration; - /* * AI options for the call. */ @JsonProperty(value = "callIntelligenceOptions") private CallIntelligenceOptionsInternal callIntelligenceOptions; - /* - * Used by customer to send custom calling context to targets - */ - @JsonProperty(value = "customCallingContext") - private CustomCallingContext customCallingContext; + /** Creates an instance of CreateCallRequestInternal class. */ + public CreateCallRequestInternal() {} /** * Get the targets property: The targets of the call. @@ -195,48 +179,6 @@ public CreateCallRequestInternal setCallbackUri(String callbackUri) { return this; } - /** - * Get the mediaStreamingConfiguration property: Media Streaming Configuration. - * - * @return the mediaStreamingConfiguration value. - */ - public MediaStreamingConfigurationInternal getMediaStreamingConfiguration() { - return this.mediaStreamingConfiguration; - } - - /** - * Set the mediaStreamingConfiguration property: Media Streaming Configuration. - * - * @param mediaStreamingConfiguration the mediaStreamingConfiguration value to set. - * @return the CreateCallRequestInternal object itself. - */ - public CreateCallRequestInternal setMediaStreamingConfiguration( - MediaStreamingConfigurationInternal mediaStreamingConfiguration) { - this.mediaStreamingConfiguration = mediaStreamingConfiguration; - return this; - } - - /** - * Get the transcriptionConfiguration property: Live Transcription Configuration. - * - * @return the transcriptionConfiguration value. - */ - public TranscriptionConfigurationInternal getTranscriptionConfiguration() { - return this.transcriptionConfiguration; - } - - /** - * Set the transcriptionConfiguration property: Live Transcription Configuration. - * - * @param transcriptionConfiguration the transcriptionConfiguration value to set. - * @return the CreateCallRequestInternal object itself. - */ - public CreateCallRequestInternal setTranscriptionConfiguration( - TranscriptionConfigurationInternal transcriptionConfiguration) { - this.transcriptionConfiguration = transcriptionConfiguration; - return this; - } - /** * Get the callIntelligenceOptions property: AI options for the call. * @@ -257,24 +199,4 @@ public CreateCallRequestInternal setCallIntelligenceOptions( this.callIntelligenceOptions = callIntelligenceOptions; return this; } - - /** - * Get the customCallingContext property: Used by customer to send custom calling context to targets. - * - * @return the customCallingContext value. - */ - public CustomCallingContext getCustomCallingContext() { - return this.customCallingContext; - } - - /** - * Set the customCallingContext property: Used by customer to send custom calling context to targets. - * - * @param customCallingContext the customCallingContext value to set. - * @return the CreateCallRequestInternal object itself. - */ - public CreateCallRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { - this.customCallingContext = customCallingContext; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java index fbcc7207a2e3..b50e208d4dcb 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomCallingContext.java @@ -8,23 +8,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The CustomCallingContext model. */ +/** The custom calling context which will be sent to the target. */ @Fluent public final class CustomCallingContext { /* - * Dictionary of + * Custom calling context VoiP headers */ @JsonProperty(value = "voipHeaders") private Map voipHeaders; /* - * Dictionary of + * Custom calling context SIP headers */ @JsonProperty(value = "sipHeaders") private Map sipHeaders; + /** Creates an instance of CustomCallingContext class. */ + public CustomCallingContext() {} + /** - * Get the voipHeaders property: Dictionary of <string>. + * Get the voipHeaders property: Custom calling context VoiP headers. * * @return the voipHeaders value. */ @@ -33,7 +36,7 @@ public Map getVoipHeaders() { } /** - * Set the voipHeaders property: Dictionary of <string>. + * Set the voipHeaders property: Custom calling context VoiP headers. * * @param voipHeaders the voipHeaders value to set. * @return the CustomCallingContext object itself. @@ -44,7 +47,7 @@ public CustomCallingContext setVoipHeaders(Map voipHeaders) { } /** - * Get the sipHeaders property: Dictionary of <string>. + * Get the sipHeaders property: Custom calling context SIP headers. * * @return the sipHeaders value. */ @@ -53,7 +56,7 @@ public Map getSipHeaders() { } /** - * Set the sipHeaders property: Dictionary of <string>. + * Set the sipHeaders property: Custom calling context SIP headers. * * @param sipHeaders the sipHeaders value to set. * @return the CustomCallingContext object itself. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomContext.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomContext.java deleted file mode 100644 index 3dbbc0d03c53..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CustomContext.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The CustomContext model. */ -@Fluent -public final class CustomContext { - /* - * Dictionary of - */ - @JsonProperty(value = "voipHeaders") - private Map voipHeaders; - - /* - * Dictionary of - */ - @JsonProperty(value = "sipHeaders") - private Map sipHeaders; - - /** Creates an instance of CustomContext class. */ - public CustomContext() {} - - /** - * Get the voipHeaders property: Dictionary of <string>. - * - * @return the voipHeaders value. - */ - public Map getVoipHeaders() { - return this.voipHeaders; - } - - /** - * Set the voipHeaders property: Dictionary of <string>. - * - * @param voipHeaders the voipHeaders value to set. - * @return the CustomContext object itself. - */ - public CustomContext setVoipHeaders(Map voipHeaders) { - this.voipHeaders = voipHeaders; - return this; - } - - /** - * Get the sipHeaders property: Dictionary of <string>. - * - * @return the sipHeaders value. - */ - public Map getSipHeaders() { - return this.sipHeaders; - } - - /** - * Set the sipHeaders property: Dictionary of <string>. - * - * @param sipHeaders the sipHeaders value to set. - * @return the CustomContext object itself. - */ - public CustomContext setSipHeaders(Map sipHeaders) { - this.sipHeaders = sipHeaders; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogInputType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogInputType.java deleted file mode 100644 index d97b6fe7408b..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogInputType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DialogInputType. */ -public final class DialogInputType extends ExpandableStringEnum { - /** Static value powerVirtualAgents for DialogInputType. */ - public static final DialogInputType POWER_VIRTUAL_AGENTS = fromString("powerVirtualAgents"); - - /** Static value azureOpenAI for DialogInputType. */ - public static final DialogInputType AZURE_OPEN_AI = fromString("azureOpenAI"); - - /** - * Creates or finds a DialogInputType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DialogInputType. - */ - @JsonCreator - public static DialogInputType fromString(String name) { - return fromString(name, DialogInputType.class); - } - - /** @return known DialogInputType values. */ - public static Collection values() { - return values(DialogInputType.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogStateResponse.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogStateResponse.java deleted file mode 100644 index 2cffa3c2ddd2..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogStateResponse.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogStateResponse model. */ -@Fluent -public final class DialogStateResponse { - /* - * The dialog ID. - */ - @JsonProperty(value = "dialogId") - private String dialogId; - - /* - * Defines dialog. - */ - @JsonProperty(value = "dialog") - private BaseDialog dialog; - - /* - * The value to identify context of the operation. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /** - * Get the dialogId property: The dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } - - /** - * Set the dialogId property: The dialog ID. - * - * @param dialogId the dialogId value to set. - * @return the DialogStateResponse object itself. - */ - public DialogStateResponse setDialogId(String dialogId) { - this.dialogId = dialogId; - return this; - } - - /** - * Get the dialog property: Defines dialog. - * - * @return the dialog value. - */ - public BaseDialog getDialog() { - return this.dialog; - } - - /** - * Set the dialog property: Defines dialog. - * - * @param dialog the dialog value to set. - * @return the DialogStateResponse object itself. - */ - public DialogStateResponse setDialog(BaseDialog dialog) { - this.dialog = dialog; - return this; - } - - /** - * Get the operationContext property: The value to identify context of the operation. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Set the operationContext property: The value to identify context of the operation. - * - * @param operationContext the operationContext value to set. - * @return the DialogStateResponse object itself. - */ - public DialogStateResponse setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogUpdateBase.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogUpdateBase.java deleted file mode 100644 index cb2f012d5189..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogUpdateBase.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.Map; - -/** The DialogUpdateBase model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = DialogUpdateBase.class) -@JsonTypeName("DialogUpdateBase") -@JsonSubTypes({@JsonSubTypes.Type(name = "AzureOpenAI", value = AzureOpenAIDialogUpdate.class)}) -@Fluent -public class DialogUpdateBase { - /* - * Dialog context. - */ - @JsonProperty(value = "context") - private Map context; - - /** - * Get the context property: Dialog context. - * - * @return the context value. - */ - public Map getContext() { - return this.context; - } - - /** - * Set the context property: Dialog context. - * - * @param context the context value to set. - * @return the DialogUpdateBase object itself. - */ - public DialogUpdateBase setContext(Map context) { - this.context = context; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogUpdated.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogUpdated.java deleted file mode 100644 index 036bd996497c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DialogUpdated.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogUpdated model. */ -@Fluent -public final class DialogUpdated { - /* - * Used by customers when calling answerCall action to correlate the - * request to the response event. - */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) - private String operationContext; - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /* - * Ivr Context - */ - @JsonProperty(value = "ivrContext", access = JsonProperty.Access.WRITE_ONLY) - private Object ivrContext; - - /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /** - * Get the operationContext property: Used by customers when calling answerCall action to correlate the request to - * the response event. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Set the dialogInputType property: Determines the type of the dialog. - * - * @param dialogInputType the dialogInputType value to set. - * @return the DialogUpdated object itself. - */ - public DialogUpdated setDialogInputType(DialogInputType dialogInputType) { - this.dialogInputType = dialogInputType; - return this; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } - - /** - * Get the ivrContext property: Ivr Context. - * - * @return the ivrContext value. - */ - public Object getIvrContext() { - return this.ivrContext; - } - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. - */ - public String getServerCallId() { - return this.serverCallId; - } - - /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @return the correlationId value. - */ - public String getCorrelationId() { - return this.correlationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfOptionsInternal.java index afe9020e401a..48d9ccd07a5f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfOptionsInternal.java @@ -29,6 +29,9 @@ public final class DtmfOptionsInternal { @JsonProperty(value = "stopTones") private List stopTones; + /** Creates an instance of DtmfOptionsInternal class. */ + public DtmfOptionsInternal() {} + /** * Get the interToneTimeoutInSeconds property: Time to wait between DTMF inputs to stop recognizing. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfResult.java index 9c9a60a1a8fa..3b2ed1ae8007 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfResult.java @@ -17,6 +17,9 @@ public final class DtmfResult { @JsonProperty(value = "tones", access = JsonProperty.Access.WRITE_ONLY) private List tones; + /** Creates an instance of DtmfResult class. */ + public DtmfResult() {} + /** * Get the tones property: The tones property. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfToneInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfToneInternal.java index a948acb7be8b..169b0de157ae 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfToneInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/DtmfToneInternal.java @@ -58,6 +58,14 @@ public final class DtmfToneInternal extends ExpandableStringEnum values() { return values(DtmfToneInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ExternalStorageInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ExternalStorageInternal.java deleted file mode 100644 index da8b5480e1d6..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ExternalStorageInternal.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ExternalStorageInternal model. */ -@Fluent -public final class ExternalStorageInternal { - /* - * Defines the type of external storage - */ - @JsonProperty(value = "storageType", required = true) - private RecordingStorageTypeInternal storageType; - - /* - * Defines the blob storage location where the recording will be stored - */ - @JsonProperty(value = "blobStorage") - private BlobStorageInternal blobStorage; - - /** - * Get the storageType property: Defines the type of external storage. - * - * @return the storageType value. - */ - public RecordingStorageTypeInternal getStorageType() { - return this.storageType; - } - - /** - * Set the storageType property: Defines the type of external storage. - * - * @param storageType the storageType value to set. - * @return the ExternalStorageInternal object itself. - */ - public ExternalStorageInternal setStorageType(RecordingStorageTypeInternal storageType) { - this.storageType = storageType; - return this; - } - - /** - * Get the blobStorage property: Defines the blob storage location where the recording will be stored. - * - * @return the blobStorage value. - */ - public BlobStorageInternal getBlobStorage() { - return this.blobStorage; - } - - /** - * Set the blobStorage property: Defines the blob storage location where the recording will be stored. - * - * @param blobStorage the blobStorage value to set. - * @return the ExternalStorageInternal object itself. - */ - public ExternalStorageInternal setBlobStorage(BlobStorageInternal blobStorage) { - this.blobStorage = blobStorage; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/FileSourceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/FileSourceInternal.java index e59e9464a3b2..1b8d7bb717e3 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/FileSourceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/FileSourceInternal.java @@ -16,6 +16,9 @@ public final class FileSourceInternal { @JsonProperty(value = "uri", required = true) private String uri; + /** Creates an instance of FileSourceInternal class. */ + public FileSourceInternal() {} + /** * Get the uri property: Uri for the audio file to be played. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GetParticipantsResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GetParticipantsResponseInternal.java index 92f47566dd3e..0e4642439f57 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GetParticipantsResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/GetParticipantsResponseInternal.java @@ -23,6 +23,9 @@ public final class GetParticipantsResponseInternal { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of GetParticipantsResponseInternal class. */ + public GetParticipantsResponseInternal() {} + /** * Get the value property: List of the current participants in the call. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldFailed.java deleted file mode 100644 index 0e4effda8555..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldFailed.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The HoldFailed model. */ -@Immutable -public final class HoldFailed { - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) - private String operationContext; - - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /** - * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. - */ - public String getServerCallId() { - return this.serverCallId; - } - - /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. - * - * @return the correlationId value. - */ - public String getCorrelationId() { - return this.correlationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldRequest.java deleted file mode 100644 index b8bc05a35054..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/HoldRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The request payload for holding participant from the call. */ -@Fluent -public final class HoldRequest { - /* - * Participant to be held from the call. - */ - @JsonProperty(value = "targetParticipant", required = true) - private CommunicationIdentifierModel targetParticipant; - - /* - * Prompt to play while in hold. - */ - @JsonProperty(value = "playSourceInfo") - private PlaySourceInternal playSourceInfo; - - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. - */ - @JsonProperty(value = "operationCallbackUri") - private String operationCallbackUri; - - /** - * Get the targetParticipant property: Participant to be held from the call. - * - * @return the targetParticipant value. - */ - public CommunicationIdentifierModel getTargetParticipant() { - return this.targetParticipant; - } - - /** - * Set the targetParticipant property: Participant to be held from the call. - * - * @param targetParticipant the targetParticipant value to set. - * @return the HoldRequest object itself. - */ - public HoldRequest setTargetParticipant(CommunicationIdentifierModel targetParticipant) { - this.targetParticipant = targetParticipant; - return this; - } - - /** - * Get the playSourceInfo property: Prompt to play while in hold. - * - * @return the playSourceInfo value. - */ - public PlaySourceInternal getPlaySourceInfo() { - return this.playSourceInfo; - } - - /** - * Set the playSourceInfo property: Prompt to play while in hold. - * - * @param playSourceInfo the playSourceInfo value to set. - * @return the HoldRequest object itself. - */ - public HoldRequest setPlaySourceInfo(PlaySourceInternal playSourceInfo) { - this.playSourceInfo = playSourceInfo; - return this; - } - - /** - * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @param operationContext the operationContext value to set. - * @return the HoldRequest object itself. - */ - public HoldRequest setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } - - /** - * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. - * - * @return the operationCallbackUri value. - */ - public String getOperationCallbackUri() { - return this.operationCallbackUri; - } - - /** - * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. - * - * @param operationCallbackUri the operationCallbackUri value to set. - * @return the HoldRequest object itself. - */ - public HoldRequest setOperationCallbackUri(String operationCallbackUri) { - this.operationCallbackUri = operationCallbackUri; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingAudioChannelTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingAudioChannelTypeInternal.java deleted file mode 100644 index f953410cea3b..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingAudioChannelTypeInternal.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MediaStreamingAudioChannelTypeInternal. */ -public final class MediaStreamingAudioChannelTypeInternal - extends ExpandableStringEnum { - /** Static value mixed for MediaStreamingAudioChannelTypeInternal. */ - public static final MediaStreamingAudioChannelTypeInternal MIXED = fromString("mixed"); - - /** Static value unmixed for MediaStreamingAudioChannelTypeInternal. */ - public static final MediaStreamingAudioChannelTypeInternal UNMIXED = fromString("unmixed"); - - /** - * Creates or finds a MediaStreamingAudioChannelTypeInternal from its string representation. - * - * @param name a name to look for. - * @return the corresponding MediaStreamingAudioChannelTypeInternal. - */ - @JsonCreator - public static MediaStreamingAudioChannelTypeInternal fromString(String name) { - return fromString(name, MediaStreamingAudioChannelTypeInternal.class); - } - - /** @return known MediaStreamingAudioChannelTypeInternal values. */ - public static Collection values() { - return values(MediaStreamingAudioChannelTypeInternal.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingConfigurationInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingConfigurationInternal.java deleted file mode 100644 index 54956c411931..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingConfigurationInternal.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration of Media streaming. */ -@Fluent -public final class MediaStreamingConfigurationInternal { - /* - * Transport URL for media streaming - */ - @JsonProperty(value = "transportUrl", required = true) - private String transportUrl; - - /* - * The type of transport to be used for media streaming, eg. Websocket - */ - @JsonProperty(value = "transportType", required = true) - private MediaStreamingTransportTypeInternal transportType; - - /* - * Content type to stream, eg. audio, audio/video - */ - @JsonProperty(value = "contentType", required = true) - private MediaStreamingContentTypeInternal contentType; - - /* - * Audio channel type to stream, eg. unmixed audio, mixed audio - */ - @JsonProperty(value = "audioChannelType", required = true) - private MediaStreamingAudioChannelTypeInternal audioChannelType; - - /** - * Get the transportUrl property: Transport URL for media streaming. - * - * @return the transportUrl value. - */ - public String getTransportUrl() { - return this.transportUrl; - } - - /** - * Set the transportUrl property: Transport URL for media streaming. - * - * @param transportUrl the transportUrl value to set. - * @return the MediaStreamingConfigurationInternal object itself. - */ - public MediaStreamingConfigurationInternal setTransportUrl(String transportUrl) { - this.transportUrl = transportUrl; - return this; - } - - /** - * Get the transportType property: The type of transport to be used for media streaming, eg. Websocket. - * - * @return the transportType value. - */ - public MediaStreamingTransportTypeInternal getTransportType() { - return this.transportType; - } - - /** - * Set the transportType property: The type of transport to be used for media streaming, eg. Websocket. - * - * @param transportType the transportType value to set. - * @return the MediaStreamingConfigurationInternal object itself. - */ - public MediaStreamingConfigurationInternal setTransportType(MediaStreamingTransportTypeInternal transportType) { - this.transportType = transportType; - return this; - } - - /** - * Get the contentType property: Content type to stream, eg. audio, audio/video. - * - * @return the contentType value. - */ - public MediaStreamingContentTypeInternal getContentType() { - return this.contentType; - } - - /** - * Set the contentType property: Content type to stream, eg. audio, audio/video. - * - * @param contentType the contentType value to set. - * @return the MediaStreamingConfigurationInternal object itself. - */ - public MediaStreamingConfigurationInternal setContentType(MediaStreamingContentTypeInternal contentType) { - this.contentType = contentType; - return this; - } - - /** - * Get the audioChannelType property: Audio channel type to stream, eg. unmixed audio, mixed audio. - * - * @return the audioChannelType value. - */ - public MediaStreamingAudioChannelTypeInternal getAudioChannelType() { - return this.audioChannelType; - } - - /** - * Set the audioChannelType property: Audio channel type to stream, eg. unmixed audio, mixed audio. - * - * @param audioChannelType the audioChannelType value to set. - * @return the MediaStreamingConfigurationInternal object itself. - */ - public MediaStreamingConfigurationInternal setAudioChannelType( - MediaStreamingAudioChannelTypeInternal audioChannelType) { - this.audioChannelType = audioChannelType; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingContentTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingContentTypeInternal.java deleted file mode 100644 index 1554ea125e58..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingContentTypeInternal.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MediaStreamingContentTypeInternal. */ -public final class MediaStreamingContentTypeInternal extends ExpandableStringEnum { - /** Static value audio for MediaStreamingContentTypeInternal. */ - public static final MediaStreamingContentTypeInternal AUDIO = fromString("audio"); - - /** - * Creates or finds a MediaStreamingContentTypeInternal from its string representation. - * - * @param name a name to look for. - * @return the corresponding MediaStreamingContentTypeInternal. - */ - @JsonCreator - public static MediaStreamingContentTypeInternal fromString(String name) { - return fromString(name, MediaStreamingContentTypeInternal.class); - } - - /** @return known MediaStreamingContentTypeInternal values. */ - public static Collection values() { - return values(MediaStreamingContentTypeInternal.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingTransportTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingTransportTypeInternal.java deleted file mode 100644 index 4bad8f6a8d5c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingTransportTypeInternal.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MediaStreamingTransportTypeInternal. */ -public final class MediaStreamingTransportTypeInternal - extends ExpandableStringEnum { - /** Static value websocket for MediaStreamingTransportTypeInternal. */ - public static final MediaStreamingTransportTypeInternal WEBSOCKET = fromString("websocket"); - - /** - * Creates or finds a MediaStreamingTransportTypeInternal from its string representation. - * - * @param name a name to look for. - * @return the corresponding MediaStreamingTransportTypeInternal. - */ - @JsonCreator - public static MediaStreamingTransportTypeInternal fromString(String name) { - return fromString(name, MediaStreamingTransportTypeInternal.class); - } - - /** @return known MediaStreamingTransportTypeInternal values. */ - public static Collection values() { - return values(MediaStreamingTransportTypeInternal.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsAppIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsAppIdentifierModel.java deleted file mode 100644 index b71df00dadbc..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsAppIdentifierModel.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A Microsoft Teams application. */ -@Fluent -public final class MicrosoftTeamsAppIdentifierModel { - /* - * The Id of the Microsoft Teams application. - */ - @JsonProperty(value = "appId", required = true) - private String appId; - - /* - * The cloud that the Microsoft Teams application belongs to. By default - * 'public' if missing. - */ - @JsonProperty(value = "cloud") - private CommunicationCloudEnvironmentModel cloud; - - /** - * Get the appId property: The Id of the Microsoft Teams application. - * - * @return the appId value. - */ - public String getAppId() { - return this.appId; - } - - /** - * Set the appId property: The Id of the Microsoft Teams application. - * - * @param appId the appId value to set. - * @return the MicrosoftTeamsAppIdentifierModel object itself. - */ - public MicrosoftTeamsAppIdentifierModel setAppId(String appId) { - this.appId = appId; - return this; - } - - /** - * Get the cloud property: The cloud that the Microsoft Teams application belongs to. By default 'public' if - * missing. - * - * @return the cloud value. - */ - public CommunicationCloudEnvironmentModel getCloud() { - return this.cloud; - } - - /** - * Set the cloud property: The cloud that the Microsoft Teams application belongs to. By default 'public' if - * missing. - * - * @param cloud the cloud value to set. - * @return the MicrosoftTeamsAppIdentifierModel object itself. - */ - public MicrosoftTeamsAppIdentifierModel setCloud(CommunicationCloudEnvironmentModel cloud) { - this.cloud = cloud; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsUserIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsUserIdentifierModel.java index 3ae62106d1a7..247d943ba1c3 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsUserIdentifierModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MicrosoftTeamsUserIdentifierModel.java @@ -11,26 +11,26 @@ @Fluent public final class MicrosoftTeamsUserIdentifierModel { /* - * The Id of the Microsoft Teams user. If not anonymous, this is the AAD - * object Id of the user. + * The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. */ @JsonProperty(value = "userId", required = true) private String userId; /* - * True if the Microsoft Teams user is anonymous. By default false if - * missing. + * True if the Microsoft Teams user is anonymous. By default false if missing. */ @JsonProperty(value = "isAnonymous") private Boolean isAnonymous; /* - * The cloud that the Microsoft Teams user belongs to. By default 'public' - * if missing. + * The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. */ @JsonProperty(value = "cloud") private CommunicationCloudEnvironmentModel cloud; + /** Creates an instance of MicrosoftTeamsUserIdentifierModel class. */ + public MicrosoftTeamsUserIdentifierModel() {} + /** * Get the userId property: The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the * user. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsRequestInternal.java index 3fbc9406dee8..54e77d5715ff 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsRequestInternal.java @@ -19,12 +19,14 @@ public final class MuteParticipantsRequestInternal { private List targetParticipants; /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. + * Used by customers when calling mid-call actions to correlate the request to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; + /** Creates an instance of MuteParticipantsRequestInternal class. */ + public MuteParticipantsRequestInternal() {} + /** * Get the targetParticipants property: Participants to be muted from the call. Only ACS Users are supported. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResponseInternal.java similarity index 77% rename from sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsResponseInternal.java rename to sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResponseInternal.java index 6b26134362d0..2832adb0924a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResponseInternal.java @@ -7,9 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The response payload for unmuting participants from the call. */ +/** The response payload for muting participants from the call. */ @Fluent -public final class UnmuteParticipantsResponseInternal { +public final class MuteParticipantsResponseInternal { /* * The operation context provided by client. */ @@ -29,9 +29,9 @@ public String getOperationContext() { * Set the operationContext property: The operation context provided by client. * * @param operationContext the operationContext value to set. - * @return the UnmuteParticipantsResponseInternal object itself. + * @return the MuteParticipantsResponseInternal object itself. */ - public UnmuteParticipantsResponseInternal setOperationContext(String operationContext) { + public MuteParticipantsResponseInternal setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java index 44b6504cbc8d..59c337267372 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MuteParticipantsResultInternal.java @@ -16,6 +16,9 @@ public final class MuteParticipantsResultInternal { @JsonProperty(value = "operationContext") private String operationContext; + /** Creates an instance of MuteParticipantsResultInternal class. */ + public MuteParticipantsResultInternal() {} + /** * Get the operationContext property: The operation context provided by client. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PhoneNumberIdentifierModel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PhoneNumberIdentifierModel.java index 29e7e249daa5..2ac970649476 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PhoneNumberIdentifierModel.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PhoneNumberIdentifierModel.java @@ -16,6 +16,9 @@ public final class PhoneNumberIdentifierModel { @JsonProperty(value = "value", required = true) private String value; + /** Creates an instance of PhoneNumberIdentifierModel class. */ + public PhoneNumberIdentifierModel() {} + /** * Get the value property: The phone number in E.164 format. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayOptionsInternal.java index 976d9e1f8aa9..9d7bed45f1c6 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayOptionsInternal.java @@ -16,12 +16,8 @@ public final class PlayOptionsInternal { @JsonProperty(value = "loop", required = true) private boolean loop; - /* - * If set play can barge into other existing queued-up/currently-processing - * requests. - */ - @JsonProperty(value = "interruptCallMediaOperation") - private Boolean interruptCallMediaOperation; + /** Creates an instance of PlayOptionsInternal class. */ + public PlayOptionsInternal() {} /** * Get the loop property: The option to play the provided audio source in loop when set to true. @@ -42,26 +38,4 @@ public PlayOptionsInternal setLoop(boolean loop) { this.loop = loop; return this; } - - /** - * Get the interruptCallMediaOperation property: If set play can barge into other existing - * queued-up/currently-processing requests. - * - * @return the interruptCallMediaOperation value. - */ - public Boolean isInterruptCallMediaOperation() { - return this.interruptCallMediaOperation; - } - - /** - * Set the interruptCallMediaOperation property: If set play can barge into other existing - * queued-up/currently-processing requests. - * - * @param interruptCallMediaOperation the interruptCallMediaOperation value to set. - * @return the PlayOptionsInternal object itself. - */ - public PlayOptionsInternal setInterruptCallMediaOperation(Boolean interruptCallMediaOperation) { - this.interruptCallMediaOperation = interruptCallMediaOperation; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayRequest.java index 87c70649e21c..cf3f339f33d0 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayRequest.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlayRequest.java @@ -37,14 +37,16 @@ public final class PlayRequest { private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. + * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be + * used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; + /** Creates an instance of PlayRequest class. */ + public PlayRequest() {} + /** * Get the playSources property: The source of the audio to be played. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceInternal.java index 1d112f984aa7..6e0b8c17accd 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceInternal.java @@ -35,12 +35,14 @@ public final class PlaySourceInternal { private TextSourceInternal text; /* - * Defines the ssml(Speech Synthesis Markup Language) source info to be - * used for play + * Defines the ssml(Speech Synthesis Markup Language) source info to be used for play */ @JsonProperty(value = "ssml") private SsmlSourceInternal ssml; + /** Creates an instance of PlaySourceInternal class. */ + public PlaySourceInternal() {} + /** * Get the kind property: Defines the type of the play source. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceTypeInternal.java index e94d5afd0320..38c4d94d5c64 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PlaySourceTypeInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for PlaySourceTypeInternal. */ +/** Defines the type of the play source. */ public final class PlaySourceTypeInternal extends ExpandableStringEnum { /** Static value file for PlaySourceTypeInternal. */ public static final PlaySourceTypeInternal FILE = fromString("file"); @@ -19,6 +19,14 @@ public final class PlaySourceTypeInternal extends ExpandableStringEnum values() { return values(PlaySourceTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java deleted file mode 100644 index 945a109bf0d2..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/PowerVirtualAgentsDialog.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Power Virtual Agents Dialog. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("PowerVirtualAgents") -@Fluent -public final class PowerVirtualAgentsDialog extends BaseDialog { - /* - * Bot identifier. - */ - @JsonProperty(value = "botAppId", required = true) - private String botAppId; - - /* - * Language. - */ - @JsonProperty(value = "language") - private String language; - - /** - * Get the botAppId property: Bot identifier. - * - * @return the botAppId value. - */ - public String getBotAppId() { - return this.botAppId; - } - - /** - * Set the botAppId property: Bot identifier. - * - * @param botAppId the botAppId value to set. - * @return the PowerVirtualAgentsDialog object itself. - */ - public PowerVirtualAgentsDialog setBotAppId(String botAppId) { - this.botAppId = botAppId; - return this; - } - - /** - * Get the language property: Language. - * - * @return the language value. - */ - public String getLanguage() { - return this.language; - } - - /** - * Set the language property: Language. - * - * @param language the language value to set. - * @return the PowerVirtualAgentsDialog object itself. - */ - public PowerVirtualAgentsDialog setLanguage(String language) { - this.language = language; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java index d2a967079384..f09d9681555b 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionChoiceInternal.java @@ -29,6 +29,9 @@ public final class RecognitionChoiceInternal { @JsonProperty(value = "tone") private DtmfToneInternal tone; + /** Creates an instance of RecognitionChoiceInternal class. */ + public RecognitionChoiceInternal() {} + /** * Get the label property: Identifier for a given choice. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionTypeInternal.java index cc38c2393bf3..e549b2dd764e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognitionTypeInternal.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecognitionTypeInternal. */ +/** + * Determines the sub-type of the recognize operation. In case of cancel operation the this field is not set and is + * returned empty. + */ public final class RecognitionTypeInternal extends ExpandableStringEnum { /** Static value dtmf for RecognitionTypeInternal. */ public static final RecognitionTypeInternal DTMF = fromString("dtmf"); @@ -19,6 +22,14 @@ public final class RecognitionTypeInternal extends ExpandableStringEnum values() { return values(RecognitionTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeInputTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeInputTypeInternal.java index 9ec0961787ef..e9f52ae11167 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeInputTypeInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeInputTypeInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecognizeInputTypeInternal. */ +/** Determines the type of the recognition. */ public final class RecognizeInputTypeInternal extends ExpandableStringEnum { /** Static value dtmf for RecognizeInputTypeInternal. */ public static final RecognizeInputTypeInternal DTMF = fromString("dtmf"); @@ -22,6 +22,14 @@ public final class RecognizeInputTypeInternal extends ExpandableStringEnum values() { return values(RecognizeInputTypeInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeOptionsInternal.java index a2aebfd1dabf..a93a38a06252 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeOptionsInternal.java @@ -59,6 +59,9 @@ public final class RecognizeOptionsInternal { @JsonProperty(value = "speechOptions") private SpeechOptionsInternal speechOptions; + /** Creates an instance of RecognizeOptionsInternal class. */ + public RecognizeOptionsInternal() {} + /** * Get the interruptPrompt property: Determines if we interrupt the prompt and start recognizing. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeRequest.java index f0dbaa776d17..8fc2d25f1346 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeRequest.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecognizeRequest.java @@ -23,8 +23,7 @@ public final class RecognizeRequest { private PlaySourceInternal playPrompt; /* - * If set recognize can barge into other existing - * queued-up/currently-processing requests. + * If set recognize can barge into other existing queued-up/currently-processing requests. */ @JsonProperty(value = "interruptCallMediaOperation") private Boolean interruptCallMediaOperation; @@ -42,14 +41,16 @@ public final class RecognizeRequest { private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. + * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be + * used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; + /** Creates an instance of RecognizeRequest class. */ + public RecognizeRequest() {} + /** * Get the recognizeInputType property: Determines the type of the recognition. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingChannelInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingChannelInternal.java index 7bc685488a2a..baf0473bc189 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingChannelInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingChannelInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecordingChannelInternal. */ +/** The channel type of call recording. */ public final class RecordingChannelInternal extends ExpandableStringEnum { /** Static value mixed for RecordingChannelInternal. */ public static final RecordingChannelInternal MIXED = fromString("mixed"); @@ -16,6 +16,14 @@ public final class RecordingChannelInternal extends ExpandableStringEnum values() { return values(RecordingChannelInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingContentInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingContentInternal.java index 929ba38b8cff..2374534bbb30 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingContentInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingContentInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecordingContentInternal. */ +/** The content type of call recording. */ public final class RecordingContentInternal extends ExpandableStringEnum { /** Static value audio for RecordingContentInternal. */ public static final RecordingContentInternal AUDIO = fromString("audio"); @@ -16,6 +16,14 @@ public final class RecordingContentInternal extends ExpandableStringEnum values() { return values(RecordingContentInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingFormatInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingFormatInternal.java index 9bb0859bafbe..3fe01dd93b39 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingFormatInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingFormatInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RecordingFormatInternal. */ +/** The format type of call recording. */ public final class RecordingFormatInternal extends ExpandableStringEnum { /** Static value wav for RecordingFormatInternal. */ public static final RecordingFormatInternal WAV = fromString("wav"); @@ -19,6 +19,14 @@ public final class RecordingFormatInternal extends ExpandableStringEnum values() { return values(RecordingFormatInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateInternal.java index 0e87ac073cf6..ede52d8ae49d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateInternal.java @@ -16,6 +16,14 @@ public final class RecordingStateInternal extends ExpandableStringEnum values() { return values(RecordingStateInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateResponseInternal.java index 5aa4c7cc30a5..9ccffca282d4 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStateResponseInternal.java @@ -22,11 +22,8 @@ public final class RecordingStateResponseInternal { @JsonProperty(value = "recordingState") private RecordingStateInternal recordingState; - /* - * The recordingType property. - */ - @JsonProperty(value = "recordingType") - private RecordingType recordingType; + /** Creates an instance of RecordingStateResponseInternal class. */ + public RecordingStateResponseInternal() {} /** * Get the recordingId property: The recordingId property. @@ -67,24 +64,4 @@ public RecordingStateResponseInternal setRecordingState(RecordingStateInternal r this.recordingState = recordingState; return this; } - - /** - * Get the recordingType property: The recordingType property. - * - * @return the recordingType value. - */ - public RecordingType getRecordingType() { - return this.recordingType; - } - - /** - * Set the recordingType property: The recordingType property. - * - * @param recordingType the recordingType value to set. - * @return the RecordingStateResponseInternal object itself. - */ - public RecordingStateResponseInternal setRecordingType(RecordingType recordingType) { - this.recordingType = recordingType; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStorageTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStorageTypeInternal.java deleted file mode 100644 index 2683f83ac474..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingStorageTypeInternal.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RecordingStorageTypeInternal. */ -public final class RecordingStorageTypeInternal extends ExpandableStringEnum { - /** Static value acs for RecordingStorageTypeInternal. */ - public static final RecordingStorageTypeInternal ACS = fromString("acs"); - - /** Static value blobStorage for RecordingStorageTypeInternal. */ - public static final RecordingStorageTypeInternal BLOB_STORAGE = fromString("blobStorage"); - - /** - * Creates or finds a RecordingStorageTypeInternal from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecordingStorageTypeInternal. - */ - @JsonCreator - public static RecordingStorageTypeInternal fromString(String name) { - return fromString(name, RecordingStorageTypeInternal.class); - } - - /** @return known RecordingStorageTypeInternal values. */ - public static Collection values() { - return values(RecordingStorageTypeInternal.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingType.java deleted file mode 100644 index 0ce3c7247aec..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RecordingType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RecordingType. */ -public final class RecordingType extends ExpandableStringEnum { - /** Static value acs for RecordingType. */ - public static final RecordingType ACS = fromString("acs"); - - /** Static value teams for RecordingType. */ - public static final RecordingType TEAMS = fromString("teams"); - - /** Static value teamsCompliance for RecordingType. */ - public static final RecordingType TEAMS_COMPLIANCE = fromString("teamsCompliance"); - - /** - * Creates or finds a RecordingType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecordingType. - */ - @JsonCreator - public static RecordingType fromString(String name) { - return fromString(name, RecordingType.class); - } - - /** @return known RecordingType values. */ - public static Collection values() { - return values(RecordingType.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RedirectCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RedirectCallRequestInternal.java index 3b125f660417..d68cae30aa61 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RedirectCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RedirectCallRequestInternal.java @@ -22,11 +22,8 @@ public final class RedirectCallRequestInternal { @JsonProperty(value = "target", required = true) private CommunicationIdentifierModel target; - /* - * Used by customer to send custom calling context to targets - */ - @JsonProperty(value = "customCallingContext") - private CustomCallingContext customCallingContext; + /** Creates an instance of RedirectCallRequestInternal class. */ + public RedirectCallRequestInternal() {} /** * Get the incomingCallContext property: The context associated with the call. @@ -67,24 +64,4 @@ public RedirectCallRequestInternal setTarget(CommunicationIdentifierModel target this.target = target; return this; } - - /** - * Get the customCallingContext property: Used by customer to send custom calling context to targets. - * - * @return the customCallingContext value. - */ - public CustomCallingContext getCustomCallingContext() { - return this.customCallingContext; - } - - /** - * Set the customCallingContext property: Used by customer to send custom calling context to targets. - * - * @param customCallingContext the customCallingContext value to set. - * @return the RedirectCallRequestInternal object itself. - */ - public RedirectCallRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { - this.customCallingContext = customCallingContext; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RejectCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RejectCallRequestInternal.java index b315242b2382..4afe1a5b8c09 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RejectCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RejectCallRequestInternal.java @@ -22,6 +22,9 @@ public final class RejectCallRequestInternal { @JsonProperty(value = "callRejectReason") private CallRejectReasonInternal callRejectReason; + /** Creates an instance of RejectCallRequestInternal class. */ + public RejectCallRequestInternal() {} + /** * Get the incomingCallContext property: The context associated with the call. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantFailed.java index c49d55435519..7c764ae81ea9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantFailed.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantFailed.java @@ -4,49 +4,112 @@ package com.azure.communication.callautomation.implementation.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** The failed to remove participant event. */ -@Immutable +@Fluent public final class RemoveParticipantFailed { /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. + * Call connection ID. + */ + @JsonProperty(value = "callConnectionId") + private String callConnectionId; + + /* + * Server call ID. */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "serverCallId") + private String serverCallId; + + /* + * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /* + * Used by customers when calling mid-call actions to correlate the request to the response event. + */ + @JsonProperty(value = "operationContext") private String operationContext; /* * Contains the resulting SIP code, sub-code and message. */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "resultInformation") private ResultInformation resultInformation; /* * Participant */ - @JsonProperty(value = "participant", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "participant") private CommunicationIdentifierModel participant; - /* - * Call connection ID. + /** Creates an instance of RemoveParticipantFailed class. */ + public RemoveParticipantFailed() {} + + /** + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; + public String getCallConnectionId() { + return this.callConnectionId; + } - /* - * Server call ID. + /** + * Set the callConnectionId property: Call connection ID. + * + * @param callConnectionId the callConnectionId value to set. + * @return the RemoveParticipantFailed object itself. */ - @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) - private String serverCallId; + public RemoveParticipantFailed setCallConnectionId(String callConnectionId) { + this.callConnectionId = callConnectionId; + return this; + } - /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. + /** + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Set the serverCallId property: Server call ID. + * + * @param serverCallId the serverCallId value to set. + * @return the RemoveParticipantFailed object itself. + */ + public RemoveParticipantFailed setServerCallId(String serverCallId) { + this.serverCallId = serverCallId; + return this; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @param correlationId the correlationId value to set. + * @return the RemoveParticipantFailed object itself. + */ + public RemoveParticipantFailed setCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to @@ -59,48 +122,54 @@ public String getOperationContext() { } /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. * - * @return the resultInformation value. + * @param operationContext the operationContext value to set. + * @return the RemoveParticipantFailed object itself. */ - public ResultInformation getResultInformation() { - return this.resultInformation; + public RemoveParticipantFailed setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; } /** - * Get the participant property: Participant. + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. * - * @return the participant value. + * @return the resultInformation value. */ - public CommunicationIdentifierModel getParticipant() { - return this.participant; + public ResultInformation getResultInformation() { + return this.resultInformation; } /** - * Get the callConnectionId property: Call connection ID. + * Set the resultInformation property: Contains the resulting SIP code, sub-code and message. * - * @return the callConnectionId value. + * @param resultInformation the resultInformation value to set. + * @return the RemoveParticipantFailed object itself. */ - public String getCallConnectionId() { - return this.callConnectionId; + public RemoveParticipantFailed setResultInformation(ResultInformation resultInformation) { + this.resultInformation = resultInformation; + return this; } /** - * Get the serverCallId property: Server call ID. + * Get the participant property: Participant. * - * @return the serverCallId value. + * @return the participant value. */ - public String getServerCallId() { - return this.serverCallId; + public CommunicationIdentifierModel getParticipant() { + return this.participant; } /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. + * Set the participant property: Participant. * - * @return the correlationId value. + * @param participant the participant value to set. + * @return the RemoveParticipantFailed object itself. */ - public String getCorrelationId() { - return this.correlationId; + public RemoveParticipantFailed setParticipant(CommunicationIdentifierModel participant) { + this.participant = participant; + return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantRequestInternal.java index de78413ebbdb..920801ad9a43 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantRequestInternal.java @@ -17,21 +17,22 @@ public final class RemoveParticipantRequestInternal { private CommunicationIdentifierModel participantToRemove; /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. + * Used by customers when calling mid-call actions to correlate the request to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. + * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be + * used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; + /** Creates an instance of RemoveParticipantRequestInternal class. */ + public RemoveParticipantRequestInternal() {} + /** * Get the participantToRemove property: The participants to be removed from the call. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantResponseInternal.java index ac1747ed3cba..6eb813eb8a9a 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantResponseInternal.java @@ -16,6 +16,9 @@ public final class RemoveParticipantResponseInternal { @JsonProperty(value = "operationContext") private String operationContext; + /** Creates an instance of RemoveParticipantResponseInternal class. */ + public RemoveParticipantResponseInternal() {} + /** * Get the operationContext property: The operation context provided by client. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantSucceeded.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantSucceeded.java index 2a1ea8af4fb4..edb2a2bd5435 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantSucceeded.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/RemoveParticipantSucceeded.java @@ -4,49 +4,112 @@ package com.azure.communication.callautomation.implementation.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** The participant removed event. */ -@Immutable +@Fluent public final class RemoveParticipantSucceeded { /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. + * Call connection ID. + */ + @JsonProperty(value = "callConnectionId") + private String callConnectionId; + + /* + * Server call ID. */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "serverCallId") + private String serverCallId; + + /* + * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /* + * Used by customers when calling mid-call actions to correlate the request to the response event. + */ + @JsonProperty(value = "operationContext") private String operationContext; /* * Contains the resulting SIP code, sub-code and message. */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "resultInformation") private ResultInformation resultInformation; /* * Participant */ - @JsonProperty(value = "participant", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "participant") private CommunicationIdentifierModel participant; - /* - * Call connection ID. + /** Creates an instance of RemoveParticipantSucceeded class. */ + public RemoveParticipantSucceeded() {} + + /** + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; + public String getCallConnectionId() { + return this.callConnectionId; + } - /* - * Server call ID. + /** + * Set the callConnectionId property: Call connection ID. + * + * @param callConnectionId the callConnectionId value to set. + * @return the RemoveParticipantSucceeded object itself. */ - @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) - private String serverCallId; + public RemoveParticipantSucceeded setCallConnectionId(String callConnectionId) { + this.callConnectionId = callConnectionId; + return this; + } - /* - * Correlation ID for event to call correlation. Also called ChainId for - * skype chain ID. + /** + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Set the serverCallId property: Server call ID. + * + * @param serverCallId the serverCallId value to set. + * @return the RemoveParticipantSucceeded object itself. + */ + public RemoveParticipantSucceeded setServerCallId(String serverCallId) { + this.serverCallId = serverCallId; + return this; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @param correlationId the correlationId value to set. + * @return the RemoveParticipantSucceeded object itself. + */ + public RemoveParticipantSucceeded setCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to @@ -59,48 +122,54 @@ public String getOperationContext() { } /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. * - * @return the resultInformation value. + * @param operationContext the operationContext value to set. + * @return the RemoveParticipantSucceeded object itself. */ - public ResultInformation getResultInformation() { - return this.resultInformation; + public RemoveParticipantSucceeded setOperationContext(String operationContext) { + this.operationContext = operationContext; + return this; } /** - * Get the participant property: Participant. + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. * - * @return the participant value. + * @return the resultInformation value. */ - public CommunicationIdentifierModel getParticipant() { - return this.participant; + public ResultInformation getResultInformation() { + return this.resultInformation; } /** - * Get the callConnectionId property: Call connection ID. + * Set the resultInformation property: Contains the resulting SIP code, sub-code and message. * - * @return the callConnectionId value. + * @param resultInformation the resultInformation value to set. + * @return the RemoveParticipantSucceeded object itself. */ - public String getCallConnectionId() { - return this.callConnectionId; + public RemoveParticipantSucceeded setResultInformation(ResultInformation resultInformation) { + this.resultInformation = resultInformation; + return this; } /** - * Get the serverCallId property: Server call ID. + * Get the participant property: Participant. * - * @return the serverCallId value. + * @return the participant value. */ - public String getServerCallId() { - return this.serverCallId; + public CommunicationIdentifierModel getParticipant() { + return this.participant; } /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain - * ID. + * Set the participant property: Participant. * - * @return the correlationId value. + * @param participant the participant value to set. + * @return the RemoveParticipantSucceeded object itself. */ - public String getCorrelationId() { - return this.correlationId; + public RemoveParticipantSucceeded setParticipant(CommunicationIdentifierModel participant) { + this.participant = participant; + return this; } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ResultInformation.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ResultInformation.java index 3063d5149440..8d82a5065cc2 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ResultInformation.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/ResultInformation.java @@ -11,15 +11,15 @@ @Fluent public final class ResultInformation { /* - * Code of the current result. This can be helpful to Call Automation team - * to troubleshoot the issue if this result was unexpected. + * Code of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this result + * was unexpected. */ @JsonProperty(value = "code") private Integer code; /* - * Subcode of the current result. This can be helpful to Call Automation - * team to troubleshoot the issue if this result was unexpected. + * Subcode of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this + * result was unexpected. */ @JsonProperty(value = "subCode") private Integer subCode; @@ -30,6 +30,9 @@ public final class ResultInformation { @JsonProperty(value = "message") private String message; + /** Creates an instance of ResultInformation class. */ + public ResultInformation() {} + /** * Get the code property: Code of the current result. This can be helpful to Call Automation team to troubleshoot * the issue if this result was unexpected. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java index d832241bc417..87af6501b8ca 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesRequestInternal.java @@ -30,14 +30,16 @@ public final class SendDtmfTonesRequestInternal { private String operationContext; /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. + * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be + * used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; + /** Creates an instance of SendDtmfTonesRequestInternal class. */ + public SendDtmfTonesRequestInternal() {} + /** * Get the tones property: List of tones to be sent to target participant. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java index 77b4ac25567a..76daec05e7dd 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SendDtmfTonesResultInternal.java @@ -16,6 +16,9 @@ public final class SendDtmfTonesResultInternal { @JsonProperty(value = "operationContext") private String operationContext; + /** Creates an instance of SendDtmfTonesResultInternal class. */ + public SendDtmfTonesResultInternal() {} + /** * Get the operationContext property: The operation context provided by client. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptions.java new file mode 100644 index 000000000000..db9f25d5a06a --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptions.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Options for continuous speech recognition. */ +@Fluent +public final class SpeechOptions { + /* + * The length of end silence when user stops speaking and cogservice send response. + */ + @JsonProperty(value = "endSilenceTimeoutInMs") + private Long endSilenceTimeoutInMs; + + /** Creates an instance of SpeechOptions class. */ + public SpeechOptions() {} + + /** + * Get the endSilenceTimeoutInMs property: The length of end silence when user stops speaking and cogservice send + * response. + * + * @return the endSilenceTimeoutInMs value. + */ + public Long getEndSilenceTimeoutInMs() { + return this.endSilenceTimeoutInMs; + } + + /** + * Set the endSilenceTimeoutInMs property: The length of end silence when user stops speaking and cogservice send + * response. + * + * @param endSilenceTimeoutInMs the endSilenceTimeoutInMs value to set. + * @return the SpeechOptions object itself. + */ + public SpeechOptions setEndSilenceTimeoutInMs(Long endSilenceTimeoutInMs) { + this.endSilenceTimeoutInMs = endSilenceTimeoutInMs; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptionsInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptionsInternal.java index 1a1a9f084f09..df7398d61497 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptionsInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechOptionsInternal.java @@ -11,12 +11,14 @@ @Fluent public final class SpeechOptionsInternal { /* - * The length of end silence when user stops speaking and cogservice send - * response. + * The length of end silence when user stops speaking and cogservice send response. */ @JsonProperty(value = "endSilenceTimeoutInMs") private Long endSilenceTimeoutInMs; + /** Creates an instance of SpeechOptionsInternal class. */ + public SpeechOptionsInternal() {} + /** * Get the endSilenceTimeoutInMs property: The length of end silence when user stops speaking and cogservice send * response. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResult.java new file mode 100644 index 000000000000..4db6c4735835 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResult.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The speech status as a result. */ +@Fluent +public final class SpeechResult { + /* + * The recognized speech in string. + */ + @JsonProperty(value = "speech") + private String speech; + + /** Creates an instance of SpeechResult class. */ + public SpeechResult() {} + + /** + * Get the speech property: The recognized speech in string. + * + * @return the speech value. + */ + public String getSpeech() { + return this.speech; + } + + /** + * Set the speech property: The recognized speech in string. + * + * @param speech the speech value to set. + * @return the SpeechResult object itself. + */ + public SpeechResult setSpeech(String speech) { + this.speech = speech; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResultInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResultInternal.java index b6fe3782b804..58ed0b60a7a1 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResultInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SpeechResultInternal.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The speech recognition status as a result. */ +/** The speech status as a result. */ @Fluent public final class SpeechResultInternal { /* @@ -16,6 +16,9 @@ public final class SpeechResultInternal { @JsonProperty(value = "speech") private String speech; + /** Creates an instance of SpeechResultInternal class. */ + public SpeechResultInternal() {} + /** * Get the speech property: The recognized speech in string. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSourceInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSourceInternal.java index 80f99a142b29..0be02732e5b1 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSourceInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/SsmlSourceInternal.java @@ -22,6 +22,9 @@ public final class SsmlSourceInternal { @JsonProperty(value = "customVoiceEndpointId") private String customVoiceEndpointId; + /** Creates an instance of SsmlSourceInternal class. */ + public SsmlSourceInternal() {} + /** * Get the ssmlText property: Ssml string for the cognitive service to be played. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartCallRecordingRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartCallRecordingRequestInternal.java index cefffe2baa74..a9bcef5bb054 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartCallRecordingRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/StartCallRecordingRequestInternal.java @@ -42,41 +42,26 @@ public final class StartCallRecordingRequestInternal { private RecordingFormatInternal recordingFormatType; /* - * The sequential order in which audio channels are assigned to - * participants in the unmixed recording. - * When 'recordingChannelType' is set to 'unmixed' and - * `audioChannelParticipantOrdering is not specified, - * the audio channel to participant mapping will be automatically assigned - * based on the order in which participant - * first audio was detected. Channel to participant mapping details can be - * found in the metadata of the recording. + * The sequential order in which audio channels are assigned to participants in the unmixed recording. + * When 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not specified, + * the audio channel to participant mapping will be automatically assigned based on the order in which participant + * first audio was detected. Channel to participant mapping details can be found in the metadata of the recording. */ @JsonProperty(value = "audioChannelParticipantOrdering") private List audioChannelParticipantOrdering; /* * The channel affinity of call recording - * When 'recordingChannelType' is set to 'unmixed', if channelAffinity is - * not specified, 'channel' will be automatically assigned. - * Channel-Participant mapping details can be found in the metadata of the - * recording. + * When 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be + * automatically assigned. + * Channel-Participant mapping details can be found in the metadata of the recording. * /// */ @JsonProperty(value = "channelAffinity") private List channelAffinity; - /* - * Optional property to specify location where recording will be stored - */ - @JsonProperty(value = "externalStorage") - private ExternalStorageInternal externalStorage; - - /* - * When set to true will start recording in Pause mode, which could be - * resumed. - */ - @JsonProperty(value = "pauseOnStart") - private Boolean pauseOnStart; + /** Creates an instance of StartCallRecordingRequestInternal class. */ + public StartCallRecordingRequestInternal() {} /** * Get the callLocator property: The call locator. @@ -230,44 +215,4 @@ public StartCallRecordingRequestInternal setChannelAffinity(List { - /** Static value transcriptionStarted for TranscriptionStatus. */ - public static final TranscriptionStatus TRANSCRIPTION_STARTED = fromString("transcriptionStarted"); - - /** Static value transcriptionFailed for TranscriptionStatus. */ - public static final TranscriptionStatus TRANSCRIPTION_FAILED = fromString("transcriptionFailed"); - - /** Static value transcriptionResumed for TranscriptionStatus. */ - public static final TranscriptionStatus TRANSCRIPTION_RESUMED = fromString("transcriptionResumed"); - - /** Static value transcriptionUpdated for TranscriptionStatus. */ - public static final TranscriptionStatus TRANSCRIPTION_UPDATED = fromString("transcriptionUpdated"); - - /** Static value transcriptionStopped for TranscriptionStatus. */ - public static final TranscriptionStatus TRANSCRIPTION_STOPPED = fromString("transcriptionStopped"); - - /** Static value unspecifiedError for TranscriptionStatus. */ - public static final TranscriptionStatus UNSPECIFIED_ERROR = fromString("unspecifiedError"); - - /** - * Creates or finds a TranscriptionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding TranscriptionStatus. - */ - @JsonCreator - public static TranscriptionStatus fromString(String name) { - return fromString(name, TranscriptionStatus.class); - } - - /** @return known TranscriptionStatus values. */ - public static Collection values() { - return values(TranscriptionStatus.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStatusDetails.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStatusDetails.java deleted file mode 100644 index 0b7fbc20a1d5..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStatusDetails.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TranscriptionStatusDetails. */ -public final class TranscriptionStatusDetails extends ExpandableStringEnum { - /** Static value subscriptionStarted for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails SUBSCRIPTION_STARTED = fromString("subscriptionStarted"); - - /** Static value streamConnectionReestablished for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_REESTABLISHED = - fromString("streamConnectionReestablished"); - - /** Static value streamConnectionUnsuccessful for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_UNSUCCESSFUL = - fromString("streamConnectionUnsuccessful"); - - /** Static value streamUrlMissing for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails STREAM_URL_MISSING = fromString("streamUrlMissing"); - - /** Static value serviceShutdown for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails SERVICE_SHUTDOWN = fromString("serviceShutdown"); - - /** Static value streamConnectionInterrupted for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_INTERRUPTED = - fromString("streamConnectionInterrupted"); - - /** Static value speechServicesConnectionError for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails SPEECH_SERVICES_CONNECTION_ERROR = - fromString("speechServicesConnectionError"); - - /** Static value subscriptionStopped for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails SUBSCRIPTION_STOPPED = fromString("subscriptionStopped"); - - /** Static value unspecifiedError for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails UNSPECIFIED_ERROR = fromString("unspecifiedError"); - - /** Static value authenticationFailure for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails AUTHENTICATION_FAILURE = fromString("authenticationFailure"); - - /** Static value badRequest for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails BAD_REQUEST = fromString("badRequest"); - - /** Static value tooManyRequests for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails TOO_MANY_REQUESTS = fromString("tooManyRequests"); - - /** Static value forbidden for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails FORBIDDEN = fromString("forbidden"); - - /** Static value serviceTimeout for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails SERVICE_TIMEOUT = fromString("serviceTimeout"); - - /** Static value transcriptionLocaleUpdated for TranscriptionStatusDetails. */ - public static final TranscriptionStatusDetails TRANSCRIPTION_LOCALE_UPDATED = - fromString("transcriptionLocaleUpdated"); - - /** - * Creates or finds a TranscriptionStatusDetails from its string representation. - * - * @param name a name to look for. - * @return the corresponding TranscriptionStatusDetails. - */ - @JsonCreator - public static TranscriptionStatusDetails fromString(String name) { - return fromString(name, TranscriptionStatusDetails.class); - } - - /** @return known TranscriptionStatusDetails values. */ - public static Collection values() { - return values(TranscriptionStatusDetails.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStopped.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStopped.java deleted file mode 100644 index 045b51b3ac1e..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionStopped.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionStopped model. - */ -@Immutable -public final class TranscriptionStopped { - /* - * Used by customers when calling mid-call actions to correlate the request to the response event. - */ - @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) - private String operationContext; - - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Defines the result for TranscriptionUpdate with the current status and the details about the status - */ - @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) - private TranscriptionUpdate transcriptionUpdate; - - /* - * Call connection ID. - */ - @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) - private String callConnectionId; - - /* - * Server call ID. - */ - @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) - private String serverCallId; - - /* - * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - */ - @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) - private String correlationId; - - /** - * Creates an instance of TranscriptionStopped class. - */ - public TranscriptionStopped() { - } - - /** - * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the transcriptionUpdate property: Defines the result for TranscriptionUpdate with the current status and the - * details about the status. - * - * @return the transcriptionUpdate value. - */ - public TranscriptionUpdate getTranscriptionUpdate() { - return this.transcriptionUpdate; - } - - /** - * Get the callConnectionId property: Call connection ID. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return this.callConnectionId; - } - - /** - * Get the serverCallId property: Server call ID. - * - * @return the serverCallId value. - */ - public String getServerCallId() { - return this.serverCallId; - } - - /** - * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype - * chain ID. - * - * @return the correlationId value. - */ - public String getCorrelationId() { - return this.correlationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportTypeInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportTypeInternal.java deleted file mode 100644 index 187ec369569f..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionTransportTypeInternal.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TranscriptionTransportTypeInternal. */ -public final class TranscriptionTransportTypeInternal extends ExpandableStringEnum { - /** Static value websocket for TranscriptionTransportTypeInternal. */ - public static final TranscriptionTransportTypeInternal WEBSOCKET = fromString("websocket"); - - /** - * Creates or finds a TranscriptionTransportTypeInternal from its string representation. - * - * @param name a name to look for. - * @return the corresponding TranscriptionTransportTypeInternal. - */ - @JsonCreator - public static TranscriptionTransportTypeInternal fromString(String name) { - return fromString(name, TranscriptionTransportTypeInternal.class); - } - - /** @return known TranscriptionTransportTypeInternal values. */ - public static Collection values() { - return values(TranscriptionTransportTypeInternal.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdate.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdate.java deleted file mode 100644 index 4996247fbfb7..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TranscriptionUpdate.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The TranscriptionUpdate model. */ -@Fluent -public final class TranscriptionUpdate { - /* - * The transcriptionStatus property. - */ - @JsonProperty(value = "transcriptionStatus") - private TranscriptionStatus transcriptionStatus; - - /* - * The transcriptionStatusDetails property. - */ - @JsonProperty(value = "transcriptionStatusDetails") - private TranscriptionStatusDetails transcriptionStatusDetails; - - /** - * Get the transcriptionStatus property: The transcriptionStatus property. - * - * @return the transcriptionStatus value. - */ - public TranscriptionStatus getTranscriptionStatus() { - return this.transcriptionStatus; - } - - /** - * Set the transcriptionStatus property: The transcriptionStatus property. - * - * @param transcriptionStatus the transcriptionStatus value to set. - * @return the TranscriptionUpdate object itself. - */ - public TranscriptionUpdate setTranscriptionStatus(TranscriptionStatus transcriptionStatus) { - this.transcriptionStatus = transcriptionStatus; - return this; - } - - /** - * Get the transcriptionStatusDetails property: The transcriptionStatusDetails property. - * - * @return the transcriptionStatusDetails value. - */ - public TranscriptionStatusDetails getTranscriptionStatusDetails() { - return this.transcriptionStatusDetails; - } - - /** - * Set the transcriptionStatusDetails property: The transcriptionStatusDetails property. - * - * @param transcriptionStatusDetails the transcriptionStatusDetails value to set. - * @return the TranscriptionUpdate object itself. - */ - public TranscriptionUpdate setTranscriptionStatusDetails(TranscriptionStatusDetails transcriptionStatusDetails) { - this.transcriptionStatusDetails = transcriptionStatusDetails; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferCallResponseInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferCallResponseInternal.java index a62c8d7ba903..c93bcaa69710 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferCallResponseInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferCallResponseInternal.java @@ -16,6 +16,9 @@ public final class TransferCallResponseInternal { @JsonProperty(value = "operationContext") private String operationContext; + /** Creates an instance of TransferCallResponseInternal class. */ + public TransferCallResponseInternal() {} + /** * Get the operationContext property: The operation context provided by client. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToParticipantRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToParticipantRequestInternal.java index cfd9adeb8794..e96efd08afac 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToParticipantRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/TransferToParticipantRequestInternal.java @@ -17,14 +17,7 @@ public final class TransferToParticipantRequestInternal { private CommunicationIdentifierModel targetParticipant; /* - * Used by customer to send custom calling context to targets - */ - @JsonProperty(value = "customCallingContext") - private CustomCallingContext customCallingContext; - - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. + * Used by customers when calling mid-call actions to correlate the request to the response event. */ @JsonProperty(value = "operationContext") private String operationContext; @@ -36,14 +29,22 @@ public final class TransferToParticipantRequestInternal { private CommunicationIdentifierModel transferee; /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. + * Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be + * used. */ @JsonProperty(value = "operationCallbackUri") private String operationCallbackUri; + /* + * Used by customer to send custom calling context to targets + */ + @JsonProperty(value = "customCallingContext") + private CustomCallingContext customCallingContext; + + /** Creates an instance of TransferToParticipantRequestInternal class. */ + public TransferToParticipantRequestInternal() {} + /** * Get the targetParticipant property: The identity of the target where call should be transferred to. * @@ -64,26 +65,6 @@ public TransferToParticipantRequestInternal setTargetParticipant(CommunicationId return this; } - /** - * Get the customCallingContext property: Used by customer to send custom calling context to targets. - * - * @return the customCallingContext value. - */ - public CustomCallingContext getCustomCallingContext() { - return this.customCallingContext; - } - - /** - * Set the customCallingContext property: Used by customer to send custom calling context to targets. - * - * @param customCallingContext the customCallingContext value to set. - * @return the TransferToParticipantRequestInternal object itself. - */ - public TransferToParticipantRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { - this.customCallingContext = customCallingContext; - return this; - } - /** * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to * the response event. @@ -149,4 +130,24 @@ public TransferToParticipantRequestInternal setOperationCallbackUri(String opera this.operationCallbackUri = operationCallbackUri; return this; } + + /** + * Get the customCallingContext property: Used by customer to send custom calling context to targets. + * + * @return the customCallingContext value. + */ + public CustomCallingContext getCustomCallingContext() { + return this.customCallingContext; + } + + /** + * Set the customCallingContext property: Used by customer to send custom calling context to targets. + * + * @param customCallingContext the customCallingContext value to set. + * @return the TransferToParticipantRequestInternal object itself. + */ + public TransferToParticipantRequestInternal setCustomCallingContext(CustomCallingContext customCallingContext) { + this.customCallingContext = customCallingContext; + return this; + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsRequestInternal.java deleted file mode 100644 index 112653a62c30..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UnmuteParticipantsRequestInternal.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The request payload for unmuting participant from the call. */ -@Fluent -public final class UnmuteParticipantsRequestInternal { - /* - * Participants to be unmuted from the call. - * Only ACS Users are supported. - */ - @JsonProperty(value = "targetParticipants", required = true) - private List targetParticipants; - - /* - * Used by customers when calling mid-call actions to correlate the request - * to the response event. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /** - * Get the targetParticipants property: Participants to be unmuted from the call. Only ACS Users are supported. - * - * @return the targetParticipants value. - */ - public List getTargetParticipants() { - return this.targetParticipants; - } - - /** - * Set the targetParticipants property: Participants to be unmuted from the call. Only ACS Users are supported. - * - * @param targetParticipants the targetParticipants value to set. - * @return the UnmuteParticipantsRequestInternal object itself. - */ - public UnmuteParticipantsRequestInternal setTargetParticipants( - List targetParticipants) { - this.targetParticipants = targetParticipants; - return this; - } - - /** - * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Set the operationContext property: Used by customers when calling mid-call actions to correlate the request to - * the response event. - * - * @param operationContext the operationContext value to set. - * @return the UnmuteParticipantsRequestInternal object itself. - */ - public UnmuteParticipantsRequestInternal setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateDialogRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateDialogRequest.java deleted file mode 100644 index 5b5e49b5ce17..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateDialogRequest.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The UpdateDialogRequest model. */ -@Fluent -public final class UpdateDialogRequest { - /* - * Dialog context. - */ - @JsonProperty(value = "dialog", required = true) - private DialogUpdateBase dialog; - - /* - * Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. - * This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. - */ - @JsonProperty(value = "operationCallbackUri") - private String operationCallbackUri; - - /* - * The value to identify context of the operation. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - /** - * Get the dialog property: Dialog context. - * - * @return the dialog value. - */ - public DialogUpdateBase getDialog() { - return this.dialog; - } - - /** - * Set the dialog property: Dialog context. - * - * @param dialog the dialog value to set. - * @return the UpdateDialogRequest object itself. - */ - public UpdateDialogRequest setDialog(DialogUpdateBase dialog) { - this.dialog = dialog; - return this; - } - - /** - * Get the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. - * - * @return the operationCallbackUri value. - */ - public String getOperationCallbackUri() { - return this.operationCallbackUri; - } - - /** - * Set the operationCallbackUri property: Set a callback URI that overrides the default callback URI set by - * CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI - * set by CreateCall/AnswerCall will be used. - * - * @param operationCallbackUri the operationCallbackUri value to set. - * @return the UpdateDialogRequest object itself. - */ - public UpdateDialogRequest setOperationCallbackUri(String operationCallbackUri) { - this.operationCallbackUri = operationCallbackUri; - return this; - } - - /** - * Get the operationContext property: The value to identify context of the operation. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } - - /** - * Set the operationContext property: The value to identify context of the operation. - * - * @param operationContext the operationContext value to set. - * @return the UpdateDialogRequest object itself. - */ - public UpdateDialogRequest setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequest.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequest.java deleted file mode 100644 index 001dc971d064..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequest.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The UpdateTranscriptionRequest model. - */ -@Fluent -public final class UpdateTranscriptionRequest { - /* - * Defines new locale for transcription. - */ - @JsonProperty(value = "locale", required = true) - private String locale; - - /** - * Creates an instance of UpdateTranscriptionRequest class. - */ - public UpdateTranscriptionRequest() { - } - - /** - * Get the locale property: Defines new locale for transcription. - * - * @return the locale value. - */ - public String getLocale() { - return this.locale; - } - - /** - * Set the locale property: Defines new locale for transcription. - * - * @param locale the locale value to set. - * @return the UpdateTranscriptionRequest object itself. - */ - public UpdateTranscriptionRequest setLocale(String locale) { - this.locale = locale; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequestInternal.java deleted file mode 100644 index bd7e4be22707..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UpdateTranscriptionRequestInternal.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The UpdateTranscriptionRequestInternal model. */ -@Fluent -public final class UpdateTranscriptionRequestInternal { - /* - * Defines new locale for transcription. - */ - @JsonProperty(value = "locale", required = true) - private String locale; - - /** - * Get the locale property: Defines new locale for transcription. - * - * @return the locale value. - */ - public String getLocale() { - return this.locale; - } - - /** - * Set the locale property: Defines new locale for transcription. - * - * @param locale the locale value to set. - * @return the UpdateTranscriptionRequestInternal object itself. - */ - public UpdateTranscriptionRequestInternal setLocale(String locale) { - this.locale = locale; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UserConsent.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UserConsent.java deleted file mode 100644 index 7b3f2174ee6c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/UserConsent.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The UserConsent model. */ -@Fluent -public final class UserConsent { - /* - * The recording property. - */ - @JsonProperty(value = "recording") - private Integer recording; - - /** - * Get the recording property: The recording property. - * - * @return the recording value. - */ - public Integer getRecording() { - return this.recording; - } - - /** - * Set the recording property: The recording property. - * - * @param recording the recording value to set. - * @return the UserConsent object itself. - */ - public UserConsent setRecording(Integer recording) { - this.recording = recording; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java index 271c6d62f0fb..15c11aadc311 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/VoiceKindInternal.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for VoiceKindInternal. */ +/** Voice kind type. */ public final class VoiceKindInternal extends ExpandableStringEnum { /** Static value male for VoiceKindInternal. */ public static final VoiceKindInternal MALE = fromString("male"); @@ -16,6 +16,14 @@ public final class VoiceKindInternal extends ExpandableStringEnum values() { return values(VoiceKindInternal.class); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantEventResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantEventResult.java deleted file mode 100644 index f551c01390c6..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantEventResult.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.models.events.AddParticipantFailed; -import com.azure.communication.callautomation.models.events.AddParticipantSucceeded; -import com.azure.communication.common.CommunicationIdentifier; -import com.azure.core.annotation.Immutable; - -/** - * The result of an add participant event. - */ -@Immutable -public final class AddParticipantEventResult { - private final boolean isSuccess; - private final AddParticipantSucceeded successResult; - private final AddParticipantFailed failureResult; - private final CommunicationIdentifier participant; - - /** - * Initializes a new instance of AddParticipantEventResult. - * - * @param isSuccess the success status of the add participant operation. - * @param successResult the add participant succeeded event. - * @param failureResult the add participant failed event. - * @param participant the participant. - */ - AddParticipantEventResult(boolean isSuccess, AddParticipantSucceeded successResult, AddParticipantFailed failureResult, CommunicationIdentifier participant) { - this.isSuccess = isSuccess; - this.successResult = successResult; - this.failureResult = failureResult; - this.participant = participant; - } - - /** - * Gets the success status of the add participant operation. - * - * @return the success status of the add participant operation. - */ - public boolean isSuccess() { - return isSuccess; - } - - /** - * Gets the add participant succeeded event. - * - * @return the add participant succeeded event. - */ - public AddParticipantSucceeded getSuccessResult() { - return successResult; - } - - /** - * Gets the add participant failed event. - * - * @return the add participant failed event. - */ - public AddParticipantFailed getFailureResult() { - return failureResult; - } - - /** - * Gets the participant. - * - * @return the participant. - */ - public CommunicationIdentifier getParticipant() { - return participant; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantResult.java index d71a8a021e96..d59bcdf74c9e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AddParticipantResult.java @@ -6,18 +6,13 @@ import com.azure.communication.callautomation.implementation.accesshelpers.AddParticipantResponseConstructorProxy; import com.azure.communication.callautomation.implementation.converters.CallParticipantConverter; import com.azure.communication.callautomation.implementation.models.AddParticipantResponseInternal; -import com.azure.communication.callautomation.models.events.AddParticipantFailed; -import com.azure.communication.callautomation.models.events.AddParticipantSucceeded; -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; import com.azure.core.annotation.Immutable; -import reactor.core.publisher.Mono; -import java.time.Duration; import java.util.Objects; /** The AddParticipantResult model. */ @Immutable -public class AddParticipantResult extends ResultWithEventHandling { +public final class AddParticipantResult { /* * The participant property. */ @@ -48,7 +43,6 @@ public AddParticipantResult create(AddParticipantResponseInternal internalHeader * */ public AddParticipantResult() { - super(); this.participant = null; this.operationContext = null; this.invitationId = null; @@ -60,7 +54,6 @@ public AddParticipantResult() { * @param addParticipantResponseInternal The response from the addParticipant service */ AddParticipantResult(AddParticipantResponseInternal addParticipantResponseInternal) { - super(); Objects.requireNonNull(addParticipantResponseInternal, "addParticipantResponseInternal must not be null"); this.participant = CallParticipantConverter.convert(addParticipantResponseInternal.getParticipant()); @@ -89,36 +82,10 @@ public String getOperationContext() { /** * Get the invitationId property: The invitation ID used to send out add * participant request. - * + * * @return the invitationId value. */ public String getInvitationId() { return invitationId; } - - @Override - public Mono waitForEventProcessorAsync(Duration timeout) { - if (eventProcessor == null) { - return Mono.empty(); - } - - return (timeout == null ? eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == AddParticipantSucceeded.class || event.getClass() == AddParticipantFailed.class)) - : eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == AddParticipantSucceeded.class || event.getClass() == AddParticipantFailed.class), timeout)).flatMap(event -> Mono.just(getReturnedEvent(event))); - } - - @Override - protected AddParticipantEventResult getReturnedEvent(CallAutomationEventBase event) { - AddParticipantEventResult result = null; - if (event.getClass() == AddParticipantSucceeded.class) { - result = new AddParticipantEventResult(true, (AddParticipantSucceeded) event, null, ((AddParticipantSucceeded) event).getParticipant()); - } else if (event.getClass() == AddParticipantFailed.class) { - result = new AddParticipantEventResult(false, null, (AddParticipantFailed) event, ((AddParticipantFailed) event).getParticipant()); - } - - return result; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallEventResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallEventResult.java deleted file mode 100644 index 270bb184f274..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallEventResult.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.models.events.AnswerFailed; -import com.azure.communication.callautomation.models.events.CallConnected; -import com.azure.core.annotation.Immutable; - -/** - * The result of an answer call event. - */ -@Immutable -public final class AnswerCallEventResult { - private final boolean isSuccess; - private final CallConnected successResult; - private final AnswerFailed failureResult; - - /** - * Initializes a new instance of AnswerCallEventResult. - * - * @param isSuccess the success status of the answer call operation. - * @param successResult the call connected success event. - */ - AnswerCallEventResult(boolean isSuccess, CallConnected successResult, AnswerFailed failureResult) { - this.isSuccess = isSuccess; - this.successResult = successResult; - this.failureResult = failureResult; - } - - /** - * Gets the success status of the answer call operation. - * - * @return the success status of the answer call operation. - */ - public boolean isSuccess() { - return isSuccess; - } - - /** - * Gets the call connected success event. - * - * @return the call connected success event. - */ - public CallConnected getSuccessResult() { - return successResult; - } - - /** - * - * @return the answer failed failure event. - */ - public AnswerFailed getFailureResult() { - return failureResult; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallOptions.java index 7379cb7675fc..4b2688756984 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallOptions.java @@ -3,7 +3,6 @@ package com.azure.communication.callautomation.models; -import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.annotation.Fluent; /** @@ -21,16 +20,6 @@ public final class AnswerCallOptions { */ private final String callbackUrl; - /** - * Media Streaming Configuration. - */ - private MediaStreamingOptions mediaStreamingOptions; - - /** - * Transcription Configuration. - */ - private TranscriptionOptions transcriptionOptions; - /* * AI options for the call. */ @@ -40,12 +29,6 @@ public final class AnswerCallOptions { * The operational context */ private String operationContext; - - /** - * The source caller ID number which is a phone number that will be used when inviting a pstn target. - * Required only when this is an incoming voip call and there will be a transfer call request to a PSTN target. - */ - private PhoneNumberIdentifier sourceCallerIdNumber; /** * Constructor @@ -76,15 +59,6 @@ public String getCallbackUrl() { return callbackUrl; } - /** - * Get the Transcription configuration. - * - * @return the transcriptionConfiguration. - */ - public TranscriptionOptions getTranscriptionConfiguration() { - return transcriptionOptions; - } - /** * Get the operationContext. * @@ -94,26 +68,6 @@ public String getOperationContext() { return operationContext; } - /** - * Get the sourceCallerIdNumber. - * - * @return the sourceCallerIdNumber - */ - public PhoneNumberIdentifier getSourceCallerIdNumber() { - return sourceCallerIdNumber; - } - - /** - * Set the transcription configuration. - * - * @param transcriptionOptions The transcription configuration. - * @return the AnswerCallOptions object itself. - */ - public AnswerCallOptions setTranscriptionConfiguration(TranscriptionOptions transcriptionOptions) { - this.transcriptionOptions = transcriptionOptions; - return this; - } - /** * Set the operationContext. * @@ -125,17 +79,6 @@ public AnswerCallOptions setOperationContext(String operationContext) { return this; } - /** - * Set the sourceCallerIdNumber. - * - * @param sourceCallerIdNumber the sourceCallerIdNumber to set - * @return the AnswerCallOptions object itself. - */ - public AnswerCallOptions setSourceCallerIdNumber(PhoneNumberIdentifier sourceCallerIdNumber) { - this.sourceCallerIdNumber = sourceCallerIdNumber; - return this; - } - /** * Get the CallIntelligenceOptions property: AI options for the call such as cognitiveServicesEndpoint * @@ -155,24 +98,4 @@ public AnswerCallOptions setCallIntelligenceOptions(CallIntelligenceOptions call this.callIntelligenceOptions = callIntelligenceOptions; return this; } - - /** - * Get the Media Streaming configuration. - * - * @return the mediaStreamingConfiguration. - */ - public MediaStreamingOptions getMediaStreamingConfiguration() { - return mediaStreamingOptions; - } - - /** - * Set the media streaming configuration. - * - * @param mediaStreamingOptions The media streaming configuration. - * @return the AnswerCallOptions object itself. - */ - public AnswerCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { - this.mediaStreamingOptions = mediaStreamingOptions; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallResult.java index b2e8bbb7cf15..2158c7e52926 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/AnswerCallResult.java @@ -5,20 +5,14 @@ import com.azure.communication.callautomation.CallConnection; import com.azure.communication.callautomation.CallConnectionAsync; -import com.azure.communication.callautomation.models.events.AnswerFailed; -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; -import com.azure.communication.callautomation.models.events.CallConnected; import com.azure.core.annotation.Immutable; -import reactor.core.publisher.Mono; - -import java.time.Duration; -import java.util.Objects; /** * The result of answering a call */ @Immutable public final class AnswerCallResult extends CallResult { + /** * Constructor * @@ -29,69 +23,4 @@ public final class AnswerCallResult extends CallResult { public AnswerCallResult(CallConnectionProperties callConnectionProperties, CallConnection callConnection, CallConnectionAsync callConnectionAsync) { super(callConnectionProperties, callConnection, callConnectionAsync); } - - /** - * Waits for the event processor to process the event - * - * @return the result of the event processing - */ - public AnswerCallEventResult waitForEventProcessor() { - return waitForEventProcessorAsync().block(); - } - - /** - * Waits for the event processor to process the event - * - * @param timeout the timeout - * @return the result of the event processing - */ - public AnswerCallEventResult waitForEventProcessor(Duration timeout) { - return waitForEventProcessorAsync(timeout).block(); - } - - /** - * Waits for the event processor to process the event - * - * @return the result of the event processing - */ - public Mono waitForEventProcessorAsync() { - return waitForEventProcessorAsync(null); - } - - /** - * Waits for the event processor to process the event - * - * @param timeout the timeout - * @return the result of the event processing - */ - public Mono waitForEventProcessorAsync(Duration timeout) { - if (eventProcessor == null) { - return Mono.empty(); - } - - return (timeout == null ? eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == CallConnected.class || event.getClass() == AnswerFailed.class)) - : eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == CallConnected.class || event.getClass() == AnswerFailed.class), timeout)).flatMap(event -> Mono.just(getReturnedEvent(event))); - } - - /** - * Sets the returned event - * - * @param event the event to set - * @return the result of the event processing - */ - private AnswerCallEventResult getReturnedEvent(CallAutomationEventBase event) { - if (event.getClass() == CallConnected.class) { - return new AnswerCallEventResult(true, (CallConnected) event, null); - } - - if (event.getClass() == AnswerFailed.class) { - return new AnswerCallEventResult(false, null, (AnswerFailed) event); - } - - return null; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/BlobStorage.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/BlobStorage.java deleted file mode 100644 index 93cbc4cbbf04..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/BlobStorage.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.core.annotation.Fluent; - -/** Used to specify Blob container url to recording storage. */ -@Fluent -public final class BlobStorage extends ExternalStorage { - - /* - * Url of a container or a location within a container - */ - private final String containerUrl; - - /** - * Constructor - * - * @param containerUrl Url of a container or a location within a container. - */ - - public BlobStorage(String containerUrl) { - super(RecordingStorageType.BLOB_STORAGE); - this.containerUrl = containerUrl; - } - - - /** - * Get the containerUrl property: Url of a container or a location within a container. - * - * @return the containerUrl value. - */ - public String getContainerUrl() { - return this.containerUrl; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallConnectionProperties.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallConnectionProperties.java index c635f1e5ed87..8cf90136a88d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallConnectionProperties.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallConnectionProperties.java @@ -29,8 +29,6 @@ public final class CallConnectionProperties { private final List targetParticipants; private final CallConnectionState callConnectionState; private final String callbackUrl; - private final String mediaSubscriptionId; - private final String dataSubscriptionId; private final CommunicationUserIdentifier answeredBy; private final String correlationId; @@ -57,8 +55,6 @@ public CallConnectionProperties() { this.targetParticipants = null; this.callConnectionState = null; this.callbackUrl = null; - this.mediaSubscriptionId = null; - this.dataSubscriptionId = null; this.answeredBy = null; this.correlationId = null; } @@ -77,8 +73,6 @@ public CallConnectionProperties() { this.targetParticipants = callConnectionPropertiesInternal.getTargets().stream().map(CommunicationIdentifierConverter::convert).collect(Collectors.toList()); this.callConnectionState = CallConnectionState.fromString(callConnectionPropertiesInternal.getCallConnectionState().toString()); this.callbackUrl = callConnectionPropertiesInternal.getCallbackUri(); - this.mediaSubscriptionId = callConnectionPropertiesInternal.getMediaSubscriptionId(); - this.dataSubscriptionId = callConnectionPropertiesInternal.getDataSubscriptionId(); this.answeredBy = CommunicationUserIdentifierConverter.convert(callConnectionPropertiesInternal.getAnsweredBy()); this.correlationId = callConnectionPropertiesInternal.getCorrelationId(); } @@ -95,7 +89,7 @@ public List getTargetParticipants() { /** * Get the source identity. * - * @return source value. + * @return sourceIdentity value. */ public CommunicationIdentifier getSource() { return source; @@ -155,24 +149,6 @@ public String getCallConnectionId() { return callConnectionId; } - /** - * Get the mediaSubscriptionId property: SubscriptionId for media streaming. - * - * @return the mediaSubscriptionId value. - */ - public String getMediaSubscriptionId() { - return mediaSubscriptionId; - } - - /** - * Get the dataSubscriptionId property: SubscriptionId for transcription. - * - * @return the dataSubscriptionId value. - */ - public String getDataSubscriptionId() { - return dataSubscriptionId; - } - /** * Get identity that answered the call * @return identity that answered the call diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognitionType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognitionType.java index 1109d1bb60d1..049eeea882c9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognitionType.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognitionType.java @@ -5,6 +5,7 @@ import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; + import java.util.Collection; /** Defines values for RecognitionType. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeChoiceOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeChoiceOptions.java index d60e6b53f5ba..4cf62a9268f9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeChoiceOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeChoiceOptions.java @@ -141,7 +141,8 @@ public CallMediaRecognizeChoiceOptions setOperationContext(String operationConte } /** - * Set the interruptPrompt property: Determines if we interrupt the prompt and start recognizing. + * Set the interruptPrompt property: If set to true, the participant has the ability to + * interrupt the prompt by pressing a digit and the service will start recognizing. * * @param interruptPrompt the interruptPrompt value to set. * @return the CallMediaRecognizeChoiceOptions object itself. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeDtmfOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeDtmfOptions.java index a20b3aa1cc7d..d8b9ad7db925 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeDtmfOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeDtmfOptions.java @@ -145,7 +145,8 @@ public CallMediaRecognizeDtmfOptions setOperationContext(String operationContext } /** - * Set the interruptPrompt property: Determines if we interrupt the prompt and start recognizing. + * Set the interruptPrompt property: If set to true, the participant has the ability to + * interrupt the prompt by pressing a digit and the service will start recognizing. * * @param interruptPrompt the interruptPrompt value to set. * @return the CallMediaRecognizeDtmfOptions object itself. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeOptions.java index 618131e97c8d..8176f74ae681 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeOptions.java @@ -57,12 +57,6 @@ public abstract class CallMediaRecognizeOptions { private Duration initialSilenceTimeout; /* - * Endpoint where the custom model was deployed. - */ - @JsonProperty(value = "speechModelEndpointId") - private String speechModelEndpointId; - - /* * Target participant of DTMF tone recognition. */ @JsonProperty(value = "targetParticipant") @@ -200,7 +194,8 @@ public Boolean isInterruptPrompt() { } /** - * Set the interruptPrompt property: Determines if we interrupt the prompt and start recognizing. + * Set the interruptPrompt property: If set to true, the participant has the ability to + * interrupt the prompt by pressing a digit and the service will start recognizing. * * @param interruptPrompt the interruptPrompt value to set. * @return the RecognizeConfigurations object itself. @@ -260,24 +255,4 @@ public CallMediaRecognizeOptions setOperationCallbackUrl(String operationCallbac this.operationCallbackUrl = operationCallbackUrl; return this; } - - /** - * Get the speech model endpoint id. - * - * @return the speech model endpoint id. - */ - public String getSpeechModelEndpointId() { - return speechModelEndpointId; - } - /** - * Set the speechModelEndpointId property: Endpoint where the custom model was deployed. - * - * @param speechModelEndpointId the initialSilenceTimeout value to set. - * @return the CallMediaRecognizeSpeechOrDtmfOptions object itself. - */ - public CallMediaRecognizeOptions setSpeechModelEndpointId(String speechModelEndpointId) { - this.speechModelEndpointId = speechModelEndpointId; - return this; - } - } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOptions.java index 774b7051b77e..7f240f1b14a7 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOptions.java @@ -104,7 +104,8 @@ public CallMediaRecognizeSpeechOptions setOperationContext(String operationConte } /** - * Set the interruptPrompt property: Determines if we interrupt the prompt and start recognizing. + * Set the interruptPrompt property: If set to true, the participant has the ability to + * interrupt the prompt by pressing a digit and the service will start recognizing. * * @param interruptPrompt the interruptPrompt value to set. * @return the CallMediaRecognizeSpeechOptions object itself. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOrDtmfOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOrDtmfOptions.java index 0dda8a407fd8..1427f121df92 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOrDtmfOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallMediaRecognizeSpeechOrDtmfOptions.java @@ -163,3 +163,4 @@ public CallMediaRecognizeSpeechOrDtmfOptions(CommunicationIdentifier targetParti this.maxTonesToCollect = maxTonesToCollect; } } + diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallParticipant.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallParticipant.java index 06a7c2b3f9b0..35beaf569e59 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallParticipant.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallParticipant.java @@ -19,24 +19,6 @@ public final class CallParticipant { */ private final Boolean isMuted; - /* - * Is participant on hold. - */ - private final Boolean isOnHold; - - /** - * Constructor of the class - * - * @param identifier The communication identifier - * @param isMuted The value of isMuted - * @param isOnHold The value of isOnHold - */ - public CallParticipant(CommunicationIdentifier identifier, Boolean isMuted, Boolean isOnHold) { - this.identifier = identifier; - this.isMuted = isMuted; - this.isOnHold = isOnHold; - } - /** * Constructor of the class * @@ -46,8 +28,6 @@ public CallParticipant(CommunicationIdentifier identifier, Boolean isMuted, Bool public CallParticipant(CommunicationIdentifier identifier, Boolean isMuted) { this.identifier = identifier; this.isMuted = isMuted; - this.isOnHold = null; - } /** @@ -67,13 +47,4 @@ public CommunicationIdentifier getIdentifier() { public Boolean isMuted() { return this.isMuted; } - - /** - * Get the isOnHold property: Is participant on hold. - * - * @return the isOnHold value. - */ - public Boolean isOnHold() { - return this.isOnHold; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallResult.java index ce2be041b714..cc62d51d83b3 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CallResult.java @@ -5,7 +5,6 @@ import com.azure.communication.callautomation.CallConnection; import com.azure.communication.callautomation.CallConnectionAsync; -import com.azure.communication.callautomation.CallAutomationEventProcessor; /** * The abstract class used as parent of [action]CallResult @@ -26,38 +25,12 @@ public abstract class CallResult { */ private final CallConnectionAsync callConnectionAsync; - /** - * The event processor that handles events. - */ - protected CallAutomationEventProcessor eventProcessor; - /** - * The call's connection id. - */ - protected String callConnectionId; - /** - * Operation context from the api request. - */ - protected String operationContextFromRequest; - CallResult(CallConnectionProperties callConnectionProperties, CallConnection callConnection, CallConnectionAsync callConnectionAsync) { this.callConnectionProperties = callConnectionProperties; this.callConnection = callConnection; this.callConnectionAsync = callConnectionAsync; } - /** - * Sets the event processor - * - * @param eventProcessor the event processor - * @param callConnectionId the call connection id - * @param operationContext the operation context - */ - public void setEventProcessor(CallAutomationEventProcessor eventProcessor, String callConnectionId, String operationContext) { - this.eventProcessor = eventProcessor; - this.callConnectionId = callConnectionId; - this.operationContextFromRequest = operationContext; - } - /** * Get the callConnectionProperties. * diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantEventResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantEventResult.java deleted file mode 100644 index b203c3d4eb28..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantEventResult.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; -import com.azure.communication.callautomation.models.events.CancelAddParticipantFailed; -import com.azure.core.annotation.Immutable; - -/** - * The result of a cancel add participant event. - */ -@Immutable -public final class CancelAddParticipantEventResult { - private final boolean isSuccess; - private final CancelAddParticipantSucceeded successResult; - private final CancelAddParticipantFailed failureResult; - private final String invitationId; - - /** - * Initializes a new instance of CancelAddParticipantEventResult. - * - * @param isSuccess the success status of the cancel add participant operation. - * @param successResult the add participant cancelled success event. - * @param failureResult the cancel add participant failed event. - * @param participant the participant. - * @param invitationId the invitation id. - */ - CancelAddParticipantEventResult(boolean isSuccess, CancelAddParticipantSucceeded successResult, CancelAddParticipantFailed failureResult, String invitationId) { - this.isSuccess = isSuccess; - this.successResult = successResult; - this.failureResult = failureResult; - this.invitationId = invitationId; - } - - /** - * Gets the success status of the cancel add participant operation. - * - * @return the success status of the cancel add participant operation. - */ - public boolean isSuccess() { - return isSuccess; - } - - /** - * Gets the add participant cancelled success event. - * - * @return the add participant cancelled success event. - */ - public CancelAddParticipantSucceeded getSuccessResult() { - return successResult; - } - - /** - * Gets the cancel add participant failed event. - * - * @return the cancel add participant failed event. - */ - public CancelAddParticipantFailed getFailureResult() { - return failureResult; - } - - /** - * Gets the invitation id. - * - * @return the invitation id. - */ - public String getInvitationId() { - return invitationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationOptions.java index fe32d6220837..69ac9dd4158d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationOptions.java @@ -6,12 +6,12 @@ import com.azure.core.annotation.Fluent; /** - * The options for cancelling add participant. + * The options for cancelling add participant operation. */ @Fluent public final class CancelAddParticipantOperationOptions { /** - * The inviation ID used to cancel the add participant request. + * The invitation ID used to cancel the add participant request. */ private final String invitationId; @@ -29,7 +29,7 @@ public final class CancelAddParticipantOperationOptions { /** * Constructor * - * @param invitationId The inviation ID used to cancel the add participant request. + * @param invitationId The invitation ID used to cancel the add participant request. */ public CancelAddParticipantOperationOptions(String invitationId) { this.invitationId = invitationId; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationResult.java index d084f7757997..452c2dad7394 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CancelAddParticipantOperationResult.java @@ -3,21 +3,16 @@ package com.azure.communication.callautomation.models; +import java.util.Objects; + import com.azure.communication.callautomation.implementation.accesshelpers.CancelAddParticipantResponseConstructorProxy; import com.azure.communication.callautomation.implementation.accesshelpers.CancelAddParticipantResponseConstructorProxy.CancelAddParticipantResponseConstructorAccessor; import com.azure.communication.callautomation.implementation.models.CancelAddParticipantResponse; -import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; -import com.azure.communication.callautomation.models.events.CancelAddParticipantFailed; import com.azure.core.annotation.Immutable; -import reactor.core.publisher.Mono; -import java.time.Duration; -import java.util.Objects; - -/** The CancelAddParticipantResult model. */ +/** The CancelAddParticipantOperation Result model. */ @Immutable -public final class CancelAddParticipantOperationResult extends ResultWithEventHandling { +public final class CancelAddParticipantOperationResult { /** * The invitation ID used to cancel the add participant request. @@ -78,29 +73,4 @@ public String getInvitationId() { public String getOperationContext() { return operationContext; } - - @Override - public Mono waitForEventProcessorAsync(Duration timeout) { - if (eventProcessor == null) { - return Mono.empty(); - } - - return (timeout == null ? eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == CancelAddParticipantSucceeded.class || event.getClass() == CancelAddParticipantFailed.class)) - : eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == CancelAddParticipantSucceeded.class || event.getClass() == CancelAddParticipantFailed.class), timeout)).flatMap(event -> Mono.just(getReturnedEvent(event))); - } - - @Override - protected CancelAddParticipantEventResult getReturnedEvent(CallAutomationEventBase event) { - CancelAddParticipantEventResult result = null; - if (event.getClass() == CancelAddParticipantSucceeded.class) { - result = new CancelAddParticipantEventResult(true, (CancelAddParticipantSucceeded) event, null, ((CancelAddParticipantSucceeded) event).getInvitationId()); - } else if (event.getClass() == CancelAddParticipantFailed.class) { - result = new CancelAddParticipantEventResult(false, null, (CancelAddParticipantFailed) event, ((CancelAddParticipantFailed) event).getInvitationId()); - } - return result; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ChoiceResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ChoiceResult.java index fdb19b4228fd..ac8239665a9f 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ChoiceResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ChoiceResult.java @@ -2,12 +2,19 @@ // Licensed under the MIT License. package com.azure.communication.callautomation.models; -import com.fasterxml.jackson.annotation.JsonProperty; + import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; /** The ChoiceResult model. */ @Fluent +@Immutable public final class ChoiceResult extends RecognizeResult { + + private ChoiceResult() { + } + /* * Label is the primary identifier for the choice detected */ @@ -31,17 +38,6 @@ public String getLabel() { return this.label; } - /** - * Set the label property: Label is the primary identifier for the choice detected. - * - * @param label the label value to set. - * @return the ChoiceResult object itself. - */ - public ChoiceResult setLabel(String label) { - this.label = label; - return this; - } - /** * Get the recognizedPhrase property: Phrases are set to the value if choice is selected via phrase detection. If * Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set to @@ -52,17 +48,4 @@ public ChoiceResult setLabel(String label) { public String getRecognizedPhrase() { return this.recognizedPhrase; } - - /** - * Set the recognizedPhrase property: Phrases are set to the value if choice is selected via phrase detection. If - * Dtmf input is recognized, then Label will be the identifier for the choice detected and phrases will be set to - * null. - * - * @param recognizedPhrase the recognizedPhrase value to set. - * @return the ChoiceResult object itself. - */ - public ChoiceResult setRecognizedPhrase(String recognizedPhrase) { - this.recognizedPhrase = recognizedPhrase; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallEventResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallEventResult.java deleted file mode 100644 index 6086de965df6..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallEventResult.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.models.events.CallConnected; -import com.azure.communication.callautomation.models.events.CreateCallFailed; -import com.azure.core.annotation.Immutable; - -/** - * The result of a create call event. - */ -@Immutable -public final class CreateCallEventResult { - private final boolean isSuccess; - private final CallConnected successResult; - private final CreateCallFailed failureResult; - - /** - * Initializes a new instance of CreateCallEventResult. - * - * @param isSuccess the success status of the create call operation. - * @param successResult the call connected success event. - */ - CreateCallEventResult(boolean isSuccess, CallConnected successResult, CreateCallFailed failureResult) { - this.isSuccess = isSuccess; - this.successResult = successResult; - this.failureResult = failureResult; - } - - /** - * Gets the success status of the create call operation. - * - * @return the success status of the create call operation. - */ - public boolean isSuccess() { - return isSuccess; - } - - /** - * Gets the call connected success event. - * - * @return the call connected success event. - */ - public CallConnected getSuccessResult() { - return successResult; - } - - /** - * - * @return the create call failure event. - */ - public CreateCallFailed getFailureResult() { - return failureResult; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java index 75f06ad80117..a9e14238ce99 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallOptions.java @@ -3,8 +3,6 @@ package com.azure.communication.callautomation.models; -import java.util.HashMap; - import com.azure.core.annotation.Fluent; /** @@ -32,22 +30,6 @@ public final class CreateCallOptions { */ private String operationContext; - /** - * Media Streaming Configuration. - */ - private MediaStreamingOptions mediaStreamingOptions; - - - /** - * Transcription Configuration. - */ - private TranscriptionOptions transcriptionOptions; - - /** - * Custom Context - */ - private final CustomCallingContext customContext; - /** * Constructor * @param callInvite Call invitee information. @@ -56,7 +38,6 @@ public final class CreateCallOptions { public CreateCallOptions(CallInvite callInvite, String callbackUrl) { this.callInvite = callInvite; this.callbackUrl = callbackUrl; - this.customContext = new CustomCallingContext(new HashMap(), new HashMap()); } /** @@ -68,16 +49,6 @@ public String getOperationContext() { return operationContext; } - /** - * Get the Transcription configuration. - * - * @return the transcriptionConfiguration. - */ - public TranscriptionOptions getTranscriptionConfiguration() { - return transcriptionOptions; - } - - /** * Set the operationContext: A customer set value used to track the answering of a call. * @@ -89,17 +60,6 @@ public CreateCallOptions setOperationContext(String operationContext) { return this; } - /** - * Set the transcription configuration. - * - * @param transcriptionOptions The transcription configuration. - * @return the CreateCallOptions object itself. - */ - public CreateCallOptions setTranscriptionConfiguration(TranscriptionOptions transcriptionOptions) { - this.transcriptionOptions = transcriptionOptions; - return this; - } - /** * Get Call invitee information * @return call invitee information @@ -136,32 +96,4 @@ public CreateCallOptions setCallIntelligenceOptions(CallIntelligenceOptions call this.callIntelligenceOptions = callIntelligenceOptions; return this; } - - /** - * Get the Media Streaming configuration. - * - * @return the mediaStreamingConfiguration. - */ - public MediaStreamingOptions getMediaStreamingConfiguration() { - return mediaStreamingOptions; - } - - /** - * Set the media streaming configuration. - * - * @param mediaStreamingOptions The media streaming configuration. - * @return the CreateCallOptions object itself. - */ - public CreateCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { - this.mediaStreamingOptions = mediaStreamingOptions; - return this; - } - - /** - * get custom context - * @return custom context - */ - public CustomCallingContext getCustomContext() { - return customContext; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallResult.java index c11199a01f2e..c7ed8093d663 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateCallResult.java @@ -5,14 +5,7 @@ import com.azure.communication.callautomation.CallConnection; import com.azure.communication.callautomation.CallConnectionAsync; -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; -import com.azure.communication.callautomation.models.events.CallConnected; -import com.azure.communication.callautomation.models.events.CreateCallFailed; import com.azure.core.annotation.Immutable; -import reactor.core.publisher.Mono; - -import java.time.Duration; -import java.util.Objects; /** * The result of answering a call @@ -30,70 +23,4 @@ public final class CreateCallResult extends CallResult { public CreateCallResult(CallConnectionProperties callConnectionProperties, CallConnection callConnection, CallConnectionAsync callConnectionAsync) { super(callConnectionProperties, callConnection, callConnectionAsync); } - - /** - * Waits for the event processor to process the event - * - * @return the result of the event processing - */ - public CreateCallEventResult waitForEventProcessor() { - return waitForEventProcessorAsync().block(); - } - - /** - * Waits for the event processor to process the event - * - * @param timeout the timeout - * @return the result of the event processing - */ - public CreateCallEventResult waitForEventProcessor(Duration timeout) { - return waitForEventProcessorAsync(timeout).block(); - } - - /** - * Waits for the event processor to process the event - * - * @return the result of the event processing - */ - public Mono waitForEventProcessorAsync() { - return waitForEventProcessorAsync(null); - } - - /** - * Waits for the event processor to process the event - * - * @param timeout the timeout - * @return the result of the event processing - */ - public Mono waitForEventProcessorAsync(Duration timeout) { - if (eventProcessor == null) { - return Mono.empty(); - } - - return (timeout == null ? eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == CallConnected.class || event.getClass() == CreateCallFailed.class)) - : eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == CallConnected.class || event.getClass() == CreateCallFailed.class), timeout) - ).flatMap(event -> Mono.just(getReturnedEvent(event))); - } - - /** - * Sets the returned event - * - * @param event the event to set - * @return the result of the event processing - */ - private CreateCallEventResult getReturnedEvent(CallAutomationEventBase event) { - if (event.getClass() == CallConnected.class) { - return new CreateCallEventResult(true, (CallConnected) event, null); - } - - if (event.getClass() == CreateCallFailed.class) { - return new CreateCallEventResult(false, null, (CreateCallFailed) event); - } - - return null; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java index 5ee265339f38..22e9504da1c5 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CreateGroupCallOptions.java @@ -7,7 +7,6 @@ import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.annotation.Fluent; -import java.util.HashMap; import java.util.List; /** @@ -30,16 +29,6 @@ public final class CreateGroupCallOptions { */ private String operationContext; - /** - * Media Streaming Configuration. - */ - private MediaStreamingOptions mediaStreamingOptions; - - /** - * Transcription Configuration. - */ - private TranscriptionOptions transcriptionOptions; - /** * Display name for call source */ @@ -55,11 +44,6 @@ public final class CreateGroupCallOptions { */ private CallIntelligenceOptions callIntelligenceOptions; - /** - * Custom Context - */ - private final CustomCallingContext customContext; - /** * Constructor * @@ -71,7 +55,6 @@ public CreateGroupCallOptions(List targetParticipants, this.callbackUrl = callbackUrl; this.sourceDisplayName = null; this.sourceCallIdNumber = null; - this.customContext = new CustomCallingContext(new HashMap(), new HashMap()); } /** @@ -128,28 +111,6 @@ public CreateGroupCallOptions setOperationContext(String operationContext) { return this; } - /** - * Set the media streaming configuration. - * - * @param mediaStreamingOptions The media streaming configuration. - * @return the CreateGroupCallOptions object itself. - */ - public CreateGroupCallOptions setMediaStreamingConfiguration(MediaStreamingOptions mediaStreamingOptions) { - this.mediaStreamingOptions = mediaStreamingOptions; - return this; - } - - /** - * Set the transcription configuration. - * - * @param transcriptionOptions The transcription configuration. - * @return the CreateGroupCallOptions object itself. - */ - public CreateGroupCallOptions setTranscriptionConfiguration(TranscriptionOptions transcriptionOptions) { - this.transcriptionOptions = transcriptionOptions; - return this; - } - /** * set display name for caller * @param sourceDisplayName display name for caller @@ -189,30 +150,4 @@ public CreateGroupCallOptions setCallIntelligenceOptions(CallIntelligenceOptions this.callIntelligenceOptions = callIntelligenceOptions; return this; } - - /** - * Get the Media Streaming configuration. - * - * @return the mediaStreamingConfiguration. - */ - public MediaStreamingOptions getMediaStreamingConfiguration() { - return mediaStreamingOptions; - } - - /** - * Get the Transcription configuration. - * - * @return the transcriptionConfiguration. - */ - public TranscriptionOptions getTranscriptionConfiguration() { - return transcriptionOptions; - } - - /** - * get custom context - * @return custom context - */ - public CustomCallingContext getCustomContext() { - return customContext; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomCallingContext.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomCallingContext.java index 8841676ab985..4d45709fdd74 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomCallingContext.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/CustomCallingContext.java @@ -58,7 +58,7 @@ public Map getVoipHeaders() { public void addSipUui(String value) { if (sipHeaders == null) { throw logger.logExceptionAsError(new IllegalStateException( - "Cannot add sip header, SipHeaders is null.")); + "Cannot add sip uui header, SipHeaders is null.")); } sipHeaders.put("User-To-User", value); } @@ -74,7 +74,7 @@ public void addSipUui(String value) { public void addSipX(String key, String value) { if (sipHeaders == null) { throw logger.logExceptionAsError(new IllegalStateException( - "Cannot add sip header, SipHeaders is null.")); + "Cannot add sip x header, SipHeaders is null.")); } sipHeaders.put("X-MS-Custom-" + key, value); } @@ -88,9 +88,9 @@ public void addSipX(String key, String value) { * @throws IllegalStateException If voipHeaders is null */ public void addVoip(String key, String value) { - if (sipHeaders == null) { + if (voipHeaders == null) { throw logger.logExceptionAsError(new IllegalStateException( - "Cannot add sip header, VoipHeaders is null.")); + "Cannot add voip header, VoipHeaders is null.")); } voipHeaders.put(key, value); } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DialogInputType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DialogInputType.java deleted file mode 100644 index 6630df7c7e35..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DialogInputType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.Collection; - -/** Determines the type of the dialog. */ -public final class DialogInputType extends ExpandableStringEnum { - /** Static value powerVirtualAgents for DialogInputType. */ - public static final DialogInputType POWER_VIRTUAL_AGENTS = fromString("powerVirtualAgents"); - - /** Static value azureOpenAI for DialogInputType. */ - public static final DialogInputType AZURE_OPEN_AI = fromString("azureOpenAI"); - - /** - * Creates a new instance of DialogInputType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DialogInputType() {} - - /** - * Creates or finds a DialogInputType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DialogInputType. - */ - @JsonCreator - public static DialogInputType fromString(String name) { - return fromString(name, DialogInputType.class); - } - - /** - * Gets known DialogInputType values. - * - * @return known DialogInputType values. - */ - public static Collection values() { - return values(DialogInputType.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DialogStateResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DialogStateResult.java deleted file mode 100644 index 476bf957b03e..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DialogStateResult.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.implementation.accesshelpers.DialogStateResponseConstructorProxy; -import com.azure.communication.callautomation.implementation.models.DialogStateResponse; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Objects; - -/** The DialogStateResult model. */ -@Immutable -public class DialogStateResult { - - /* - * The dialog ID. - */ - @JsonProperty(value = "dialogId") - private String dialogId; - - /* - * Defines options for dialog. - */ - @JsonProperty(value = "dialogOptions") - private StartDialogOptions dialogOptions; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * The value to identify context of the operation. - */ - @JsonProperty(value = "operationContext") - private String operationContext; - - static { - DialogStateResponseConstructorProxy.setAccessor( - new DialogStateResponseConstructorProxy.DialogStateResponseConstructorAccessor() { - @Override - public DialogStateResult create(DialogStateResponse internalHeaders) { - return new DialogStateResult(internalHeaders); - } - }); - } - - /** - * Public constructor. - * - */ - public DialogStateResult() { - this.dialogId = null; - this.operationContext = null; - } - - /** - * Constructor of the class - * - * @param dialogStateResponse The response from the dialog service - */ - DialogStateResult(DialogStateResponse dialogStateResponse) { - Objects.requireNonNull(dialogStateResponse, "dialogStateResponse must not be null"); - - this.dialogId = dialogStateResponse.getDialogId(); - this.operationContext = dialogStateResponse.getOperationContext(); - } - - - /** - * Get the dialogId property: The dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return dialogId; - } - - /** - * Get the operationContext property: The value to identify context of the operation. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return operationContext; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DtmfResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DtmfResult.java index 73162bbd3a35..7240a3d40ca2 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DtmfResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/DtmfResult.java @@ -12,6 +12,7 @@ /** The DtmfResult model. */ @Fluent public final class DtmfResult extends RecognizeResult { + /* * The tones property. */ @@ -39,9 +40,10 @@ public DtmfResult setTones(List dtmfTones) { } /** - * Set the tones property: The tones property. + * Converts the incoming DtmfTone list to a sequential string + * e.g. the list {DtmfTone.TWO, DtmfTone.THREE, DtmfTone.POUND} will convert into "23#" * - * @return the DtmfResult object itself. + * @return string sequence of Dtmf tones */ public String convertToString() { if (this.dtmfTones == null) { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ExternalStorage.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ExternalStorage.java deleted file mode 100644 index 4f5f795efbe6..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ExternalStorage.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Abstract base class for different external storage types. */ -@Fluent -public abstract class ExternalStorage { - @JsonProperty(value = "storageType") - private final RecordingStorageType storageType; - - /** - * Get the storageType property: Defines the type of external storage. - * - * @return the storageType value. - */ - public RecordingStorageType getStorageType() { - return storageType; - } - - /** - * The constructor - * - * @param storageType Specify the storage type kind. - */ - ExternalStorage(RecordingStorageType storageType) { - this.storageType = storageType; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/HoldOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/HoldOptions.java deleted file mode 100644 index 9d1dbdb93ebc..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/HoldOptions.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.common.CommunicationIdentifier; - -/** - * Options for the Hold operation. - */ -public class HoldOptions { - - /** - * Participant to put on hold. - */ - private final CommunicationIdentifier targetParticipant; - - /** - * Audio to play while on hold. - */ - private PlaySource playSourceInfo; - - /** - * Operation context. - */ - private String operationContext; - - /** - * operationCallbackUri. - */ - private String operationCallbackUri; - - /** - * Create a new HoldOptions object. - * @param targetParticipant Participant to be put on hold. - */ - public HoldOptions(CommunicationIdentifier targetParticipant) { - this.targetParticipant = targetParticipant; - } - - /** - * Get Participant to be put on hold. - * @return participant. - */ - public CommunicationIdentifier getTargetParticipant() { - return targetParticipant; - } - - /** - * Get PlaySourceInfo - * @return the playSourceInfo. - */ - public PlaySource getPlaySourceInfo() { - return playSourceInfo; - } - - /** - * Sets the playSourceInfo. - * @param playSourceInfo playSourceInfo - * @return The HoldOptions object. - */ - public HoldOptions setPlaySourceInfo(PlaySource playSourceInfo) { - this.playSourceInfo = playSourceInfo; - return this; - } - - /** - * Get the operation context. - * @return operation context. - */ - public String getOperationContext() { - return operationContext; - } - - /** - * Sets the operation context. - * @param operationContext Operation Context - * @return The HoldOptions object. - */ - public HoldOptions setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } - - /** - * Get the operationCallbackUri. - * @return operationCallbackUri. - */ - public String getOperationCallbackUri() { - return operationCallbackUri; - } - - /** - * Sets the operationCallbackUri. - * @param operationCallbackUri operationCallbackUri - * @return The HoldOptions object. - */ - public HoldOptions setOperationCallbackUri(String operationCallbackUri) { - this.operationCallbackUri = operationCallbackUri; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingAudioChannel.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingAudioChannel.java deleted file mode 100644 index 49213e38eec6..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingAudioChannel.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MediaStreamingAudioChannelType. */ -public final class MediaStreamingAudioChannel extends ExpandableStringEnum { - /** Static value mixed for MediaStreamingAudioChannelType. */ - public static final MediaStreamingAudioChannel MIXED = fromString("mixed"); - - /** Static value unmixed for MediaStreamingAudioChannelType. */ - public static final MediaStreamingAudioChannel UNMIXED = fromString("unmixed"); - - /** - * Creates or finds a MediaStreamingAudioChannelType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MediaStreamingAudioChannelType. - */ - @JsonCreator - public static MediaStreamingAudioChannel fromString(String name) { - return fromString(name, MediaStreamingAudioChannel.class); - } - - /** @return known MediaStreamingAudioChannelType values. */ - public static Collection values() { - return values(MediaStreamingAudioChannel.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingContent.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingContent.java deleted file mode 100644 index 482428e8e8e5..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingContent.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MediaStreamingContentType. */ -public final class MediaStreamingContent extends ExpandableStringEnum { - /** Static value audio for MediaStreamingContentType. */ - public static final MediaStreamingContent AUDIO = fromString("audio"); - - /** - * Creates or finds a MediaStreamingContentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MediaStreamingContentType. - */ - @JsonCreator - public static MediaStreamingContent fromString(String name) { - return fromString(name, MediaStreamingContent.class); - } - - /** @return known MediaStreamingContentType values. */ - public static Collection values() { - return values(MediaStreamingContent.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingOptions.java deleted file mode 100644 index 3499b3668b4d..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingOptions.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The MediaStreamingConfigurationInternal model. */ -@Fluent -public final class MediaStreamingOptions { - /* - * Transport URL for media streaming - */ - @JsonProperty(value = "transportUrl") - private final String transportUrl; - - /* - * The type of transport to be used for media streaming, eg. Websocket - */ - @JsonProperty(value = "transportType") - private final MediaStreamingTransport transportType; - - /* - * Content type to stream, eg. audio, audio/video - */ - @JsonProperty(value = "contentType") - private final MediaStreamingContent contentType; - - /* - * Audio channel type to stream, eg. unmixed audio, mixed audio - */ - @JsonProperty(value = "audioChannelType") - private final MediaStreamingAudioChannel audioChannelType; - - /** - * Creates a new instance of MediaStreamingConfiguration - * @param transportUrl - The Transport URL - * @param transportType - Transport type - * @param contentType - Content Type - * @param audioChannelType - Audio Channel Type - */ - public MediaStreamingOptions(String transportUrl, MediaStreamingTransport transportType, MediaStreamingContent contentType, MediaStreamingAudioChannel audioChannelType) { - this.transportUrl = transportUrl; - this.transportType = transportType; - this.contentType = contentType; - this.audioChannelType = audioChannelType; - } - - /** - * Get the transportUrl property: Transport URL for media streaming. - * - * @return the transportUrl value. - */ - public String getTransportUrl() { - return this.transportUrl; - } - - /** - * Get the transportType property: The type of tranport to be used for media streaming, eg. Websocket. - * - * @return the transportType value. - */ - public MediaStreamingTransport getTransportType() { - return this.transportType; - } - - /** - * Get the contentType property: Content type to stream, eg. audio, audio/video. - * - * @return the contentType value. - */ - public MediaStreamingContent getContentType() { - return this.contentType; - } - - /** - * Get the audioChannelType property: Audio channel type to stream, eg. unmixed audio, mixed audio. - * - * @return the audioChannelType value. - */ - public MediaStreamingAudioChannel getAudioChannelType() { - return this.audioChannelType; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingTransport.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingTransport.java deleted file mode 100644 index 5a25ad7179d0..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MediaStreamingTransport.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MediaStreamingTransportType. */ -public final class MediaStreamingTransport extends ExpandableStringEnum { - /** Static value websocket for MediaStreamingTransportType. */ - public static final MediaStreamingTransport WEBSOCKET = fromString("websocket"); - - /** - * Creates or finds a MediaStreamingTransportType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MediaStreamingTransportType. - */ - @JsonCreator - public static MediaStreamingTransport fromString(String name) { - return fromString(name, MediaStreamingTransport.class); - } - - /** @return known MediaStreamingTransportType values. */ - public static Collection values() { - return values(MediaStreamingTransport.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantResult.java index d8bbf105fee8..6ef69fd67a4c 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/MuteParticipantResult.java @@ -32,12 +32,12 @@ public MuteParticipantResult() { /** * Package-private constructor of the class, used internally only. * - * @param MuteParticipantsResultInternal The response from the service + * @param muteParticipantsResultInternal The response from the service */ - MuteParticipantResult(MuteParticipantsResultInternal muteParticipantsResponseInternal) { - Objects.requireNonNull(muteParticipantsResponseInternal, "muteParticipantsResponseInternal must not be null"); + MuteParticipantResult(MuteParticipantsResultInternal muteParticipantsResultInternal) { + Objects.requireNonNull(muteParticipantsResultInternal, "muteParticipantsResultInternal must not be null"); - this.operationContext = muteParticipantsResponseInternal.getOperationContext(); + this.operationContext = muteParticipantsResultInternal.getOperationContext(); } /** diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayOptions.java index 623a5717a50f..0f89fb69e981 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayOptions.java @@ -38,7 +38,7 @@ public final class PlayOptions { * This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. */ private String operationCallbackUrl; - + /** * Constructor * @param playSources A List of {@link PlaySource} representing the sources to play. diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayToAllOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayToAllOptions.java index 922b3669c7ff..ceb4d80c7c2b 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayToAllOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/PlayToAllOptions.java @@ -33,11 +33,6 @@ public final class PlayToAllOptions { */ private String operationCallbackUrl; - /* - * If set play can barge into other existing queued-up/currently-processing requests. - */ - private boolean interruptCallMediaOperation; - /** * Constructor * @param playSources A List of {@link PlaySource} representing the sources to play. @@ -124,26 +119,4 @@ public PlayToAllOptions setOperationCallbackUrl(String operationCallbackUrl) { this.operationCallbackUrl = operationCallbackUrl; return this; } - - /** - * Get the interruptCallMediaOperation property: If set play can barge into other existing - * queued-up/currently-processing requests. - * - * @return the interruptCallMediaOperation value. - */ - public boolean isInterruptCallMediaOperation() { - return this.interruptCallMediaOperation; - } - - /** - * Set the interruptCallMediaOperation property: If set play can barge into other existing - * queued-up/currently-processing requests. - * - * @param interruptCallMediaOperation the interruptCallMediaOperation value to set. - * @return the PlayOptionsInternal object itself. - */ - public PlayToAllOptions setInterruptCallMediaOperation(boolean interruptCallMediaOperation) { - this.interruptCallMediaOperation = interruptCallMediaOperation; - return this; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognitionChoice.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognitionChoice.java index 841de3f13d13..118ef43a01b9 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognitionChoice.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognitionChoice.java @@ -87,3 +87,4 @@ public RecognitionChoice setTone(DtmfTone tone) { return this; } } + diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeInputType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeInputType.java index 8258f1cc56e9..47a7632fb501 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeInputType.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeInputType.java @@ -5,6 +5,7 @@ import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; + import java.util.Collection; /** Defines values for RecognizeInputTypeInternal. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeResult.java index ecf22bde34e6..e3206c4606a2 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecognizeResult.java @@ -3,7 +3,7 @@ package com.azure.communication.callautomation.models; -/** Defines the absract for Recognize Result. */ +/** Defines the abstract for Recognize Result. */ public abstract class RecognizeResult { } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecordingStorageType.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecordingStorageType.java index 5f7c634950f8..3b074cef4800 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecordingStorageType.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/RecordingStorageType.java @@ -14,9 +14,6 @@ public final class RecordingStorageType extends ExpandableStringEnum { +public final class RemoveParticipantResult { /* * The operation context provided by client. */ @@ -33,7 +28,8 @@ public RemoveParticipantResult create(RemoveParticipantResponseInternal internal } /** - * Initializes a new instance of RemoveParticipantResult. + * Public constructor. + * */ public RemoveParticipantResult() { this.operationContext = null; @@ -58,32 +54,4 @@ public RemoveParticipantResult() { public String getOperationContext() { return this.operationContext; } - - @Override - public Mono waitForEventProcessorAsync(Duration timeout) { - if (eventProcessor == null) { - return Mono.empty(); - } - - return (timeout == null ? eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == RemoveParticipantSucceeded.class || event.getClass() == RemoveParticipantFailed.class)) - : eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == RemoveParticipantSucceeded.class || event.getClass() == RemoveParticipantFailed.class), timeout) - ).flatMap(event -> Mono.just(getReturnedEvent(event))); - } - - @Override - protected RemoveParticipantEventResult getReturnedEvent(CallAutomationEventBase event) { - RemoveParticipantEventResult result = null; - - if (event.getClass() == RemoveParticipantSucceeded.class) { - result = new RemoveParticipantEventResult(true, (RemoveParticipantSucceeded) event, null, ((RemoveParticipantSucceeded) event).getParticipant()); - } else if (event.getClass() == RemoveParticipantFailed.class) { - result = new RemoveParticipantEventResult(false, null, (RemoveParticipantFailed) event, ((RemoveParticipantFailed) event).getParticipant()); - } - - return result; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ResultWithEventHandling.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ResultWithEventHandling.java deleted file mode 100644 index 251dcef7d50f..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/ResultWithEventHandling.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.CallAutomationEventProcessor; -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; -import reactor.core.publisher.Mono; - -import java.time.Duration; - -/** - * Injects the event handling into the result - */ -public abstract class ResultWithEventHandling { - /** - * The event processor that handles events. - */ - protected CallAutomationEventProcessor eventProcessor; - /** - * The call's connection id. - */ - protected String callConnectionId; - /** - * Operation context from the api request. - */ - protected String operationContextFromRequest; - - /** - * Sets the event processor - * - * @param eventProcessor the event processor - * @param callConnectionId the call connection id - * @param operationContext the operation context - */ - public void setEventProcessor(CallAutomationEventProcessor eventProcessor, String callConnectionId, String operationContext) { - this.eventProcessor = eventProcessor; - this.callConnectionId = callConnectionId; - this.operationContextFromRequest = operationContext; - } - - /** - * Waits for the event processor to process the event - * - * @return the result of the event processing - */ - public TEventResult waitForEventProcessor() { - return waitForEventProcessorAsync().block(); - } - - /** - * Waits for the event processor to process the event - * - * @param timeout the timeout - * @return the result of the event processing - */ - public TEventResult waitForEventProcessor(Duration timeout) { - return waitForEventProcessorAsync(timeout).block(); - } - - /** - * Waits for the event processor to process the event - * - * @return the result of the event processing - */ - public Mono waitForEventProcessorAsync() { - return waitForEventProcessorAsync(null); - } - - /** - * Waits for the event processor to process the event - * - * @param timeout the timeout - * @return the result of the event processing - */ - public abstract Mono waitForEventProcessorAsync(Duration timeout); - - /** - * Sets the returned event - * - * @param event the event to set - * @return the result of the event processing - */ - protected abstract TEventResult getReturnedEvent(CallAutomationEventBase event); -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SsmlSource.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SsmlSource.java index c2d8e8907feb..57adf37d3107 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SsmlSource.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/SsmlSource.java @@ -16,7 +16,7 @@ public final class SsmlSource extends PlaySource { private String ssmlText; /* - * Endpoint where the Custom Voice was deployed. + * Endpoint where the custom voice was deployed. */ @JsonProperty(value = "customVoiceEndpointId") private String customVoiceEndpointId; @@ -54,7 +54,7 @@ public String getCustomVoiceEndpointId() { * Set the customVoiceEndpointId property: Endpoint where the custom voice was deployed. * * @param customVoiceEndpointId the customVoiceEndpointId value to set. - * @return the TextSourceInternal object itself. + * @return the SsmlSourceInternal object itself. */ public SsmlSource setCustomVoiceEndpointId(String customVoiceEndpointId) { this.customVoiceEndpointId = customVoiceEndpointId; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartDialogOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartDialogOptions.java deleted file mode 100644 index 966d8eec8964..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartDialogOptions.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import java.util.Map; -import java.util.UUID; - -/** - * The options for starting a dialog. - */ -public class StartDialogOptions { - - /* - * Bot identifier. - */ - private String botId; - - /* - * The dialog ID. - */ - private final String dialogId; - - /* - * Determines the type of the dialog. - */ - private final DialogInputType dialogInputType; - - /* - * Dialog context. - */ - private final Map dialogContext; - - /* - * The value to identify context of the operation. - */ - private String operationContext; - - /** - * Creates a new instance of the DialogOptions. - * - * @param dialogInputType type of dialog - * @param dialogContext context of the dialog - */ - public StartDialogOptions(DialogInputType dialogInputType, Map dialogContext) { - this.dialogInputType = dialogInputType; - this.dialogContext = dialogContext; - this.dialogId = UUID.randomUUID().toString(); - } - - /** - * Creates a new instance of the DialogOptions. - * - * @param dialogId id of the dialog - * @param dialogInputType type of dialog - * @param dialogContext context of the dialog - */ - public StartDialogOptions(String dialogId, DialogInputType dialogInputType, Map dialogContext) { - this.dialogId = dialogId; - this.dialogInputType = dialogInputType; - this.dialogContext = dialogContext; - } - - /** - * Get the botAppId property: Bot identifier. - * - * @return the botAppId value. - */ - public String getBotId() { - return botId; - } - - /** - * Set the botAppId property: Bot identifier. - * - * @param botId context of the operation - */ - public void setBotId(String botId) { - this.botId = botId; - } - - /** - * Get the dialogId property: The dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return dialogId; - } - - /** - * Get the dialogOptions property: Defines options for dialog. - * - * @return the dialogOptions value. - */ - public DialogInputType getDialogInputType() { - return dialogInputType; - } - - /** - * Get the dialogContext property: Dialog context. - * - * @return the dialogContext value. - */ - public Map getDialogContext() { - return dialogContext; - } - - /** - * Get the operationContext property: The value to identify context of the operation. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return operationContext; - } - - /** - * Set the operationContext property: The value to identify context of the operation. - * - * @param operationContext context of the operation - */ - public void setOperationContext(String operationContext) { - this.operationContext = operationContext; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartHoldMusicOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartHoldMusicOptions.java deleted file mode 100644 index 1ef9f5dc1364..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartHoldMusicOptions.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.common.CommunicationIdentifier; - -/** - * Options for the Start Hold Music operation. - */ -public class StartHoldMusicOptions { - - /** - * Participant to put on hold. - */ - private final CommunicationIdentifier targetParticipant; - - /** - * Audio to play while on hold. - */ - private final PlaySource playSourceInfo; - - /** - * If Audio will loop. Default is true. - */ - private boolean loop; - - /** - * Operation context. - */ - private String operationContext; - - /** - * Create a new StartHoldMusicOptions object. - * @param targetParticipant Participant to be put on hold. - * @param playSourceInfo Audio to be played while on hold. - */ - public StartHoldMusicOptions(CommunicationIdentifier targetParticipant, PlaySource playSourceInfo) { - this.targetParticipant = targetParticipant; - this.playSourceInfo = playSourceInfo; - loop = true; - } - - /** - * Get Participant to be put on hold. - * @return participant. - */ - public CommunicationIdentifier getTargetParticipant() { - return targetParticipant; - } - - /** - * Get PlaySourceInfo - * @return the playSourceInfo. - */ - public PlaySource getPlaySourceInfo() { - return playSourceInfo; - } - - /** - * Get if the music is in loop. - * @return true for loop, false for play once. - */ - public boolean isLoop() { - return loop; - } - - /** - * Set the value for loop. - * @param loop - boolean. - * @return The StartHoldMusicOptions object. - */ - public StartHoldMusicOptions setLoop(boolean loop) { - this.loop = loop; - return this; - } - - /** - * Get the operation context. - * @return operation context. - */ - public String getOperationContext() { - return operationContext; - } - - /** - * Sets the operation context. - * @param operationContext Operation Context - * @return The StartHoldMusicOptions object. - */ - public StartHoldMusicOptions setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartRecordingOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartRecordingOptions.java index fd3709545f63..9efeb074ac2e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartRecordingOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartRecordingOptions.java @@ -27,14 +27,10 @@ public final class StartRecordingOptions { private RecordingFormat recordingFormat; - private Boolean pauseOnStart; - private List audioChannelParticipantOrdering; private List channelAffinity; - private ExternalStorage externalStorage; - /** * Constructor * @@ -134,26 +130,6 @@ public StartRecordingOptions setRecordingFormat(RecordingFormat recordingFormat) return this; } - /** - * Get pause on start. - * - * @return pause on start. - */ - public Boolean getPauseOnStart() { - return pauseOnStart; - } - - /** - * Set the pause on start property. - * - * @param pauseOnStart the {@link pauseOnStart}. - * @return the {@link StartRecordingOptions} - */ - public StartRecordingOptions setPauseOnStart(Boolean pauseOnStart) { - this.pauseOnStart = pauseOnStart; - return this; - } - /** * Get the audioChannelParticipantOrdering property: The sequential order in which audio channels are assigned to * participants in the unmixed recording. When 'recordingChannelType' is set to 'unmixed' and @@ -182,26 +158,6 @@ public StartRecordingOptions setAudioChannelParticipantOrdering(List { - /** - * Static value websocket for TranscriptionTransportType. - */ - public static final TranscriptionTransportType WEBSOCKET = fromString("websocket"); - - /** - * Creates a new instance of TranscriptionTransportType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TranscriptionTransportType() { - } - - /** - * Creates or finds a TranscriptionTransportType from its string representation. - * - * @param name a name to look for. - * @return the corresponding TranscriptionTransportType. - */ - @JsonCreator - public static TranscriptionTransportType fromString(String name) { - return fromString(name, TranscriptionTransportType.class); - } - - /** - * Gets known TranscriptionTransportType values. - * - * @return known TranscriptionTransportType values. - */ - public static Collection values() { - return values(TranscriptionTransportType.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallResult.java index efa91c290e85..0be8087caebf 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallResult.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallResult.java @@ -5,18 +5,13 @@ import com.azure.communication.callautomation.implementation.accesshelpers.TransferCallResponseConstructorProxy; import com.azure.communication.callautomation.implementation.models.TransferCallResponseInternal; -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; -import com.azure.communication.callautomation.models.events.CallTransferAccepted; -import com.azure.communication.callautomation.models.events.CallTransferFailed; import com.azure.core.annotation.Immutable; -import reactor.core.publisher.Mono; -import java.time.Duration; import java.util.Objects; /** The TransferCallResult model. */ @Immutable -public final class TransferCallResult extends ResultWithEventHandling { +public final class TransferCallResult { /* * The operation context provided by client. */ @@ -59,32 +54,4 @@ public TransferCallResult() { public String getOperationContext() { return this.operationContext; } - - @Override - public Mono waitForEventProcessorAsync(Duration timeout) { - if (eventProcessor == null) { - return Mono.empty(); - } - - return (timeout == null ? eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == CallTransferAccepted.class || event.getClass() == CallTransferFailed.class)) - : eventProcessor.waitForEventProcessorAsync(event -> Objects.equals(event.getCallConnectionId(), callConnectionId) - && (Objects.equals(event.getOperationContext(), operationContextFromRequest) || operationContextFromRequest == null) - && (event.getClass() == CallTransferAccepted.class || event.getClass() == CallTransferFailed.class), timeout) - ).flatMap(event -> Mono.just(getReturnedEvent(event))); - } - - @Override - protected TransferCallToParticipantEventResult getReturnedEvent(CallAutomationEventBase event) { - TransferCallToParticipantEventResult result = null; - - if (event.getClass() == CallTransferAccepted.class) { - result = new TransferCallToParticipantEventResult(true, (CallTransferAccepted) event, null); - } else if (event.getClass() == CallTransferFailed.class) { - result = new TransferCallToParticipantEventResult(false, null, (CallTransferFailed) event); - } - - return result; - } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallToParticipantEventResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallToParticipantEventResult.java deleted file mode 100644 index 6b968bb95797..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/TransferCallToParticipantEventResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.models.events.CallTransferAccepted; -import com.azure.communication.callautomation.models.events.CallTransferFailed; -import com.azure.core.annotation.Immutable; - -/** - * The result of a transfer call to participant event. - */ -@Immutable -public final class TransferCallToParticipantEventResult { - private final boolean isSuccess; - private final CallTransferAccepted successResult; - private final CallTransferFailed failureResult; - - /** - * Initializes a new instance of TransferCallToParticipantEventResult. - * - * @param isSuccess the success status of the transfer call to participant operation. - * @param successResult the transfer call to participant succeeded event. - * @param failureResult the transfer call to participant failed event. - */ - TransferCallToParticipantEventResult(boolean isSuccess, CallTransferAccepted successResult, CallTransferFailed failureResult) { - this.isSuccess = isSuccess; - this.successResult = successResult; - this.failureResult = failureResult; - } - - /** - * Gets the success status of the transfer call to participant operation. - * - * @return the success status of the transfer call to participant operation. - */ - public boolean isSuccess() { - return isSuccess; - } - - /** - * Gets the transfer call to participant succeeded event. - * - * @return the transfer call to participant succeeded event. - */ - public CallTransferAccepted getSuccessResult() { - return successResult; - } - - /** - * Gets the transfer call to participant failed event. - * - * @return the transfer call to participant failed event. - */ - public CallTransferFailed getFailureResult() { - return failureResult; - } - -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantOptions.java deleted file mode 100644 index 6c1341c81709..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantOptions.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.common.CommunicationIdentifier; -import com.azure.core.annotation.Fluent; - -/** - * The options for unmuting a participant. - */ -@Fluent -public final class UnmuteParticipantOptions { - /** - * The participants to unmute. - * Only ACS Users are currently supported. - */ - private final CommunicationIdentifier targetParticipant; - - /** - * The operational context - */ - private String operationContext; - - /** - * Constructor - * - * @param targetParticipant The participants to unmute. - */ - public UnmuteParticipantOptions(CommunicationIdentifier targetParticipant) { - this.targetParticipant = targetParticipant; - } - - /** - * Get the participant. - * - * @return the participant to unmute. - */ - public CommunicationIdentifier getTargetParticipant() { - return targetParticipant; - } - - /** - * Get the operationContext. - * - * @return the operationContext - */ - public String getOperationContext() { - return operationContext; - } - - /** - * Set the operationContext. - * - * @param operationContext the operationContext to set - * @return the UnmuteParticipantOptions object itself. - */ - public UnmuteParticipantOptions setOperationContext(String operationContext) { - this.operationContext = operationContext; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantResult.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantResult.java deleted file mode 100644 index 8a3d95295b0d..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UnmuteParticipantResult.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.communication.callautomation.implementation.accesshelpers.UnmuteParticipantsResponseConstructorProxy; -import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal; -import com.azure.core.annotation.Immutable; - -import java.util.Objects; - -/** The UnmuteParticipantsResult model. */ -@Immutable -public final class UnmuteParticipantResult { - /* - * The operation context provided by client. - */ - private final String operationContext; - - static { - UnmuteParticipantsResponseConstructorProxy.setAccessor(UnmuteParticipantResult::new); - } - - /** - * Public constructor. - * - */ - public UnmuteParticipantResult() { - this.operationContext = null; - } - - /** - * Package-private constructor of the class, used internally only. - * - * @param unmuteParticipantsResponseInternal The response from the service - */ - UnmuteParticipantResult(UnmuteParticipantsResponseInternal unmuteParticipantsResponseInternal) { - Objects.requireNonNull(unmuteParticipantsResponseInternal, "unmuteParticipantsResponseInternal must not be null"); - - this.operationContext = unmuteParticipantsResponseInternal.getOperationContext(); - } - - /** - * Get the operationContext property: The operation context provided by client. - * - * @return the operationContext value. - */ - public String getOperationContext() { - return this.operationContext; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UserConsent.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UserConsent.java deleted file mode 100644 index b2c4bd2d164a..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/UserConsent.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The UserConsent model. */ -@Fluent -public final class UserConsent { - /* - * The recording property. - */ - @JsonProperty(value = "recording") - private Integer recording; - - /** Creates an instance of UserConsent class. */ - public UserConsent() {} - - /** - * Get the recording property: The recording property. - * - * @return the recording value. - */ - public Integer getRecording() { - return this.recording; - } - - /** - * Set the recording property: The recording property. - * - * @param recording the recording value to set. - * @return the UserConsent object itself. - */ - public UserConsent setRecording(Integer recording) { - this.recording = recording; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/AnswerFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/AnswerFailed.java deleted file mode 100644 index fec022b7c7ce..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/AnswerFailed.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** AnswerFailed event. */ -@Immutable -public final class AnswerFailed extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation") - private ResultInformation resultInformation; - - private AnswerFailed() { - this.resultInformation = null; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionStopped.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionStopped.java index 44540eaf09b2..717a68c7ab95 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionStopped.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionStopped.java @@ -16,10 +16,7 @@ public final class ContinuousDtmfRecognitionStopped extends CallAutomationEventB @JsonProperty(value = "resultInformation") private final ResultInformation resultInformation; - /** - * Constructor for ContinuousDtmfRecognitionToneReceived - */ - public ContinuousDtmfRecognitionStopped() { + private ContinuousDtmfRecognitionStopped() { resultInformation = null; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneFailed.java index e015a5b97bae..cad45c984d8b 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneFailed.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneFailed.java @@ -16,10 +16,7 @@ public final class ContinuousDtmfRecognitionToneFailed extends CallAutomationEve @JsonProperty(value = "resultInformation") private final ResultInformation resultInformation; - /** - * Constructor for ContinuousDtmfRecognitionToneReceived - */ - public ContinuousDtmfRecognitionToneFailed() { + private ContinuousDtmfRecognitionToneFailed() { resultInformation = null; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneReceived.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneReceived.java index 32a0fceb2f0e..18480f9b996c 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneReceived.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ContinuousDtmfRecognitionToneReceived.java @@ -32,7 +32,7 @@ public final class ContinuousDtmfRecognitionToneReceived extends CallAutomationE /** * Constructor for ContinuousDtmfRecognitionToneReceived */ - public ContinuousDtmfRecognitionToneReceived() { + private ContinuousDtmfRecognitionToneReceived() { resultInformation = null; sequenceId = 0; tone = null; @@ -53,7 +53,7 @@ public int getSequenceId() { * * @return the tone value. */ - public DtmfTone getTone() { + public DtmfTone getTone() { return this.tone; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CreateCallFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CreateCallFailed.java deleted file mode 100644 index 95e6b808b23a..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/CreateCallFailed.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The CreateCallFailed event. */ -@Immutable -public final class CreateCallFailed extends CallAutomationEventBase { - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation") - private ResultInformation resultInformation; - - private CreateCallFailed() { - this.resultInformation = null; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogCompleted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogCompleted.java deleted file mode 100644 index f81e686141f8..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogCompleted.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogCompleted model. */ -@Immutable -public class DialogCompleted extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /** Creates an instance of DialogCompleted class. */ - public DialogCompleted() {} - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogConsent.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogConsent.java deleted file mode 100644 index 4c5161304b93..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogConsent.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.communication.callautomation.models.UserConsent; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogConsent model. */ -@Immutable -public final class DialogConsent extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * UserConsent data from the Conversation Conductor - */ - @JsonProperty(value = "userConsent", access = JsonProperty.Access.WRITE_ONLY) - private UserConsent userConsent; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /** Creates an instance of DialogConsent class. */ - public DialogConsent() {} - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Get the userConsent property: UserConsent data from the Conversation Conductor. - * - * @return the userConsent value. - */ - public UserConsent getUserConsent() { - return this.userConsent; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogFailed.java deleted file mode 100644 index 3d64182a0038..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogFailed.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogFailed model. */ -public final class DialogFailed extends CallAutomationEventBase { - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /** Creates an instance of DialogCompleted class. */ - public DialogFailed() {} - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogHangup.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogHangup.java deleted file mode 100644 index 0f4a0c883d7c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogHangup.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogHangup model. */ -@Fluent -public final class DialogHangup extends CallAutomationEventBase { - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /* - * Ivr Context - */ - @JsonProperty(value = "ivrContext", access = JsonProperty.Access.WRITE_ONLY) - private Object ivrContext; - - /** Creates an instance of DialogHangup class. */ - public DialogHangup() {} - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } - - /** - * Get the ivrContext property: Ivr Context. - * - * @return the ivrContext value. - */ - public Object getIvrContext() { - return this.ivrContext; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogLanguageChange.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogLanguageChange.java deleted file mode 100644 index c0d55784ba16..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogLanguageChange.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogLanguageChange model. */ -@Fluent -public final class DialogLanguageChange extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /* - * Selected Language - */ - @JsonProperty(value = "selectedLanguage", access = JsonProperty.Access.WRITE_ONLY) - private String selectedLanguage; - - /* - * Ivr Context - */ - @JsonProperty(value = "ivrContext", access = JsonProperty.Access.WRITE_ONLY) - private Object ivrContext; - - /** Creates an instance of DialogLanguageChange class. */ - public DialogLanguageChange() {} - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } - - /** - * Get the selectedLanguage property: Selected Language. - * - * @return the selectedLanguage value. - */ - public String getSelectedLanguage() { - return this.selectedLanguage; - } - - /** - * Get the ivrContext property: Ivr Context. - * - * @return the ivrContext value. - */ - public Object getIvrContext() { - return this.ivrContext; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogSensitivityUpdate.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogSensitivityUpdate.java deleted file mode 100644 index ec42e938f049..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogSensitivityUpdate.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogSensitivityUpdate model. */ -@Fluent -public final class DialogSensitivityUpdate extends CallAutomationEventBase { - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /* - * SensitiveMask - */ - @JsonProperty(value = "sensitiveMask", access = JsonProperty.Access.WRITE_ONLY) - private Boolean sensitiveMask; - - /** Creates an instance of DialogSensitivityUpdate class. */ - public DialogSensitivityUpdate() {} - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } - - /** - * Get the sensitiveMask property: SensitiveMask. - * - * @return the sensitiveMask value. - */ - public Boolean isSensitiveMask() { - return this.sensitiveMask; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogStarted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogStarted.java deleted file mode 100644 index 205301c68c07..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogStarted.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogStarted model. */ -@Immutable -public class DialogStarted extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /** Creates an instance of DialogStarted class. */ - public DialogStarted() {} - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogTransfer.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogTransfer.java deleted file mode 100644 index 3ebf114624c5..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/DialogTransfer.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DialogTransfer model. */ -@Fluent -public final class DialogTransfer extends CallAutomationEventBase { - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private ResultInformation resultInformation; - - /* - * Determines the type of the dialog. - */ - @JsonProperty(value = "dialogInputType") - private DialogInputType dialogInputType; - - /* - * Dialog ID - */ - @JsonProperty(value = "dialogId", access = JsonProperty.Access.WRITE_ONLY) - private String dialogId; - - /* - * Transfer type - */ - @JsonProperty(value = "transferType", access = JsonProperty.Access.WRITE_ONLY) - private String transferType; - - /* - * Transfer destination - */ - @JsonProperty(value = "transferDestination", access = JsonProperty.Access.WRITE_ONLY) - private String transferDestination; - - /* - * IVR context - */ - @JsonProperty(value = "ivrContext", access = JsonProperty.Access.WRITE_ONLY) - private Object ivrContext; - - /** Creates an instance of DialogTransfer class. */ - public DialogTransfer() {} - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the dialogInputType property: Determines the type of the dialog. - * - * @return the dialogInputType value. - */ - public DialogInputType getDialogInputType() { - return this.dialogInputType; - } - - /** - * Get the dialogId property: Dialog ID. - * - * @return the dialogId value. - */ - public String getDialogId() { - return this.dialogId; - } - - /** - * Get the transferType property: Transfer type. - * - * @return the transferType value. - */ - public String getTransferType() { - return this.transferType; - } - - /** - * Get the transferDestination property: Transfer destination. - * - * @return the transferDestination value. - */ - public String getTransferDestination() { - return this.transferDestination; - } - - /** - * Get the ivrContext property: IVR context. - * - * @return the ivrContext value. - */ - public Object getIvrContext() { - return this.ivrContext; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/HoldFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/HoldFailed.java deleted file mode 100644 index 086b1da19c30..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/HoldFailed.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The HoldFailed model. */ -@Immutable -public final class HoldFailed extends CallAutomationEventBaseWithReasonCode { - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation") - private final ResultInformation resultInformation; - - private HoldFailed() { - this.resultInformation = null; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ReasonCode.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ReasonCode.java index 9fa3e81cc45f..5a5872899001 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ReasonCode.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/ReasonCode.java @@ -43,8 +43,6 @@ public static class Play extends ExpandableStringEnum { public static final ReasonCode DOWNLOAD_FAILED = fromReasonCode(8536); /** Action failed, invalid file format. */ public static final ReasonCode INVALID_FILE_FORMAT = fromReasonCode(8535); - /** Action failed, cognitive service play error. */ - public static final ReasonCode COGNITEIVE_SERVICE_PLAY_ERROR = fromReasonCode(8565); /** Action failed, text or ssml play source empty. */ public static final ReasonCode TEXT_OR_SSML_SOURCE_EMPTY = fromReasonCode(8582); /** Action failed, cognitive services error. */ diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesCompleted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesCompleted.java index 15dcbf2d9029..1961aececf7e 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesCompleted.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesCompleted.java @@ -16,10 +16,7 @@ public final class SendDtmfTonesCompleted extends CallAutomationEventBase { @JsonProperty(value = "resultInformation") private final ResultInformation resultInformation; - /** - * Constructor for SendDtmfTonesCompleted - */ - public SendDtmfTonesCompleted() { + private SendDtmfTonesCompleted() { resultInformation = null; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesFailed.java index 67c8aeb6d902..669b71f07a79 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesFailed.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/SendDtmfTonesFailed.java @@ -16,10 +16,7 @@ public final class SendDtmfTonesFailed extends CallAutomationEventBase { @JsonProperty(value = "resultInformation") private final ResultInformation resultInformation; - /** - * Constructor for SendDtmfTonesFailed - */ - public SendDtmfTonesFailed() { + private SendDtmfTonesFailed() { resultInformation = null; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TeamsComplianceRecordingStateChanged.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TeamsComplianceRecordingStateChanged.java deleted file mode 100644 index afe186af651f..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TeamsComplianceRecordingStateChanged.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.RecordingState; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** The TeamsComplianceRecordingStateChanged model. */ -@Immutable -public final class TeamsComplianceRecordingStateChanged extends CallAutomationEventBase { - - /** - * Recording Id. - */ - @JsonProperty(value = "recordingId") - private final String recordingId; - - /** - * Recording state. - */ - @JsonProperty(value = "state") - private final RecordingState recordingState; - - /** - * Time of when it started recording. - */ - @JsonIgnore - private final OffsetDateTime startDateTime; - - @JsonCreator - private TeamsComplianceRecordingStateChanged(@JsonProperty("startDateTime") String startDateTime) { - this.startDateTime = OffsetDateTime.parse(startDateTime, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - this.recordingId = null; - this.recordingState = null; - } - - /** - * Get the recordingId property: Recording Id. - * - * @return the recordingId value. - */ - public String getRecordingId() { - return recordingId; - } - - /** - * Get the recordingState property: Recording State. - * - * @return the recordingState value. - */ - public RecordingState getRecordingState() { - return recordingState; - } - - /** - * Get the startDateTime property: Start Date time. - * - * @return the startDateTime value. - */ - public OffsetDateTime getStartDateTime() { - return startDateTime; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TeamsRecordingStateChanged.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TeamsRecordingStateChanged.java deleted file mode 100644 index 6d1db9aa7952..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TeamsRecordingStateChanged.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.events; - -import com.azure.communication.callautomation.models.RecordingState; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** The TeamsRecordingStateChanged model. */ -@Immutable -public final class TeamsRecordingStateChanged extends CallAutomationEventBase { - - /** - * Recording Id. - */ - @JsonProperty(value = "recordingId") - private final String recordingId; - - /** - * Recording state. - */ - @JsonProperty(value = "state") - private final RecordingState recordingState; - - /** - * Time of when it started recording. - */ - @JsonIgnore - private final OffsetDateTime startDateTime; - - @JsonCreator - private TeamsRecordingStateChanged(@JsonProperty("startDateTime") String startDateTime) { - this.startDateTime = OffsetDateTime.parse(startDateTime, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - this.recordingId = null; - this.recordingState = null; - } - - /** - * Get the recordingId property: Recording Id. - * - * @return the recordingId value. - */ - public String getRecordingId() { - return recordingId; - } - - /** - * Get the recordingState property: Recording State. - * - * @return the recordingState value. - */ - public RecordingState getRecordingState() { - return recordingState; - } - - /** - * Get the startDateTime property: Start Date time. - * - * @return the startDateTime value. - */ - public OffsetDateTime getStartDateTime() { - return startDateTime; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionFailed.java deleted file mode 100644 index f4eeabcbbe1e..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionFailed.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionFailed model. - */ -@Fluent -public final class TranscriptionFailed extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code, sub-code and message. - */ - @JsonProperty(value = "resultInformation") - private final ResultInformation resultInformation; - - /* - * Defines the result for TranscriptionUpdate with the current status and the details about the status - */ - @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) - private final TranscriptionUpdate transcriptionUpdateResult; - - /** - * Creates an instance of TranscriptionFailed class. - */ - public TranscriptionFailed() { - this.resultInformation = null; - this.transcriptionUpdateResult = null; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status - * and the details about the status. - * - * @return the transcriptionUpdateResult value. - */ - public TranscriptionUpdate getTranscriptionUpdateResult() { - return this.transcriptionUpdateResult; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionResumed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionResumed.java deleted file mode 100644 index d810f59f7c2c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionResumed.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionResumed model. - */ -@Fluent -public final class TranscriptionResumed extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private final ResultInformation resultInformation; - - /* - * Defines the result for TranscriptionUpdate with the current status and the details about the status - */ - @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) - private final TranscriptionUpdate transcriptionUpdateResult; - - /** - * Creates an instance of TranscriptionResumed class. - */ - public TranscriptionResumed() { - resultInformation = null; - transcriptionUpdateResult = null; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status - * and the details about the status. - * - * @return the transcriptionUpdateResult value. - */ - public TranscriptionUpdate getTranscriptionUpdateResult() { - return this.transcriptionUpdateResult; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStarted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStarted.java deleted file mode 100644 index 060157545a66..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStarted.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionStarted model. - */ -@Fluent -public final class TranscriptionStarted extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private final ResultInformation resultInformation; - - /* - * Defines the result for TranscriptionUpdate with the current status and the details about the status - */ - @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) - private final TranscriptionUpdate transcriptionUpdateResult; - - /** - * Creates an instance of TranscriptionStarted class. - */ - public TranscriptionStarted() { - resultInformation = null; - transcriptionUpdateResult = null; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status - * and the details about the status. - * - * @return the transcriptionUpdateResult value. - */ - public TranscriptionUpdate getTranscriptionUpdateResult() { - return this.transcriptionUpdateResult; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatus.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatus.java deleted file mode 100644 index b00f8e095004..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatus.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.Collection; - -/** - * Defines values for TranscriptionStatus. - */ -public final class TranscriptionStatus extends ExpandableStringEnum { - /** - * Static value transcriptionStarted for TranscriptionStatus. - */ - public static final TranscriptionStatus TRANSCRIPTION_STARTED = fromString("transcriptionStarted"); - - /** - * Static value transcriptionFailed for TranscriptionStatus. - */ - public static final TranscriptionStatus TRANSCRIPTION_FAILED = fromString("transcriptionFailed"); - - /** - * Static value transcriptionResumed for TranscriptionStatus. - */ - public static final TranscriptionStatus TRANSCRIPTION_RESUMED = fromString("transcriptionResumed"); - - /** - * Static value transcriptionLocaleUpdated for TranscriptionStatus. - */ - public static final TranscriptionStatus TRANSCRIPTION_LOCALE_UPDATED = fromString("transcriptionLocaleUpdated"); - - /** - * Static value transcriptionStopped for TranscriptionStatus. - */ - public static final TranscriptionStatus TRANSCRIPTION_STOPPED = fromString("transcriptionStopped"); - - /** - * Static value unspecifiedError for TranscriptionStatus. - */ - public static final TranscriptionStatus UNSPECIFIED_ERROR = fromString("unspecifiedError"); - - /** - * Creates a new instance of TranscriptionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TranscriptionStatus() { - } - - /** - * Creates or finds a TranscriptionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding TranscriptionStatus. - */ - @JsonCreator - public static TranscriptionStatus fromString(String name) { - return fromString(name, TranscriptionStatus.class); - } - - /** - * Gets known TranscriptionStatus values. - * - * @return known TranscriptionStatus values. - */ - public static Collection values() { - return values(TranscriptionStatus.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatusDetails.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatusDetails.java deleted file mode 100644 index 351d299e2a6a..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStatusDetails.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.Collection; - -/** - * Defines values for TranscriptionStatusDetails. - */ -public final class TranscriptionStatusDetails extends ExpandableStringEnum { - /** - * Static value subscriptionStarted for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails SUBSCRIPTION_STARTED = fromString("subscriptionStarted"); - - /** - * Static value streamConnectionReestablished for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_REESTABLISHED - = fromString("streamConnectionReestablished"); - - /** - * Static value streamConnectionUnsuccessful for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_UNSUCCESSFUL - = fromString("streamConnectionUnsuccessful"); - - /** - * Static value streamUrlMissing for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails STREAM_URL_MISSING = fromString("streamUrlMissing"); - - /** - * Static value serviceShutdown for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails SERVICE_SHUTDOWN = fromString("serviceShutdown"); - - /** - * Static value streamConnectionInterrupted for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails STREAM_CONNECTION_INTERRUPTED - = fromString("streamConnectionInterrupted"); - - /** - * Static value speechServicesConnectionError for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails SPEECH_SERVICES_CONNECTION_ERROR - = fromString("speechServicesConnectionError"); - - /** - * Static value subscriptionStopped for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails SUBSCRIPTION_STOPPED = fromString("subscriptionStopped"); - - /** - * Static value unspecifiedError for TranscriptionStatusDetails. - */ - public static final TranscriptionStatusDetails UNSPECIFIED_ERROR = fromString("unspecifiedError"); - - /** - * Creates a new instance of TranscriptionStatusDetails value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TranscriptionStatusDetails() { - } - - /** - * Creates or finds a TranscriptionStatusDetails from its string representation. - * - * @param name a name to look for. - * @return the corresponding TranscriptionStatusDetails. - */ - @JsonCreator - public static TranscriptionStatusDetails fromString(String name) { - return fromString(name, TranscriptionStatusDetails.class); - } - - /** - * Gets known TranscriptionStatusDetails values. - * - * @return known TranscriptionStatusDetails values. - */ - public static Collection values() { - return values(TranscriptionStatusDetails.class); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStopped.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStopped.java deleted file mode 100644 index c41373ffbaac..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionStopped.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionStopped model. - */ -@Fluent -public final class TranscriptionStopped extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private final ResultInformation resultInformation; - - /* - * Defines the result for TranscriptionUpdate with the current status and the details about the status - */ - @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) - private final TranscriptionUpdate transcriptionUpdateResult; - - /** - * Creates an instance of TranscriptionStopped class. - */ - public TranscriptionStopped() { - resultInformation = null; - transcriptionUpdateResult = null; - } - - /** - * Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status - * and the details about the status. - * - * @return the transcriptionUpdateResult value. - */ - public TranscriptionUpdate getTranscriptionUpdateResult() { - return this.transcriptionUpdateResult; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdate.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdate.java deleted file mode 100644 index ff510421c203..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdate.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionUpdate model. - */ -@Fluent -public final class TranscriptionUpdate { - /* - * The transcriptionStatus property. - */ - @JsonProperty(value = "transcriptionStatus") - private TranscriptionStatus transcriptionStatus; - - /* - * The transcriptionStatusDetails property. - */ - @JsonProperty(value = "transcriptionStatusDetails") - private TranscriptionStatusDetails transcriptionStatusDetails; - - /** - * Creates an instance of TranscriptionUpdate class. - */ - public TranscriptionUpdate() { - } - - /** - * Get the transcriptionStatus property: The transcriptionStatus property. - * - * @return the transcriptionStatus value. - */ - public TranscriptionStatus getTranscriptionStatus() { - return this.transcriptionStatus; - } - - /** - * Set the transcriptionStatus property: The transcriptionStatus property. - * - * @param transcriptionStatus the transcriptionStatus value to set. - * @return the TranscriptionUpdate object itself. - */ - public TranscriptionUpdate setTranscriptionStatus(TranscriptionStatus transcriptionStatus) { - this.transcriptionStatus = transcriptionStatus; - return this; - } - - /** - * Get the transcriptionStatusDetails property: The transcriptionStatusDetails property. - * - * @return the transcriptionStatusDetails value. - */ - public TranscriptionStatusDetails getTranscriptionStatusDetails() { - return this.transcriptionStatusDetails; - } - - /** - * Set the transcriptionStatusDetails property: The transcriptionStatusDetails property. - * - * @param transcriptionStatusDetails the transcriptionStatusDetails value to set. - * @return the TranscriptionUpdate object itself. - */ - public TranscriptionUpdate setTranscriptionStatusDetails(TranscriptionStatusDetails transcriptionStatusDetails) { - this.transcriptionStatusDetails = transcriptionStatusDetails; - return this; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdated.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdated.java deleted file mode 100644 index e762737ffb6e..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/TranscriptionUpdated.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callautomation.models.events; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The TranscriptionUpdated model. - */ -@Fluent -public final class TranscriptionUpdated extends CallAutomationEventBase { - - /* - * Contains the resulting SIP code/sub-code and message from NGC services. - */ - @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) - private final ResultInformation resultInformation; - - /* - * Defines the result for TranscriptionUpdate with the current status and the details about the status - */ - @JsonProperty(value = "transcriptionUpdate", access = JsonProperty.Access.WRITE_ONLY) - private final TranscriptionUpdate transcriptionUpdateResult; - - /** - * Creates an instance of TranscriptionUpdated class. - */ - public TranscriptionUpdated() { - resultInformation = null; - transcriptionUpdateResult = null; - } - - /** - * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. - * - * @return the resultInformation value. - */ - public ResultInformation getResultInformation() { - return this.resultInformation; - } - - /** - * Get the transcriptionUpdateResult property: Defines the result for TranscriptionUpdate with the current status - * and the details about the status. - * - * @return the transcriptionUpdateResult value. - */ - public TranscriptionUpdate getTranscriptionUpdateResult() { - return this.transcriptionUpdateResult; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/package-info.java index 91a5fa7fc254..2ef5cf66e565 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/package-info.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing classes for AzureCommunicationCallAutomationService. Azure Communication Service Call Automation - * APIs. + * Package containing the data models for AzureCommunicationCallAutomationService. Azure Communication Service Call + * Automation APIs. */ package com.azure.communication.callautomation.models; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingData.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingData.java deleted file mode 100644 index 09374d3615d5..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingData.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming; - -/** The abstract classed used as parent of Streaming data such as Audio, Transcription or Captions. */ -public abstract class StreamingData { -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingDataParser.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingDataParser.java deleted file mode 100644 index 8e0de8a8d067..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/StreamingDataParser.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming; - -import com.azure.communication.callautomation.implementation.converters.AudioDataConverter; -import com.azure.communication.callautomation.implementation.converters.AudioMetadataConverter; -import com.azure.communication.callautomation.implementation.converters.TranscriptionDataConverter; -import com.azure.communication.callautomation.implementation.converters.TranscriptionMetadataConverter; -import com.azure.communication.callautomation.models.streaming.media.AudioData; -import com.azure.communication.callautomation.models.streaming.media.AudioMetadata; -import com.azure.communication.callautomation.models.streaming.transcription.TranscriptionData; -import com.azure.communication.callautomation.models.streaming.transcription.TranscriptionMetadata; -import com.azure.core.util.BinaryData; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.nio.charset.StandardCharsets; - -/** - * A generic parser for different packages, such as Media(Audio) or Transcription, received as - * part of streaming over websocket - */ -public final class StreamingDataParser { - private static final ClientLogger LOGGER = new ClientLogger(StreamingDataParser.class); - - /*** - * Parses StreamingData such as Audio, Transcription or Captions from BinaryData. - * - * @param json The MediaStreaming package as a BinaryData object. - * @throws RuntimeException Any exceptions occur at runtime. - * @return a MediaStreamingPackageBase object. - */ - public static StreamingData parse(BinaryData json) { - return parse(json.toString()); - } - - /*** - * Parses a StreamingData such as Audio, Transcription or Captions from byte array. - * - * @param receivedBytes The MediaStreaming package as a byte[]. - * @throws RuntimeException Any exceptions occur at runtime. - * @return a MediaStreamingPackageBase object. - */ - public static StreamingData parse(byte[] receivedBytes) { - return parse(new String(receivedBytes, StandardCharsets.UTF_8)); - } - - /*** - * Parses a StreamingData such as Audio, Transcription or Captions from String. - * - * @param stringJson The MediaStreaming package as a String. - * @throws RuntimeException Any exceptions occur at runtime. - * @return a MediaStreamingPackageBase object. - */ - public static StreamingData parse(String stringJson) { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - JsonNode jsonData = mapper.readTree(stringJson); - - //region Audio - if (stringJson.contains("AudioData")) { - AudioDataConverter audioInternal = mapper.convertValue(jsonData.get("audioData"), AudioDataConverter.class); - return new AudioData(audioInternal.getData(), audioInternal.getTimestamp(), audioInternal.getParticipantRawID(), audioInternal.isSilent()); - } - if (stringJson.contains("AudioMetadata")) { - AudioMetadataConverter metadataInternal = mapper.convertValue(jsonData.get("audioMetadata"), AudioMetadataConverter.class); - return new AudioMetadata(metadataInternal.getMediaSubscriptionId(), metadataInternal.getEncoding(), metadataInternal.getSampleRate(), metadataInternal.getChannels(), metadataInternal.getLength()); - } - //endregion - - //region Transcription - if (stringJson.contains("TranscriptionData")) { - TranscriptionDataConverter transcriptionInternal = mapper.convertValue(jsonData.get("transcriptionData"), TranscriptionDataConverter.class); - return new TranscriptionData(transcriptionInternal.getText(), transcriptionInternal.getFormat(), transcriptionInternal.getConfidence(), transcriptionInternal.getOffset(), transcriptionInternal.getDuration(), transcriptionInternal.getWords(), transcriptionInternal.getParticipantRawID(), transcriptionInternal.getResultStatus()); - } - if (stringJson.contains("TranscriptionMetadata")) { - TranscriptionMetadataConverter transcriptionMetadataInternal = mapper.convertValue(jsonData.get("transcriptionMetadata"), TranscriptionMetadataConverter.class); - return new TranscriptionMetadata(transcriptionMetadataInternal.getTranscriptionSubscriptionId(), transcriptionMetadataInternal.getLocale(), transcriptionMetadataInternal.getCallConnectionId(), transcriptionMetadataInternal.getCorrelationId()); - } - //endregion - - return null; - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } catch (JsonProcessingException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioData.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioData.java deleted file mode 100644 index bb9b4c12f70d..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioData.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming.media; - -import com.azure.communication.callautomation.models.streaming.StreamingData; -import com.azure.communication.common.CommunicationIdentifier; - -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** The MediaStreamingAudio model. */ -public final class AudioData extends StreamingData { - - /* - * The audio data. - */ - private final String data; - - /* - * The timestamp of when the media was sourced. - */ - private final OffsetDateTime timestamp; - - /* - * The participantId. - */ - private final CommunicationIdentifier participant; - - /* - * Indicates if the received audio buffer contains only silence. - */ - private final boolean silent; - - /** - * The constructor - * - * @param data The audio data. - * @param timestamp The timestamp of when the media was sourced. - * @param participantRawID The participantId. - * @param silent Indicates if the received audio buffer contains only silence. - */ - public AudioData(String data, String timestamp, String participantRawID, boolean silent) { - this.data = data; - this.timestamp = OffsetDateTime.parse(timestamp, DateTimeFormatter.ISO_OFFSET_DATE_TIME); - if (participantRawID != null && !participantRawID.isEmpty()) { - this.participant = CommunicationIdentifier.fromRawId(participantRawID); - } else { - participant = null; - } - this.silent = silent; - } - - /** - * Get the data property. - * - * @return the data value. - */ - public String getData() { - return data; - } - - /** - * Get the timestamp property. - * - * @return the timestamp value. - */ - public OffsetDateTime getTimestamp() { - return timestamp; - } - - /** - * Get the participantRawID property. - * - * @return the participantRawID value. - */ - public CommunicationIdentifier getParticipant() { - return participant; - } - - /** - * Get the silent property. - * - * @return the silent value. - */ - public boolean isSilent() { - return silent; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioMetadata.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioMetadata.java deleted file mode 100644 index 41503a385405..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/AudioMetadata.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming.media; - -import com.azure.communication.callautomation.models.streaming.StreamingData; - -/** The MediaStreamingMetadata model. */ -public final class AudioMetadata extends StreamingData { - - /* - * The mediaSubscriptionId. - */ - private final String mediaSubscriptionId; - - /* - * The encoding. - */ - private final String encoding; - - /* - * The sampleRate. - */ - private final int sampleRate; - - /* - * The channels. - */ - private final int channels; - - /* - * The length. - */ - private final int length; - - /** - * The constructor - * - * @param mediaSubscriptionId The mediaSubscriptionId. - * @param encoding The encoding. - * @param sampleRate The sampleRate. - * @param channels The channels. - * @param length The length. - */ - public AudioMetadata(String mediaSubscriptionId, String encoding, int sampleRate, int channels, int length) { - this.mediaSubscriptionId = mediaSubscriptionId; - this.encoding = encoding; - this.sampleRate = sampleRate; - this.channels = channels; - this.length = length; - } - - /** - * Get the mediaSubscriptionId property. - * - * @return the mediaSubscriptionId value. - */ - public String getMediaSubscriptionId() { - return mediaSubscriptionId; - } - - /** - * Get the encoding property. - * - * @return the encoding value. - */ - public String getEncoding() { - return encoding; - } - - /** - * Get the sampleRate property. - * - * @return the sampleRate value. - */ - public int getSampleRate() { - return sampleRate; - } - - /** - * Get the channels property. - * - * @return the channels value. - */ - public int getChannels() { - return channels; - } - - /** - * Get the length property. - * - * @return the length value. - */ - public int getLength() { - return length; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/package-info.java deleted file mode 100644 index 4ccc2863a62a..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/media/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** Package containing websocket models for Media Streaming. null. */ -package com.azure.communication.callautomation.models.streaming.media; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/package-info.java deleted file mode 100644 index 3ac68832f269..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** Package containing websocket models for streaming data such Media Streaming, Transcription or Live Caption. null. */ -package com.azure.communication.callautomation.models.streaming; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/ResultStatus.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/ResultStatus.java deleted file mode 100644 index cdf989f4c89f..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/ResultStatus.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming.transcription; - -/** - * The status of the result of transcription - */ -public enum ResultStatus { - - /** - * Intermediate result - */ - INTERMEDIATE, - - /** - * Final result - */ - FINAL -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TextFormat.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TextFormat.java deleted file mode 100644 index e3b3545b487d..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TextFormat.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming.transcription; - -/** - * The format of transcription text - */ -public enum TextFormat { - - /** - * Formatted recognize text with punctuations - */ - DISPLAY -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionData.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionData.java deleted file mode 100644 index 1f6be9738fcd..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionData.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming.transcription; - -import com.azure.communication.callautomation.models.streaming.StreamingData; -import com.azure.communication.common.CommunicationIdentifier; -import com.azure.core.util.logging.ClientLogger; - -import java.util.List; - -/** - * The TranscriptionData model. - */ -public final class TranscriptionData extends StreamingData { - - private static final ClientLogger LOGGER = new ClientLogger(TranscriptionData.class); - - /* - * The display form of the recognized word - */ - private final String text; - - /* - * The format of text - */ - private final TextFormat format; - - /* - * Confidence of recognition of the whole phrase, from 0.0 (no confidence) to 1.0 (full confidence) - */ - private final double confidence; - - /* - * The position of this payload - */ - private final long offset; - - /* - * Duration in ticks. 1 tick = 100 nanoseconds. - */ - private final long duration; - - /* - * The result for each word of the phrase - */ - private final List words; - - /* - * The identified speaker based on participant raw ID - */ - private final CommunicationIdentifier participant; - - /** - * Status of the result of transcription - */ - private final ResultStatus resultStatus; - - /** - * The TranscriptionData constructor - * - * @param text The display form of the recognized word - * @param format The format of text - * @param confidence Confidence of recognition of the whole phrase, from 0.0 (no confidence) to 1.0 (full confidence) - * @param offset The position of this payload - * @param duration The Duration in ticks. 1 tick = 100 nanoseconds. - * @param words The result for each word of the phrase - * @param participantRawID The identified speaker based on participant raw ID - * @param resultStatus Status of the result of transcription - */ - public TranscriptionData(String text, String format, double confidence, long offset, long duration, List words, String participantRawID, String resultStatus) { - this.text = text; - this.format = convertToTextFormatEnum(format); - this.confidence = confidence; - this.offset = offset; - this.duration = duration; - this.words = words; - if (participantRawID != null && !participantRawID.isEmpty()) { - this.participant = CommunicationIdentifier.fromRawId(participantRawID); - } else { - participant = null; - } - this.resultStatus = convertToResultStatusEnum(resultStatus); - } - - private ResultStatus convertToResultStatusEnum(String resultStatus) { - if ("Intermediate".equalsIgnoreCase(resultStatus)) { - return ResultStatus.INTERMEDIATE; - } else if ("Final".equalsIgnoreCase(resultStatus)) { - return ResultStatus.FINAL; - } else { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(resultStatus)); - - } - } - - private TextFormat convertToTextFormatEnum(String format) { - if ("Display".equalsIgnoreCase(format)) { - return TextFormat.DISPLAY; - } else { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(format)); - } - } - - /** - * Get the text property. - * - * @return the text value. - */ - public String getText() { - return text; - } - - /** - * Get the format property. - * - * @return the format value. - */ - public TextFormat getFormat() { - return format; - } - - /** - * Get the confidence property. - * - * @return the confidence value. - */ - public double getConfidence() { - return confidence; - } - - /** - * Get the offset property. - * - * @return the offset value. - */ - public Long getOffset() { - return offset; - } - /** - * Get the duration property. - * - * @return the duration value. - */ - public Long getDuration() { - return duration; - } - /** - * Get the words property. - * - * @return the words value. - */ - public List getWords() { - return words; - } - - /** - * Get the participantRawID property. - * - * @return the participantRawID value. - */ - public CommunicationIdentifier getParticipant() { - return participant; - } - - /** - * Get the resultStatus property. - * - * @return the resultStatus value. - */ - public ResultStatus getResultStatus() { - return resultStatus; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionMetadata.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionMetadata.java deleted file mode 100644 index 1a6641772bde..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/TranscriptionMetadata.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming.transcription; - -import com.azure.communication.callautomation.models.streaming.StreamingData; - -/** - * Metadata for Transcription Streaming. - */ -public final class TranscriptionMetadata extends StreamingData { - - - /* - * Transcription Subscription Id. - */ - private final String transcriptionSubscriptionId; - - /* - * The target locale in which the translated text needs to be - */ - private final String locale; - - /* - * Call connection id - */ - private final String callConnectionId; - - /* - * Correlation id - */ - private final String correlationId; - - /** - * Creates an instance of TranscriptionMetadata class. - * @param transcriptionSubscriptionId Transcription Subscription Id. - * @param locale The target locale in which the translated text needs to be - * @param callConnectionId Call connection id - * @param correlationId Correlation id - */ - public TranscriptionMetadata(String transcriptionSubscriptionId, String locale, String callConnectionId, String correlationId) { - this.transcriptionSubscriptionId = transcriptionSubscriptionId; - this.locale = locale; - this.callConnectionId = callConnectionId; - this.correlationId = correlationId; - } - - /** - * Get the transcriptionSubscriptionId property. - * - * @return the transcriptionSubscriptionId value. - */ - public String getTranscriptionSubscriptionId() { - return transcriptionSubscriptionId; - } - - /** - * Get the locale property. - * - * @return the locale value. - */ - public String getLocale() { - return locale; - } - - /** - * Get the callConnectionId property. - * - * @return the callConnectionId value. - */ - public String getCallConnectionId() { - return callConnectionId; - } - - /** - * Get the correlationId property. - * - * @return the correlationId value. - */ - public String getCorrelationId() { - return correlationId; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/Word.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/Word.java deleted file mode 100644 index e0582ee875a4..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/Word.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation.models.streaming.transcription; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The result for each word of the phrase - */ -public class Word { - - /* - * Text in the phrase. - */ - @JsonProperty(value = "text") - private String text; - - /* - * The word's position within the phrase. - */ - @JsonProperty(value = "offset") - private long offset; - - /* - * Duration in ticks. 1 tick = 100 nanoseconds. - */ - @JsonProperty(value = "duration") - private long duration; - - /** - * Get the text property. - * - * @return the text value. - */ - public String getText() { - return text; - } - - /** - * Get the offset property. - * - * @return the offset value. - */ - public long getOffset() { - return offset; - } - - /** - * Get the duration property. - * - * @return the duration value. - */ - public long getDuration() { - return duration; - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/package-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/package-info.java deleted file mode 100644 index ba9eb057e8e4..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/streaming/transcription/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** Package containing websocket models for Transcription. null. */ -package com.azure.communication.callautomation.models.streaming.transcription; diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/module-info.java b/sdk/communication/azure-communication-callautomation/src/main/java/module-info.java index 42bdba18262d..8a600dad623c 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/module-info.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/module-info.java @@ -9,7 +9,6 @@ exports com.azure.communication.callautomation; exports com.azure.communication.callautomation.models; exports com.azure.communication.callautomation.models.events; - exports com.azure.communication.callautomation.implementation.eventprocessor; // exporting some packages specifically for Jackson opens com.azure.communication.callautomation.implementation.models to com.fasterxml.jackson.databind, com.azure.core; @@ -17,10 +16,4 @@ opens com.azure.communication.callautomation.models to com.azure.core, com.fasterxml.jackson.databind; opens com.azure.communication.callautomation.models.events to com.fasterxml.jackson.databind; opens com.azure.communication.callautomation.implementation.converters to com.azure.core, com.fasterxml.jackson.databind; - exports com.azure.communication.callautomation.models.streaming.media; - opens com.azure.communication.callautomation.models.streaming.media to com.azure.core, com.fasterxml.jackson.databind; - exports com.azure.communication.callautomation.models.streaming; - opens com.azure.communication.callautomation.models.streaming to com.azure.core, com.fasterxml.jackson.databind; - exports com.azure.communication.callautomation.models.streaming.transcription; - opens com.azure.communication.callautomation.models.streaming.transcription to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java index a8efd0787418..b6e9b6acb003 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java @@ -16,6 +16,7 @@ import com.azure.communication.identity.CommunicationIdentityAsyncClient; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; +import com.azure.core.test.annotation.DoNotRecord; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -31,6 +32,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class CallAutomationAsyncClientAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -131,6 +133,7 @@ public void createVOIPCallAndAnswerThenHangupAutomatedTest(HttpClient httpClient } } + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientUnitTests.java index 14ad80ed2c25..4d48cce6aae7 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientUnitTests.java @@ -8,8 +8,8 @@ import com.azure.communication.callautomation.models.CallInvite; import com.azure.communication.callautomation.models.CallRejectReason; import com.azure.communication.callautomation.models.CreateCallOptions; -import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.CreateCallResult; +import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.RedirectCallOptions; import com.azure.communication.callautomation.models.RejectCallOptions; import com.azure.communication.common.CommunicationIdentifier; @@ -31,7 +31,7 @@ public void createGroupCall() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null), 201) ))); CallInvite callInvite = new CallInvite(new CommunicationUserIdentifier(CALL_TARGET_ID)); @@ -44,7 +44,7 @@ public void createCall() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null), 201) ))); List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); @@ -57,21 +57,17 @@ public void createGroupCallWithResponse() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 201) ))); List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); CreateGroupCallOptions callOptions = new CreateGroupCallOptions(targets, CALL_CALLBACK_URL); callOptions.setOperationContext(CALL_SUBJECT); - callOptions.setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION); - callOptions.setTranscriptionConfiguration(TRANSCRIPTION_CONFIGURATION); Response createCallResult = callAutomationAsyncClient.createGroupCallWithResponse(callOptions).block(); assertNotNull(createCallResult); assertEquals(201, createCallResult.getStatusCode()); assertNotNull(createCallResult.getValue()); - assertEquals(MEDIA_SUBSCRIPTION_ID, createCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); - assertEquals(DATA_SUBSCRIPTION_ID, createCallResult.getValue().getCallConnectionProperties().getDataSubscriptionId()); } @Test @@ -79,20 +75,18 @@ public void createCallWithResponse() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 201) ))); + CallInvite callInvite = new CallInvite(new CommunicationUserIdentifier(CALL_TARGET_ID)); CreateCallOptions callOptions = new CreateCallOptions(callInvite, CALL_CALLBACK_URL); callOptions.setOperationContext(CALL_SUBJECT); - callOptions.setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION); - callOptions.setTranscriptionConfiguration(TRANSCRIPTION_CONFIGURATION); Response createCallResult = callAutomationAsyncClient.createCallWithResponse(callOptions).block(); assertNotNull(createCallResult); assertEquals(201, createCallResult.getStatusCode()); assertNotNull(createCallResult.getValue()); - assertEquals("mediaSubscriptionId", createCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); } @Test @@ -100,7 +94,7 @@ public void answerCall() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null), 200) ))); AnswerCallResult answerCallResult = callAutomationAsyncClient.answerCall(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL).block(); @@ -113,21 +107,16 @@ public void answerCallWithResponse() { CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) ))); - AnswerCallOptions answerCallOptions = new AnswerCallOptions(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL) - .setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION) - .setTranscriptionConfiguration(TRANSCRIPTION_CONFIGURATION); - + AnswerCallOptions answerCallOptions = new AnswerCallOptions(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL); Response answerCallResult = callAutomationAsyncClient.answerCallWithResponse( answerCallOptions).block(); assertNotNull(answerCallResult); assertEquals(200, answerCallResult.getStatusCode()); assertNotNull(answerCallResult.getValue()); - assertEquals(MEDIA_SUBSCRIPTION_ID, answerCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); - assertEquals(DATA_SUBSCRIPTION_ID, answerCallResult.getValue().getCallConnectionProperties().getDataSubscriptionId()); } @Test diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAutomatedLiveTestBase.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAutomatedLiveTestBase.java index e1b4f6a66890..6331e129df01 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAutomatedLiveTestBase.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAutomatedLiveTestBase.java @@ -8,6 +8,7 @@ import com.azure.communication.callautomation.models.events.CallAutomationEventBase; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.amqp.AmqpTransportType; +import com.azure.core.http.HttpClient; import com.azure.core.http.HttpMethod; import com.azure.core.http.HttpRequest; import com.azure.core.http.HttpResponse; @@ -18,20 +19,18 @@ import com.azure.messaging.servicebus.ServiceBusException; import com.azure.messaging.servicebus.ServiceBusFailureReason; import com.azure.messaging.servicebus.ServiceBusProcessorClient; -import com.azure.core.http.HttpClient; import com.azure.messaging.servicebus.ServiceBusReceivedMessage; import com.azure.messaging.servicebus.ServiceBusReceivedMessageContext; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; - import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.lang.reflect.Type; -import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.LocalDateTime; import java.util.ArrayList; @@ -54,11 +53,9 @@ public class CallAutomationAutomatedLiveTestBase extends CallAutomationLiveTestB .get("DISPATCHER_ENDPOINT", "https://incomingcalldispatcher.azurewebsites.net"); protected static final String DISPATCHER_CALLBACK = DISPATCHER_ENDPOINT + "/api/servicebuscallback/events"; - protected static final String BOT_APP_ID = Configuration.getGlobalConfiguration() - .get("BOT_APP_ID", - "REDACTED-bedb-REDACTED-b8c6-REDACTED"); @Override + @SuppressWarnings("unchecked") protected void beforeTest() { super.beforeTest(); processorStore = new ConcurrentHashMap<>(); @@ -69,40 +66,33 @@ protected void beforeTest() { // Load persisted events back to memory when in playback mode if (getTestMode() == TestMode.PLAYBACK) { try { - String fileName = "./src/test/resources/session-records/" + testContextManager.getTestName() + ".json"; - FileInputStream fileInputStream = new FileInputStream(fileName); - byte[] jsonData = new byte[fileInputStream.available()]; - fileInputStream.read(jsonData); - fileInputStream.close(); - String jsonString = new String(jsonData, StandardCharsets.UTF_8); - ObjectMapper objectMapper = new ObjectMapper(); - List persistedEvents = objectMapper.readValue(jsonString, new TypeReference>() {}); + String fileName = "./src/test/resources/session-records/" + testContextManager.getTestName(); + ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream(fileName)); + ArrayList persistedEvents = (ArrayList) objectInputStream.readObject(); persistedEvents.forEach(this::messageBodyHandler); - } catch (IOException e) { + objectInputStream.close(); + } catch (IOException | ClassNotFoundException e) { throw new RuntimeException(e); } } + } @Override protected void afterTest() { super.afterTest(); - if (processorStore != null) { - processorStore.forEach((key, value) -> value.close()); - } + processorStore.forEach((key, value) -> value.close()); // In recording mode, manually store events from event dispatcher into local disk as the callAutomationClient doesn't do so if (getTestMode() == TestMode.RECORD) { try { - String fileName = "./src/test/resources/session-records/" + testContextManager.getTestName() + ".json"; - - ObjectMapper objectMapper = new ObjectMapper(); - String jsonString = objectMapper.writeValueAsString(eventsToPersist); + String fileName = "./src/test/resources/session-records/" + testContextManager.getTestName(); new FileOutputStream(fileName).close(); FileOutputStream fileOutputStream = new FileOutputStream(fileName, false); - fileOutputStream.write(jsonString.getBytes()); - fileOutputStream.flush(); - fileOutputStream.close(); + ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); + objectOutputStream.writeObject(eventsToPersist); + objectOutputStream.flush(); + objectOutputStream.close(); } catch (IOException e) { throw new RuntimeException(e); } @@ -119,25 +109,25 @@ protected String serviceBusWithNewCall(CommunicationIdentifier caller, Communica String callerId = parseIdsFromIdentifier(caller); String receiverId = parseIdsFromIdentifier(receiver); String uniqueId = callerId + receiverId; - if (getTestMode() != TestMode.PLAYBACK) { - // subscribe - HttpClient httpClient = HttpClient.createDefault(); - String dispatcherUrl = DISPATCHER_ENDPOINT + String.format("/api/servicebuscallback/subscribe?q=%s", uniqueId); - HttpRequest request = new HttpRequest(HttpMethod.POST, dispatcherUrl); - HttpResponse response = httpClient.send(request).block(); - assert response != null; - // create a service bus processor - ServiceBusProcessorClient serviceBusProcessorClient = createServiceBusClientBuilderWithConnectionString() - .processor() - .queueName(uniqueId) - .processMessage(this::messageHandler) - .processError(serviceBusErrorContext -> errorHandler(serviceBusErrorContext, new CountDownLatch(1))) - .buildProcessorClient(); - - serviceBusProcessorClient.start(); - processorStore.put(uniqueId, serviceBusProcessorClient); - } + // subscribe + HttpClient httpClient = HttpClient.createDefault(); + String dispatcherUrl = DISPATCHER_ENDPOINT + String.format("/api/servicebuscallback/subscribe?q=%s", uniqueId); + HttpRequest request = new HttpRequest(HttpMethod.POST, dispatcherUrl); + HttpResponse response = httpClient.send(request).block(); + assert response != null; + System.out.println(String.format("Subscription to dispatcher of %s: ", uniqueId) + response.getStatusCode()); + + // create a service bus processor + ServiceBusProcessorClient serviceBusProcessorClient = createServiceBusClientBuilderWithConnectionString() + .processor() + .queueName(uniqueId) + .processMessage(this::messageHandler) + .processError(serviceBusErrorContext -> errorHandler(serviceBusErrorContext, new CountDownLatch(1))) + .buildProcessorClient(); + + serviceBusProcessorClient.start(); + processorStore.put(uniqueId, serviceBusProcessorClient); return uniqueId; } @@ -145,6 +135,7 @@ protected void messageHandler(ServiceBusReceivedMessageContext context) { // receive message from dispatcher ServiceBusReceivedMessage message = context.getMessage(); String body = message.getBody().toString(); + System.out.println(body); // When in recording mode, save incoming events into memory for future use if (getTestMode() == TestMode.RECORD) { diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java index 31705ac84099..552141884a42 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationClientUnitTests.java @@ -7,8 +7,8 @@ import com.azure.communication.callautomation.models.AnswerCallResult; import com.azure.communication.callautomation.models.CallInvite; import com.azure.communication.callautomation.models.CallRejectReason; -import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.CreateCallResult; +import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.RedirectCallOptions; import com.azure.communication.callautomation.models.RejectCallOptions; import com.azure.communication.common.CommunicationIdentifier; @@ -35,7 +35,7 @@ public void createCall() { CallAutomationClient callAutomationClient = getCallAutomationClientWithSourceIdentity(caller, new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 201) ))); List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); @@ -49,7 +49,7 @@ public void createCallWithResponse() { CallAutomationClient callAutomationClient = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 201) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, null), 201) ))); CommunicationUserIdentifier caller = new CommunicationUserIdentifier(CALL_CALLER_ID); List targets = new ArrayList<>(Collections.singletonList(new CommunicationUserIdentifier(CALL_TARGET_ID))); @@ -61,7 +61,6 @@ public void createCallWithResponse() { assertNotNull(createCallResult); assertEquals(201, createCallResult.getStatusCode()); assertNotNull(createCallResult.getValue()); - assertEquals(null, createCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); } @Test @@ -69,7 +68,7 @@ public void answerCall() { CallAutomationClient callAutomationClient = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) ))); AnswerCallResult answerCallResult = callAutomationClient.answerCall(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL); @@ -82,12 +81,10 @@ public void answerCallWithResponse() { CallAutomationClient callAutomationClient = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) ))); - AnswerCallOptions answerCallOptions = new AnswerCallOptions(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL) - .setMediaStreamingConfiguration(MEDIA_STREAMING_CONFIGURATION) - .setTranscriptionConfiguration(TRANSCRIPTION_CONFIGURATION); + AnswerCallOptions answerCallOptions = new AnswerCallOptions(CALL_INCOMING_CALL_CONTEXT, CALL_CALLBACK_URL); Response answerCallResult = callAutomationClient.answerCallWithResponse( answerCallOptions, Context.NONE); @@ -95,8 +92,6 @@ public void answerCallWithResponse() { assertNotNull(answerCallResult); assertEquals(200, answerCallResult.getStatusCode()); assertNotNull(answerCallResult.getValue()); - assertEquals(MEDIA_SUBSCRIPTION_ID, answerCallResult.getValue().getCallConnectionProperties().getMediaSubscriptionId()); - assertEquals(DATA_SUBSCRIPTION_ID, answerCallResult.getValue().getCallConnectionProperties().getDataSubscriptionId()); } @Test diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java deleted file mode 100644 index 3c23a7e0c411..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java +++ /dev/null @@ -1,1429 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.communication.callautomation.models.ChoiceResult; -import com.azure.communication.callautomation.models.DtmfResult; -import com.azure.communication.callautomation.models.RecognizeResult; -import com.azure.communication.callautomation.models.RecordingState; -import com.azure.communication.callautomation.models.events.AnswerFailed; -import com.azure.communication.callautomation.models.events.CallAutomationEventBase; -import com.azure.communication.callautomation.models.events.CallConnected; -import com.azure.communication.callautomation.models.events.CallTransferAccepted; -import com.azure.communication.callautomation.models.events.CancelAddParticipantFailed; -import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; -import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionStopped; -import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneFailed; -import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneReceived; -import com.azure.communication.callautomation.models.events.CreateCallFailed; -import com.azure.communication.callautomation.models.events.DialogCompleted; -import com.azure.communication.callautomation.models.events.DialogConsent; -import com.azure.communication.callautomation.models.events.DialogFailed; -import com.azure.communication.callautomation.models.events.DialogHangup; -import com.azure.communication.callautomation.models.events.DialogLanguageChange; -import com.azure.communication.callautomation.models.events.DialogSensitivityUpdate; -import com.azure.communication.callautomation.models.events.DialogStarted; -import com.azure.communication.callautomation.models.events.DialogTransfer; -import com.azure.communication.callautomation.models.events.HoldFailed; -import com.azure.communication.callautomation.models.events.ParticipantsUpdated; -import com.azure.communication.callautomation.models.events.PlayCanceled; -import com.azure.communication.callautomation.models.events.PlayCompleted; -import com.azure.communication.callautomation.models.events.PlayFailed; -import com.azure.communication.callautomation.models.events.ReasonCode; -import com.azure.communication.callautomation.models.events.ReasonCode.Recognize; -import com.azure.communication.callautomation.models.events.RecognizeCanceled; -import com.azure.communication.callautomation.models.events.RecognizeCompleted; -import com.azure.communication.callautomation.models.events.RecognizeFailed; -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.SendDtmfTonesCompleted; -import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; -import com.azure.communication.callautomation.models.events.TeamsComplianceRecordingStateChanged; -import com.azure.communication.callautomation.models.events.TeamsRecordingStateChanged; -import com.azure.communication.callautomation.models.events.TranscriptionFailed; -import com.azure.communication.callautomation.models.events.TranscriptionResumed; -import com.azure.communication.callautomation.models.events.TranscriptionStarted; -import com.azure.communication.callautomation.models.events.TranscriptionStatus; -import com.azure.communication.callautomation.models.events.TranscriptionStatusDetails; -import com.azure.communication.callautomation.models.events.TranscriptionStopped; -import com.azure.communication.callautomation.models.events.TranscriptionUpdated; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Objects; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertInstanceOf; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class CallAutomationEventParserAndProcessorUnitTests { - static final String EVENT_PARTICIPANT_UPDATED = "{\"id\":\"61069ef9-5ca9-457f-ac36-e2bb5e8400ca\",\"source\":\"calling/callConnections/401f3500-62bd-46a9-8c09-9e1b06caca01/ParticipantsUpdated\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"participants\":[{\"identifier\": {\"rawId\":\"8:acs:816df1ca-971b-44d7-b8b1-8fba90748500_00000013-2ff6-dd51-54b7-a43a0d001998\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"8:acs:816df1ca-971b-44d7-b8b1-8fba90748500_00000013-2ff6-dd51-54b7-a43a0d001998\"}}, \"isMuted\": false, \"isOnHold\": false},{\"identifier\": {\"rawId\":\"8:acs:816df1ca-971b-44d7-b8b1-8fba90748500_00000013-2ff7-1579-99bf-a43a0d0010bc\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"8:acs:816df1ca-971b-44d7-b8b1-8fba90748500_00000013-2ff7-1579-99bf-a43a0d0010bc\"}}, \"isMuted\": false, \"isOnHold\": false}],\"type\":\"participantsUpdated\",\"callConnectionId\":\"401f3500-62bd-46a9-8c09-9e1b06caca01\",\"correlationId\":\"ebd8bf1f-0794-494f-bdda-913042c06ef7\"},\"time\":\"2022-08-12T03:35:07.9129474+00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f3500-62bd-46a9-8c09-9e1b06caca01/ParticipantsUpdated\"}"; - static final String EVENT_CALL_CONNECTED = "{\"id\":\"46116fb7-27e0-4a99-9478-a659c8fd4815\",\"source\":\"calling/callConnections/401f3500-62bd-46a9-8c09-9e1b06caca01/CallConnected\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"type\":\"callConnected\",\"callConnectionId\":\"401f3500-62bd-46a9-8c09-9e1b06caca01\",\"correlationId\":\"ebd8bf1f-0794-494f-bdda-913042c06ef7\"},\"time\":\"2022-08-12T03:35:07.8174402+00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f3500-62bd-46a9-8c09-9e1b06caca01/CallConnected\"}"; - static final String EVENT_RECOGNIZE_DTMF = "[{\"id\":\"ac2cb537-2d62-48bf-909e-cc93534c4258\",\"source\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"type\":\"Microsoft.Communication.RecognizeCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"operationContext\":\"OperationalContextValue-1118-1049\",\"resultInformation\":{\"code\":200,\"subCode\":8533,\"message\":\"Action completed, DTMF option matched.\"},\"recognitionType\":\"dtmf\",\"dtmfResult\":{\"tones\":[\"five\", \"six\", \"pound\"]},\"choiceResult\":{\"label\":\"Marketing\"},\"callConnectionId\":\"401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"serverCallId\":\"serverCallId\",\"correlationId\":\"d4f4c1be-59d8-4850-b9bf-ee564c15839d\"},\"time\":\"2022-11-22T01:41:44.5582769+00:00\",\"specversion\":\"1.0\",\"subject\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\"}]"; - static final String EVENT_RECOGNIZE_CHOICE = "[{\"id\":\"e25b99ef-3632-45bb-96d1-d9191547ff33\",\"source\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"type\":\"Microsoft.Communication.RecognizeCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"operationContext\":\"OperationalContextValue-1118-1049\",\"resultInformation\":{\"code\":200,\"subCode\":8545,\"message\":\"Action completed, Recognized phrase matches a valid option.\"},\"recognitionType\":\"choices\",\"choiceResult\":{\"label\":\"Support\",\"recognizedPhrase\":\"customer help\"},\"callConnectionId\":\"401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"serverCallId\":\"serverCallId\",\"correlationId\":\"d4f4c1be-59d8-4850-b9bf-ee564c15839d\"},\"time\":\"2022-11-22T01:41:00.1967145+00:00\",\"specversion\":\"1.0\",\"subject\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\"}]"; - - @Test - public void parseEvent() { - CallAutomationEventBase callAutomationEvent = CallAutomationEventParser.parseEvents(EVENT_PARTICIPANT_UPDATED).get(0); - - assertNotNull(callAutomationEvent); - assertEquals(callAutomationEvent.getClass(), ParticipantsUpdated.class); - ParticipantsUpdated participantsUpdated = (ParticipantsUpdated) callAutomationEvent; - assertNotNull((participantsUpdated).getParticipants()); - participantsUpdated.getParticipants().forEach(participant -> { - assertNotNull(participant); - assertNotNull(participant.getIdentifier()); - assertNotNull(participant.isMuted()); - assertNotNull(participant.isOnHold()); - }); - } - - @Test - public void parseEventList() { - List callAutomationEventList = CallAutomationEventParser.parseEvents("[" - + EVENT_CALL_CONNECTED + "," + EVENT_PARTICIPANT_UPDATED + "]"); - - assertNotNull(callAutomationEventList); - assertEquals(callAutomationEventList.get(0).getClass(), CallConnected.class); - assertEquals(callAutomationEventList.get(1).getClass(), ParticipantsUpdated.class); - assertNotNull(callAutomationEventList.get(0).getCallConnectionId()); - } - - @Test - public void parseRecordingStateChangedEvent() { - String receivedEvent = "[\n" - + " {\n" - + " \"id\": \"bf59843a-888f-47ca-8d1c-885c1f5e71dc\",\n" - + " \"source\": \"calling/recordings/serverCallId/recordingId/recordingId/RecordingStateChanged\",\n" - + " \"type\": \"Microsoft.Communication.RecordingStateChanged\",\n" - + " \"data\": {\n" - + " \"type\": \"recordingStateChanged\",\n" - + " \"recordingId\": \"recordingId\",\n" - + " \"state\": \"active\",\n" - + " \"startDateTime\": \"2022-08-11T23:42:45.4394211+00:00\",\n" - + " \"callConnectionId\": \"callConnectionId\",\n" - + " \"serverCallId\": \"serverCallId\",\n" - + " \"correlationId\": \"correlationId\"\n" - + " },\n" - + " \"time\": \"2022-08-11T23:42:45.5346632+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/recordings/serverCallId/recordingId/recordingId\"\n" - + " }\n" - + "]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - RecordingStateChanged recordingEvent = (RecordingStateChanged) event; - assertNotNull(recordingEvent); - assertEquals("serverCallId", recordingEvent.getServerCallId()); - assertEquals("recordingId", recordingEvent.getRecordingId()); - assertEquals(RecordingState.ACTIVE, recordingEvent.getRecordingState()); - } - - @Test - public void parseTeamsComplianceRecordingStateChangedEvent() { - String receivedEvent = "[\n" - + " {\n" - + " \"id\": \"bf59843a-888f-47ca-8d1c-885c1f5e71dc\",\n" - + " \"source\": \"calling/recordings/serverCallId/recordingId/recordingId/TeamsComplianceRecordingStateChanged\",\n" - + " \"type\": \"Microsoft.Communication.TeamsComplianceRecordingStateChanged\",\n" - + " \"data\": {\n" - + " \"type\": \"teamsComplianceRecordingStateChanged\",\n" - + " \"recordingId\": \"recordingId\",\n" - + " \"state\": \"active\",\n" - + " \"startDateTime\": \"2022-08-11T23:42:45.4394211+00:00\",\n" - + " \"callConnectionId\": \"callConnectionId\",\n" - + " \"serverCallId\": \"serverCallId\",\n" - + " \"correlationId\": \"correlationId\"\n" - + " },\n" - + " \"time\": \"2022-08-11T23:42:45.5346632+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/recordings/serverCallId/recordingId/recordingId\"\n" - + " }\n" - + "]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - TeamsComplianceRecordingStateChanged recordingEvent = (TeamsComplianceRecordingStateChanged) event; - assertNotNull(recordingEvent); - assertEquals("serverCallId", recordingEvent.getServerCallId()); - assertEquals("recordingId", recordingEvent.getRecordingId()); - assertEquals(RecordingState.ACTIVE, recordingEvent.getRecordingState()); - } - - @Test - public void parseTeamsRecordingStateChangedEvent() { - String receivedEvent = "[\n" - + " {\n" - + " \"id\": \"bf59843a-888f-47ca-8d1c-885c1f5e71dc\",\n" - + " \"source\": \"calling/recordings/serverCallId/recordingId/recordingId/TeamsRecordingStateChanged\",\n" - + " \"type\": \"Microsoft.Communication.TeamsRecordingStateChanged\",\n" - + " \"data\": {\n" - + " \"type\": \"teamsRecordingStateChanged\",\n" - + " \"recordingId\": \"recordingId\",\n" - + " \"state\": \"active\",\n" - + " \"startDateTime\": \"2022-08-11T23:42:45.4394211+00:00\",\n" - + " \"callConnectionId\": \"callConnectionId\",\n" - + " \"serverCallId\": \"serverCallId\",\n" - + " \"correlationId\": \"correlationId\"\n" - + " },\n" - + " \"time\": \"2022-08-11T23:42:45.5346632+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/recordings/serverCallId/recordingId/recordingId\"\n" - + " }\n" - + "]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - TeamsRecordingStateChanged recordingEvent = (TeamsRecordingStateChanged) event; - assertNotNull(recordingEvent); - assertEquals("serverCallId", recordingEvent.getServerCallId()); - assertEquals("recordingId", recordingEvent.getRecordingId()); - assertEquals(RecordingState.ACTIVE, recordingEvent.getRecordingState()); - } - - @Test - public void parsePlayCompletedEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + "\"source\": \"calling/callConnections/callConnectionId/PlayCompleted\",\n" - + "\"type\": \"Microsoft.Communication.PlayCompleted\",\n" - + "\"data\": {\n" - + "\"resultInformation\": {\n" - + "\"code\": 200,\n" - + "\"subCode\": 0,\n" - + "\"message\": \"Action completed successfully.\"\n" - + "},\n" - + "\"type\": \"playCompleted\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"correlationId\"\n" - + "},\n" - + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/callConnectionId\"\n" - + "}]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - PlayCompleted playCompleted = (PlayCompleted) event; - assertNotNull(playCompleted); - assertEquals("serverCallId", playCompleted.getServerCallId()); - assertEquals(200, playCompleted.getResultInformation().getCode()); - assertEquals(ReasonCode.COMPLETED_SUCCESSFULLY, playCompleted.getReasonCode()); - } - - @Test - public void parsePlayFailedEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + "\"source\": \"calling/callConnections/callConnectionId/PlayFailed\",\n" - + "\"type\": \"Microsoft.Communication.PlayFailed\",\n" - + "\"data\": {\n" - + "\"resultInformation\": {\n" - + "\"code\": 400,\n" - + "\"subCode\": 8536,\n" - + "\"message\": \"Action failed, file could not be downloaded.\"\n" - + "},\n" - + "\"type\": \"playFailed\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"correlationId\"\n" - + "},\n" - + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/callConnectionId\"\n" - + "}]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - PlayFailed playFailed = (PlayFailed) event; - assertNotNull(playFailed); - assertEquals("serverCallId", playFailed.getServerCallId()); - assertEquals(400, playFailed.getResultInformation().getCode()); - assertEquals(ReasonCode.Play.DOWNLOAD_FAILED, playFailed.getReasonCode()); - } - - @Test - public void parsePlayCanceledEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + "\"source\": \"calling/callConnections/callConnectionId/PlayCanceled\",\n" - + "\"type\": \"Microsoft.Communication.PlayCanceled\",\n" - + "\"data\": {\n" - + "\"type\": \"playCanceled\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"correlationId\"\n" - + "},\n" - + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/callConnectionId\"\n" - + "}]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - PlayCanceled playCanceled = (PlayCanceled) event; - assertNotNull(playCanceled); - assertEquals("serverCallId", playCanceled.getServerCallId()); - } - @Test - public void parseRecognizeCompletedWithChoiceEvent() { - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(EVENT_RECOGNIZE_CHOICE).get(0); - assertNotNull(event); - RecognizeCompleted recognizeCompleted = (RecognizeCompleted) event; - assertNotNull(recognizeCompleted); - Optional choiceResult = recognizeCompleted.getRecognizeResult(); - assertInstanceOf(ChoiceResult.class, choiceResult.get()); - assertEquals("serverCallId", recognizeCompleted.getServerCallId()); - assertEquals(200, recognizeCompleted.getResultInformation().getCode()); - assertEquals(Recognize.SPEECH_OPTION_MATCHED, recognizeCompleted.getReasonCode()); - } - - @Test - public void parseRecognizeCompletedWithDtmfEvent() { - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(EVENT_RECOGNIZE_DTMF).get(0); - assertNotNull(event); - RecognizeCompleted recognizeCompleted = (RecognizeCompleted) event; - Optional dtmfResult = recognizeCompleted.getRecognizeResult(); - DtmfResult tonesResult = (DtmfResult) dtmfResult.get(); - assertInstanceOf(DtmfResult.class, dtmfResult.get()); - String tonesInString = tonesResult.convertToString(); - assertEquals(tonesInString, "56#"); - assertNotNull(recognizeCompleted); - assertEquals("serverCallId", recognizeCompleted.getServerCallId()); - assertEquals(200, recognizeCompleted.getResultInformation().getCode()); - assertEquals(Recognize.DMTF_OPTION_MATCHED, recognizeCompleted.getReasonCode()); - } - - @Test - public void parseRecognizeFailedEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + "\"source\": \"calling/callConnections/callConnectionId/RecognizeCompleted\",\n" - + "\"type\": \"Microsoft.Communication.RecognizeFailed\",\n" - + "\"data\": {\n" - + "\"resultInformation\": {\n" - + "\"code\": 400,\n" - + "\"subCode\": 8510,\n" - + "\"message\": \"Action failed, initial silence timeout reached.\"\n" - + "},\n" - + "\"type\": \"recognizeFailed\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"correlationId\"\n" - + "},\n" - + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/callConnectionId\"\n" - + "}]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - RecognizeFailed recognizeFailed = (RecognizeFailed) event; - assertNotNull(recognizeFailed); - assertEquals("serverCallId", recognizeFailed.getServerCallId()); - assertEquals(400, recognizeFailed.getResultInformation().getCode()); - assertEquals(ReasonCode.Recognize.INITIAL_SILENCE_TIMEOUT, recognizeFailed.getReasonCode()); - } - - @Test - public void parseRecognizeCanceledEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + "\"source\": \"calling/callConnections/callConnectionId/RecognizeCanceled\",\n" - + "\"type\": \"Microsoft.Communication.RecognizeCanceled\",\n" - + "\"data\": {\n" - + "\"type\": \"recognizeCanceled\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"correlationId\"\n" - + "},\n" - + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/callConnectionId\"\n" - + "}]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - RecognizeCanceled recognizeCanceled = (RecognizeCanceled) event; - assertNotNull(recognizeCanceled); - assertEquals("serverCallId", recognizeCanceled.getServerCallId()); - } - - @Test - public void parseAndProcessRemoveParticipantSucceededEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" - + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" - + "\"type\": \"Microsoft.Communication.RemoveParticipantSucceeded\",\n" - + "\"data\": {\n" - + "\"operationContext\": \"context\",\n" - + "\"participant\": {\n" - + "\"rawId\": \"rawId\",\n" - + "\"phoneNumber\": {\n" - + "\"value\": \"value\"\n" - + "}\n" - + "},\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" - + "},\n" - + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" - + "}]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - - RemoveParticipantSucceeded removeParticipantSucceeded = (RemoveParticipantSucceeded) event; - - assertNotNull(removeParticipantSucceeded); - assertEquals("serverCallId", removeParticipantSucceeded.getServerCallId()); - assertEquals("callConnectionId", removeParticipantSucceeded.getCallConnectionId()); - assertEquals("rawId", removeParticipantSucceeded.getParticipant().getRawId()); - - CallAutomationEventProcessor callAutomationEventProcessor = new CallAutomationEventProcessor(); - callAutomationEventProcessor.processEvents(receivedEvent); - RemoveParticipantSucceeded eventFromProcessor = callAutomationEventProcessor.waitForEventProcessor( - removeParticipantSucceeded.getCallConnectionId(), - removeParticipantSucceeded.getOperationContext(), - RemoveParticipantSucceeded.class); - assertEquals("serverCallId", eventFromProcessor.getServerCallId()); - assertEquals("callConnectionId", eventFromProcessor.getCallConnectionId()); - assertEquals("rawId", eventFromProcessor.getParticipant().getRawId()); - } - - @Test - public void parseAndProcessRemoveParticipantFailedEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" - + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" - + "\"type\": \"Microsoft.Communication.RemoveParticipantFailed\",\n" - + "\"data\": {\n" - + "\"operationContext\": \"context\",\n" - + "\"participant\": {\n" - + "\"rawId\": \"rawId\",\n" - + "\"phoneNumber\": {\n" - + "\"value\": \"value\"\n" - + "}\n" - + "},\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" - + "},\n" - + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" - + "}]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - RemoveParticipantFailed removeParticipantFailed = (RemoveParticipantFailed) event; - - assertNotNull(removeParticipantFailed); - assertEquals("serverCallId", removeParticipantFailed.getServerCallId()); - assertEquals("callConnectionId", removeParticipantFailed.getCallConnectionId()); - assertEquals("rawId", removeParticipantFailed.getParticipant().getRawId()); - - CallAutomationEventProcessor callAutomationEventProcessor = new CallAutomationEventProcessor(); - callAutomationEventProcessor.waitForEventProcessorAsync(removeParticipantFailed.getCallConnectionId(), - removeParticipantFailed.getOperationContext(), RemoveParticipantFailed.class) - .subscribe(eventFromProcessor -> { - assertEquals("serverCallId", eventFromProcessor.getServerCallId()); - assertEquals("callConnectionId", eventFromProcessor.getCallConnectionId()); - assertEquals("rawId", eventFromProcessor.getParticipant().getRawId()); - }); - callAutomationEventProcessor.processEvents(receivedEvent); - } - - @Test - public void parseContinuousDtmfRecognitionToneReceivedEvent() { - - String receivedEvent = "[\n" - + " {\n" - + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + " \"source\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneReceived\",\n" - + " \"type\":\"Microsoft.Communication.ContinuousDtmfRecognitionToneReceived\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"data\":{\n" - + " \"eventSource\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneReceived\",\n" - + " \"resultInformation\":{\n" - + " \"code\":200,\n" - + " \"subCode\":0,\n" - + " \"message\":\"DTMF tone received successfully.\"\n" - + " },\n" - + " \"type\":\"ContinuousDtmfRecognitionToneReceived\",\n" - + " \"sequenceId\":1,\n" - + " \"tone\":\"eight\",\n" - + " \"callConnectionId\":\"callConnectionId\",\n" - + " \"serverCallId\":\"serverCallId\",\n" - + " \"correlationId\":\"correlationId\",\n" - + " \"operationContext\":\"context\",\n" - + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"datacontenttype\":\"application/json\",\n" - + " \"subject\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneReceived\"\n" - + " }\n" - + " }\n" - + "]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - ContinuousDtmfRecognitionToneReceived continuousDtmfRecognitionToneReceived = (ContinuousDtmfRecognitionToneReceived) event; - - assertNotNull(continuousDtmfRecognitionToneReceived); - assertEquals("serverCallId", continuousDtmfRecognitionToneReceived.getServerCallId()); - assertEquals("callConnectionId", continuousDtmfRecognitionToneReceived.getCallConnectionId()); - assertEquals("eight", continuousDtmfRecognitionToneReceived.getTone().toString()); - assertEquals(1, continuousDtmfRecognitionToneReceived.getSequenceId()); - assertEquals("correlationId", continuousDtmfRecognitionToneReceived.getCorrelationId()); - assertEquals(200, continuousDtmfRecognitionToneReceived.getResultInformation().getCode()); - assertEquals(0, continuousDtmfRecognitionToneReceived.getResultInformation().getSubCode()); - assertEquals("context", continuousDtmfRecognitionToneReceived.getOperationContext()); - assertEquals("DTMF tone received successfully.", continuousDtmfRecognitionToneReceived.getResultInformation().getMessage()); - } - - @Test - public void parseContinuousDtmfRecognitionToneFailedEvent() { - - String receivedEvent = "[\n" - + " {\n" - + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + " \"source\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneFailed\",\n" - + " \"type\":\"Microsoft.Communication.ContinuousDtmfRecognitionToneFailed\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"data\":{\n" - + " \"eventSource\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneFailed\",\n" - + " \"resultInformation\":{\n" - + " \"code\":400,\n" - + " \"subCode\":12323,\n" - + " \"message\":\"Continuous DTMF tone Couldn't be received successfully.\"\n" - + " },\n" - + " \"type\":\"ContinuousDtmfRecognitionToneFailed\",\n" - + " \"callConnectionId\":\"callConnectionId\",\n" - + " \"serverCallId\":\"serverCallId\",\n" - + " \"correlationId\":\"correlationId\",\n" - + " \"operationContext\":\"context\",\n" - + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"datacontenttype\":\"application/json\",\n" - + " \"subject\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneFailed\"\n" - + " }\n" - + " }\n" - + "]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - ContinuousDtmfRecognitionToneFailed continuousDtmfRecognitionToneFailed = (ContinuousDtmfRecognitionToneFailed) event; - - assertNotNull(continuousDtmfRecognitionToneFailed); - assertEquals("serverCallId", continuousDtmfRecognitionToneFailed.getServerCallId()); - assertEquals("callConnectionId", continuousDtmfRecognitionToneFailed.getCallConnectionId()); - assertEquals("correlationId", continuousDtmfRecognitionToneFailed.getCorrelationId()); - assertEquals(400, continuousDtmfRecognitionToneFailed.getResultInformation().getCode()); - assertEquals(12323, continuousDtmfRecognitionToneFailed.getResultInformation().getSubCode()); - assertEquals("context", continuousDtmfRecognitionToneFailed.getOperationContext()); - assertEquals("Continuous DTMF tone Couldn't be received successfully.", continuousDtmfRecognitionToneFailed.getResultInformation().getMessage()); - } - - @Test - public void parseContinuousDtmfRecognitionStoppedEvent() { - - String receivedEvent = "[\n" - + " {\n" - + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + " \"source\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionStopped\",\n" - + " \"type\":\"Microsoft.Communication.ContinuousDtmfRecognitionStopped\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"data\":{\n" - + " \"eventSource\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionStopped\",\n" - + " \"resultInformation\":{\n" - + " \"code\":200,\n" - + " \"subCode\":0,\n" - + " \"message\":\"Continuous DTMF Recognition stopped successfully.\"\n" - + " },\n" - + " \"type\":\"ContinuousDtmfRecognitionStopped\",\n" - + " \"callConnectionId\":\"callConnectionId\",\n" - + " \"serverCallId\":\"serverCallId\",\n" - + " \"correlationId\":\"correlationId\",\n" - + " \"operationContext\":\"context\",\n" - + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"datacontenttype\":\"application/json\",\n" - + " \"subject\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionStopped\"\n" - + " }\n" - + " }\n" - + "]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - ContinuousDtmfRecognitionStopped continuousDtmfRecognitionStopped = (ContinuousDtmfRecognitionStopped) event; - - assertNotNull(continuousDtmfRecognitionStopped); - assertEquals("serverCallId", continuousDtmfRecognitionStopped.getServerCallId()); - assertEquals("callConnectionId", continuousDtmfRecognitionStopped.getCallConnectionId()); - assertEquals("correlationId", continuousDtmfRecognitionStopped.getCorrelationId()); - assertEquals(200, continuousDtmfRecognitionStopped.getResultInformation().getCode()); - assertEquals(0, continuousDtmfRecognitionStopped.getResultInformation().getSubCode()); - assertEquals("context", continuousDtmfRecognitionStopped.getOperationContext()); - assertEquals("Continuous DTMF Recognition stopped successfully.", continuousDtmfRecognitionStopped.getResultInformation().getMessage()); - } - - @Test - public void parseSendDtmfTonesCompletedEvent() { - - String receivedEvent = "[\n" - + " {\n" - + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + " \"source\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\",\n" - + " \"type\":\"Microsoft.Communication.SendDtmfTonesCompleted\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"data\":{\n" - + " \"eventSource\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\",\n" - + " \"resultInformation\":{\n" - + " \"code\":200,\n" - + " \"subCode\":0,\n" - + " \"message\":\"Send DTMF completed successfully.\"\n" - + " },\n" - + " \"type\":\"SendDtmfTonesCompleted\",\n" - + " \"callConnectionId\":\"callConnectionId\",\n" - + " \"serverCallId\":\"serverCallId\",\n" - + " \"correlationId\":\"correlationId\",\n" - + " \"operationContext\":\"context\",\n" - + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"datacontenttype\":\"application/json\",\n" - + " \"subject\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\"\n" - + " }\n" - + " }\n" - + "]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - SendDtmfTonesCompleted sendDtmfTonesCompleted = (SendDtmfTonesCompleted) event; - - assertNotNull(sendDtmfTonesCompleted); - assertEquals("serverCallId", sendDtmfTonesCompleted.getServerCallId()); - assertEquals("callConnectionId", sendDtmfTonesCompleted.getCallConnectionId()); - assertEquals("correlationId", sendDtmfTonesCompleted.getCorrelationId()); - assertEquals(200, sendDtmfTonesCompleted.getResultInformation().getCode()); - assertEquals(0, sendDtmfTonesCompleted.getResultInformation().getSubCode()); - assertEquals("context", sendDtmfTonesCompleted.getOperationContext()); - assertEquals("Send DTMF completed successfully.", sendDtmfTonesCompleted.getResultInformation().getMessage()); - } - - @Test - public void parseSendDtmfTonesFailedEvent() { - - String receivedEvent = "[\n" - + " {\n" - + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + " \"source\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\",\n" - + " \"type\":\"Microsoft.Communication.SendDtmfTonesFailed\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"data\":{\n" - + " \"eventSource\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\",\n" - + " \"resultInformation\":{\n" - + " \"code\":200,\n" - + " \"subCode\":0,\n" - + " \"message\":\"Send DTMF couldn't be completed successfully.\"\n" - + " },\n" - + " \"type\":\"SendDtmfTonesFailed\",\n" - + " \"callConnectionId\":\"callConnectionId\",\n" - + " \"serverCallId\":\"serverCallId\",\n" - + " \"correlationId\":\"correlationId\",\n" - + " \"operationContext\":\"context\",\n" - + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" - + " \"specversion\":\"1.0\",\n" - + " \"datacontenttype\":\"application/json\",\n" - + " \"subject\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\"\n" - + " }\n" - + " }\n" - + "]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - SendDtmfTonesFailed sendDtmfTonesFailed = (SendDtmfTonesFailed) event; - - assertNotNull(sendDtmfTonesFailed); - assertEquals("serverCallId", sendDtmfTonesFailed.getServerCallId()); - assertEquals("callConnectionId", sendDtmfTonesFailed.getCallConnectionId()); - assertEquals("correlationId", sendDtmfTonesFailed.getCorrelationId()); - assertEquals(200, sendDtmfTonesFailed.getResultInformation().getCode()); - assertEquals(0, sendDtmfTonesFailed.getResultInformation().getSubCode()); - assertEquals("context", sendDtmfTonesFailed.getOperationContext()); - assertEquals("Send DTMF couldn't be completed successfully.", sendDtmfTonesFailed.getResultInformation().getMessage()); - } - - @Test - public void parseTransferAccptedEvent() { - String receivedEvent = "[\n" - + " {\n" - + " \"id\": \"91f8b34b-383c-431d-9fa5-79d39fad9300\",\n" - + " \"source\": \"calling/callConnections/411f0b00-dc73-4528-a9e6-968ba983d2a1\",\n" - + " \"type\": \"Microsoft.Communication.CallTransferAccepted\",\n" - + " \"data\": {\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 7015,\n" - + " \"message\": \"The transfer operation completed successfully.\"\n" - + " },\n" - + " \"transferTarget\": {\n" - + " \"rawId\": \"8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2f-2234-655d-573a0d00443e\",\n" - + " \"kind\": \"communicationUser\",\n" - + " \"communicationUser\": {\n" - + " \"id\": \"8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2f-2234-655d-573a0d00443e\"\n" - + " }\n" - + " },\n" - + " \"transferee\": {\n" - + " \"rawId\": \"8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2e-e2b4-655d-573a0d004434\",\n" - + " \"kind\": \"communicationUser\",\n" - + " \"communicationUser\": {\n" - + " \"id\": \"8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2e-e2b4-655d-573a0d004434\"\n" - + " }\n" - + " },\n" - + " \"callConnectionId\": \"411f0b00-dc73-4528-a9e6-968ba983d2a1\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDEuY29udi5za3lwZS5jb20vY29udi8yZWtNYmJRN3VVbUY1RDJERFdITWJnP2k9MTUmZT02MzgyNTMwMzY2ODQ5NzkwMDI=\",\n" - + " \"correlationId\": \"be43dd55-38e9-4de8-9d75-e20b6b32744f\"\n" - + " },\n" - + " \"time\": \"2023-07-19T18:31:16.6795146+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/411f0b00-dc73-4528-a9e6-968ba983d2a1\"\n" - + " }\n" - + "]"; - CallTransferAccepted event = (CallTransferAccepted) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDEuY29udi5za3lwZS5jb20vY29udi8yZWtNYmJRN3VVbUY1RDJERFdITWJnP2k9MTUmZT02MzgyNTMwMzY2ODQ5NzkwMDI=", event.getServerCallId()); - assertEquals("411f0b00-dc73-4528-a9e6-968ba983d2a1", event.getCallConnectionId()); - assertEquals("be43dd55-38e9-4de8-9d75-e20b6b32744f", event.getCorrelationId()); - assertEquals("The transfer operation completed successfully.", event.getResultInformation().getMessage()); - assertEquals("8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2f-2234-655d-573a0d00443e", event.getTransferTarget().getRawId()); - assertEquals("8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2e-e2b4-655d-573a0d004434", event.getTransferee().getRawId()); - - CallAutomationEventProcessor callAutomationEventProcessor = new CallAutomationEventProcessor(); - callAutomationEventProcessor.processEvents(receivedEvent); - CallAutomationEventBase eventComing = callAutomationEventProcessor.waitForEventProcessor(eventFromProcessor -> Objects.equals(event.getServerCallId(), eventFromProcessor.getServerCallId()) - && Objects.equals(event.getCallConnectionId(), eventFromProcessor.getCallConnectionId())); - - assertNotNull(eventComing); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDEuY29udi5za3lwZS5jb20vY29udi8yZWtNYmJRN3VVbUY1RDJERFdITWJnP2k9MTUmZT02MzgyNTMwMzY2ODQ5NzkwMDI=", eventComing.getServerCallId()); - assertEquals("411f0b00-dc73-4528-a9e6-968ba983d2a1", eventComing.getCallConnectionId()); - assertEquals("be43dd55-38e9-4de8-9d75-e20b6b32744f", eventComing.getCorrelationId()); - assertEquals("The transfer operation completed successfully.", ((CallTransferAccepted) eventComing).getResultInformation().getMessage()); - assertEquals("8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2f-2234-655d-573a0d00443e", ((CallTransferAccepted) eventComing).getTransferTarget().getRawId()); - assertEquals("8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2e-e2b4-655d-573a0d004434", ((CallTransferAccepted) eventComing).getTransferee().getRawId()); - } - - @Test - public void parseCancelAddParticipantSucceededEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" - + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" - + "\"type\": \"Microsoft.Communication.CancelAddParticipantSucceeded\",\n" - + "\"data\": {\n" - + "\"operationContext\": \"context\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"invitationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\",\n" - + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" - + "},\n" - + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" - + "}]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - - CancelAddParticipantSucceeded cancelAddParticipantSucceeded = (CancelAddParticipantSucceeded) event; - - assertNotNull(cancelAddParticipantSucceeded); - assertEquals("serverCallId", cancelAddParticipantSucceeded.getServerCallId()); - assertEquals("callConnectionId", cancelAddParticipantSucceeded.getCallConnectionId()); - assertEquals("b880bd5a-1916-470a-b43d-aabf3caff91c", cancelAddParticipantSucceeded.getInvitationId()); - } - - @Test - public void parseCancelAddParticipantFailedEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" - + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" - + "\"type\": \"Microsoft.Communication.CancelAddParticipantFailed\",\n" - + "\"data\": {\n" - + "\"operationContext\": \"context\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"invitationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\",\n" - + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" - + "},\n" - + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" - + "}]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - CancelAddParticipantFailed cancelAddParticipantFailed = (CancelAddParticipantFailed) event; - - assertNotNull(cancelAddParticipantFailed); - assertEquals("serverCallId", cancelAddParticipantFailed.getServerCallId()); - assertEquals("callConnectionId", cancelAddParticipantFailed.getCallConnectionId()); - assertEquals("b880bd5a-1916-470a-b43d-aabf3caff91c", cancelAddParticipantFailed.getInvitationId()); - - CallAutomationEventProcessor callAutomationEventProcessor = new CallAutomationEventProcessor(); - callAutomationEventProcessor.attachOngoingEventProcessor(cancelAddParticipantFailed.getCallConnectionId(), - eventToHandle -> { - assertEquals("serverCallId", eventToHandle.getServerCallId()); - assertEquals("callConnectionId", eventToHandle.getCallConnectionId()); - assertEquals("b880bd5a-1916-470a-b43d-aabf3caff91c", eventToHandle.getInvitationId()); - }, CancelAddParticipantFailed.class); - callAutomationEventProcessor.processEvents(receivedEvent); - callAutomationEventProcessor.detachOngoingEventProcessor(cancelAddParticipantFailed.getCallConnectionId(), CancelAddParticipantFailed.class); - } - - @Test - public void parseDialogCompletedEvent() { - String receivedEvent = "\n" - + " {\n" - + " \"id\": \"91f8b34b-383c-431d-9fa5-79d39fad9300\",\n" - + " \"source\": \"calling/callConnections/441fbf00-5b21-4beb-bd4d-fd665ca4b65f\",\n" - + " \"type\": \"Microsoft.Communication.DialogCompleted\",\n" - + " \"data\": {\n" - + " \"operationContext\": \"context\",\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Success Result\"\n" - + " },\n" - + " \"dialogInputType\": \"powerVirtualAgents\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"441fbf00-5b21-4beb-bd4d-fd665ca4b65f\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzc2MtMDkuY29udi5za3lwZS5jb20vY29udi9ubUpvbG9wMUhrdWhDVllYNUlxTTZnP2k9OCZlPTYzODI1NjEzMTYxNDIwOTA2MQ==\",\n" - + " \"correlationId\": \"fb2d738b-d9cb-496c-8be6-416aeecd4d96\"\n" - + " },\n" - + " \"time\": \"2023-07-27T07:48:56.0766803+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/441fbf00-5b21-4beb-bd4d-fd665ca4b65f\"\n" - + " }]"; - DialogCompleted event = (DialogCompleted) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzc2MtMDkuY29udi5za3lwZS5jb20vY29udi9ubUpvbG9wMUhrdWhDVllYNUlxTTZnP2k9OCZlPTYzODI1NjEzMTYxNDIwOTA2MQ==", event.getServerCallId()); - assertEquals("441fbf00-5b21-4beb-bd4d-fd665ca4b65f", event.getCallConnectionId()); - assertEquals("fb2d738b-d9cb-496c-8be6-416aeecd4d96", event.getCorrelationId()); - assertEquals("Success Result", event.getResultInformation().getMessage()); - assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); - assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); - } - - @Test - public void parseDialogStartedEvent() { - String receivedEvent = "[{\n" - + " \"id\": \"91f8b34b-383c-431d-9fa5-79d39fad9300\",\n" - + " \"source\": \"calling/callConnections/441fbf00-5b21-4beb-bd4d-fd665ca4b65f\",\n" - + " \"type\": \"Microsoft.Communication.DialogStarted\",\n" - + " \"data\": {\n" - + " \"operationContext\": \"context\",\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Success Result\"\n" - + " },\n" - + " \"dialogInputType\": \"powerVirtualAgents\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"441fbf00-5b21-4beb-bd4d-fd665ca4b65f\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzc2MtMDkuY29udi5za3lwZS5jb20vY29udi9ubUpvbG9wMUhrdWhDVllYNUlxTTZnP2k9OCZlPTYzODI1NjEzMTYxNDIwOTA2MQ==\",\n" - + " \"correlationId\": \"fb2d738b-d9cb-496c-8be6-416aeecd4d96\"\n" - + " },\n" - + " \"time\": \"2023-07-27T07:48:55.2765079+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/441fbf00-5b21-4beb-bd4d-fd665ca4b65f\"\n" - + "}]"; - DialogStarted event = (DialogStarted) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzc2MtMDkuY29udi5za3lwZS5jb20vY29udi9ubUpvbG9wMUhrdWhDVllYNUlxTTZnP2k9OCZlPTYzODI1NjEzMTYxNDIwOTA2MQ==", event.getServerCallId()); - assertEquals("441fbf00-5b21-4beb-bd4d-fd665ca4b65f", event.getCallConnectionId()); - assertEquals("fb2d738b-d9cb-496c-8be6-416aeecd4d96", event.getCorrelationId()); - assertEquals("Success Result", event.getResultInformation().getMessage()); - assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); - assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); - } - - @Test - public void parseDialogFailedEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"91f8b34b-383c-431d-9fa5-79d39fad9300\",\n" - + " \"source\": \"calling/callConnections/441fbf00-5b21-4beb-bd4d-fd665ca4b65f\",\n" - + " \"type\": \"Microsoft.Communication.DialogFailed\",\n" - + " \"data\": {\n" - + " \"operationContext\": \"context\",\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Operation Failed\"\n" - + " },\n" - + " \"dialogInputType\": \"powerVirtualAgents\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"441fbf00-5b21-4beb-bd4d-fd665ca4b65f\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzc2MtMDkuY29udi5za3lwZS5jb20vY29udi9ubUpvbG9wMUhrdWhDVllYNUlxTTZnP2k9OCZlPTYzODI1NjEzMTYxNDIwOTA2MQ==\",\n" - + " \"correlationId\": \"fb2d738b-d9cb-496c-8be6-416aeecd4d96\"\n" - + " },\n" - + " \"time\": \"2023-07-27T07:48:55.5109544+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/441fbf00-5b21-4beb-bd4d-fd665ca4b65f\"\n" - + "}]"; - DialogFailed event = (DialogFailed) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzc2MtMDkuY29udi5za3lwZS5jb20vY29udi9ubUpvbG9wMUhrdWhDVllYNUlxTTZnP2k9OCZlPTYzODI1NjEzMTYxNDIwOTA2MQ==", event.getServerCallId()); - assertEquals("441fbf00-5b21-4beb-bd4d-fd665ca4b65f", event.getCallConnectionId()); - assertEquals("fb2d738b-d9cb-496c-8be6-416aeecd4d96", event.getCorrelationId()); - assertEquals("Operation Failed", event.getResultInformation().getMessage()); - assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); - assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); - } - - @Test - public void parseDialogLanguageChangeEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/441fbf00-5b21-4beb-bd4d-fd665ca4b65f\",\n" - + " \"type\": \"Microsoft.Communication.DialogLanguageChange\",\n" - + " \"data\": {\n" - + " \"selectedLanguage\": \"eng-USA\",\n" - + " \"operationContext\": \"context\",\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Success Result\"\n" - + " },\n" - + " \"dialogInputType\": \"powerVirtualAgents\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"ivrContext\": \"Sanitized\",\n" - + " \"callConnectionId\": \"441fbf00-5b21-4beb-bd4d-fd665ca4b65f\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzc2MtMDkuY29udi5za3lwZS5jb20vY29udi9ubUpvbG9wMUhrdWhDVllYNUlxTTZnP2k9OCZlPTYzODI1NjEzMTYxNDIwOTA2MQ==\",\n" - + " \"correlationId\": \"fb2d738b-d9cb-496c-8be6-416aeecd4d96\"\n" - + " },\n" - + " \"time\": \"2023-07-27T07:48:55.5109544+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/441fbf00-5b21-4beb-bd4d-fd665ca4b65f\"\n" - + "}]"; - - DialogLanguageChange event = (DialogLanguageChange) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzc2MtMDkuY29udi5za3lwZS5jb20vY29udi9ubUpvbG9wMUhrdWhDVllYNUlxTTZnP2k9OCZlPTYzODI1NjEzMTYxNDIwOTA2MQ==", event.getServerCallId()); - assertEquals("441fbf00-5b21-4beb-bd4d-fd665ca4b65f", event.getCallConnectionId()); - assertEquals("fb2d738b-d9cb-496c-8be6-416aeecd4d96", event.getCorrelationId()); - assertEquals("Success Result", event.getResultInformation().getMessage()); - assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); - assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); - assertEquals("Sanitized", event.getIvrContext()); - } - - @Test - public void parseDialogSensitivityUpdateEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.DialogSensitivityUpdate\",\n" - + " \"data\": {\n" - + " \"sensitiveMask\": false,\n" - + " \"operationContext\": \"context\",\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Success Result\"\n" - + " },\n" - + " \"dialogInputType\": \"powerVirtualAgents\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - DialogSensitivityUpdate event = (DialogSensitivityUpdate) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Success Result", event.getResultInformation().getMessage()); - assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); - assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); - } - - @Test - public void parseDialogConsentEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.DialogConsent\",\n" - + " \"data\": {\n" - + " \"sensitiveMask\": false,\n" - + " \"operationContext\": \"context\",\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Success Result\"\n" - + " },\n" - + " \"dialogInputType\": \"powerVirtualAgents\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - DialogConsent event = (DialogConsent) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Success Result", event.getResultInformation().getMessage()); - assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); - assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); - } - - @Test - public void parseDialogHangupEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.DialogHangup\",\n" - + " \"data\": {\n" - + " \"sensitiveMask\": false,\n" - + " \"operationContext\": \"context\",\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Success Result\"\n" - + " },\n" - + " \"dialogInputType\": \"powerVirtualAgents\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - DialogHangup event = (DialogHangup) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Success Result", event.getResultInformation().getMessage()); - assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); - assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); - } - - @Test - public void parseDialogTransferEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.DialogTransfer\",\n" - + " \"data\": {\n" - + " \"sensitiveMask\": false,\n" - + " \"operationContext\": \"context\",\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Success Result\"\n" - + " },\n" - + " \"dialogInputType\": \"powerVirtualAgents\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - DialogTransfer event = (DialogTransfer) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Success Result", event.getResultInformation().getMessage()); - assertEquals("92e08834-b6ee-4ede-8956-9fefa27a691c", event.getDialogId()); - assertEquals("powerVirtualAgents", event.getDialogInputType().toString()); - } - - @Test - public void parseTranscriptionStartedEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.TranscriptionStarted\",\n" - + " \"data\": {\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Transcription started successfully.\"\n" - + " },\n" - + " \"transcriptionUpdate\": {\n" - + " \"transcriptionStatus\": \"transcriptionStarted\",\n" - + " \"transcriptionStatusDetails\": \"subscriptionStarted\"\n" - + " },\n" - + " \"version\": \"2023-01-15-preview\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" - + " \"publicEventType\": \"Microsoft.Communication.TranscriptionStarted\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - - - TranscriptionStarted event = (TranscriptionStarted) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Transcription started successfully.", event.getResultInformation().getMessage()); - - assertNotNull(event.getTranscriptionUpdateResult()); - assertEquals(TranscriptionStatus.TRANSCRIPTION_STARTED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); - assertEquals(TranscriptionStatusDetails.SUBSCRIPTION_STARTED, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); - } - @Test - public void parseTranscriptionResumedEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.TranscriptionResumed\",\n" - + " \"data\": {\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Transcription resumed.\"\n" - + " },\n" - + " \"transcriptionUpdate\": {\n" - + " \"transcriptionStatus\": \"transcriptionResumed\",\n" - + " \"transcriptionStatusDetails\": \"streamConnectionReestablished\"\n" - + " },\n" - + " \"version\": \"2023-01-15-preview\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" - + " \"publicEventType\": \"icrosoft.Communication.TranscriptionResumed\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - - - TranscriptionResumed event = (TranscriptionResumed) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Transcription resumed.", event.getResultInformation().getMessage()); - - assertNotNull(event.getTranscriptionUpdateResult()); - assertEquals(TranscriptionStatus.TRANSCRIPTION_RESUMED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); - assertEquals(TranscriptionStatusDetails.STREAM_CONNECTION_REESTABLISHED, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); - } - @Test - public void parseTranscriptionStoppedEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.TranscriptionStopped\",\n" - + " \"data\": {\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Transcription stopped.\"\n" - + " },\n" - + " \"transcriptionUpdate\": {\n" - + " \"transcriptionStatus\": \"transcriptionStopped\",\n" - + " \"transcriptionStatusDetails\": \"subscriptionStopped\"\n" - + " },\n" - + " \"version\": \"2023-01-15-preview\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" - + " \"publicEventType\": \"icrosoft.Communication.TranscriptionStopped\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - - - TranscriptionStopped event = (TranscriptionStopped) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Transcription stopped.", event.getResultInformation().getMessage()); - - assertNotNull(event.getTranscriptionUpdateResult()); - assertEquals(TranscriptionStatus.TRANSCRIPTION_STOPPED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); - assertEquals(TranscriptionStatusDetails.SUBSCRIPTION_STOPPED, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); - } - @Test - public void parseTranscriptionFailedEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.TranscriptionFailed\",\n" - + " \"data\": {\n" - + " \"resultInformation\": {\n" - + " \"code\": 500,\n" - + " \"subCode\": 9999,\n" - + " \"message\": \"Unknown internal server error.\"\n" - + " },\n" - + " \"transcriptionUpdate\": {\n" - + " \"transcriptionStatus\": \"transcriptionFailed\",\n" - + " \"transcriptionStatusDetails\": \"unspecifiedError\"\n" - + " },\n" - + " \"version\": \"2023-01-15-preview\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" - + " \"publicEventType\": \"icrosoft.Communication.TranscriptionFailed\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - - - TranscriptionFailed event = (TranscriptionFailed) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Unknown internal server error.", event.getResultInformation().getMessage()); - - assertNotNull(event.getTranscriptionUpdateResult()); - assertEquals(TranscriptionStatus.TRANSCRIPTION_FAILED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); - assertEquals(TranscriptionStatusDetails.UNSPECIFIED_ERROR, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); - } - - - @Test - public void parseTranscriptionUpdatedEvent() { - String receivedEvent = "[" - + " {\n" - + " \"id\": \"Sanitized\",\n" - + " \"source\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"type\": \"Microsoft.Communication.TranscriptionUpdated\",\n" - + " \"data\": {\n" - + " \"resultInformation\": {\n" - + " \"code\": 200,\n" - + " \"subCode\": 0,\n" - + " \"message\": \"Transcription updated.\"\n" - + " },\n" - + " \"transcriptionUpdate\": {\n" - + " \"transcriptionStatus\": \"transcriptionLocaleUpdated\",\n" - + " \"transcriptionStatusDetails\": \"subscriptionStarted\"\n" - + " },\n" - + " \"version\": \"2023-01-15-preview\",\n" - + " \"dialogId\": \"92e08834-b6ee-4ede-8956-9fefa27a691c\",\n" - + " \"callConnectionId\": \"491f1300-0c70-4f8c-97b4-94474f2a371b\",\n" - + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==\",\n" - + " \"correlationId\": \"ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5\",\n" - + " \"publicEventType\": \"Microsoft.Communication.TranscriptionUpdated\"\n" - + " },\n" - + " \"time\": \"2023-08-02T08:44:58.9826643+00:00\",\n" - + " \"specversion\": \"1.0\",\n" - + " \"datacontenttype\": \"application/json\",\n" - + " \"subject\": \"calling/callConnections/491f1300-0c70-4f8c-97b4-94474f2a371b\"\n" - + "}]"; - - - TranscriptionUpdated event = (TranscriptionUpdated) CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zaXBuZWVRSGIwYUN1cmNfbmF4SjB3P2k9MTAtNjAtMzAtMTI1JmU9NjM4MjY1MTkwMDQ1MzY2NjYx==", event.getServerCallId()); - assertEquals("491f1300-0c70-4f8c-97b4-94474f2a371b", event.getCallConnectionId()); - assertEquals("ccadc1b4-7ea5-4d74-aebe-2c37ddc742a5", event.getCorrelationId()); - assertEquals("Transcription updated.", event.getResultInformation().getMessage()); - - assertNotNull(event.getTranscriptionUpdateResult()); - assertEquals(TranscriptionStatus.TRANSCRIPTION_LOCALE_UPDATED, event.getTranscriptionUpdateResult().getTranscriptionStatus()); - assertEquals(TranscriptionStatusDetails.SUBSCRIPTION_STARTED, event.getTranscriptionUpdateResult().getTranscriptionStatusDetails()); - } - - @Test - public void parseAnswerFailedEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" - + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" - + "\"type\": \"Microsoft.Communication.AnswerFailed\",\n" - + "\"data\": {\n" - + "\"operationContext\": \"context\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" - + "},\n" - + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" - + "}]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - AnswerFailed answerFailed = (AnswerFailed) event; - - assertNotNull(answerFailed); - assertEquals("serverCallId", answerFailed.getServerCallId()); - assertEquals("callConnectionId", answerFailed.getCallConnectionId()); - - CallAutomationEventProcessor callAutomationEventProcessor = new CallAutomationEventProcessor(); - callAutomationEventProcessor.attachOngoingEventProcessor(answerFailed.getCallConnectionId(), - eventToHandle -> { - assertEquals("serverCallId", eventToHandle.getServerCallId()); - assertEquals("callConnectionId", eventToHandle.getCallConnectionId()); - }, AnswerFailed.class); - callAutomationEventProcessor.processEvents(receivedEvent); - callAutomationEventProcessor.detachOngoingEventProcessor(answerFailed.getCallConnectionId(), AnswerFailed.class); - } - - @Test - public void parseCreateCallFailedEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" - + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" - + "\"type\": \"Microsoft.Communication.CreateCallFailed\",\n" - + "\"data\": {\n" - + "\"operationContext\": \"context\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" - + "},\n" - + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" - + "}]"; - - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - - assertNotNull(event); - - CreateCallFailed createCallFailed = (CreateCallFailed) event; - - assertNotNull(createCallFailed); - assertEquals("serverCallId", createCallFailed.getServerCallId()); - assertEquals("callConnectionId", createCallFailed.getCallConnectionId()); - - CallAutomationEventProcessor callAutomationEventProcessor = new CallAutomationEventProcessor(); - callAutomationEventProcessor.attachOngoingEventProcessor(createCallFailed.getCallConnectionId(), - eventToHandle -> { - assertEquals("serverCallId", eventToHandle.getServerCallId()); - assertEquals("callConnectionId", eventToHandle.getCallConnectionId()); - }, CreateCallFailed.class); - callAutomationEventProcessor.processEvents(receivedEvent); - callAutomationEventProcessor.detachOngoingEventProcessor(createCallFailed.getCallConnectionId(), CreateCallFailed.class); - } - - @Test - public void parseHoldFailedEvent() { - String receivedEvent = "[{\n" - + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" - + "\"source\": \"calling/callConnections/callConnectionId/HoldFailed\",\n" - + "\"type\": \"Microsoft.Communication.HoldFailed\",\n" - + "\"data\": {\n" - + "\"resultInformation\": {\n" - + "\"code\": 400,\n" - + "\"subCode\": 8536,\n" - + "\"message\": \"Action failed, file could not be downloaded.\"\n" - + "},\n" - + "\"type\": \"HoldFailed\",\n" - + "\"callConnectionId\": \"callConnectionId\",\n" - + "\"serverCallId\": \"serverCallId\",\n" - + "\"correlationId\": \"correlationId\"\n" - + "},\n" - + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" - + "\"specversion\": \"1.0\",\n" - + "\"datacontenttype\": \"application/json\",\n" - + "\"subject\": \"calling/callConnections/callConnectionId\"\n" - + "}]"; - CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); - assertNotNull(event); - HoldFailed holdFailed = (HoldFailed) event; - assertNotNull(holdFailed); - assertEquals("correlationId", holdFailed.getCorrelationId()); - assertEquals("serverCallId", holdFailed.getServerCallId()); - assertEquals(400, holdFailed.getResultInformation().getCode()); - assertEquals(ReasonCode.Play.DOWNLOAD_FAILED, holdFailed.getReasonCode()); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserUnitTests.java new file mode 100644 index 000000000000..3d51b6cf1db9 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserUnitTests.java @@ -0,0 +1,692 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation; + +import com.azure.communication.callautomation.models.ChoiceResult; +import com.azure.communication.callautomation.models.DtmfResult; +import com.azure.communication.callautomation.models.DtmfTone; +import com.azure.communication.callautomation.models.RecognizeResult; +import com.azure.communication.callautomation.models.RecordingState; +import com.azure.communication.callautomation.models.events.CallAutomationEventBase; +import com.azure.communication.callautomation.models.events.CallConnected; +import com.azure.communication.callautomation.models.events.CallTransferAccepted; +import com.azure.communication.callautomation.models.events.CancelAddParticipantFailed; +import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; +import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionStopped; +import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneFailed; +import com.azure.communication.callautomation.models.events.ContinuousDtmfRecognitionToneReceived; +import com.azure.communication.callautomation.models.events.ParticipantsUpdated; +import com.azure.communication.callautomation.models.events.PlayCanceled; +import com.azure.communication.callautomation.models.events.PlayCompleted; +import com.azure.communication.callautomation.models.events.PlayFailed; +import com.azure.communication.callautomation.models.events.ReasonCode; +import com.azure.communication.callautomation.models.events.ReasonCode.Recognize; +import com.azure.communication.callautomation.models.events.RecognizeCanceled; +import com.azure.communication.callautomation.models.events.RecognizeCompleted; +import com.azure.communication.callautomation.models.events.RecognizeFailed; +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.SendDtmfTonesCompleted; +import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public class CallAutomationEventParserUnitTests { + static final String EVENT_PARTICIPANT_UPDATED = "{\"id\":\"61069ef9-5ca9-457f-ac36-e2bb5e8400ca\",\"source\":\"calling/callConnections/401f3500-62bd-46a9-8c09-9e1b06caca01/ParticipantsUpdated\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"participants\":[{\"identifier\": {\"rawId\":\"8:acs:816df1ca-971b-44d7-b8b1-8fba90748500_00000013-2ff6-dd51-54b7-a43a0d001998\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"8:acs:816df1ca-971b-44d7-b8b1-8fba90748500_00000013-2ff6-dd51-54b7-a43a0d001998\"}}, \"isMuted\": false},{\"identifier\": {\"rawId\":\"8:acs:816df1ca-971b-44d7-b8b1-8fba90748500_00000013-2ff7-1579-99bf-a43a0d0010bc\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"8:acs:816df1ca-971b-44d7-b8b1-8fba90748500_00000013-2ff7-1579-99bf-a43a0d0010bc\"}}, \"isMuted\": false}],\"type\":\"participantsUpdated\",\"callConnectionId\":\"401f3500-62bd-46a9-8c09-9e1b06caca01\",\"correlationId\":\"ebd8bf1f-0794-494f-bdda-913042c06ef7\"},\"time\":\"2022-08-12T03:35:07.9129474+00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f3500-62bd-46a9-8c09-9e1b06caca01/ParticipantsUpdated\"}"; + static final String EVENT_CALL_CONNECTED = "{\"id\":\"46116fb7-27e0-4a99-9478-a659c8fd4815\",\"source\":\"calling/callConnections/401f3500-62bd-46a9-8c09-9e1b06caca01/CallConnected\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"type\":\"callConnected\",\"callConnectionId\":\"401f3500-62bd-46a9-8c09-9e1b06caca01\",\"correlationId\":\"ebd8bf1f-0794-494f-bdda-913042c06ef7\"},\"time\":\"2022-08-12T03:35:07.8174402+00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f3500-62bd-46a9-8c09-9e1b06caca01/CallConnected\"}"; + static final String EVENT_RECOGNIZE_DTMF = "[{\"id\":\"ac2cb537-2d62-48bf-909e-cc93534c4258\",\"source\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"type\":\"Microsoft.Communication.RecognizeCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"operationContext\":\"OperationalContextValue-1118-1049\",\"resultInformation\":{\"code\":200,\"subCode\":8533,\"message\":\"Action completed, DTMF option matched.\"},\"recognitionType\":\"dtmf\",\"dtmfResult\":{\"tones\":[\"five\", \"six\", \"pound\"]},\"choiceResult\":{\"label\":\"Marketing\"},\"callConnectionId\":\"401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"serverCallId\":\"serverCallId\",\"correlationId\":\"d4f4c1be-59d8-4850-b9bf-ee564c15839d\"},\"time\":\"2022-11-22T01:41:44.5582769+00:00\",\"specversion\":\"1.0\",\"subject\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\"}]"; + static final String EVENT_RECOGNIZE_CHOICE = "[{\"id\":\"e25b99ef-3632-45bb-96d1-d9191547ff33\",\"source\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"type\":\"Microsoft.Communication.RecognizeCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"operationContext\":\"OperationalContextValue-1118-1049\",\"resultInformation\":{\"code\":200,\"subCode\":8545,\"message\":\"Action completed, Recognized phrase matches a valid option.\"},\"recognitionType\":\"choices\",\"choiceResult\":{\"label\":\"Support\",\"recognizedPhrase\":\"customer help\"},\"callConnectionId\":\"401f7000-c1c0-41e2-962d-85d0dc1d6f01\",\"serverCallId\":\"serverCallId\",\"correlationId\":\"d4f4c1be-59d8-4850-b9bf-ee564c15839d\"},\"time\":\"2022-11-22T01:41:00.1967145+00:00\",\"specversion\":\"1.0\",\"subject\":\"calling/callConnections/401f7000-c1c0-41e2-962d-85d0dc1d6f01\"}]"; + + @Test + public void parseEvent() { + CallAutomationEventBase callAutomationEvent = CallAutomationEventParser.parseEvents(EVENT_PARTICIPANT_UPDATED).get(0); + + assertNotNull(callAutomationEvent); + assertEquals(callAutomationEvent.getClass(), ParticipantsUpdated.class); + ParticipantsUpdated participantsUpdated = (ParticipantsUpdated) callAutomationEvent; + assertNotNull((participantsUpdated).getParticipants()); + participantsUpdated.getParticipants().forEach(participant -> { + assertNotNull(participant); + assertNotNull(participant.getIdentifier()); + assertNotNull(participant.isMuted()); + }); + } + + @Test + public void parseEventList() { + List callAutomationEventList = CallAutomationEventParser.parseEvents("[" + + EVENT_CALL_CONNECTED + "," + EVENT_PARTICIPANT_UPDATED + "]"); + + assertNotNull(callAutomationEventList); + assertEquals(callAutomationEventList.get(0).getClass(), CallConnected.class); + assertEquals(callAutomationEventList.get(1).getClass(), ParticipantsUpdated.class); + assertNotNull(callAutomationEventList.get(0).getCallConnectionId()); + } + + @Test + public void parseRecordingStateChangedEvent() { + String receivedEvent = "[\n" + + " {\n" + + " \"id\": \"bf59843a-888f-47ca-8d1c-885c1f5e71dc\",\n" + + " \"source\": \"calling/recordings/serverCallId/recordingId/recordingId/RecordingStateChanged\",\n" + + " \"type\": \"Microsoft.Communication.RecordingStateChanged\",\n" + + " \"data\": {\n" + + " \"type\": \"recordingStateChanged\",\n" + + " \"recordingId\": \"recordingId\",\n" + + " \"state\": \"active\",\n" + + " \"startDateTime\": \"2022-08-11T23:42:45.4394211+00:00\",\n" + + " \"callConnectionId\": \"callConnectionId\",\n" + + " \"serverCallId\": \"serverCallId\",\n" + + " \"correlationId\": \"correlationId\"\n" + + " },\n" + + " \"time\": \"2022-08-11T23:42:45.5346632+00:00\",\n" + + " \"specversion\": \"1.0\",\n" + + " \"datacontenttype\": \"application/json\",\n" + + " \"subject\": \"calling/recordings/serverCallId/recordingId/recordingId\"\n" + + " }\n" + + "]"; + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + RecordingStateChanged recordingEvent = (RecordingStateChanged) event; + assertNotNull(recordingEvent); + assertEquals("serverCallId", recordingEvent.getServerCallId()); + assertEquals("recordingId", recordingEvent.getRecordingId()); + assertEquals(RecordingState.ACTIVE, recordingEvent.getRecordingState()); + } + + @Test + public void parsePlayCompletedEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + "\"source\": \"calling/callConnections/callConnectionId/PlayCompleted\",\n" + + "\"type\": \"Microsoft.Communication.PlayCompleted\",\n" + + "\"data\": {\n" + + "\"resultInformation\": {\n" + + "\"code\": 200,\n" + + "\"subCode\": 0,\n" + + "\"message\": \"Action completed successfully.\"\n" + + "},\n" + + "\"type\": \"playCompleted\",\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"correlationId\": \"correlationId\"\n" + + "},\n" + + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/callConnectionId\"\n" + + "}]"; + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + PlayCompleted playCompleted = (PlayCompleted) event; + assertNotNull(playCompleted); + assertEquals("serverCallId", playCompleted.getServerCallId()); + assertEquals(200, playCompleted.getResultInformation().getCode()); + assertEquals(ReasonCode.COMPLETED_SUCCESSFULLY, playCompleted.getReasonCode()); + } + + @Test + public void parsePlayFailedEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + "\"source\": \"calling/callConnections/callConnectionId/PlayFailed\",\n" + + "\"type\": \"Microsoft.Communication.PlayFailed\",\n" + + "\"data\": {\n" + + "\"resultInformation\": {\n" + + "\"code\": 400,\n" + + "\"subCode\": 8536,\n" + + "\"message\": \"Action failed, file could not be downloaded.\"\n" + + "},\n" + + "\"type\": \"playFailed\",\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"correlationId\": \"correlationId\"\n" + + "},\n" + + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/callConnectionId\"\n" + + "}]"; + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + PlayFailed playFailed = (PlayFailed) event; + assertNotNull(playFailed); + assertEquals("serverCallId", playFailed.getServerCallId()); + assertEquals(400, playFailed.getResultInformation().getCode()); + assertEquals(ReasonCode.Play.DOWNLOAD_FAILED, playFailed.getReasonCode()); + } + + @Test + public void parsePlayCanceledEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + "\"source\": \"calling/callConnections/callConnectionId/PlayCanceled\",\n" + + "\"type\": \"Microsoft.Communication.PlayCanceled\",\n" + + "\"data\": {\n" + + "\"type\": \"playCanceled\",\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"correlationId\": \"correlationId\"\n" + + "},\n" + + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/callConnectionId\"\n" + + "}]"; + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + PlayCanceled playCanceled = (PlayCanceled) event; + assertNotNull(playCanceled); + assertEquals("serverCallId", playCanceled.getServerCallId()); + } + @Test + public void parseRecognizeCompletedWithChoiceEvent() { + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(EVENT_RECOGNIZE_CHOICE).get(0); + assertNotNull(event); + RecognizeCompleted recognizeCompleted = (RecognizeCompleted) event; + assertNotNull(recognizeCompleted); + Optional recognizeResult = recognizeCompleted.getRecognizeResult(); + assertInstanceOf(ChoiceResult.class, recognizeResult.get()); + + ChoiceResult choiceResult = (ChoiceResult) recognizeResult.get(); + assertEquals("Support", choiceResult.getLabel()); + assertEquals("customer help", choiceResult.getRecognizedPhrase()); + assertEquals("serverCallId", recognizeCompleted.getServerCallId()); + assertEquals(200, recognizeCompleted.getResultInformation().getCode()); + assertEquals(Recognize.SPEECH_OPTION_MATCHED, recognizeCompleted.getReasonCode()); + } + + @Test + public void parseRecognizeCompletedWithDtmfEvent() { + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(EVENT_RECOGNIZE_DTMF).get(0); + assertNotNull(event); + RecognizeCompleted recognizeCompleted = (RecognizeCompleted) event; + Optional recognizeResult = recognizeCompleted.getRecognizeResult(); + assertNotNull(recognizeCompleted); + assertEquals("serverCallId", recognizeCompleted.getServerCallId()); + assertEquals(200, recognizeCompleted.getResultInformation().getCode()); + assertEquals(Recognize.DMTF_OPTION_MATCHED, recognizeCompleted.getReasonCode()); + assertInstanceOf(DtmfResult.class, recognizeResult.get()); + DtmfResult dtmfResult = (DtmfResult) recognizeResult.get(); + List dtmfToneList = dtmfResult.getTones(); + assertEquals(3, dtmfToneList.size()); + assertEquals("five", dtmfToneList.get(0).toString()); + assertEquals("six", dtmfToneList.get(1).toString()); + assertEquals("pound", dtmfToneList.get(2).toString()); + String tonesInString = dtmfResult.convertToString(); + assertEquals(tonesInString, "56#"); + } + + @Test + public void parseRecognizeFailedEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + "\"source\": \"calling/callConnections/callConnectionId/RecognizeCompleted\",\n" + + "\"type\": \"Microsoft.Communication.RecognizeFailed\",\n" + + "\"data\": {\n" + + "\"resultInformation\": {\n" + + "\"code\": 400,\n" + + "\"subCode\": 8510,\n" + + "\"message\": \"Action failed, initial silence timeout reached.\"\n" + + "},\n" + + "\"type\": \"recognizeFailed\",\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"correlationId\": \"correlationId\"\n" + + "},\n" + + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/callConnectionId\"\n" + + "}]"; + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + RecognizeFailed recognizeFailed = (RecognizeFailed) event; + assertNotNull(recognizeFailed); + assertEquals("serverCallId", recognizeFailed.getServerCallId()); + assertEquals(400, recognizeFailed.getResultInformation().getCode()); + assertEquals(ReasonCode.Recognize.INITIAL_SILENCE_TIMEOUT, recognizeFailed.getReasonCode()); + } + + @Test + public void parseRecognizeCanceledEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + "\"source\": \"calling/callConnections/callConnectionId/RecognizeCanceled\",\n" + + "\"type\": \"Microsoft.Communication.RecognizeCanceled\",\n" + + "\"data\": {\n" + + "\"type\": \"recognizeCanceled\",\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"correlationId\": \"correlationId\"\n" + + "},\n" + + "\"time\": \"2022-08-12T03:13:25.0252763+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/callConnectionId\"\n" + + "}]"; + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + RecognizeCanceled recognizeCanceled = (RecognizeCanceled) event; + assertNotNull(recognizeCanceled); + assertEquals("serverCallId", recognizeCanceled.getServerCallId()); + } + + @Test + public void parseRemoveParticipantSucceededEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" + + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" + + "\"type\": \"Microsoft.Communication.RemoveParticipantSucceeded\",\n" + + "\"data\": {\n" + + "\"operationContext\": \"context\",\n" + + "\"participant\": {\n" + + "\"rawId\": \"rawId\",\n" + + "\"phoneNumber\": {\n" + + "\"value\": \"value\"\n" + + "}\n" + + "},\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" + + "},\n" + + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" + + "}]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + + RemoveParticipantSucceeded removeParticipantSucceeded = (RemoveParticipantSucceeded) event; + + assertNotNull(removeParticipantSucceeded); + assertEquals("serverCallId", removeParticipantSucceeded.getServerCallId()); + assertEquals("callConnectionId", removeParticipantSucceeded.getCallConnectionId()); + assertEquals("rawId", removeParticipantSucceeded.getParticipant().getRawId()); + } + + @Test + public void parseRemoveParticipantFailedEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" + + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" + + "\"type\": \"Microsoft.Communication.RemoveParticipantFailed\",\n" + + "\"data\": {\n" + + "\"operationContext\": \"context\",\n" + + "\"participant\": {\n" + + "\"rawId\": \"rawId\",\n" + + "\"phoneNumber\": {\n" + + "\"value\": \"value\"\n" + + "}\n" + + "},\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" + + "},\n" + + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" + + "}]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + + RemoveParticipantFailed removeParticipantFailed = (RemoveParticipantFailed) event; + + assertNotNull(removeParticipantFailed); + assertEquals("serverCallId", removeParticipantFailed.getServerCallId()); + assertEquals("callConnectionId", removeParticipantFailed.getCallConnectionId()); + assertEquals("rawId", removeParticipantFailed.getParticipant().getRawId()); + } + + @Test + public void parseContinuousDtmfRecognitionToneReceivedEvent() { + + String receivedEvent = "[\n" + + " {\n" + + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + " \"source\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneReceived\",\n" + + " \"type\":\"Microsoft.Communication.ContinuousDtmfRecognitionToneReceived\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"data\":{\n" + + " \"eventSource\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneReceived\",\n" + + " \"resultInformation\":{\n" + + " \"code\":200,\n" + + " \"subCode\":0,\n" + + " \"message\":\"DTMF tone received successfully.\"\n" + + " },\n" + + " \"type\":\"ContinuousDtmfRecognitionToneReceived\",\n" + + " \"sequenceId\":1,\n" + + " \"tone\":\"eight\",\n" + + " \"callConnectionId\":\"callConnectionId\",\n" + + " \"serverCallId\":\"serverCallId\",\n" + + " \"correlationId\":\"correlationId\",\n" + + " \"operationContext\":\"context\",\n" + + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"datacontenttype\":\"application/json\",\n" + + " \"subject\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneReceived\"\n" + + " }\n" + + " }\n" + + "]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + + ContinuousDtmfRecognitionToneReceived continuousDtmfRecognitionToneReceived = (ContinuousDtmfRecognitionToneReceived) event; + + assertNotNull(continuousDtmfRecognitionToneReceived); + assertEquals("serverCallId", continuousDtmfRecognitionToneReceived.getServerCallId()); + assertEquals("callConnectionId", continuousDtmfRecognitionToneReceived.getCallConnectionId()); + assertEquals("eight", continuousDtmfRecognitionToneReceived.getTone().toString()); + assertEquals(1, continuousDtmfRecognitionToneReceived.getSequenceId()); + assertEquals("correlationId", continuousDtmfRecognitionToneReceived.getCorrelationId()); + assertEquals(200, continuousDtmfRecognitionToneReceived.getResultInformation().getCode()); + assertEquals(0, continuousDtmfRecognitionToneReceived.getResultInformation().getSubCode()); + assertEquals("context", continuousDtmfRecognitionToneReceived.getOperationContext()); + assertEquals("DTMF tone received successfully.", continuousDtmfRecognitionToneReceived.getResultInformation().getMessage()); + } + + @Test + public void parseContinuousDtmfRecognitionToneFailedEvent() { + + String receivedEvent = "[\n" + + " {\n" + + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + " \"source\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneFailed\",\n" + + " \"type\":\"Microsoft.Communication.ContinuousDtmfRecognitionToneFailed\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"data\":{\n" + + " \"eventSource\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneFailed\",\n" + + " \"resultInformation\":{\n" + + " \"code\":400,\n" + + " \"subCode\":12323,\n" + + " \"message\":\"Continuous DTMF tone Couldn't be received successfully.\"\n" + + " },\n" + + " \"type\":\"ContinuousDtmfRecognitionToneFailed\",\n" + + " \"callConnectionId\":\"callConnectionId\",\n" + + " \"serverCallId\":\"serverCallId\",\n" + + " \"correlationId\":\"correlationId\",\n" + + " \"operationContext\":\"context\",\n" + + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"datacontenttype\":\"application/json\",\n" + + " \"subject\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionToneFailed\"\n" + + " }\n" + + " }\n" + + "]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + + ContinuousDtmfRecognitionToneFailed continuousDtmfRecognitionToneFailed = (ContinuousDtmfRecognitionToneFailed) event; + + assertNotNull(continuousDtmfRecognitionToneFailed); + assertEquals("serverCallId", continuousDtmfRecognitionToneFailed.getServerCallId()); + assertEquals("callConnectionId", continuousDtmfRecognitionToneFailed.getCallConnectionId()); + assertEquals("correlationId", continuousDtmfRecognitionToneFailed.getCorrelationId()); + assertEquals(400, continuousDtmfRecognitionToneFailed.getResultInformation().getCode()); + assertEquals(12323, continuousDtmfRecognitionToneFailed.getResultInformation().getSubCode()); + assertEquals("context", continuousDtmfRecognitionToneFailed.getOperationContext()); + assertEquals("Continuous DTMF tone Couldn't be received successfully.", continuousDtmfRecognitionToneFailed.getResultInformation().getMessage()); + } + + @Test + public void parseContinuousDtmfRecognitionStoppedEvent() { + + String receivedEvent = "[\n" + + " {\n" + + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + " \"source\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionStopped\",\n" + + " \"type\":\"Microsoft.Communication.ContinuousDtmfRecognitionStopped\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"data\":{\n" + + " \"eventSource\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionStopped\",\n" + + " \"resultInformation\":{\n" + + " \"code\":200,\n" + + " \"subCode\":0,\n" + + " \"message\":\"Continuous DTMF Recognition stopped successfully.\"\n" + + " },\n" + + " \"type\":\"ContinuousDtmfRecognitionStopped\",\n" + + " \"callConnectionId\":\"callConnectionId\",\n" + + " \"serverCallId\":\"serverCallId\",\n" + + " \"correlationId\":\"correlationId\",\n" + + " \"operationContext\":\"context\",\n" + + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"datacontenttype\":\"application/json\",\n" + + " \"subject\":\"calling/callConnections/callConnectionId/ContinuousDtmfRecognitionStopped\"\n" + + " }\n" + + " }\n" + + "]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + + ContinuousDtmfRecognitionStopped continuousDtmfRecognitionStopped = (ContinuousDtmfRecognitionStopped) event; + + assertNotNull(continuousDtmfRecognitionStopped); + assertEquals("serverCallId", continuousDtmfRecognitionStopped.getServerCallId()); + assertEquals("callConnectionId", continuousDtmfRecognitionStopped.getCallConnectionId()); + assertEquals("correlationId", continuousDtmfRecognitionStopped.getCorrelationId()); + assertEquals(200, continuousDtmfRecognitionStopped.getResultInformation().getCode()); + assertEquals(0, continuousDtmfRecognitionStopped.getResultInformation().getSubCode()); + assertEquals("context", continuousDtmfRecognitionStopped.getOperationContext()); + assertEquals("Continuous DTMF Recognition stopped successfully.", continuousDtmfRecognitionStopped.getResultInformation().getMessage()); + } + + @Test + public void parseSendDtmfTonesCompletedEvent() { + + String receivedEvent = "[\n" + + " {\n" + + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + " \"source\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\",\n" + + " \"type\":\"Microsoft.Communication.SendDtmfTonesCompleted\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"data\":{\n" + + " \"eventSource\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\",\n" + + " \"resultInformation\":{\n" + + " \"code\":200,\n" + + " \"subCode\":0,\n" + + " \"message\":\"Send DTMF completed successfully.\"\n" + + " },\n" + + " \"type\":\"SendDtmfTonesCompleted\",\n" + + " \"callConnectionId\":\"callConnectionId\",\n" + + " \"serverCallId\":\"serverCallId\",\n" + + " \"correlationId\":\"correlationId\",\n" + + " \"operationContext\":\"context\",\n" + + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"datacontenttype\":\"application/json\",\n" + + " \"subject\":\"calling/callConnections/callConnectionId/SendDtmfTonesCompleted\"\n" + + " }\n" + + " }\n" + + "]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + + SendDtmfTonesCompleted sendDtmfTonesCompleted = (SendDtmfTonesCompleted) event; + + assertNotNull(sendDtmfTonesCompleted); + assertEquals("serverCallId", sendDtmfTonesCompleted.getServerCallId()); + assertEquals("callConnectionId", sendDtmfTonesCompleted.getCallConnectionId()); + assertEquals("correlationId", sendDtmfTonesCompleted.getCorrelationId()); + assertEquals(200, sendDtmfTonesCompleted.getResultInformation().getCode()); + assertEquals(0, sendDtmfTonesCompleted.getResultInformation().getSubCode()); + assertEquals("context", sendDtmfTonesCompleted.getOperationContext()); + assertEquals("Send DTMF completed successfully.", sendDtmfTonesCompleted.getResultInformation().getMessage()); + } + + @Test + public void parseSendDtmfTonesFailedEvent() { + + String receivedEvent = "[\n" + + " {\n" + + " \"id\":\"704a7a96-4d74-4ebe-9cd0-b7cc39c3d7b1\",\n" + + " \"source\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\",\n" + + " \"type\":\"Microsoft.Communication.SendDtmfTonesFailed\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"data\":{\n" + + " \"eventSource\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\",\n" + + " \"resultInformation\":{\n" + + " \"code\":200,\n" + + " \"subCode\":0,\n" + + " \"message\":\"Send DTMF couldn't be completed successfully.\"\n" + + " },\n" + + " \"type\":\"SendDtmfTonesFailed\",\n" + + " \"callConnectionId\":\"callConnectionId\",\n" + + " \"serverCallId\":\"serverCallId\",\n" + + " \"correlationId\":\"correlationId\",\n" + + " \"operationContext\":\"context\",\n" + + " \"time\":\"2022-08-12T03:13:25.0252763+00:00\",\n" + + " \"specversion\":\"1.0\",\n" + + " \"datacontenttype\":\"application/json\",\n" + + " \"subject\":\"calling/callConnections/callConnectionId/SendDtmfTonesFailed\"\n" + + " }\n" + + " }\n" + + "]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + + SendDtmfTonesFailed sendDtmfTonesFailed = (SendDtmfTonesFailed) event; + + assertNotNull(sendDtmfTonesFailed); + assertEquals("serverCallId", sendDtmfTonesFailed.getServerCallId()); + assertEquals("callConnectionId", sendDtmfTonesFailed.getCallConnectionId()); + assertEquals("correlationId", sendDtmfTonesFailed.getCorrelationId()); + assertEquals(200, sendDtmfTonesFailed.getResultInformation().getCode()); + assertEquals(0, sendDtmfTonesFailed.getResultInformation().getSubCode()); + assertEquals("context", sendDtmfTonesFailed.getOperationContext()); + assertEquals("Send DTMF couldn't be completed successfully.", sendDtmfTonesFailed.getResultInformation().getMessage()); + } + + @Test + public void parseTransferAccptedEvent() { + String receivedEvent = "[\n" + + " {\n" + + " \"id\": \"91f8b34b-383c-431d-9fa5-79d39fad9300\",\n" + + " \"source\": \"calling/callConnections/411f0b00-dc73-4528-a9e6-968ba983d2a1\",\n" + + " \"type\": \"Microsoft.Communication.CallTransferAccepted\",\n" + + " \"data\": {\n" + + " \"resultInformation\": {\n" + + " \"code\": 200,\n" + + " \"subCode\": 7015,\n" + + " \"message\": \"The transfer operation completed successfully.\"\n" + + " },\n" + + " \"transferTarget\": {\n" + + " \"rawId\": \"8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2f-2234-655d-573a0d00443e\",\n" + + " \"kind\": \"communicationUser\",\n" + + " \"communicationUser\": {\n" + + " \"id\": \"8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2f-2234-655d-573a0d00443e\"\n" + + " }\n" + + " },\n" + + " \"transferee\": {\n" + + " \"rawId\": \"8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2e-e2b4-655d-573a0d004434\",\n" + + " \"kind\": \"communicationUser\",\n" + + " \"communicationUser\": {\n" + + " \"id\": \"8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2e-e2b4-655d-573a0d004434\"\n" + + " }\n" + + " },\n" + + " \"callConnectionId\": \"411f0b00-dc73-4528-a9e6-968ba983d2a1\",\n" + + " \"serverCallId\": \"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDEuY29udi5za3lwZS5jb20vY29udi8yZWtNYmJRN3VVbUY1RDJERFdITWJnP2k9MTUmZT02MzgyNTMwMzY2ODQ5NzkwMDI=\",\n" + + " \"correlationId\": \"be43dd55-38e9-4de8-9d75-e20b6b32744f\"\n" + + " },\n" + + " \"time\": \"2023-07-19T18:31:16.6795146+00:00\",\n" + + " \"specversion\": \"1.0\",\n" + + " \"datacontenttype\": \"application/json\",\n" + + " \"subject\": \"calling/callConnections/411f0b00-dc73-4528-a9e6-968ba983d2a1\"\n" + + " }\n" + + "]"; + CallTransferAccepted event = (CallTransferAccepted) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDEuY29udi5za3lwZS5jb20vY29udi8yZWtNYmJRN3VVbUY1RDJERFdITWJnP2k9MTUmZT02MzgyNTMwMzY2ODQ5NzkwMDI=", event.getServerCallId()); + assertEquals("411f0b00-dc73-4528-a9e6-968ba983d2a1", event.getCallConnectionId()); + assertEquals("be43dd55-38e9-4de8-9d75-e20b6b32744f", event.getCorrelationId()); + assertEquals("The transfer operation completed successfully.", event.getResultInformation().getMessage()); + assertEquals("8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2f-2234-655d-573a0d00443e", event.getTransferTarget().getRawId()); + assertEquals("8:acs:3afbe310-c6d9-4b6f-a11e-c2aeb352f207_0000001a-0f2e-e2b4-655d-573a0d004434", event.getTransferee().getRawId()); + } + + @Test + public void parseCancelAddParticipantSucceededEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" + + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" + + "\"type\": \"Microsoft.Communication.CancelAddParticipantSucceeded\",\n" + + "\"data\": {\n" + + "\"operationContext\": \"context\",\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"invitationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\",\n" + + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" + + "},\n" + + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" + + "}]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + + CancelAddParticipantSucceeded cancelAddParticipantSucceeded = (CancelAddParticipantSucceeded) event; + + assertNotNull(cancelAddParticipantSucceeded); + assertEquals("serverCallId", cancelAddParticipantSucceeded.getServerCallId()); + assertEquals("callConnectionId", cancelAddParticipantSucceeded.getCallConnectionId()); + assertEquals("b880bd5a-1916-470a-b43d-aabf3caff91c", cancelAddParticipantSucceeded.getInvitationId()); + } + + @Test + public void parseCancelAddParticipantFailedEvent() { + String receivedEvent = "[{\n" + + "\"id\": \"c3220fa3-79bd-473e-96a2-3ecb5be7d71f\",\n" + + "\"source\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\",\n" + + "\"type\": \"Microsoft.Communication.CancelAddParticipantFailed\",\n" + + "\"data\": {\n" + + "\"operationContext\": \"context\",\n" + + "\"callConnectionId\": \"callConnectionId\",\n" + + "\"serverCallId\": \"serverCallId\",\n" + + "\"invitationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\",\n" + + "\"correlationId\": \"b880bd5a-1916-470a-b43d-aabf3caff91c\"\n" + + "},\n" + + "\"time\": \"2023-03-22T16:57:09.287755+00:00\",\n" + + "\"specversion\": \"1.0\",\n" + + "\"datacontenttype\": \"application/json\",\n" + + "\"subject\": \"calling/callConnections/421f3500-f5de-4c12-bf61-9e2641433687\"\n" + + "}]"; + + CallAutomationEventBase event = CallAutomationEventParser.parseEvents(receivedEvent).get(0); + + assertNotNull(event); + + CancelAddParticipantFailed cancelAddParticipantFailed = (CancelAddParticipantFailed) event; + + assertNotNull(cancelAddParticipantFailed); + assertEquals("serverCallId", cancelAddParticipantFailed.getServerCallId()); + assertEquals("callConnectionId", cancelAddParticipantFailed.getCallConnectionId()); + assertEquals("b880bd5a-1916-470a-b43d-aabf3caff91c", cancelAddParticipantFailed.getInvitationId()); + } + +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationLiveTestBase.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationLiveTestBase.java index 716181cca5a8..435cdf869629 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationLiveTestBase.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationLiveTestBase.java @@ -10,9 +10,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipelineNextPolicy; import com.azure.core.http.HttpResponse; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.models.BodilessMatcher; -import com.azure.core.test.models.CustomMatcher; +import com.azure.core.test.TestBase; import com.azure.core.test.TestMode; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; @@ -21,14 +19,13 @@ import java.time.OffsetDateTime; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.StringJoiner; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; -public class CallAutomationLiveTestBase extends TestProxyTestBase { +public class CallAutomationLiveTestBase extends TestBase { protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); @@ -61,17 +58,13 @@ public class CallAutomationLiveTestBase extends TestProxyTestBase { protected static final String PHONE_USER_1 = Configuration.getGlobalConfiguration() .get("TARGET_PHONE_NUMBER", "+16471234567"); protected static final String MEDIA_SOURCE = Configuration.getGlobalConfiguration() - .get("ACS_MEDIA_SOURCE", "https://contoso.com/music.wav"); + .get("ACS_MEDIA_SOURCE", "https://stmikhailccaaptest.blob.core.windows.net/assets/out.wav"); private static final StringJoiner JSON_PROPERTIES_TO_REDACT = new StringJoiner("\":\"|\"", "\"", "\":\"") .add("value") .add("rawId") .add("id") - .add("callbackUri") - .add("botAppId") - .add("ivrContext") - .add("incomingCallContext") - .add("serverCallId"); + .add("callbackUri"); protected static final Pattern JSON_PROPERTY_VALUE_REDACTION_PATTERN = Pattern.compile(String.format("(?:%s)(.*?)(?:\",|\"})", JSON_PROPERTIES_TO_REDACT), Pattern.CASE_INSENSITIVE); @@ -86,17 +79,11 @@ protected CommunicationIdentityClientBuilder getCommunicationIdentityClientUsing redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data))); builder.addPolicy(interceptorManager.getRecordPolicy(redactors)); } - - if (interceptorManager.isPlaybackMode()) { - interceptorManager.addMatchers(Arrays.asList(new BodilessMatcher(), - new CustomMatcher().setHeadersKeyOnlyMatch(Arrays.asList("repeatability-first-sent", - "repeatability-request-id", "x-ms-content-sha256", "x-ms-hmac-string-to-sign-base64")))); - } - return builder; } protected CallAutomationClientBuilder getCallAutomationClientUsingConnectionString(HttpClient httpClient) { + CallAutomationClientBuilder builder; if (COMMUNICATION_CUSTOM_ENDPOINT_ENABLED) { builder = new CallAutomationClientBuilder() @@ -114,13 +101,6 @@ protected CallAutomationClientBuilder getCallAutomationClientUsingConnectionStri redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data))); builder.addPolicy(interceptorManager.getRecordPolicy(redactors)); } - - if (interceptorManager.isPlaybackMode()) { - interceptorManager.addMatchers(Arrays.asList(new BodilessMatcher(), - new CustomMatcher().setHeadersKeyOnlyMatch(Arrays.asList("repeatability-first-sent", - "repeatability-request-id", "x-ms-content-sha256", "x-ms-hmac-string-to-sign-base64")))); - } - return builder; } @@ -137,13 +117,6 @@ protected CallAutomationClientBuilder getCallAutomationClientUsingTokenCredentia redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data))); builder.addPolicy(interceptorManager.getRecordPolicy(redactors)); } - - if (interceptorManager.isPlaybackMode()) { - interceptorManager.addMatchers(Arrays.asList(new BodilessMatcher(), - new CustomMatcher().setHeadersKeyOnlyMatch(Arrays.asList("repeatability-first-sent", - "repeatability-request-id", "x-ms-content-sha256", "x-ms-hmac-string-to-sign-base64")))); - } - return builder; } @@ -160,13 +133,6 @@ protected CallAutomationClientBuilder getCallAutomationClientUsingInvalidTokenCr redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data))); builder.addPolicy(interceptorManager.getRecordPolicy(redactors)); } - - if (interceptorManager.isPlaybackMode()) { - interceptorManager.addMatchers(Arrays.asList(new BodilessMatcher(), - new CustomMatcher().setHeadersKeyOnlyMatch(Arrays.asList("repeatability-first-sent", - "repeatability-request-id", "x-ms-content-sha256", "x-ms-hmac-string-to-sign-base64")))); - } - return builder; } @@ -174,6 +140,11 @@ protected Mono logHeaders(String testName, HttpPipelineNextPolicy return next.process() .flatMap(httpResponse -> { final HttpResponse bufferedResponse = httpResponse.buffer(); + + /* Should sanitize printed response url */ + System.out.println("Chain-ID header for " + testName + " request " + + bufferedResponse.getRequest().getUrl() + + ": " + bufferedResponse.getHeaderValue("X-Microsoft-Skype-Chain-ID")); return Mono.just(bufferedResponse); }); } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationServiceVersionTest.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationServiceVersionTest.java new file mode 100644 index 000000000000..aff82d5ddd65 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationServiceVersionTest.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation; + +import org.junit.jupiter.api.Test; + +import static com.azure.communication.callautomation.CallAutomationServiceVersion.V2023_03_06; +import static com.azure.communication.callautomation.CallAutomationServiceVersion.V2023_10_15; +import static org.junit.jupiter.api.Assertions.*; + +class CallAutomationServiceVersionTest { + + @Test + void getVersion() { + CallAutomationServiceVersion callAutomationServiceVersion = V2023_03_06; + assertEquals("2023-03-06", callAutomationServiceVersion.getVersion()); + callAutomationServiceVersion = V2023_10_15; + assertEquals("2023-10-15", callAutomationServiceVersion.getVersion()); + } + + @Test + void getLatest() { + assertEquals(V2023_10_15, CallAutomationServiceVersion.getLatest()); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java index 4218f17cb0ad..9327b9d8c467 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationUnitTestBase.java @@ -15,13 +15,6 @@ import com.azure.communication.callautomation.implementation.models.CallConnectionStateModelInternal; import com.azure.communication.callautomation.implementation.models.CallParticipantInternal; import com.azure.communication.callautomation.implementation.models.GetParticipantsResponseInternal; -import com.azure.communication.callautomation.implementation.models.DialogStateResponse; -import com.azure.communication.callautomation.models.MediaStreamingAudioChannel; -import com.azure.communication.callautomation.models.MediaStreamingOptions; -import com.azure.communication.callautomation.models.MediaStreamingContent; -import com.azure.communication.callautomation.models.MediaStreamingTransport; -import com.azure.communication.callautomation.models.TranscriptionOptions; -import com.azure.communication.callautomation.models.TranscriptionTransportType; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -46,26 +39,10 @@ public class CallAutomationUnitTestBase { static final String CALL_CONNECTION_STATE = "connected"; static final String CALL_SUBJECT = "subject"; static final String CALL_CALLBACK_URL = "https://REDACTED.com/events"; + static final String OPERATION_CALLBACK_URL = "https://REDACTED.com/events"; static final String CALL_INCOMING_CALL_CONTEXT = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.REDACTED"; static final String CALL_OPERATION_CONTEXT = "operationContext"; static final String MEDIA_SUBSCRIPTION_ID = "mediaSubscriptionId"; - static final String DATA_SUBSCRIPTION_ID = "dataSubscriptionId"; - static final String DIALOG_ID = "dialogId"; - static final String BOT_APP_ID = "botAppId"; - - static final MediaStreamingOptions MEDIA_STREAMING_CONFIGURATION = new MediaStreamingOptions( - "https://websocket.url.com", - MediaStreamingTransport.WEBSOCKET, - MediaStreamingContent.AUDIO, - MediaStreamingAudioChannel.MIXED - ); - - static final TranscriptionOptions TRANSCRIPTION_CONFIGURATION = new TranscriptionOptions( - "https://websocket.url.com", - TranscriptionTransportType.WEBSOCKET, - "en-US", - true - ); public static String generateDownloadResult(String content) { return content; @@ -73,14 +50,12 @@ public static String generateDownloadResult(String content) { public static String generateCallProperties(String callConnectionId, String serverCallId, String callerId, String callerDisplayName, String targetId, String connectionState, - String subject, String callbackUri, String mediaSubscriptionId, String dataSubscriptionId) { + String subject, String callbackUri, String mediaSubscriptionId) { CallConnectionPropertiesInternal result = new CallConnectionPropertiesInternal() .setCallConnectionId(callConnectionId) .setServerCallId(serverCallId) .setCallbackUri(callbackUri) .setCallConnectionState(CallConnectionStateModelInternal.fromString(connectionState)) - .setMediaSubscriptionId(mediaSubscriptionId) - .setDataSubscriptionId(dataSubscriptionId) .setSourceDisplayName(callerDisplayName) .setTargets(new ArrayList<>(Collections.singletonList(ModelGenerator.generateUserIdentifierModel(targetId))) ); @@ -88,16 +63,16 @@ public static String generateCallProperties(String callConnectionId, String serv return serializeObject(result); } - public static String generateGetParticipantResponse(String callerId, boolean isMuted, boolean isHold) { - CallParticipantInternal callParticipant = ModelGenerator.generateAcsCallParticipantInternal(callerId, isMuted, isHold); + public static String generateGetParticipantResponse(String callerId, boolean isMuted) { + CallParticipantInternal callParticipant = ModelGenerator.generateAcsCallParticipantInternal(callerId, isMuted); return serializeObject(callParticipant); } public static String generateListParticipantsResponse() { GetParticipantsResponseInternal getParticipantsResponseInternal = new GetParticipantsResponseInternal() .setValue(new ArrayList<>(Arrays.asList( - ModelGenerator.generateAcsCallParticipantInternal(CALL_CALLER_ID, false, false), - ModelGenerator.generateAcsCallParticipantInternal(CALL_TARGET_ID, true, true)))) + ModelGenerator.generateAcsCallParticipantInternal(CALL_CALLER_ID, false), + ModelGenerator.generateAcsCallParticipantInternal(CALL_TARGET_ID, true)))) .setNextLink(""); return serializeObject(getParticipantsResponseInternal); @@ -106,18 +81,11 @@ public static String generateListParticipantsResponse() { public static String generateAddParticipantsResponse() { AddParticipantResponseInternal addParticipantsResponseInternal = new AddParticipantResponseInternal() .setOperationContext(CALL_OPERATION_CONTEXT) - .setParticipant(ModelGenerator.generateAcsCallParticipantInternal(CALL_TARGET_ID, false, false)); + .setParticipant(ModelGenerator.generateAcsCallParticipantInternal(CALL_TARGET_ID, false)); return serializeObject(addParticipantsResponseInternal); } - public static String generateDialogStateResponse() { - DialogStateResponse dialogStateResponse = new DialogStateResponse() - .setDialogId(DIALOG_ID); - - return serializeObject(dialogStateResponse); - } - public static CallAutomationAsyncClient getCallAutomationAsyncClient(ArrayList> responses) { HttpClient mockHttpClient = new MockHttpClient(responses); diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java index c807992bf2a3..3be5ddc75ef5 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java @@ -12,17 +12,20 @@ import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; import com.azure.communication.callautomation.models.CreateCallResult; import com.azure.communication.callautomation.models.CreateGroupCallOptions; +import com.azure.communication.callautomation.models.MuteParticipantOptions; +import com.azure.communication.callautomation.models.MuteParticipantResult; import com.azure.communication.callautomation.models.RemoveParticipantResult; import com.azure.communication.callautomation.models.events.AddParticipantSucceeded; import com.azure.communication.callautomation.models.events.CallConnected; -import com.azure.communication.callautomation.models.events.RemoveParticipantSucceeded; import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; +import com.azure.communication.callautomation.models.events.RemoveParticipantSucceeded; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.identity.CommunicationIdentityAsyncClient; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; - +import com.azure.core.test.annotation.DoNotRecord; +import org.eclipse.jetty.http.HttpStatus; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -33,12 +36,14 @@ import java.util.List; import java.util.Objects; +import static com.azure.communication.callautomation.CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; public class CallConnectionAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { - + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -157,6 +162,139 @@ public void createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAut } } + @DoNotRecord(skipInPlayback = true) + @ParameterizedTest + @MethodSource("com.azure.core.test.TestBase#getHttpClients") + @DisabledIfEnvironmentVariable( + named = "SKIP_LIVE_TEST", + matches = "(?i)(true)", + disabledReason = "Requires environment to be set up") + public void addAParticipantAndMuteInCallAutomatedTest(HttpClient httpClient) { + /* Test case: ACS to ACS call + * 1. create a CallAutomationClient. + * 2. create a call from source to one ACS target. + * 3. get updated call properties and check for the connected state. + * 4. add one more ACS target to the call. + * 5. wait for the incomingCallContext on another receiver + * 6. answer the call + * 7. mute the participant + * 9. verify that the participant got successfully muted + */ + CommunicationIdentityAsyncClient identityAsyncClient = getCommunicationIdentityClientUsingConnectionString(httpClient) + .addPolicy((context, next) -> logHeaders("addAParticipantAndMuteInCallAutomatedTest", next)) + .buildAsyncClient(); + + List callDestructors = new ArrayList<>(); + + try { + // create caller and receiver + CommunicationUserIdentifier caller = identityAsyncClient.createUser().block(); + CommunicationUserIdentifier receiver = identityAsyncClient.createUser().block(); + CommunicationUserIdentifier anotherReceiver = identityAsyncClient.createUser().block(); + + String uniqueId = serviceBusWithNewCall(caller, receiver); + String anotherUniqueId = serviceBusWithNewCall(caller, anotherReceiver); + + // Create call automation client for caller. + CallAutomationAsyncClient callerAsyncClient = getCallAutomationClientUsingConnectionString(httpClient) + .addPolicy((context, next) -> logHeaders("addAParticipantAndMuteInCallAutomatedTest", next)) + .sourceIdentity(caller) + .buildAsyncClient(); + + // Create call automation client for receivers. + CallAutomationAsyncClient receiverAsyncClient = getCallAutomationClientUsingConnectionString(httpClient) + .addPolicy((context, next) -> logHeaders("addAParticipantAndMuteInCallAutomatedTest", next)) + .buildAsyncClient(); + + // create a call + List targetParticipants = new ArrayList<>(Arrays.asList(receiver)); + CreateGroupCallOptions createCallOptions = new CreateGroupCallOptions(targetParticipants, + DISPATCHER_CALLBACK + String.format("?q=%s", uniqueId)); + Response createCallResultResponse = callerAsyncClient.createGroupCallWithResponse(createCallOptions).block(); + assertNotNull(createCallResultResponse); + CreateCallResult createCallResult = createCallResultResponse.getValue(); + assertNotNull(createCallResult); + assertNotNull(createCallResult.getCallConnectionProperties()); + String callerConnectionId = createCallResult.getCallConnectionProperties().getCallConnectionId(); + assertNotNull(callerConnectionId); + + // wait for the incomingCallContext + String incomingCallContext = waitForIncomingCallContext(uniqueId, Duration.ofSeconds(10)); + assertNotNull(incomingCallContext); + + // answer the call + AnswerCallOptions answerCallOptions = new AnswerCallOptions(incomingCallContext, + DISPATCHER_CALLBACK + String.format("?q=%s", uniqueId)); + AnswerCallResult answerCallResult = Objects.requireNonNull(receiverAsyncClient.answerCallWithResponse(answerCallOptions).block()).getValue(); + assertNotNull(answerCallResult); + assertNotNull(answerCallResult.getCallConnectionAsync()); + assertNotNull(answerCallResult.getCallConnectionProperties()); + String receiverConnectionId = answerCallResult.getCallConnectionProperties().getCallConnectionId(); + callDestructors.add(answerCallResult.getCallConnectionAsync()); + + // wait for callConnected + CallConnected callConnected = waitForEvent(CallConnected.class, receiverConnectionId, Duration.ofSeconds(10)); + assertNotNull(callConnected); + + // add another receiver to the call + AddParticipantOptions addParticipantsOptions = new AddParticipantOptions(new CallInvite(anotherReceiver)); + Response addParticipantsResultResponse = createCallResult.getCallConnectionAsync().addParticipantWithResponse(addParticipantsOptions).block(); + assertNotNull(addParticipantsResultResponse); + + // wait for the incomingCallContext on another receiver + String anotherIncomingCallContext = waitForIncomingCallContext(anotherUniqueId, Duration.ofSeconds(10)); + assertNotNull(anotherIncomingCallContext); + + // answer the call + answerCallOptions = new AnswerCallOptions(anotherIncomingCallContext, + DISPATCHER_CALLBACK + String.format("?q=%s", anotherUniqueId)); + AnswerCallResult anotherAnswerCallResult = Objects.requireNonNull(receiverAsyncClient.answerCallWithResponse(answerCallOptions).block()).getValue(); + assertNotNull(anotherAnswerCallResult); + assertNotNull(anotherAnswerCallResult.getCallConnectionAsync()); + assertNotNull(anotherAnswerCallResult.getCallConnectionProperties()); + callDestructors.add(anotherAnswerCallResult.getCallConnectionAsync()); + + // wait for addParticipantSucceed + AddParticipantSucceeded addParticipantSucceeded = waitForEvent(AddParticipantSucceeded.class, callerConnectionId, Duration.ofSeconds(10)); + assertNotNull(addParticipantSucceeded); + + // mute the participant + Response muteResponse = createCallResult.getCallConnectionAsync() + .muteParticipantWithResponse(new MuteParticipantOptions(receiver).setOperationContext(CALL_OPERATION_CONTEXT)).block(); + assertNotNull(muteResponse); + MuteParticipantResult muteParticipantResult = muteResponse.getValue(); + assertNotNull(muteParticipantResult); + assertEquals(CALL_OPERATION_CONTEXT, muteParticipantResult.getOperationContext()); + assertEquals(HttpStatus.OK_200, muteResponse.getStatusCode()); + + sleepIfRunningAgainstService(4000); + + // verify that the participant got successfully muted + boolean isMuted = false; + List listParticipantsResult = createCallResult.getCallConnectionAsync().listParticipants().log().collectList().block(); + if (listParticipantsResult != null) { + for (CallParticipant participant : listParticipantsResult) { + if (participant.getIdentifier().equals(receiver) && participant.isMuted()) { + isMuted = true; + } + } + } + assertTrue(isMuted, "Failed to mute participant"); + } catch (Exception ex) { + fail("Unexpected exception received", ex); + } finally { + if (!callDestructors.isEmpty()) { + try { + callDestructors.forEach(callConnection -> callConnection.hangUpWithResponse(true).block()); + } catch (Exception ignored) { + // Some call might have been terminated during the test, and it will cause exceptions here. + // Do nothing and iterate to next call connection. + } + } + } + } + + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -241,7 +379,7 @@ public void createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant .block(); assertNotNull(cancelAddParticipantResponse); - // wait for CancelAddParticipantSucceeded + // wait for addParticipantSucceed CancelAddParticipantSucceeded cancelAddParticipantSucceeded = waitForEvent(CancelAddParticipantSucceeded.class, callerConnectionId, Duration.ofSeconds(10)); assertNotNull(cancelAddParticipantSucceeded); } catch (Exception ex) { diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncUnitTests.java index d7dd9b27108c..2a899b6bbf6b 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncUnitTests.java @@ -4,29 +4,15 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.implementation.models.CancelAddParticipantResponse; +import com.azure.communication.callautomation.implementation.models.MuteParticipantsResponseInternal; import com.azure.communication.callautomation.implementation.models.MuteParticipantsResultInternal; import com.azure.communication.callautomation.implementation.models.RemoveParticipantResponseInternal; import com.azure.communication.callautomation.implementation.models.TransferCallResponseInternal; -import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal; -import com.azure.communication.callautomation.models.AddParticipantOptions; -import com.azure.communication.callautomation.models.AddParticipantResult; -import com.azure.communication.callautomation.models.CallConnectionProperties; -import com.azure.communication.callautomation.models.CallInvite; -import com.azure.communication.callautomation.models.CallParticipant; -import com.azure.communication.callautomation.models.CancelAddParticipantOperationOptions; -import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; -import com.azure.communication.callautomation.models.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.UnmuteParticipantOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantResult; +import com.azure.communication.callautomation.models.*; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.common.PhoneNumberIdentifier; -import com.azure.core.http.rest.Response; import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.Response; import org.junit.jupiter.api.Test; import java.util.AbstractMap.SimpleEntry; @@ -36,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; public class CallConnectionAsyncUnitTests extends CallAutomationUnitTestBase { @@ -44,7 +31,7 @@ public void getCallProperties() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); @@ -58,7 +45,7 @@ public void getCallPropertiesWithResponse() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); @@ -112,7 +99,7 @@ public void hangUpWithResponseForEveryone() { public void getParticipant() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(generateGetParticipantResponse(CALL_CALLER_ID, false, false), 200) + new SimpleEntry<>(generateGetParticipantResponse(CALL_CALLER_ID, false), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); @@ -126,7 +113,7 @@ public void getParticipant() { public void getParticipantWithResponse() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(generateGetParticipantResponse(CALL_CALLER_ID, false, false), 200) + new SimpleEntry<>(generateGetParticipantResponse(CALL_CALLER_ID, false), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); @@ -284,16 +271,20 @@ public void muteParticipant() { ))) .getCallConnectionAsync(CALL_CONNECTION_ID); - MuteParticipantResult muteParticipantResultResponse = callConnectionAsync.muteParticipant(new CommunicationUserIdentifier(CALL_TARGET_ID)).block(); + MuteParticipantOptions options = new MuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)); + options.setOperationContext(CALL_OPERATION_CONTEXT); + Response muteParticipantResultResponse = callConnectionAsync.muteParticipantWithResponse(options).block(); assertNotNull(muteParticipantResultResponse); + assertNull(muteParticipantResultResponse.getValue().getOperationContext()); } + @Test public void muteParticipantWithResponse() { CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(serializeObject(new MuteParticipantsResultInternal() + new SimpleEntry<>(serializeObject(new MuteParticipantsResponseInternal() .setOperationContext(CALL_OPERATION_CONTEXT)), 200) ))) .getCallConnectionAsync(CALL_CONNECTION_ID); @@ -333,62 +324,6 @@ public void muteNotAcsParticipant() { new PhoneNumberIdentifier("+11234567890")).block()); } - @Test - public void unmuteParticipant() { - CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( - Collections.singletonList( - new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal()), 200) - ))) - .getCallConnectionAsync(CALL_CONNECTION_ID); - - UnmuteParticipantResult unmuteParticipantResult = callConnectionAsync.unmuteParticipant(new CommunicationUserIdentifier(CALL_TARGET_ID)).block(); - - assertNotNull(unmuteParticipantResult); - } - - @Test - public void unmuteParticipantNotFound() { - CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( - Collections.singletonList( - new SimpleEntry<>("", 404) - ))) - .getCallConnectionAsync(CALL_CONNECTION_ID); - - assertThrows(HttpResponseException.class, () -> callConnectionAsync.unmuteParticipant( - new CommunicationUserIdentifier(CALL_TARGET_ID)).block()); - } - - @Test - public void unmuteNotAcsParticipant() { - CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( - Collections.singletonList( - new SimpleEntry<>("", 400) - ))) - .getCallConnectionAsync(CALL_CONNECTION_ID); - - assertThrows(HttpResponseException.class, () -> callConnectionAsync.unmuteParticipant( - new PhoneNumberIdentifier("+11234567890")).block()); - } - - @Test - public void unmuteParticipantWithResponse() { - CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(new ArrayList<>( - Collections.singletonList( - new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal() - .setOperationContext(CALL_OPERATION_CONTEXT)), 200) - ))) - .getCallConnectionAsync(CALL_CONNECTION_ID); - - UnmuteParticipantOptions unmuteParticipantOptions = new UnmuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)) - .setOperationContext(CALL_OPERATION_CONTEXT); - - Response unmuteParticipantsResultResponse = - callConnectionAsync.unmuteParticipantWithResponse(unmuteParticipantOptions).block(); - - assertNotNull(unmuteParticipantsResultResponse); - assertEquals(200, unmuteParticipantsResultResponse.getStatusCode()); - assertNotNull(unmuteParticipantsResultResponse.getValue()); - } @Test public void cancelAddParticipant() { diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionUnitTests.java index cc47b99a0bd5..cabb760757d9 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionUnitTests.java @@ -4,39 +4,25 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.implementation.models.CancelAddParticipantResponse; +import com.azure.communication.callautomation.implementation.models.MuteParticipantsResponseInternal; import com.azure.communication.callautomation.implementation.models.MuteParticipantsResultInternal; import com.azure.communication.callautomation.implementation.models.RemoveParticipantResponseInternal; import com.azure.communication.callautomation.implementation.models.TransferCallResponseInternal; -import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal; -import com.azure.communication.callautomation.models.AddParticipantOptions; -import com.azure.communication.callautomation.models.AddParticipantResult; -import com.azure.communication.callautomation.models.CallConnectionProperties; -import com.azure.communication.callautomation.models.CallInvite; -import com.azure.communication.callautomation.models.CallParticipant; -import com.azure.communication.callautomation.models.CancelAddParticipantOperationOptions; -import com.azure.communication.callautomation.models.CancelAddParticipantOperationResult; -import com.azure.communication.callautomation.models.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.UnmuteParticipantOptions; -import com.azure.communication.callautomation.models.UnmuteParticipantResult; +import com.azure.communication.callautomation.models.*; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import org.junit.jupiter.api.Test; -import java.util.ArrayList; - import java.util.AbstractMap.SimpleEntry; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; public class CallConnectionUnitTests extends CallAutomationUnitTestBase { @Test @@ -44,7 +30,7 @@ public void getCallProperties() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) ))) .getCallConnection(CALL_CONNECTION_ID); @@ -58,7 +44,7 @@ public void getCallPropertiesWithResponse() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( new SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID, CALL_SERVER_CALL_ID, - CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID, DATA_SUBSCRIPTION_ID), 200) + CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE, CALL_SUBJECT, CALL_CALLBACK_URL, MEDIA_SUBSCRIPTION_ID), 200) ))) .getCallConnection(CALL_CONNECTION_ID); @@ -112,7 +98,7 @@ public void hangUpWithResponseForEveryone() { public void getParticipant() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(generateGetParticipantResponse(CALL_CALLER_ID, false, false), 200) + new SimpleEntry<>(generateGetParticipantResponse(CALL_CALLER_ID, false), 200) ))) .getCallConnection(CALL_CONNECTION_ID); @@ -126,7 +112,7 @@ public void getParticipant() { public void getParticipantWithResponse() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(generateGetParticipantResponse(CALL_CALLER_ID, false, false), 200) + new SimpleEntry<>(generateGetParticipantResponse(CALL_CALLER_ID, false), 200) ))) .getCallConnection(CALL_CONNECTION_ID); @@ -265,66 +251,35 @@ public void muteParticipant() { ))) .getCallConnection(CALL_CONNECTION_ID); - MuteParticipantResult muteParticipantResult = - callConnection.muteParticipant(new CommunicationUserIdentifier(CALL_TARGET_ID)); - - assertNotNull(muteParticipantResult); - } - - @Test - public void muteParticipantWithResponse() { - CallConnection callConnection = getCallAutomationClient(new ArrayList<>( - Collections.singletonList( - new SimpleEntry<>(serializeObject(new MuteParticipantsResultInternal() - .setOperationContext(CALL_OPERATION_CONTEXT)), 200) - ))) - .getCallConnection(CALL_CONNECTION_ID); - - MuteParticipantOptions muteParticipantOptions = new MuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)) - .setOperationContext(CALL_OPERATION_CONTEXT); - - Response muteParticipantResultResponse = - callConnection.muteParticipantWithResponse(muteParticipantOptions, Context.NONE); + MuteParticipantOptions options = new MuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)); + options.setOperationContext(CALL_OPERATION_CONTEXT); + Response muteParticipantResultResponse = callConnection.muteParticipantWithResponse(options, Context.NONE); assertNotNull(muteParticipantResultResponse); - assertEquals(200, muteParticipantResultResponse.getStatusCode()); - assertNotNull(muteParticipantResultResponse.getValue()); - } - - @Test - public void unmuteParticipant() { - CallConnection callConnection = getCallAutomationClient(new ArrayList<>( - Collections.singletonList( - new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal()), 200) - ))) - .getCallConnection(CALL_CONNECTION_ID); - - UnmuteParticipantResult unmuteParticipantsResult = - callConnection.unmuteParticipant(new CommunicationUserIdentifier(CALL_TARGET_ID)); - - assertNotNull(unmuteParticipantsResult); + assertNull(muteParticipantResultResponse.getValue().getOperationContext()); } @Test - public void unmuteParticipantWithResponse() { + public void muteParticipantsWithResponse() { CallConnection callConnection = getCallAutomationClient(new ArrayList<>( Collections.singletonList( - new SimpleEntry<>(serializeObject(new UnmuteParticipantsResponseInternal() + new SimpleEntry<>(serializeObject(new MuteParticipantsResponseInternal() .setOperationContext(CALL_OPERATION_CONTEXT)), 200) ))) .getCallConnection(CALL_CONNECTION_ID); - UnmuteParticipantOptions muteParticipantOptions = new UnmuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)) + MuteParticipantOptions options = new MuteParticipantOptions(new CommunicationUserIdentifier(CALL_TARGET_ID)) .setOperationContext(CALL_OPERATION_CONTEXT); - Response unmuteParticipantResultResponse = - callConnection.unmuteParticipantWithResponse(muteParticipantOptions, Context.NONE); + Response muteParticipantsResultResponse = + callConnection.muteParticipantWithResponse(options, Context.NONE); - assertNotNull(unmuteParticipantResultResponse); - assertEquals(200, unmuteParticipantResultResponse.getStatusCode()); - assertNotNull(unmuteParticipantResultResponse.getValue()); + assertNotNull(muteParticipantsResultResponse); + assertEquals(200, muteParticipantsResultResponse.getStatusCode()); + assertNotNull(muteParticipantsResultResponse.getValue()); } + @Test public void cancelAddParticipant() { String invitationId = "invitationId"; diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java deleted file mode 100644 index f37ce857bf5c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.communication.callautomation.models.*; -import com.azure.communication.callautomation.models.events.CallConnected; -import com.azure.communication.callautomation.models.events.DialogCompleted; -import com.azure.communication.callautomation.models.events.DialogStarted; -import com.azure.communication.common.CommunicationIdentifier; -import com.azure.communication.common.CommunicationUserIdentifier; -import com.azure.communication.identity.CommunicationIdentityAsyncClient; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; - -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -import java.time.Duration; -import java.util.*; - -import static org.junit.jupiter.api.Assertions.*; - -public class CallDialogAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "SKIP_LIVE_TEST", - matches = "(?i)(true)", - disabledReason = "Requires environment to be set up") - public void dialogActionInACallAutomatedTest(HttpClient httpClient) { - /* Test case:Start and Stop Dialog on ACS to ACS call - * 1. create a CallAutomationClient. - * 2. create a call from source to one ACS target. - * 3. get updated call properties and check for the connected state. - * 4. Start dialog, expect no failure(exception) - * 5. Stop dialog, expect DialogCompletedEvent - * 6. hang up the call. - */ - - CommunicationIdentityAsyncClient identityAsyncClient = getCommunicationIdentityClientUsingConnectionString(httpClient) - .addPolicy((context, next) -> logHeaders("dialogActionInACallAutomatedTest", next)) - .buildAsyncClient(); - - List callDestructors = new ArrayList<>(); - - try { - // create caller and receiver - CommunicationUserIdentifier caller = identityAsyncClient.createUser().block(); - CommunicationUserIdentifier receiver = identityAsyncClient.createUser().block(); - - CallAutomationAsyncClient callerAsyncClient = getCallAutomationClientUsingConnectionString(httpClient) - .addPolicy((context, next) -> logHeaders("dialogActionInACallAutomatedTest", next)) - .sourceIdentity(caller) - .buildAsyncClient(); - - // Create call automation client for receivers. - CallAutomationAsyncClient receiverAsyncClient = getCallAutomationClientUsingConnectionString(httpClient) - .addPolicy((context, next) -> logHeaders("dialogActionInACallAutomatedTest", next)) - .buildAsyncClient(); - - String uniqueId = serviceBusWithNewCall(caller, receiver); - - // create a call - List targets = Collections.singletonList(receiver); - CreateGroupCallOptions createCallOptions = new CreateGroupCallOptions(targets, - DISPATCHER_CALLBACK + String.format("?q=%s", uniqueId)); - Response createCallResultResponse = callerAsyncClient.createGroupCallWithResponse(createCallOptions).block(); - - assertNotNull(createCallResultResponse); - CreateCallResult createCallResult = createCallResultResponse.getValue(); - assertNotNull(createCallResult); - assertNotNull(createCallResult.getCallConnectionProperties()); - String callerConnectionId = createCallResult.getCallConnectionProperties().getCallConnectionId(); - assertNotNull(callerConnectionId); - - // wait for the incomingCallContext - String incomingCallContext = waitForIncomingCallContext(uniqueId, Duration.ofSeconds(10)); - assertNotNull(incomingCallContext); - - // answer the call - AnswerCallOptions answerCallOptions = new AnswerCallOptions(incomingCallContext, - DISPATCHER_CALLBACK + String.format("?q=%s", uniqueId)); - AnswerCallResult answerCallResult = Objects.requireNonNull(receiverAsyncClient.answerCallWithResponse(answerCallOptions).block()).getValue(); - String receiverConnectionId = answerCallResult.getCallConnectionProperties().getCallConnectionId(); - assertNotNull(answerCallResult); - assertNotNull(answerCallResult.getCallConnectionAsync()); - assertNotNull(answerCallResult.getCallConnectionProperties()); - callDestructors.add(answerCallResult.getCallConnectionAsync()); - - // wait for callConnected - CallConnected callConnected = waitForEvent(CallConnected.class, callerConnectionId, Duration.ofSeconds(10)); - assertNotNull(callConnected); - - // start dialog - String dialogId = "92e08834-b6ee-4ede-8956-9fefa27a691c"; - Map dialogContext = new HashMap<>(); - StartDialogOptions options = new StartDialogOptions(dialogId, DialogInputType.POWER_VIRTUAL_AGENTS, dialogContext); - options.setBotId(BOT_APP_ID); - - CallDialogAsync callDialogAsync = answerCallResult.getCallConnectionAsync().getCallDialogAsync(); - Response dialogStateResultResponse = callDialogAsync.startDialogWithResponse(options).block(); - assertNotNull(dialogStateResultResponse); - assertEquals(201, dialogStateResultResponse.getStatusCode()); - DialogStateResult dialogStateResult = dialogStateResultResponse.getValue(); - assertNotNull(dialogStateResult); - assertEquals(dialogId, dialogStateResult.getDialogId()); - DialogStarted dialogStarted = waitForEvent(DialogStarted.class, receiverConnectionId, Duration.ofSeconds(20)); - assertNotNull(dialogStarted); - - // stop dialog - callDialogAsync.stopDialog(dialogId).block(); - DialogCompleted dialogCompleted = waitForEvent(DialogCompleted.class, receiverConnectionId, Duration.ofSeconds(20)); - assertNotNull(dialogCompleted); - } catch (Exception ex) { - fail("Unexpected exception received", ex); - } finally { - if (!callDestructors.isEmpty()) { - try { - callDestructors.forEach(callConnection -> callConnection.hangUpWithResponse(true).block()); - } catch (Exception ignored) { - // Some call might have been terminated during the test, and it will cause exceptions here. - // Do nothing and iterate to next call connection. - } - } - } - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncUnitTests.java deleted file mode 100644 index 2e3f3e837814..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncUnitTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.communication.callautomation.models.DialogStateResult; -import com.azure.communication.callautomation.models.StartDialogOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Test; - -import java.util.*; - -import static com.azure.communication.callautomation.CallAutomationUnitTestBase.*; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class CallDialogAsyncUnitTests { - - private CallDialogAsync callDialogAsync; - - @Test - public void startDialogWithResponseTest() { - // override callDialog to mock 201 response code - CallConnectionAsync callConnectionAsync = - CallAutomationUnitTestBase.getCallConnectionAsync(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>(generateDialogStateResponse(), 201))) - ); - callDialogAsync = callConnectionAsync.getCallDialogAsync(); - - Map dialogContext = new HashMap<>(); - StartDialogOptions options = new StartDialogOptions( - DialogInputType.POWER_VIRTUAL_AGENTS, - dialogContext); - - options.setOperationContext("operationContext"); - options.setBotId(BOT_APP_ID); - - Response response = callDialogAsync.startDialogWithResponse(options).block(); - - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - } - - @Test - public void stopDialogWithResponseTest() { - // override callDialog to mock 204 response code - CallConnectionAsync callConnectionAsync = - CallAutomationUnitTestBase.getCallConnectionAsync(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>("", 204))) - ); - callDialogAsync = callConnectionAsync.getCallDialogAsync(); - - Response response = callDialogAsync.stopDialogWithResponse(DIALOG_ID).block(); - - assertEquals(response.getStatusCode(), 204); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogUnitTests.java deleted file mode 100644 index d0faffc0fec4..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogUnitTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.communication.callautomation.models.DialogInputType; -import com.azure.communication.callautomation.models.DialogStateResult; -import com.azure.communication.callautomation.models.StartDialogOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import org.junit.jupiter.api.Test; - -import java.util.*; - -import static com.azure.communication.callautomation.CallAutomationUnitTestBase.*; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class CallDialogUnitTests { - - private CallDialog callDialog; - - @Test - public void startDialogTest() { - // override callDialog to mock 201 response code - CallConnection callConnection = - CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>(generateDialogStateResponse(), 201))) - ); - callDialog = callConnection.getCallDialog(); - - Map dialogContext = new HashMap<>(); - StartDialogOptions options = new StartDialogOptions( - DIALOG_ID, - DialogInputType.POWER_VIRTUAL_AGENTS, - dialogContext); - - DialogStateResult response = callDialog.startDialog(options); - - assertNotNull(response); - assertEquals(response.getDialogId(), DIALOG_ID); - } - - @Test - public void startDialogWithResponseTest() { - // override callDialog to mock 201 response code - CallConnection callConnection = - CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>(generateDialogStateResponse(), 201))) - ); - callDialog = callConnection.getCallDialog(); - - Map dialogContext = new HashMap<>(); - StartDialogOptions options = new StartDialogOptions( - DialogInputType.AZURE_OPEN_AI, - dialogContext); - - options.setOperationContext("operationContext"); - options.setBotId(BOT_APP_ID); - - Response response = callDialog.startDialogWithResponse( - options, - Context.NONE); - - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - } - - @Test - public void stopDialogWithResponseTest() { - // override callDialog to mock 204 response code - CallConnection callConnection = - CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>("", 204))) - ); - callDialog = callConnection.getCallDialog(); - - Response response = callDialog.stopDialogWithResponse( - DIALOG_ID, - Context.NONE); - - assertEquals(response.getStatusCode(), 204); - } -} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java index 60e5034b3d1d..c1d2e52f7005 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java @@ -24,7 +24,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; - +import com.azure.core.test.annotation.DoNotRecord; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class CallMediaAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { - + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -128,6 +128,7 @@ public void playMediaInACallAutomatedTest(HttpClient httpClient) { } } + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -140,7 +141,7 @@ public void dtmfActionsInACallAutomatedTest(HttpClient httpClient) { * 2. Create a call from source to one ACS target. * 3. Get updated call properties and check for the connected state. * 4. Start continuous Dtmf detection on source, expect no failure(exception) - * 5. Send Dtmf tones to target, expect SendDtmfCompleted event and no failure(exception) + * 5. Send Dtmf tones to target, expect SendDtmfTonesCompleted event and no failure(exception) * 6. Stop continuous Dtmf detection on source, expect ContinuousDtmfDetectionStopped event and no failure(exception) * 7. Hang up the call. */ @@ -152,8 +153,8 @@ public void dtmfActionsInACallAutomatedTest(HttpClient httpClient) { List callDestructors = new ArrayList<>(); try { - CommunicationIdentifier caller; - CommunicationIdentifier receiver; + PhoneNumberIdentifier caller; + PhoneNumberIdentifier receiver; // when in playback, use Sanitized values if (getTestMode() == TestMode.PLAYBACK) { caller = new PhoneNumberIdentifier("Sanitized"); @@ -176,7 +177,7 @@ public void dtmfActionsInACallAutomatedTest(HttpClient httpClient) { String uniqueId = serviceBusWithNewCall(caller, receiver); // create a call - CallInvite invite = new CallInvite((PhoneNumberIdentifier) receiver, (PhoneNumberIdentifier) caller); + CallInvite invite = new CallInvite(receiver, caller); CreateCallResult createCallResult = client.createCall(invite, DISPATCHER_CALLBACK + String.format("?q=%s", uniqueId)).block(); // validate the call @@ -213,9 +214,9 @@ public void dtmfActionsInACallAutomatedTest(HttpClient httpClient) { // send Dtmf tones to target callMediaAsync.sendDtmfTones(Stream.of(DtmfTone.A, DtmfTone.B).collect(Collectors.toList()), receiver).block(); - // validate SendDtmfCompleted - SendDtmfTonesCompleted sendDtmfCompleted = waitForEvent(SendDtmfTonesCompleted.class, callerConnectionId, Duration.ofSeconds(20)); - assertNotNull(sendDtmfCompleted); + // validate SendDtmfTonesCompleted + SendDtmfTonesCompleted sendDtmfTonesCompleted = waitForEvent(SendDtmfTonesCompleted.class, callerConnectionId, Duration.ofSeconds(20)); + assertNotNull(sendDtmfTonesCompleted); // stop continuous dtmf callMediaAsync.stopContinuousDtmfRecognition(receiver).block(); diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncUnitTests.java index d9c72cf8e7cd..2b8bce08943d 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncUnitTests.java @@ -11,18 +11,14 @@ 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.HoldOptions; +import com.azure.communication.callautomation.models.SendDtmfTonesOptions; +import com.azure.communication.callautomation.models.VoiceKind; import com.azure.communication.callautomation.models.PlayOptions; import com.azure.communication.callautomation.models.PlayToAllOptions; import com.azure.communication.callautomation.models.RecognitionChoice; import com.azure.communication.callautomation.models.RecognizeInputType; -import com.azure.communication.callautomation.models.SendDtmfTonesOptions; import com.azure.communication.callautomation.models.SsmlSource; -import com.azure.communication.callautomation.models.StartHoldMusicOptions; -import com.azure.communication.callautomation.models.StartTranscriptionOptions; -import com.azure.communication.callautomation.models.StopTranscriptionOptions; import com.azure.communication.callautomation.models.TextSource; -import com.azure.communication.callautomation.models.VoiceKind; import com.azure.communication.common.CommunicationUserIdentifier; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -37,6 +33,9 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import static com.azure.communication.callautomation.CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT; +import static com.azure.communication.callautomation.CallAutomationUnitTestBase.OPERATION_CALLBACK_URL; +import static com.azure.communication.callautomation.CallAutomationUnitTestBase.serializeObject; import static org.junit.jupiter.api.Assertions.assertEquals; public class CallMediaAsyncUnitTests { @@ -53,11 +52,11 @@ public void setup() { callMedia = getMockCallMedia(202); playFileSource = new FileSource(); - playFileSource.setPlaySourceCacheId("playFileSourceId"); + playFileSource.setPlaySourceCacheId("playFileSourceCacheId"); playFileSource.setUrl("filePath"); playTextSource = new TextSource(); - playTextSource.setPlaySourceCacheId("playTextSourceId"); + playTextSource.setPlaySourceCacheId("playTextSourceCacheId"); playTextSource.setVoiceKind(VoiceKind.MALE); playTextSource.setSourceLocale("en-US"); playTextSource.setVoiceName("LULU"); @@ -72,7 +71,7 @@ public void setup() { public void playFileWithResponseTest() { playOptions = new PlayOptions(playFileSource, Collections.singletonList(new CommunicationUserIdentifier("id"))) .setLoop(false) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); StepVerifier.create( callMedia.playWithResponse(playOptions)) @@ -84,19 +83,7 @@ public void playFileWithResponseTest() { public void playFileToAllWithResponseTest() { playToAllOptions = new PlayToAllOptions(playFileSource) .setLoop(false) - .setOperationContext("operationContext"); - StepVerifier.create( - callMedia.playToAllWithResponse(playToAllOptions)) - .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) - .verifyComplete(); - } - - @Test - public void playFileToAllWithBargeInWithResponseTest() { - playToAllOptions = new PlayToAllOptions(playFileSource) - .setLoop(false) - .setInterruptCallMediaOperation(true) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); StepVerifier.create( callMedia.playToAllWithResponse(playToAllOptions)) .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) @@ -107,7 +94,7 @@ public void playFileToAllWithBargeInWithResponseTest() { public void playTextWithResponseTest() { playOptions = new PlayOptions(playTextSource, Collections.singletonList(new CommunicationUserIdentifier("id"))) .setLoop(false) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); StepVerifier.create( callMedia.playWithResponse(playOptions)) .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) @@ -118,19 +105,7 @@ public void playTextWithResponseTest() { public void playTextToAllWithResponseTest() { playToAllOptions = new PlayToAllOptions(playTextSource) .setLoop(false) - .setOperationContext("operationContext"); - StepVerifier.create( - callMedia.playToAllWithResponse(playToAllOptions)) - .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) - .verifyComplete(); - } - - @Test - public void playTextToAllWithBargeInWithResponseTest() { - playToAllOptions = new PlayToAllOptions(playTextSource) - .setLoop(false) - .setInterruptCallMediaOperation(true) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); StepVerifier.create( callMedia.playToAllWithResponse(playToAllOptions)) .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) @@ -141,30 +116,18 @@ public void playTextToAllWithBargeInWithResponseTest() { public void playSsmlWithResponseTest() { playOptions = new PlayOptions(playSsmlSource, Collections.singletonList(new CommunicationUserIdentifier("id"))) .setLoop(false) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); StepVerifier.create( callMedia.playWithResponse(playOptions)) .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) .verifyComplete(); } - - @Test - public void playSsmlToAllWithResponseTest() { - playToAllOptions = new PlayToAllOptions(playSsmlSource) - .setLoop(false) - .setOperationContext("operationContext"); - StepVerifier.create( - callMedia.playToAllWithResponse(playToAllOptions)) - .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) - .verifyComplete(); - } @Test - public void playSsmlToAllWithBargeInWithResponseTest() { + public void playSsmlToAllWithResponseTest() { playToAllOptions = new PlayToAllOptions(playSsmlSource) .setLoop(false) - .setInterruptCallMediaOperation(true) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); StepVerifier.create( callMedia.playToAllWithResponse(playToAllOptions)) .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) @@ -202,7 +165,7 @@ public void recognizeWithResponseWithFileSourceDtmfOptions() { recognizeOptions.setPlayPrompt(new FileSource().setUrl("abc")); recognizeOptions.setInterruptCallMediaOperation(true); recognizeOptions.setStopCurrentOperations(true); - recognizeOptions.setOperationContext("operationContext"); + recognizeOptions.setOperationContext(CALL_OPERATION_CONTEXT); recognizeOptions.setInterruptPrompt(true); recognizeOptions.setInitialSilenceTimeout(Duration.ofSeconds(4)); @@ -217,9 +180,8 @@ public void startContinuousDtmfRecognitionWithResponse() { // override callMedia to mock 200 response code callMedia = getMockCallMedia(200); ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions(new CommunicationUserIdentifier("id")); - StepVerifier.create( - callMedia.startContinuousDtmfRecognitionWithResponse( - options)) + options.setOperationContext(CALL_OPERATION_CONTEXT); + StepVerifier.create(callMedia.startContinuousDtmfRecognitionWithResponse(options)) .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) .verifyComplete(); } @@ -229,25 +191,25 @@ public void stopContinuousDtmfRecognitionWithResponse() { // override callMedia to mock 200 response code callMedia = getMockCallMedia(200); ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions(new CommunicationUserIdentifier("id")); - StepVerifier.create( - callMedia.stopContinuousDtmfRecognitionWithResponse( - options)) + options.setOperationContext(CALL_OPERATION_CONTEXT); + options.setOperationCallbackUrl(OPERATION_CALLBACK_URL); + StepVerifier.create(callMedia.stopContinuousDtmfRecognitionWithResponse(options)) .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) .verifyComplete(); } @Test - public void sendDtmfWithResponse() { + public void sendDtmfTonesWithResponse() { CallConnectionAsync callConnection = CallAutomationUnitTestBase.getCallConnectionAsync(new ArrayList<>( Collections.singletonList(new AbstractMap.SimpleEntry<>( - CallAutomationUnitTestBase.serializeObject(new SendDtmfTonesResultInternal().setOperationContext("operationContext")), 202))) + serializeObject(new SendDtmfTonesResultInternal().setOperationContext(CALL_OPERATION_CONTEXT)), 202))) ); callMedia = callConnection.getCallMediaAsync(); List tones = Stream.of(DtmfTone.ONE, DtmfTone.TWO, DtmfTone.THREE).collect(Collectors.toList()); SendDtmfTonesOptions options = new SendDtmfTonesOptions(tones, new CommunicationUserIdentifier("id")); - options.setOperationContext("operationContext"); - options.setOperationCallbackUrl(CallAutomationUnitTestBase.CALL_CALLBACK_URL); + options.setOperationContext(CALL_OPERATION_CONTEXT); + options.setOperationCallbackUrl(OPERATION_CALLBACK_URL); StepVerifier.create(callMedia.sendDtmfTonesWithResponse(options)) .consumeNextWith(response -> assertEquals(202, response.getStatusCode())).verifyComplete(); } @@ -266,7 +228,7 @@ public void recognizeWithResponseWithTextSourceDtmfOptions() { recognizeOptions.setPlayPrompt(new TextSource().setText("Test dmtf option with text source.")); recognizeOptions.setInterruptCallMediaOperation(true); recognizeOptions.setStopCurrentOperations(true); - recognizeOptions.setOperationContext("operationContext"); + recognizeOptions.setOperationContext(CALL_OPERATION_CONTEXT); recognizeOptions.setInterruptPrompt(true); recognizeOptions.setInitialSilenceTimeout(Duration.ofSeconds(4)); @@ -281,24 +243,25 @@ public void recognizeWithResponseWithTextSourceDtmfOptions() { @Test public void recognizeWithResponseWithFileSourceChoiceOptions() { - RecognitionChoice recognizeChoice1 = new RecognitionChoice(); - RecognitionChoice recognizeChoice2 = new RecognitionChoice(); - recognizeChoice1.setTone(DtmfTone.ZERO); - recognizeChoice2.setTone(DtmfTone.SIX); - List recognizeChoices = new ArrayList<>( - Arrays.asList(recognizeChoice1, recognizeChoice2) + RecognitionChoice recognitionChoice1 = new RecognitionChoice(); + RecognitionChoice recognitionChoice2 = new RecognitionChoice(); + recognitionChoice1.setTone(DtmfTone.ZERO); + recognitionChoice2.setTone(DtmfTone.SIX); + recognitionChoice2.setLabel("label"); + recognitionChoice2.setPhrases(Collections.singletonList("phrase")); + List recognitionChoices = new ArrayList<>( + Arrays.asList(recognitionChoice1, recognitionChoice2) ); - CallMediaRecognizeChoiceOptions recognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognizeChoices); + CallMediaRecognizeChoiceOptions recognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognitionChoices); recognizeOptions.setRecognizeInputType(RecognizeInputType.CHOICES); recognizeOptions.setPlayPrompt(new FileSource().setUrl("abc")); recognizeOptions.setInterruptCallMediaOperation(true); recognizeOptions.setStopCurrentOperations(true); - recognizeOptions.setOperationContext("operationContext"); + recognizeOptions.setOperationContext(CALL_OPERATION_CONTEXT); recognizeOptions.setInterruptPrompt(true); recognizeOptions.setInitialSilenceTimeout(Duration.ofSeconds(4)); recognizeOptions.setSpeechLanguage("en-US"); - recognizeOptions.setSpeechModelEndpointId("customModelEndpointId"); StepVerifier.create( callMedia.startRecognizingWithResponse(recognizeOptions)) @@ -309,20 +272,22 @@ public void recognizeWithResponseWithFileSourceChoiceOptions() { @Test public void recognizeWithResponseTextChoiceOptions() { - RecognitionChoice recognizeChoice1 = new RecognitionChoice(); - RecognitionChoice recognizeChoice2 = new RecognitionChoice(); - recognizeChoice1.setTone(DtmfTone.ZERO); - recognizeChoice2.setTone(DtmfTone.THREE); - List recognizeChoices = new ArrayList<>( - Arrays.asList(recognizeChoice1, recognizeChoice2) + RecognitionChoice recognitionChoice1 = new RecognitionChoice(); + RecognitionChoice recognitionChoice2 = new RecognitionChoice(); + recognitionChoice1.setTone(DtmfTone.ZERO); + recognitionChoice2.setTone(DtmfTone.THREE); + recognitionChoice2.setLabel("label"); + recognitionChoice2.setPhrases(Collections.singletonList("phrase")); + List recognitionChoices = new ArrayList<>( + Arrays.asList(recognitionChoice1, recognitionChoice2) ); - CallMediaRecognizeChoiceOptions recognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognizeChoices); + CallMediaRecognizeChoiceOptions recognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognitionChoices); recognizeOptions.setRecognizeInputType(RecognizeInputType.CHOICES); recognizeOptions.setPlayPrompt(new TextSource().setText("Test recognize choice with text source.")); recognizeOptions.setInterruptCallMediaOperation(true); recognizeOptions.setStopCurrentOperations(true); - recognizeOptions.setOperationContext("operationContext"); + recognizeOptions.setOperationContext(CALL_OPERATION_CONTEXT); recognizeOptions.setInterruptPrompt(true); recognizeOptions.setInitialSilenceTimeout(Duration.ofSeconds(4)); recognizeOptions.setSpeechLanguage("en-US"); @@ -342,10 +307,9 @@ public void recognizeWithResponseTextSpeechOptions() { recognizeOptions.setPlayPrompt(new TextSource().setText("Test recognize speech or dtmf with text source.")); recognizeOptions.setInterruptCallMediaOperation(true); recognizeOptions.setStopCurrentOperations(true); - recognizeOptions.setOperationContext("operationContext"); + recognizeOptions.setOperationContext(CALL_OPERATION_CONTEXT); recognizeOptions.setInterruptPrompt(true); recognizeOptions.setInitialSilenceTimeout(Duration.ofSeconds(4)); - recognizeOptions.setSpeechModelEndpointId("customModelEndpointId"); StepVerifier.create( callMedia.startRecognizingWithResponse(recognizeOptions)) @@ -362,10 +326,9 @@ public void recognizeWithResponseTextSpeechOrDtmfOptions() { recognizeOptions.setPlayPrompt(new SsmlSource().setSsmlText("No input recieved and recognition timed out, Disconnecting the call. Played through SSML. Thank you!")); recognizeOptions.setInterruptCallMediaOperation(true); recognizeOptions.setStopCurrentOperations(true); - recognizeOptions.setOperationContext("operationContext"); + recognizeOptions.setOperationContext(CALL_OPERATION_CONTEXT); recognizeOptions.setInterruptPrompt(true); recognizeOptions.setInitialSilenceTimeout(Duration.ofSeconds(4)); - recognizeOptions.setSpeechModelEndpointId("customModelEndpointId"); StepVerifier.create( callMedia.startRecognizingWithResponse(recognizeOptions)) @@ -373,71 +336,6 @@ public void recognizeWithResponseTextSpeechOrDtmfOptions() { .verifyComplete(); } - @Test - public void startHoldMusicWithResponseTest() { - - callMedia = getMockCallMedia(200); - StartHoldMusicOptions options = new StartHoldMusicOptions( - new CommunicationUserIdentifier("id"), - new TextSource().setText("audio to play")); - StepVerifier.create( - callMedia.startHoldMusicWithResponse(options)) - .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) - .verifyComplete(); - } - - @Test - public void stopHoldMusicWithResponseTest() { - - callMedia = getMockCallMedia(200); - StepVerifier.create( - callMedia.stopHoldMusicWithResponse( - new CommunicationUserIdentifier("id"), - "operationalContext" - )) - .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) - .verifyComplete(); - } - - @Test - public void holdWithResponseTest() { - - callMedia = getMockCallMedia(200); - HoldOptions options = new HoldOptions( - new CommunicationUserIdentifier("id")) - .setPlaySourceInfo(new TextSource().setText("audio to play")); - StepVerifier.create( - callMedia.holdWithResponse(options)) - .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) - .verifyComplete(); - } - - @Test - public void holdWithResponseNoPromptTest() { - - callMedia = getMockCallMedia(200); - HoldOptions options = new HoldOptions( - new CommunicationUserIdentifier("id")) - .setPlaySourceInfo(new TextSource().setText("audio to play")); - StepVerifier.create( - callMedia.holdWithResponse(options)) - .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) - .verifyComplete(); - } - - @Test - public void unholdWithResponseTest() { - - callMedia = getMockCallMedia(200); - StepVerifier.create( - callMedia.unholdWithResponse( - new CommunicationUserIdentifier("id"), - "operationalContext" - )) - .consumeNextWith(response -> assertEquals(200, response.getStatusCode())) - .verifyComplete(); - } - private CallMediaAsync getMockCallMedia(int expectedStatusCode) { CallConnectionAsync callConnection = CallAutomationUnitTestBase.getCallConnectionAsync(new ArrayList<>( @@ -445,35 +343,4 @@ private CallMediaAsync getMockCallMedia(int expectedStatusCode) { ); return callConnection.getCallMediaAsync(); } - - @Test - public void startTranscriptionWithResponse() { - callMedia = getMockCallMedia(202); - StartTranscriptionOptions options = new StartTranscriptionOptions(); - options.setOperationContext("operationContext"); - options.setLocale("en-US"); - StepVerifier.create( - callMedia.startTranscriptionWithResponseAsync(options)) - .consumeNextWith(response -> assertEquals(202, response.getStatusCode()) - ) - .verifyComplete(); - } - @Test - public void stopTranscriptionWithResponse() { - callMedia = getMockCallMedia(202); - StopTranscriptionOptions options = new StopTranscriptionOptions(); - options.setOperationContext("operationContext"); - StepVerifier.create( - callMedia.stopTranscriptionWithResponseAsync(options) - ) - .consumeNextWith(response -> assertEquals(202, response.getStatusCode())) - .verifyComplete(); - } - @Test - public void updateTranscriptionWithResponse() { - callMedia = getMockCallMedia(202); - StepVerifier.create( - callMedia.updateTranscription("en-US") - ).verifyComplete(); - } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaUnitTests.java index 21697f5e0e11..75a1c2375833 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaUnitTests.java @@ -4,7 +4,18 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.implementation.models.SendDtmfTonesResultInternal; -import com.azure.communication.callautomation.models.*; +import com.azure.communication.callautomation.models.CallMediaRecognizeChoiceOptions; +import com.azure.communication.callautomation.models.CallMediaRecognizeDtmfOptions; +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.SendDtmfTonesOptions; +import com.azure.communication.callautomation.models.VoiceKind; +import com.azure.communication.callautomation.models.PlayOptions; +import com.azure.communication.callautomation.models.PlayToAllOptions; +import com.azure.communication.callautomation.models.RecognitionChoice; +import com.azure.communication.callautomation.models.TextSource; +import com.azure.communication.callautomation.models.SendDtmfTonesResult; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -19,6 +30,9 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import static com.azure.communication.callautomation.CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT; +import static com.azure.communication.callautomation.CallAutomationUnitTestBase.OPERATION_CALLBACK_URL; +import static com.azure.communication.callautomation.CallAutomationUnitTestBase.serializeObject; import static org.junit.jupiter.api.Assertions.assertEquals; public class CallMediaUnitTests { @@ -38,22 +52,21 @@ public void setup() { callMedia = callConnection.getCallMedia(); playFileSource = new FileSource(); - playFileSource.setPlaySourceCacheId("playTextSourceId"); + playFileSource.setPlaySourceCacheId("playTextSourceCacheId"); playFileSource.setUrl("filePath"); playTextSource = new TextSource(); - playTextSource.setPlaySourceCacheId("playTextSourceId"); + playTextSource.setPlaySourceCacheId("playTextSourceCacheId"); playTextSource.setVoiceKind(VoiceKind.MALE); playTextSource.setSourceLocale("en-US"); playTextSource.setVoiceName("LULU"); - playTextSource.setCustomVoiceEndpointId("customVoiceEndpointId"); } @Test public void playFileWithResponseTest() { playOptions = new PlayOptions(playFileSource, Collections.singletonList(new CommunicationUserIdentifier("id"))) .setLoop(false) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); Response response = callMedia.playWithResponse(playOptions, Context.NONE); assertEquals(response.getStatusCode(), 202); } @@ -62,17 +75,7 @@ public void playFileWithResponseTest() { public void playFileToAllWithResponseTest() { playToAllOptions = new PlayToAllOptions(playFileSource) .setLoop(false) - .setOperationContext("operationContext"); - Response response = callMedia.playToAllWithResponse(playToAllOptions, Context.NONE); - assertEquals(response.getStatusCode(), 202); - } - - @Test - public void playFileToAllWithBargeInWithResponseTest() { - playToAllOptions = new PlayToAllOptions(playFileSource) - .setLoop(false) - .setInterruptCallMediaOperation(true) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); Response response = callMedia.playToAllWithResponse(playToAllOptions, Context.NONE); assertEquals(response.getStatusCode(), 202); } @@ -81,7 +84,7 @@ public void playFileToAllWithBargeInWithResponseTest() { public void playTextWithResponseTest() { playOptions = new PlayOptions(playTextSource, Collections.singletonList(new CommunicationUserIdentifier("id"))) .setLoop(false) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); Response response = callMedia.playWithResponse(playOptions, Context.NONE); assertEquals(response.getStatusCode(), 202); } @@ -90,21 +93,11 @@ public void playTextWithResponseTest() { public void playTextToAllWithResponseTest() { playToAllOptions = new PlayToAllOptions(playTextSource) .setLoop(false) - .setOperationContext("operationContext"); + .setOperationContext(CALL_OPERATION_CONTEXT); Response response = callMedia.playToAllWithResponse(playToAllOptions, Context.NONE); assertEquals(response.getStatusCode(), 202); } - @Test - public void playTextToAllWithBargeInWithResponseTest() { - playToAllOptions = new PlayToAllOptions(playTextSource) - .setLoop(false) - .setInterruptCallMediaOperation(true) - .setOperationContext("operationContext"); - Response response = callMedia.playToAllWithResponse(playToAllOptions, Context.NONE); - assertEquals(response.getStatusCode(), 202); - } - @Test public void cancelAllOperationsWithResponse() { Response response = callMedia.cancelAllMediaOperationsWithResponse(Context.NONE); @@ -120,16 +113,27 @@ public void recognizeWithDtmfResponseTest() { @Test public void recognizeWithChoiceResponseTest() { - RecognitionChoice recognizeChoice1 = new RecognitionChoice(); - RecognitionChoice recognizeChoice2 = new RecognitionChoice(); - List recognizeChoices = new ArrayList<>( - Arrays.asList(recognizeChoice1, recognizeChoice2) + RecognitionChoice recognitionChoice1 = new RecognitionChoice(); + RecognitionChoice recognitionChoice2 = new RecognitionChoice(); + List recognitionChoices = new ArrayList<>( + Arrays.asList(recognitionChoice1, recognitionChoice2) ); - CallMediaRecognizeChoiceOptions callMediaRecognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognizeChoices); + CallMediaRecognizeChoiceOptions callMediaRecognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("id"), recognitionChoices); Response response = callMedia.startRecognizingWithResponse(callMediaRecognizeOptions, Context.NONE); assertEquals(response.getStatusCode(), 202); } + @Test + public void startContinuousDtmfRecognitionTest() { + // override callMedia to mock 200 response code + CallConnection callConnection = + CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( + Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) + ); + //expect no exception + callConnection.getCallMedia().startContinuousDtmfRecognition(new CommunicationUserIdentifier("id")); + } + @Test public void startContinuousDtmfRecognitionWithResponseTest() { // override callMedia to mock 200 response code @@ -139,10 +143,23 @@ public void startContinuousDtmfRecognitionWithResponseTest() { ); callMedia = callConnection.getCallMedia(); ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions(new CommunicationUserIdentifier("id")); + options.setOperationContext(CALL_OPERATION_CONTEXT); Response response = callMedia.startContinuousDtmfRecognitionWithResponse(options, Context.NONE); assertEquals(response.getStatusCode(), 200); } + + @Test + public void stopContinuousDtmfRecognitionTest() { + // override callMedia to mock 200 response code + CallConnection callConnection = + CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( + Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) + ); + //expect no exception + callConnection.getCallMedia().stopContinuousDtmfRecognition(new CommunicationUserIdentifier("id")); + } + @Test public void stopContinuousDtmfRecognitionWithResponseTest() { // override callMedia to mock 200 response code @@ -152,8 +169,9 @@ public void stopContinuousDtmfRecognitionWithResponseTest() { ); callMedia = callConnection.getCallMedia(); ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions(new CommunicationUserIdentifier("id")); - Response response = callMedia.stopContinuousDtmfRecognitionWithResponse(options, Context.NONE - ); + options.setOperationContext(CALL_OPERATION_CONTEXT); + options.setOperationCallbackUrl(OPERATION_CALLBACK_URL); + Response response = callMedia.stopContinuousDtmfRecognitionWithResponse(options, Context.NONE); assertEquals(response.getStatusCode(), 200); } @@ -162,7 +180,7 @@ public void sendDtmfTonesTest() { CallConnection callConnection = CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( Collections.singletonList(new AbstractMap.SimpleEntry<>( - CallAutomationUnitTestBase.serializeObject(new SendDtmfTonesResultInternal().setOperationContext(CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT)), 202))) + serializeObject(new SendDtmfTonesResultInternal().setOperationContext(CALL_OPERATION_CONTEXT)), 202))) ); //expect no exception callConnection.getCallMedia().sendDtmfTones( @@ -176,103 +194,15 @@ public void sendDtmfTonesWithResponseTest() { CallConnection callConnection = CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( Collections.singletonList(new AbstractMap.SimpleEntry<>( - CallAutomationUnitTestBase.serializeObject(new SendDtmfTonesResultInternal().setOperationContext(CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT)), 202))) + serializeObject(new SendDtmfTonesResultInternal().setOperationContext(CALL_OPERATION_CONTEXT)), 202))) ); callMedia = callConnection.getCallMedia(); List tones = Stream.of(DtmfTone.ONE, DtmfTone.TWO, DtmfTone.THREE).collect(Collectors.toList()); SendDtmfTonesOptions options = new SendDtmfTonesOptions(tones, new CommunicationUserIdentifier("id")); options.setOperationContext("ctx"); - options.setOperationCallbackUrl(CallAutomationUnitTestBase.CALL_OPERATION_CONTEXT); + options.setOperationCallbackUrl(OPERATION_CALLBACK_URL); Response response = callMedia.sendDtmfTonesWithResponse(options, Context.NONE); assertEquals(response.getStatusCode(), 202); } - @Test - public void startHoldMusicWithResponseTest() { - CallConnection callConnection = - CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) - ); - callMedia = callConnection.getCallMedia(); - StartHoldMusicOptions options = new StartHoldMusicOptions( - new CommunicationUserIdentifier("id"), - new TextSource().setText("audio to play")); - Response response = callMedia.startHoldMusicWithResponse(options, null); - assertEquals(response.getStatusCode(), 200); - } - - @Test - public void stopHoldMusicWithResponseTest() { - CallConnection callConnection = - CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) - ); - callMedia = callConnection.getCallMedia(); - - Response response = callMedia.stopHoldMusicWithResponse(new CommunicationUserIdentifier("id"), - "operationalContext", Context.NONE); - assertEquals(response.getStatusCode(), 200); - } - - @Test - public void holdWithResponseTest() { - CallConnection callConnection = - CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) - ); - callMedia = callConnection.getCallMedia(); - HoldOptions options = new HoldOptions(new CommunicationUserIdentifier("id")) - .setPlaySourceInfo(new TextSource().setText("audio to play")); - Response response = callMedia.holdWithResponse(options, null); - assertEquals(response.getStatusCode(), 200); - } - - @Test - public void holdWithResponseNoPromptTest() { - CallConnection callConnection = - CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) - ); - callMedia = callConnection.getCallMedia(); - HoldOptions options = new HoldOptions( - new CommunicationUserIdentifier("id")); - Response response = callMedia.holdWithResponse(options, null); - assertEquals(response.getStatusCode(), 200); - } - - @Test - public void unholdWithResponseTest() { - CallConnection callConnection = - CallAutomationUnitTestBase.getCallConnection(new ArrayList<>( - Collections.singletonList(new AbstractMap.SimpleEntry<>("", 200))) - ); - callMedia = callConnection.getCallMedia(); - - Response response = callMedia.unholdWithResponse(new CommunicationUserIdentifier("id"), - "operationalContext", Context.NONE); - assertEquals(response.getStatusCode(), 200); - } - - @Test - public void startTranscriptionWithResponse() { - StartTranscriptionOptions options = new StartTranscriptionOptions(); - options.setOperationContext("operationContext"); - options.setLocale("en-US"); - Response response = callMedia.startTranscriptionWithResponse(options, Context.NONE); - assertEquals(response.getStatusCode(), 202); - } - - @Test - public void stopTranscriptionWithResponse() { - StopTranscriptionOptions options = new StopTranscriptionOptions(); - options.setOperationContext("operationContext"); - Response response = callMedia.stopTranscriptionWithResponse(options, Context.NONE); - assertEquals(response.getStatusCode(), 202); - } - - @Test - public void updateTranscriptionWithResponse() { - Response response = callMedia.updateTranscriptionWithResponse("en-US", Context.NONE); - assertEquals(response.getStatusCode(), 202); - } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java index 98e6ee049631..93897c8ab8b0 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java @@ -7,8 +7,8 @@ import com.azure.communication.callautomation.models.AnswerCallResult; import com.azure.communication.callautomation.models.CallConnectionProperties; import com.azure.communication.callautomation.models.CallConnectionState; -import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.CreateCallResult; +import com.azure.communication.callautomation.models.CreateGroupCallOptions; import com.azure.communication.callautomation.models.RecordingChannel; import com.azure.communication.callautomation.models.RecordingContent; import com.azure.communication.callautomation.models.RecordingFormat; @@ -21,7 +21,7 @@ import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.identity.CommunicationIdentityClient; import com.azure.core.http.HttpClient; - +import com.azure.core.test.annotation.DoNotRecord; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.fail; public class CallRecordingAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { - + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void createACSCallAndUnmixedAudioTest(HttpClient httpClient) { @@ -118,6 +118,7 @@ public void createACSCallAndUnmixedAudioTest(HttpClient httpClient) { } } + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void createACSCallUnmixedAudioAffinityTest(HttpClient httpClient) { diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/ModelGenerator.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/ModelGenerator.java index 2fc7f4c4514c..b037d1467a88 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/ModelGenerator.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/ModelGenerator.java @@ -18,10 +18,9 @@ static CommunicationIdentifierModel generateUserIdentifierModel(String userId) { .setId(userId)); } - static CallParticipantInternal generateAcsCallParticipantInternal(String callerId, boolean isMuted, boolean isHold) { + static CallParticipantInternal generateAcsCallParticipantInternal(String callerId, boolean isMuted) { return new CallParticipantInternal() .setIdentifier(ModelGenerator.generateUserIdentifierModel(callerId)) - .setIsMuted(isMuted) - .setIsOnHold(isHold); + .setIsMuted(isMuted); } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/StreamingDataParserUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/StreamingDataParserUnitTests.java deleted file mode 100644 index 7ce463704ee1..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/StreamingDataParserUnitTests.java +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callautomation; - -import com.azure.communication.callautomation.models.streaming.StreamingDataParser; -import com.azure.communication.callautomation.models.streaming.media.AudioData; -import com.azure.communication.callautomation.models.streaming.media.AudioMetadata; -import com.azure.communication.callautomation.models.streaming.transcription.*; -import com.azure.core.util.BinaryData; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.jupiter.api.Test; - -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.*; - -public class StreamingDataParserUnitTests { - //region Audio - @Test - public void parseAudioData() { - String audioJson = "{" - + "\"kind\": \"AudioData\"," - + "\"audioData\": {" - + "\"timestamp\": \"2022-10-03T19:16:12.925Z\"," - + "\"participantRawID\": \"participantId\"," - + "\"data\": \"AQIDBAU=\"," - + "\"silent\": false" - + "}" - + "}"; - AudioData audioData = (AudioData) StreamingDataParser.parse(audioJson); - assertNotNull(audioData); - checkAudioData(audioData); - } - - @Test - public void parseAudioDataNoParticipantNoSilent() { - String audioJson = "{" - + "\"kind\": \"AudioData\"," - + "\"audioData\": {" - + "\"timestamp\": \"2022-10-03T19:16:12.925Z\"," - + "\"data\": \"AQIDBAU=\"" - + "}" - + "}"; - AudioData audioData = (AudioData) StreamingDataParser.parse(audioJson); - assertNotNull(audioData); - checkAudioDataNoParticipant(audioData); - } - - @Test - public void parseAudioMetadata() { - String metadataJson = "{" - + " \"kind\": \"AudioMetadata\"," - + "\"audioMetadata\": {" - + "\"subscriptionId\": \"subscriptionId\"," - + "\"encoding\": \"PCM\"," - + "\"sampleRate\": 8," - + "\"channels\": 2," - + "\"length\": 100" - + "}" - + "}"; - AudioMetadata audioMetadata = (AudioMetadata) StreamingDataParser.parse(metadataJson); - assertNotNull(audioMetadata); - checkAudioMetadata(audioMetadata); - } - - @Test - public void parseBinaryAudioData() { - String jsonData = createAudioDataJson(); - AudioData audioData = (AudioData) StreamingDataParser.parse(BinaryData.fromString(jsonData)); - checkAudioData(audioData); - } - - @Test - public void parseBinaryAudioMetadata() { - String jsonMetadata = createAudioMetadataJson(); - AudioMetadata audioMetadata = (AudioMetadata) StreamingDataParser.parse(BinaryData.fromString(jsonMetadata)); - checkAudioMetadata(audioMetadata); - } - - @Test - public void parseBinaryArrayAudioData() { - String jsonData = createAudioDataJson(); - AudioData audioData = (AudioData) StreamingDataParser.parse(jsonData.getBytes(StandardCharsets.UTF_8)); - checkAudioData(audioData); - } - - @Test - public void parseBinaryArrayAudioMetadata() { - String jsonMetadata = createAudioMetadataJson(); - AudioMetadata audioMetadata = (AudioMetadata) StreamingDataParser.parse(jsonMetadata.getBytes(StandardCharsets.UTF_8)); - checkAudioMetadata(audioMetadata); - } - - private void checkAudioData(AudioData mediaStreamingAudio) { - assertEquals(OffsetDateTime.parse("2022-10-03T19:16:12.925Z"), mediaStreamingAudio.getTimestamp()); - assertEquals("participantId", mediaStreamingAudio.getParticipant().getRawId()); - assertEquals("AQIDBAU=", mediaStreamingAudio.getData()); - assertFalse(mediaStreamingAudio.isSilent()); - } - - private void checkAudioDataNoParticipant(AudioData mediaStreamingAudio) { - assertEquals(OffsetDateTime.parse("2022-10-03T19:16:12.925Z"), mediaStreamingAudio.getTimestamp()); - assertNull(mediaStreamingAudio.getParticipant()); - assertEquals("AQIDBAU=", mediaStreamingAudio.getData()); - assertFalse(mediaStreamingAudio.isSilent()); - } - - private void checkAudioMetadata(AudioMetadata audioMetadata) { - assertEquals("subscriptionId", audioMetadata.getMediaSubscriptionId()); - assertEquals("PCM", audioMetadata.getEncoding()); - assertEquals(8, audioMetadata.getSampleRate()); - assertEquals(2, audioMetadata.getChannels()); - assertEquals(100, audioMetadata.getLength()); - } - - private String createAudioMetadataJson() { - try { - ObjectMapper objectMapper = new ObjectMapper(); - ObjectNode audioMetadata = objectMapper.createObjectNode(); - audioMetadata.put("kind", "AudioMetadata"); - audioMetadata.put("subscriptionId", "subscriptionId"); - audioMetadata.put("encoding", "PCM"); - audioMetadata.put("sampleRate", 8); - audioMetadata.put("channels", 2); - audioMetadata.put("length", 100); - ObjectNode root = objectMapper.createObjectNode(); - root.put("kind", "AudioMetadata"); - root.set("audioMetadata", audioMetadata); - return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(root); - } catch (Exception e) { - throw new RuntimeException(); - } - } - - private String createAudioDataJson() { - try { - ObjectMapper objectMapper = new ObjectMapper(); - ObjectNode audioData = objectMapper.createObjectNode(); - audioData.put("kind", "AudioData"); - audioData.put("timestamp", "2022-10-03T19:16:12.925Z"); - audioData.put("participantRawID", "participantId"); - audioData.put("data", "AQIDBAU="); - audioData.put("silent", false); - ObjectNode root = objectMapper.createObjectNode(); - root.put("kind", "AudioData"); - root.set("audioData", audioData); - return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(root); - } catch (Exception e) { - throw new RuntimeException(); - } - } - //endregion - - // region Transcription - @Test - public void parseTranscriptionData() { - String transcriptionJson = - "{" - + "\"kind\":\"TranscriptionData\"," - + "\"transcriptionData\":" - + "{" - + "\"text\":\"Hello World!\"," - + "\"format\":\"display\"," - + "\"confidence\":0.98," - + "\"offset\":1," - + "\"duration\":2," - + "\"words\":" - + "[" - + "{" - + "\"text\":\"Hello\"," - + "\"offset\":1," - + "\"duration\":1" - + "}," - + "{" - + "\"text\":\"World\"," - + "\"offset\":6," - + "\"duration\":1" - + "}" - + "]," - + "\"participantRawID\":\"abc12345\"," - + "\"resultStatus\":\"final\"" - + "}" - + "}"; - TranscriptionData transcriptionData = (TranscriptionData) StreamingDataParser.parse(transcriptionJson); - assertNotNull(transcriptionData); - validateTranscriptionData(transcriptionData); - } - - @Test - public void parseTranscriptionMetadata() { - String transcriptionMetadataJson = - "{" - + "\"kind\":\"TranscriptionMetadata\"," - + "\"transcriptionMetadata\":" - + "{" - + "\"subscriptionId\":\"subscriptionId\"," - + "\"locale\":\"en-US\"," - + "\"callConnectionId\":\"callConnectionId\"," - + "\"correlationId\":\"correlationId\"" - + "}" - + "}"; - TranscriptionMetadata transcriptionMetadata = (TranscriptionMetadata) StreamingDataParser.parse(transcriptionMetadataJson); - assertNotNull(transcriptionMetadata); - validateTranscriptionMetadata(transcriptionMetadata); - } - - @Test - public void parseBinaryTranscriptionData() { - String jsonData = createTranscriptionDataJson(); - TranscriptionData transcriptionData = (TranscriptionData) StreamingDataParser.parse(BinaryData.fromString(jsonData)); - validateTranscriptionData(transcriptionData); - } - - @Test - public void parseBinaryTranscriptionMetadata() { - String jsonMetadata = createTranscriptionMetadataJson(); - TranscriptionMetadata transcriptionMetadata = (TranscriptionMetadata) StreamingDataParser.parse(BinaryData.fromString(jsonMetadata)); - validateTranscriptionMetadata(transcriptionMetadata); - } - - @Test - public void parseBinaryArrayTranscriptionData() { - String jsonData = createTranscriptionDataJson(); - TranscriptionData transcriptionData = (TranscriptionData) StreamingDataParser.parse(jsonData.getBytes(StandardCharsets.UTF_8)); - validateTranscriptionData(transcriptionData); - } - - @Test - public void parseBinaryArrayTranscriptionMetadata() { - String jsonMetadata = createTranscriptionMetadataJson(); - TranscriptionMetadata transcriptionMetadata = (TranscriptionMetadata) StreamingDataParser.parse(jsonMetadata.getBytes(StandardCharsets.UTF_8)); - validateTranscriptionMetadata(transcriptionMetadata); - } - - private void validateTranscriptionData(TranscriptionData transcription) { - assertNotNull(transcription); - assertEquals("Hello World!", transcription.getText()); - assertEquals(TextFormat.DISPLAY, transcription.getFormat()); - assertEquals(0.98d, transcription.getConfidence()); - assertEquals(1, transcription.getOffset()); - assertEquals(2, transcription.getDuration()); - - // validate individual words - List words = transcription.getWords(); - assertEquals(2, words.size()); - assertEquals("Hello", words.get(0).getText()); - assertEquals(1, words.get(0).getOffset()); - assertEquals(1, words.get(0).getDuration()); - assertEquals("World", words.get(1).getText()); - assertEquals(6, words.get(1).getOffset()); - assertEquals(1, words.get(0).getDuration()); - - assertNotNull(transcription.getParticipant()); - assertEquals("abc12345", transcription.getParticipant().getRawId()); - assertEquals(ResultStatus.FINAL, transcription.getResultStatus()); - } - - private static void validateTranscriptionMetadata(TranscriptionMetadata transcriptionMetadata) { - assertNotNull(transcriptionMetadata); - assertEquals("subscriptionId", transcriptionMetadata.getTranscriptionSubscriptionId()); - assertEquals("en-US", transcriptionMetadata.getLocale()); - assertEquals("callConnectionId", transcriptionMetadata.getCallConnectionId()); - assertEquals("correlationId", transcriptionMetadata.getCorrelationId()); - } - - - private String createTranscriptionMetadataJson() { - try { - ObjectMapper objectMapper = new ObjectMapper(); - ObjectNode jsonData = objectMapper.createObjectNode(); - jsonData.put("kind", "TranscriptionMetadata"); - ObjectNode transcriptionMetaData = objectMapper.createObjectNode(); - jsonData.set("transcriptionMetadata", transcriptionMetaData); - transcriptionMetaData.put("subscriptionId", "subscriptionId"); - transcriptionMetaData.put("locale", "en-US"); - transcriptionMetaData.put("callConnectionId", "callConnectionId"); - transcriptionMetaData.put("correlationId", "correlationId"); - return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonData); - } catch (Exception e) { - throw new RuntimeException(); - } - } - - private String createTranscriptionDataJson() { - try { - ObjectMapper objectMapper = new ObjectMapper(); - ObjectNode jsonData = objectMapper.createObjectNode(); - jsonData.put("kind", "TranscriptionData"); - ObjectNode transcriptionData = objectMapper.createObjectNode(); - jsonData.set("transcriptionData", transcriptionData); - transcriptionData.put("text", "Hello World!"); - transcriptionData.put("format", "Display"); - transcriptionData.put("confidence", 0.98d); - transcriptionData.put("offset", 1); - transcriptionData.put("duration", 2); - - ArrayNode words = objectMapper.createArrayNode(); - transcriptionData.set("words", words); - - ObjectNode word0 = objectMapper.createObjectNode(); - word0.put("text", "Hello"); - word0.put("offset", 1); - word0.put("duration", 1); - words.add(word0); - - ObjectNode word1 = objectMapper.createObjectNode(); - word1.put("text", "World"); - word1.put("offset", 6); - word1.put("duration", 1); - words.add(word1); - - transcriptionData.put("participantRawID", "abc12345"); - transcriptionData.put("resultStatus", "final"); - - return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonData); - } catch (Exception e) { - throw new RuntimeException(); - } - } - //endregion -} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallAutomationAsyncClientAutomatedLiveTests.createVOIPCallAndAnswerThenHangupAutomatedTest[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallAutomationAsyncClientAutomatedLiveTests.createVOIPCallAndAnswerThenHangupAutomatedTest[1].json new file mode 100644 index 000000000000..fa5c281e2095 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallAutomationAsyncClientAutomatedLiveTests.createVOIPCallAndAnswerThenHangupAutomatedTest[1].json @@ -0,0 +1,146 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "fe2a28cc-9eaf-450b-9f63-fb1682c38b44", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009epg", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "15ms", + "MS-CV" : "N4WTjxporEOqbbUq53RH1A.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "fe2a28cc-9eaf-450b-9f63-fb1682c38b44", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "8d7b82e4-39dd-4b69-91a2-92aca7d39267", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-rea5uwam7949bcf7tfst339vg0000000024000000000gdy8", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "12ms", + "MS-CV" : "FR7KGjGUDkGiI41+/Sw+rg.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "8d7b82e4-39dd-4b69-91a2-92aca7d39267", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "af82bcd5-6edf-46c1-b284-a9c2c23a8031", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073231Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009fzv", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "901", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "ac4811cc-4a81-4a04-8965-acfa0dd25389", + "Body" : "{\"callConnectionId\":\"401fc800-5b95-4fe8-88e5-9bd9b02046c1\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"ac4811cc-4a81-4a04-8965-acfa0dd25389\"}", + "Date" : "Thu, 26 Oct 2023 07:32:32 GMT", + "x-ms-client-request-id" : "af82bcd5-6edf-46c1-b284-a9c2c23a8031", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "af0e5719-129f-4793-9136-f38def143875", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073235Z-v0d15wb7vh7nm1g3xxrgh7qk740000000ebg0000000148w2", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:35 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1061", + "X-Microsoft-Skype-Chain-ID" : "ac4811cc-4a81-4a04-8965-acfa0dd25389", + "Body" : "{\"callConnectionId\":\"401fc800-0757-43f5-8b87-591e8954e683\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252L2VpZk1oSVVkTEV5dnNCbEdJWWozTVE/aT0xJmU9NjM4MzMyMTgwNjA1NjMyMzg2\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"ac4811cc-4a81-4a04-8965-acfa0dd25389\"}", + "x-ms-client-request-id" : "af0e5719-129f-4793-9136-f38def143875", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/401fc800-0757-43f5-8b87-591e8954e683:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "772dd657-3857-4ed7-84f1-cf19edc6eef9", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073239Z-v0d15wb7vh7nm1g3xxrgh7qk740000000ebg0000000149ue", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "ac4811cc-4a81-4a04-8965-acfa0dd25389", + "Date" : "Thu, 26 Oct 2023 07:32:40 GMT", + "x-ms-client-request-id" : "772dd657-3857-4ed7-84f1-cf19edc6eef9" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/401fc800-0757-43f5-8b87-591e8954e683:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "1dd52b2f-5d65-48c2-bb01-e8bb2a1625f2", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073242Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009kmq", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "53", + "StatusCode" : "404", + "X-Microsoft-Skype-Chain-ID" : "65278974-d8f7-4e63-93b7-f89f083b56cf", + "Body" : "{\"error\":{\"code\":\"8522\",\"message\":\"Call not found.\"}}", + "Date" : "Thu, 26 Oct 2023 07:32:42 GMT", + "x-ms-client-request-id" : "1dd52b2f-5d65-48c2-bb01-e8bb2a1625f2", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallAutomationAsyncClientAutomatedLiveTests.createVOIPCallAndRejectAutomatedTest[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallAutomationAsyncClientAutomatedLiveTests.createVOIPCallAndRejectAutomatedTest[1].json new file mode 100644 index 000000000000..d823b5e00f55 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallAutomationAsyncClientAutomatedLiveTests.createVOIPCallAndRejectAutomatedTest[1].json @@ -0,0 +1,122 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "4ed544e4-8e12-4541-b51c-d5760bb63462", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r4y0", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "15ms", + "MS-CV" : "Mj7x64U+a0SPh0MfM7CguQ.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "4ed544e4-8e12-4541-b51c-d5760bb63462", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "863ac2cb-6123-47d5-b777-3007cb294413", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r51u", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:29 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "18ms", + "MS-CV" : "Xq50ITad2kWMp1xK6hhJlg.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "863ac2cb-6123-47d5-b777-3007cb294413", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "95590aca-ea68-4b16-a7dd-28cb3c539604", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073232Z-5xg90dtek91vvahf0h361c0d580000000ec0000000022z72", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "901", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "05cbd59c-bd1a-4412-b930-a4d2ae64027f", + "Body" : "{\"callConnectionId\":\"411fc800-b7d1-4c17-b11b-78fdbaa1a4e5\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"05cbd59c-bd1a-4412-b930-a4d2ae64027f\"}", + "Date" : "Thu, 26 Oct 2023 07:32:33 GMT", + "x-ms-client-request-id" : "95590aca-ea68-4b16-a7dd-28cb3c539604", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:reject?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "ee87e15b-19cd-417c-8a6b-fc8b7590f9d9", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073236Z-5xg90dtek91vvahf0h361c0d580000000ec0000000023011", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "05cbd59c-bd1a-4412-b930-a4d2ae64027f", + "Date" : "Thu, 26 Oct 2023 07:32:36 GMT", + "x-ms-client-request-id" : "ee87e15b-19cd-417c-8a6b-fc8b7590f9d9" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-b7d1-4c17-b11b-78fdbaa1a4e5?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "9b5cbfb4-68ad-40b4-a8c2-33a177d537e2", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073237Z-rea5uwam7949bcf7tfst339vg0000000024000000000gg48", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "53", + "StatusCode" : "404", + "X-Microsoft-Skype-Chain-ID" : "32d948f3-a5f5-475d-90d9-028502e2ac87", + "Body" : "{\"error\":{\"code\":\"8522\",\"message\":\"Call not found.\"}}", + "Date" : "Thu, 26 Oct 2023 07:32:37 GMT", + "x-ms-client-request-id" : "9b5cbfb4-68ad-40b4-a8c2-33a177d537e2", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.addAParticipantAndMuteInCallAutomatedTest[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.addAParticipantAndMuteInCallAutomatedTest[1].json new file mode 100644 index 000000000000..dd8429cfad7d --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.addAParticipantAndMuteInCallAutomatedTest[1].json @@ -0,0 +1,268 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "cfddb058-9651-4f65-836e-5d594b586290", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009epf", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "13ms", + "MS-CV" : "fKzGyGN/5Ee3RGsZxTdNHw.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "cfddb058-9651-4f65-836e-5d594b586290", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "56e13b29-5047-4803-bc9e-1b0f85e9f623", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009evg", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "15ms", + "MS-CV" : "G8sfHOiZyk2fSJqZcz3Ltw.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "56e13b29-5047-4803-bc9e-1b0f85e9f623", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "3d1683c3-c5a4-4cae-9ad0-b3250285d6a3", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-rea5uwam7949bcf7tfst339vg0000000024000000000gdzh", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:28 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "12ms", + "MS-CV" : "oO4u7Lny5Umt1zZzlpeGzg.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "3d1683c3-c5a4-4cae-9ad0-b3250285d6a3", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "c9132e83-d44c-4359-a5bb-4541777de983", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073233Z-t8edrzupp17w99nx5xx1y1aztw00000005mg000000017yzz", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "901", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "e8085fcd-522e-449e-b2b1-5a96c7360768", + "Body" : "{\"callConnectionId\":\"411fc800-3707-4cc9-ad17-915c66c6babb\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"e8085fcd-522e-449e-b2b1-5a96c7360768\"}", + "Date" : "Thu, 26 Oct 2023 07:32:34 GMT", + "x-ms-client-request-id" : "c9132e83-d44c-4359-a5bb-4541777de983", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "c2825a6f-b30d-456b-a912-e884f263904f", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073235Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009h0k", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:37 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1061", + "X-Microsoft-Skype-Chain-ID" : "e8085fcd-522e-449e-b2b1-5a96c7360768", + "Body" : "{\"callConnectionId\":\"441fc800-9e7b-4c03-ba17-3c1529debdc9\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252LzNudDA3bXFLdTB5MmZ0Tk5ickJwU1E/aT0xJmU9NjM4MzMyMTgwNjA1NjMyMzg2\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"e8085fcd-522e-449e-b2b1-5a96c7360768\"}", + "x-ms-client-request-id" : "c2825a6f-b30d-456b-a912-e884f263904f", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-3707-4cc9-ad17-915c66c6babb/participants:add?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "bb257c25-af4d-4f57-8e67-688217e1a762", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073239Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009hue", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 26 Oct 2023 07:32:40 GMT", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "328", + "X-Microsoft-Skype-Chain-ID" : "e8085fcd-522e-449e-b2b1-5a96c7360768", + "Body" : "{\"participant\":{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},\"invitationId\":\"f9c74c45-16d9-43cb-aa99-b3a081424b4e\"}", + "x-ms-client-request-id" : "bb257c25-af4d-4f57-8e67-688217e1a762", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "bf774afb-c02e-4a90-a7db-b8a910034761", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073244Z-rea5uwam7949bcf7tfst339vg0000000024000000000ghhk", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1061", + "X-Microsoft-Skype-Chain-ID" : "e8085fcd-522e-449e-b2b1-5a96c7360768", + "Body" : "{\"callConnectionId\":\"411fc800-1524-4b3c-91f0-02ac0ad55349\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252LzNudDA3bXFLdTB5MmZ0Tk5ickJwU1E/aT0xJmU9NjM4MzMyMTgwNjA1NjMyMzg2\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"e8085fcd-522e-449e-b2b1-5a96c7360768\"}", + "x-ms-client-request-id" : "bf774afb-c02e-4a90-a7db-b8a910034761", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-3707-4cc9-ad17-915c66c6babb/participants:mute?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "358f097f-c3b7-41a6-bbe5-3ecb2b8cfb23", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073246Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009muh", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:47 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "39", + "X-Microsoft-Skype-Chain-ID" : "e8085fcd-522e-449e-b2b1-5a96c7360768", + "Body" : "{\"operationContext\":\"operationContext\"}", + "x-ms-client-request-id" : "358f097f-c3b7-41a6-bbe5-3ecb2b8cfb23", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-3707-4cc9-ad17-915c66c6babb/participants?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "74c530e4-4b90-4be9-a572-4d6feb330dc4", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073251Z-rea5uwam7949bcf7tfst339vg0000000024000000000gkxx", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:51 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "787", + "X-Microsoft-Skype-Chain-ID" : "e8085fcd-522e-449e-b2b1-5a96c7360768", + "Body" : "{\"value\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":true},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}]}", + "x-ms-client-request-id" : "74c530e4-4b90-4be9-a572-4d6feb330dc4", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/441fc800-9e7b-4c03-ba17-3c1529debdc9:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "a9fc927c-3397-4ad9-8f09-a6e1a3221d9d", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073251Z-5xg90dtek91vvahf0h361c0d580000000ec000000002336h", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "e8085fcd-522e-449e-b2b1-5a96c7360768", + "Date" : "Thu, 26 Oct 2023 07:32:51 GMT", + "x-ms-client-request-id" : "a9fc927c-3397-4ad9-8f09-a6e1a3221d9d" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-1524-4b3c-91f0-02ac0ad55349:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "cb62ffc2-dd30-4720-b376-0d8127c18225", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073251Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009p7q", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "53", + "StatusCode" : "404", + "X-Microsoft-Skype-Chain-ID" : "7c999496-1359-4304-aff1-c990185a205c", + "Body" : "{\"error\":{\"code\":\"8522\",\"message\":\"Call not found.\"}}", + "Date" : "Thu, 26 Oct 2023 07:32:52 GMT", + "x-ms-client-request-id" : "cb62ffc2-dd30-4720-b376-0d8127c18225", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant[1].json new file mode 100644 index 000000000000..36514d67f98e --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant[1].json @@ -0,0 +1,198 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "e8b5e96b-371a-4ae1-9201-db146d4d1292", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009epe", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:28 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "15ms", + "MS-CV" : "pQPtLqslSkOX7i+RLt1dkQ.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "e8b5e96b-371a-4ae1-9201-db146d4d1292", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "b1d06b0c-a2b9-47d5-84aa-e6d2966209a3", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073228Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009f2d", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:28 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "15ms", + "MS-CV" : "EVN7xB+8IEufnVNK3ZhzeQ.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "b1d06b0c-a2b9-47d5-84aa-e6d2966209a3", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "5967a2df-31d6-45a3-ba9b-939a08cdd392", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073228Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009f5n", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:29 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "13ms", + "MS-CV" : "3z6Qhq+tzkagZfbQdMZyMw.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "5967a2df-31d6-45a3-ba9b-939a08cdd392", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "938eb428-cc1e-48b9-b563-a6e3b8e2ceef", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073232Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r5qt", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "901", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "8289c713-e1f4-4fcd-b023-744d2b4fe804", + "Body" : "{\"callConnectionId\":\"411fc800-c880-4fa2-9b97-782cd959ceed\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"8289c713-e1f4-4fcd-b023-744d2b4fe804\"}", + "Date" : "Thu, 26 Oct 2023 07:32:33 GMT", + "x-ms-client-request-id" : "938eb428-cc1e-48b9-b563-a6e3b8e2ceef", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "c610ce69-6b4c-47d2-ba10-5909cd5d797d", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073236Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r67u", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:36 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1061", + "X-Microsoft-Skype-Chain-ID" : "8289c713-e1f4-4fcd-b023-744d2b4fe804", + "Body" : "{\"callConnectionId\":\"411fc800-5b5a-4661-bd6e-e68e5994b713\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252LzdiU1RMcnNzQWs2TV83dElCeUFQVUE/aT0yJmU9NjM4MzMyMTg5NTgxMzk0NjEw\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"8289c713-e1f4-4fcd-b023-744d2b4fe804\"}", + "x-ms-client-request-id" : "c610ce69-6b4c-47d2-ba10-5909cd5d797d", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-c880-4fa2-9b97-782cd959ceed/participants:add?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "72440943-0568-4057-815e-2550c4f16977", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073238Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r6gw", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 26 Oct 2023 07:32:38 GMT", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "328", + "X-Microsoft-Skype-Chain-ID" : "8289c713-e1f4-4fcd-b023-744d2b4fe804", + "Body" : "{\"participant\":{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},\"invitationId\":\"1bc8007b-043f-4904-bee5-a944190da5a3\"}", + "x-ms-client-request-id" : "72440943-0568-4057-815e-2550c4f16977", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-c880-4fa2-9b97-782cd959ceed/participants:cancelAddParticipant?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "88d847bd-3e38-418d-9ee0-6087c0c8bc3c", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073241Z-t8edrzupp17w99nx5xx1y1aztw00000005mg0000000180xp", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 26 Oct 2023 07:32:42 GMT", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "55", + "X-Microsoft-Skype-Chain-ID" : "8289c713-e1f4-4fcd-b023-744d2b4fe804", + "Body" : "{\"invitationId\":\"1bc8007b-043f-4904-bee5-a944190da5a3\"}", + "x-ms-client-request-id" : "88d847bd-3e38-418d-9ee0-6087c0c8bc3c", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-5b5a-4661-bd6e-e68e5994b713:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "c45826af-f95f-4185-9eac-46cce0860202", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073244Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009m2r", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "8289c713-e1f4-4fcd-b023-744d2b4fe804", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "x-ms-client-request-id" : "c45826af-f95f-4185-9eac-46cce0860202" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest[1].json new file mode 100644 index 000000000000..a9fdc2352a4b --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallConnectionAsyncAutomatedLiveTests.createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest[1].json @@ -0,0 +1,246 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "7c52f975-936a-4da1-93bc-4c58ccf52080", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073237Z-v0d15wb7vh7nm1g3xxrgh7qk740000000ebg0000000149dg", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:38 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "13ms", + "MS-CV" : "BMBeYxja2ke3GoQSz5btiA.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "7c52f975-936a-4da1-93bc-4c58ccf52080", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "8153f858-f007-42de-8a86-c3ff4aa7631e", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073238Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009hn5", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:38 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "13ms", + "MS-CV" : "N2v/nglUTEagVPOY1sB/aQ.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "8153f858-f007-42de-8a86-c3ff4aa7631e", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "dc9b7c2a-7455-4429-b473-56825ded354d", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073238Z-5xg90dtek91vvahf0h361c0d580000000ec00000000230ez", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:39 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "12ms", + "MS-CV" : "CMBoUJxbnUuHiKjsHBnXkQ.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "dc9b7c2a-7455-4429-b473-56825ded354d", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "0f8e7fb6-3da0-4590-90f6-6633290ee511", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073243Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009kv2", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "901", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "845adfc6-18b5-49e1-ad65-a43820e2a503", + "Body" : "{\"callConnectionId\":\"431fc800-1fd9-46b4-87f5-a879a5cf8e09\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"845adfc6-18b5-49e1-ad65-a43820e2a503\"}", + "Date" : "Thu, 26 Oct 2023 07:32:43 GMT", + "x-ms-client-request-id" : "0f8e7fb6-3da0-4590-90f6-6633290ee511", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "99b72c93-113a-46a9-899d-9ce9fb8faa2a", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073244Z-5xg90dtek91vvahf0h361c0d580000000ec00000000231s5", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1061", + "X-Microsoft-Skype-Chain-ID" : "845adfc6-18b5-49e1-ad65-a43820e2a503", + "Body" : "{\"callConnectionId\":\"411fc800-bf93-4123-a090-c14ef4cc7cbf\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252L3FXMTBpWVNiLTBtSTF6eHlSUV8teHc/aT0wJmU9NjM4MzMyMTcyMzgyNDg0OTYx\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"845adfc6-18b5-49e1-ad65-a43820e2a503\"}", + "x-ms-client-request-id" : "99b72c93-113a-46a9-899d-9ce9fb8faa2a", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/431fc800-1fd9-46b4-87f5-a879a5cf8e09/participants:add?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "fb2b6773-18af-4df4-ad1b-c9923c3bcce3", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073246Z-t8edrzupp17w99nx5xx1y1aztw00000005mg00000001820x", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 26 Oct 2023 07:32:47 GMT", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "328", + "X-Microsoft-Skype-Chain-ID" : "845adfc6-18b5-49e1-ad65-a43820e2a503", + "Body" : "{\"participant\":{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},\"invitationId\":\"eedc3d4a-07c7-4f26-82bd-ad7b4afe4724\"}", + "x-ms-client-request-id" : "fb2b6773-18af-4df4-ad1b-c9923c3bcce3", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "79cbe447-c98c-459e-b67a-b9ce1a2a03de", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073250Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009ns8", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:50 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1061", + "X-Microsoft-Skype-Chain-ID" : "845adfc6-18b5-49e1-ad65-a43820e2a503", + "Body" : "{\"callConnectionId\":\"431fc800-f414-4428-a37f-355b9c7dad59\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252L3FXMTBpWVNiLTBtSTF6eHlSUV8teHc/aT0wJmU9NjM4MzMyMTcyMzgyNDg0OTYx\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"845adfc6-18b5-49e1-ad65-a43820e2a503\"}", + "x-ms-client-request-id" : "79cbe447-c98c-459e-b67a-b9ce1a2a03de", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/431fc800-1fd9-46b4-87f5-a879a5cf8e09/participants?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "2f8e2f41-37f7-4592-b64f-331cc834dd3d", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073253Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009prw", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:53 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "788", + "X-Microsoft-Skype-Chain-ID" : "845adfc6-18b5-49e1-ad65-a43820e2a503", + "Body" : "{\"value\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}]}", + "x-ms-client-request-id" : "2f8e2f41-37f7-4592-b64f-331cc834dd3d", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/431fc800-1fd9-46b4-87f5-a879a5cf8e09/participants:remove?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "86e97626-cada-4185-8a79-1e6c5e73d597", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073253Z-t8edrzupp17w99nx5xx1y1aztw00000005mg0000000183fz", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 26 Oct 2023 07:32:54 GMT", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "2", + "X-Microsoft-Skype-Chain-ID" : "845adfc6-18b5-49e1-ad65-a43820e2a503", + "Body" : "{}", + "x-ms-client-request-id" : "86e97626-cada-4185-8a79-1e6c5e73d597", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-bf93-4123-a090-c14ef4cc7cbf:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "592d0a47-2c6c-4e35-b6ef-cbd9581a965d", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073256Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r8v4", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "53", + "StatusCode" : "404", + "X-Microsoft-Skype-Chain-ID" : "710dd3cf-6689-456c-86c1-9282b303f096", + "Body" : "{\"error\":{\"code\":\"8522\",\"message\":\"Call not found.\"}}", + "Date" : "Thu, 26 Oct 2023 07:32:56 GMT", + "x-ms-client-request-id" : "592d0a47-2c6c-4e35-b6ef-cbd9581a965d", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallMediaAsyncAutomatedLiveTests.dtmfActionsInACallAutomatedTest[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallMediaAsyncAutomatedLiveTests.dtmfActionsInACallAutomatedTest[1].json new file mode 100644 index 000000000000..7151c27c914e --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallMediaAsyncAutomatedLiveTests.dtmfActionsInACallAutomatedTest[1].json @@ -0,0 +1,166 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "bf29ec11-ed3d-46d0-a4b6-827245338367", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073229Z-t8edrzupp17w99nx5xx1y1aztw00000005mg000000017y7e", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:30 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "12ms", + "MS-CV" : "gTNp+fn03US8lT2I0wFOiA.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "bf29ec11-ed3d-46d0-a4b6-827245338367", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "5dbe5942-00f3-4add-a626-29956f03674f", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073231Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009g22", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "688", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "71c082ec-aeb5-4549-8ec8-214b31a1fb08", + "Body" : "{\"callConnectionId\":\"431fc800-aad9-4e7e-9ea6-b99cd9f2a04f\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"phoneNumber\",\"phoneNumber\":{\"value\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceCallerIdNumber\":{\"value\":\"REDACTED\"},\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"71c082ec-aeb5-4549-8ec8-214b31a1fb08\"}", + "Date" : "Thu, 26 Oct 2023 07:32:32 GMT", + "x-ms-client-request-id" : "5dbe5942-00f3-4add-a626-29956f03674f", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "ec8f3ea9-2441-4b75-961e-17350ea6f031", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073236Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009han", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:37 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "961", + "X-Microsoft-Skype-Chain-ID" : "6b34cf46-2eaa-4234-a44f-dc69a68be5a0", + "Body" : "{\"callConnectionId\":\"431fc800-1e52-4cc0-9fc4-8cd6edebc161\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzZWEtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi83andxTlNnbW0wZWVSaWdadndjM1dBP2k9MTAtNjAtMTAtMTImZT02MzgzMzM2NTg2MzY4NzU4OTE=\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"phoneNumber\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"correlationId\":\"6b34cf46-2eaa-4234-a44f-dc69a68be5a0\",\"answeredBy\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "ec8f3ea9-2441-4b75-961e-17350ea6f031", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/431fc800-aad9-4e7e-9ea6-b99cd9f2a04f:startContinuousDtmfRecognition?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "b78a7bdf-a22c-48ea-bc10-42dc3674060d", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "Accept-Ranges" : "bytes", + "x-azure-ref" : "20231026T073240Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r6tc", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "X-Microsoft-Skype-Chain-ID" : "71c082ec-aeb5-4549-8ec8-214b31a1fb08", + "Date" : "Thu, 26 Oct 2023 07:32:43 GMT", + "x-ms-client-request-id" : "b78a7bdf-a22c-48ea-bc10-42dc3674060d" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/431fc800-aad9-4e7e-9ea6-b99cd9f2a04f:sendDtmfTones?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "230efe70-b151-442b-bc0a-0d8b998d7d6c", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073243Z-v0d15wb7vh7nm1g3xxrgh7qk740000000ebg000000014ady", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "2", + "X-Microsoft-Skype-Chain-ID" : "71c082ec-aeb5-4549-8ec8-214b31a1fb08", + "Body" : "{}", + "x-ms-client-request-id" : "230efe70-b151-442b-bc0a-0d8b998d7d6c", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/431fc800-aad9-4e7e-9ea6-b99cd9f2a04f:stopContinuousDtmfRecognition?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "fe12d01c-eb90-447b-ba4a-be0ee850d648", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "Accept-Ranges" : "bytes", + "x-azure-ref" : "20231026T073246Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009mqb", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "X-Microsoft-Skype-Chain-ID" : "71c082ec-aeb5-4549-8ec8-214b31a1fb08", + "Date" : "Thu, 26 Oct 2023 07:32:46 GMT", + "x-ms-client-request-id" : "fe12d01c-eb90-447b-ba4a-be0ee850d648" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/431fc800-1e52-4cc0-9fc4-8cd6edebc161:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "6ff63cc3-6cbc-4438-9cc3-58ab4cb620b2", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073247Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r7tn", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "6b34cf46-2eaa-4234-a44f-dc69a68be5a0", + "Date" : "Thu, 26 Oct 2023 07:32:48 GMT", + "x-ms-client-request-id" : "6ff63cc3-6cbc-4438-9cc3-58ab4cb620b2" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallMediaAsyncAutomatedLiveTests.playMediaInACallAutomatedTest[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallMediaAsyncAutomatedLiveTests.playMediaInACallAutomatedTest[1].json new file mode 100644 index 000000000000..6cb36ffde2f0 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallMediaAsyncAutomatedLiveTests.playMediaInACallAutomatedTest[1].json @@ -0,0 +1,145 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "adb41352-2939-4960-9f50-9ae74533ed95", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-t8edrzupp17w99nx5xx1y1aztw00000005mg000000017xpx", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "12ms", + "MS-CV" : "m8xa4Nk+Sk6H+KQa6QORUw.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "adb41352-2939-4960-9f50-9ae74533ed95", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "ee130546-ef14-48cf-9ecf-a5da69504728", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-t8edrzupp17w99nx5xx1y1aztw00000005mg000000017xtz", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "12ms", + "MS-CV" : "q1mDlkyVD0a+ouQpbt3nJg.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "ee130546-ef14-48cf-9ecf-a5da69504728", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "805b3f35-bd50-4e27-92c9-676cc4efaaa5", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073231Z-rea5uwam7949bcf7tfst339vg0000000024000000000ger8", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "901", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "71729a28-3888-4eab-9b8a-23a285e18c82", + "Body" : "{\"callConnectionId\":\"411fc800-c874-4d70-a40b-74135f5714ad\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"71729a28-3888-4eab-9b8a-23a285e18c82\"}", + "Date" : "Thu, 26 Oct 2023 07:32:32 GMT", + "x-ms-client-request-id" : "805b3f35-bd50-4e27-92c9-676cc4efaaa5", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "3003a9aa-90cb-4568-8828-b6cfd87dca6e", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073235Z-rea5uwam7949bcf7tfst339vg0000000024000000000gfq4", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:35 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1061", + "X-Microsoft-Skype-Chain-ID" : "71729a28-3888-4eab-9b8a-23a285e18c82", + "Body" : "{\"callConnectionId\":\"411fc800-6989-423a-bda9-0b5889dc62c9\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252L0t3ZVFnSFpBckUtZllEejducFgyU3c/aT0yJmU9NjM4MzMyMTg5NTgxMzk0NjEw\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"71729a28-3888-4eab-9b8a-23a285e18c82\"}", + "x-ms-client-request-id" : "3003a9aa-90cb-4568-8828-b6cfd87dca6e", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-c874-4d70-a40b-74135f5714ad:play?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "3a093c5e-b692-4103-97c4-5af8d2de9e70", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073238Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009hsk", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "71729a28-3888-4eab-9b8a-23a285e18c82", + "Date" : "Thu, 26 Oct 2023 07:32:39 GMT", + "x-ms-client-request-id" : "3a093c5e-b692-4103-97c4-5af8d2de9e70" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/411fc800-6989-423a-bda9-0b5889dc62c9:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "f1fa03a4-f83d-4d34-9962-a2b9e715eca7", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073249Z-v0d15wb7vh7nm1g3xxrgh7qk740000000ebg000000014br7", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "71729a28-3888-4eab-9b8a-23a285e18c82", + "Date" : "Thu, 26 Oct 2023 07:32:49 GMT", + "x-ms-client-request-id" : "f1fa03a4-f83d-4d34-9962-a2b9e715eca7" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallRecordingAutomatedLiveTests.createACSCallAndUnmixedAudioTest[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallRecordingAutomatedLiveTests.createACSCallAndUnmixedAudioTest[1].json new file mode 100644 index 000000000000..44148ad29c38 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallRecordingAutomatedLiveTests.createACSCallAndUnmixedAudioTest[1].json @@ -0,0 +1,192 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "14d81b7d-63ee-49a5-b597-10e010b07a24", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-rea5uwam7949bcf7tfst339vg0000000024000000000gdub", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "13ms", + "MS-CV" : "/0StpuUZGEidAD8cMmME3w.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "14d81b7d-63ee-49a5-b597-10e010b07a24", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "a1368150-31ef-471e-96cb-79c5980a83dd", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009evh", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "15ms", + "MS-CV" : "dfGrLELAJUSTYEfQ/82eoQ.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "a1368150-31ef-471e-96cb-79c5980a83dd", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "b5cfe64a-31b5-4037-ba02-5596b02f759a", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073231Z-v0d15wb7vh7nm1g3xxrgh7qk740000000ebg00000001480c", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "901", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "4f183fc8-2121-41f6-8625-7df01d8b1791", + "Body" : "{\"callConnectionId\":\"401fc800-90fa-419b-9166-f9bf9eed3861\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"4f183fc8-2121-41f6-8625-7df01d8b1791\"}", + "Date" : "Thu, 26 Oct 2023 07:32:32 GMT", + "x-ms-client-request-id" : "b5cfe64a-31b5-4037-ba02-5596b02f759a", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "cff5c765-d9fd-4560-89c0-4d86683ef8b4", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073235Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009h27", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:35 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "904", + "X-Microsoft-Skype-Chain-ID" : "4f183fc8-2121-41f6-8625-7df01d8b1791", + "Body" : "{\"callConnectionId\":\"431fc800-28ba-4e5e-9231-7d69ab0eb99f\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252LzdJS3FUT1k2ekUtaE5iYzhhMElEemc/aT0yJmU9NjM4MzMyMTg5NTgxMzk0NjEw\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"4f183fc8-2121-41f6-8625-7df01d8b1791\"}", + "x-ms-client-request-id" : "cff5c765-d9fd-4560-89c0-4d86683ef8b4", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/401fc800-90fa-419b-9166-f9bf9eed3861?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "9f846df1-7f0e-441b-a269-ab4b2dd5c515", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073238Z-t8edrzupp17w99nx5xx1y1aztw00000005mg00000001807e", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:39 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1086", + "X-Microsoft-Skype-Chain-ID" : "4f183fc8-2121-41f6-8625-7df01d8b1791", + "Body" : "{\"callConnectionId\":\"401fc800-90fa-419b-9166-f9bf9eed3861\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252LzdJS3FUT1k2ekUtaE5iYzhhMElEemc/aT0yJmU9NjM4MzMyMTg5NTgxMzk0NjEw\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connected\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"4f183fc8-2121-41f6-8625-7df01d8b1791\"}", + "x-ms-client-request-id" : "9f846df1-7f0e-441b-a269-ab4b2dd5c515", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/recordings?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "1614b9bb-4cd3-4d4c-812e-c311003ed731", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073239Z-rea5uwam7949bcf7tfst339vg0000000024000000000ggef", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:43 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "208", + "X-Microsoft-Skype-Chain-ID" : "a3ed9f0a-a197-4a1f-bc2a-2d3716764767", + "Body" : "{\"recordingId\":\"eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI0MTFmYzgwMC1jYTUzLTQ2OGQtYTBlMy1kNWRiOTA1OTA3YmYiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiIzZjExMWFiYi0zZjcwLTQxN2UtOTVhNS0wZDM5OWZhMTE3OWYifQ\",\"recordingState\":\"inactive\"}", + "x-ms-client-request-id" : "1614b9bb-4cd3-4d4c-812e-c311003ed731", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI0MTFmYzgwMC1jYTUzLTQ2OGQtYTBlMy1kNWRiOTA1OTA3YmYiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiIzZjExMWFiYi0zZjcwLTQxN2UtOTVhNS0wZDM5OWZhMTE3OWYifQ?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "9d6d6fc7-6898-4178-ab76-d5caaf1af309", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073243Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009m08", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "4f183fc8-2121-41f6-8625-7df01d8b1791", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "x-ms-client-request-id" : "9d6d6fc7-6898-4178-ab76-d5caaf1af309" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/401fc800-90fa-419b-9166-f9bf9eed3861:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "0091c30e-e405-4010-a272-75c2fd514cf2", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073244Z-t8edrzupp17w99nx5xx1y1aztw00000005pg00000000r78x", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "4f183fc8-2121-41f6-8625-7df01d8b1791", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "x-ms-client-request-id" : "0091c30e-e405-4010-a272-75c2fd514cf2" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallRecordingAutomatedLiveTests.createACSCallUnmixedAudioAffinityTest[1].json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallRecordingAutomatedLiveTests.createACSCallUnmixedAudioAffinityTest[1].json new file mode 100644 index 000000000000..7614521d9dcf --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/CallRecordingAutomatedLiveTests.createACSCallUnmixedAudioAffinityTest[1].json @@ -0,0 +1,192 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "f8bb44fa-ff86-4325-b031-fc485389dd84", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-v0d15wb7vh7nm1g3xxrgh7qk740000000ebg00000001471b", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "14ms", + "MS-CV" : "Cw+hWQxztE68PG1oT34nKg.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "f8bb44fa-ff86-4325-b031-fc485389dd84", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/identities?api-version=2022-10-01", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "bb35c679-e765-4cb0-97a9-69637fc0b787", + "user-agent" : "azsdk-java-azure-communication-identity/1.4.10 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073227Z-v0d15wb7vh7nm1g3xxrgh7qk740000000ebg00000001475b", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-10-31-preview, 2021-11-01, 2022-06-01, 2022-10-01, 2023-10-01", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Thu, 26 Oct 2023 07:32:27 GMT", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "13ms", + "MS-CV" : "x497FSX96UmRTbRl1eEUwg.2.0", + "Content-Length" : "101", + "Body" : "{\"identity\":{\"id\":\"REDACTED\"}}", + "x-ms-client-request-id" : "bb35c679-e765-4cb0-97a9-69637fc0b787", + "Request-Context" : "appId=", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "aff9c3e4-8273-4379-9cb2-6afcd25d22a8", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073231Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009g00", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "901", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "0b8c8acf-410b-43d5-bda1-ff178f3b16bc", + "Body" : "{\"callConnectionId\":\"441fc800-7e16-4646-861c-dd79bad03fbb\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connecting\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"0b8c8acf-410b-43d5-bda1-ff178f3b16bc\"}", + "Date" : "Thu, 26 Oct 2023 07:32:34 GMT", + "x-ms-client-request-id" : "aff9c3e4-8273-4379-9cb2-6afcd25d22a8", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections:answer?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "48e3e633-c322-440c-88d4-7e065053a2bf", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073236Z-t8edrzupp17w99nx5xx1y1aztw00000005mg000000017zqk", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:36 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "904", + "X-Microsoft-Skype-Chain-ID" : "0b8c8acf-410b-43d5-bda1-ff178f3b16bc", + "Body" : "{\"callConnectionId\":\"411fc800-fded-4d86-b7c4-5dcd1307b10f\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252LzBpaDl1VGU0R2s2UnVoTUxBOEJEcUE/aT0yJmU9NjM4MzMyMTg5NTgxMzk0NjEw\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"unknown\",\"callbackUri\":\"REDACTED\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"0b8c8acf-410b-43d5-bda1-ff178f3b16bc\"}", + "x-ms-client-request-id" : "48e3e633-c322-440c-88d4-7e065053a2bf", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/441fc800-7e16-4646-861c-dd79bad03fbb?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "5e53878c-6553-408c-bd9a-53f3feac14bb", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073239Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009k1h", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:40 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "1086", + "X-Microsoft-Skype-Chain-ID" : "0b8c8acf-410b-43d5-bda1-ff178f3b16bc", + "Body" : "{\"callConnectionId\":\"441fc800-7e16-4646-861c-dd79bad03fbb\",\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC94LWNvbnYtdXN3ZS0wMS5jb252LnNreXBlLmNvbS9jb252LzBpaDl1VGU0R2s2UnVoTUxBOEJEcUE/aT0yJmU9NjM4MzMyMTg5NTgxMzk0NjEw\",\"targets\":[{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}}],\"callConnectionState\":\"connected\",\"callbackUri\":\"REDACTED\",\"sourceDisplayName\":\"\",\"source\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"correlationId\":\"0b8c8acf-410b-43d5-bda1-ff178f3b16bc\"}", + "x-ms-client-request-id" : "5e53878c-6553-408c-bd9a-53f3feac14bb", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/recordings?api-version=2023-10-15", + "Headers" : { + "content-type" : "application/json", + "x-ms-client-request-id" : "11bf36c9-ab57-44c5-add5-c390ec5cd62f", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073240Z-5xg90dtek91vvahf0h361c0d580000000ec00000000230vt", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "Accept-Ranges" : "bytes", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "Content-Length" : "208", + "X-Microsoft-Skype-Chain-ID" : "6f8dd9af-ac37-44d7-949f-09711ec6f6ca", + "Body" : "{\"recordingId\":\"eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI0MTFmYzgwMC1kMDJjLTQ5MTgtOWQ4ZC0xNWMwN2FhZWNlZTkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJiMTYzNDJiMi00NjA1LTQ3OGItOTU1ZS1lOTJhMDY2M2VhMWIifQ\",\"recordingState\":\"inactive\"}", + "x-ms-client-request-id" : "11bf36c9-ab57-44c5-add5-c390ec5cd62f", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI0MTFmYzgwMC1kMDJjLTQ5MTgtOWQ4ZC0xNWMwN2FhZWNlZTkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJiMTYzNDJiMi00NjA1LTQ3OGItOTU1ZS1lOTJhMDY2M2VhMWIifQ?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "825aed07-da32-4a69-b099-8454ec714acc", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073244Z-t8edrzupp17w99nx5xx1y1aztw00000005mg0000000181d0", + "X-Cache" : "CONFIG_NOCACHE", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "0b8c8acf-410b-43d5-bda1-ff178f3b16bc", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "x-ms-client-request-id" : "825aed07-da32-4a69-b099-8454ec714acc" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/callConnections/441fc800-7e16-4646-861c-dd79bad03fbb:terminate?api-version=2023-10-15", + "Headers" : { + "x-ms-client-request-id" : "54c73c19-682b-4441-9b19-eadf6562b41b", + "user-agent" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)" + }, + "Response" : { + "x-azure-ref" : "20231026T073244Z-cv08mth3vh17tfvh5w1d795q140000000eb0000000009m5s", + "X-Cache" : "CONFIG_NOCACHE", + "Repeatability-Result" : "accepted", + "Connection" : "keep-alive", + "X-Microsoft-Skype-Client" : "azsdk-java-azure-communication-callautomation/1.1.0 (20.0.1; Windows 11; 10.0)", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "X-Microsoft-Skype-Chain-ID" : "0b8c8acf-410b-43d5-bda1-ff178f3b16bc", + "Date" : "Thu, 26 Oct 2023 07:32:44 GMT", + "x-ms-client-request-id" : "54c73c19-682b-4441-9b19-eadf6562b41b" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/addAParticipantAndMuteInCallAutomatedTest b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/addAParticipantAndMuteInCallAutomatedTest new file mode 100644 index 000000000000..c85565c920c9 Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/addAParticipantAndMuteInCallAutomatedTest differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest new file mode 100644 index 000000000000..bc7d717ad07e Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest.json deleted file mode 100644 index e204ec563f02..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"6b301218-78ee-4dfe-b1f9-6af7728f3ddd\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-40ec-484c-b8ef-04e29639496b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6b301218-78ee-4dfe-b1f9-6af7728f3ddd\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:04:50.2440489\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-40ec-484c-b8ef-04e29639496b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6b301218-78ee-4dfe-b1f9-6af7728f3ddd\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:04:50.2440489\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-40ec-484c-b8ef-04e29639496b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6b301218-78ee-4dfe-b1f9-6af7728f3ddd\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:04:54.0565499\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-40ec-484c-b8ef-04e29639496b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6b301218-78ee-4dfe-b1f9-6af7728f3ddd\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-01-09T21:04:54.5253025\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-40ec-484c-b8ef-04e29639496b\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest new file mode 100644 index 000000000000..30a8439bbb71 Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest.json deleted file mode 100644 index 131f7722d11e..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"9155ec80-7f4b-456e-a6c4-fd12ecd3e248\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"9155ec80-7f4b-456e-a6c4-fd12ecd3e248\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:05:00.4021471\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"9155ec80-7f4b-456e-a6c4-fd12ecd3e248\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:05:00.4021471\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-f684-4d60-a17b-5d99fae7cd67\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"9155ec80-7f4b-456e-a6c4-fd12ecd3e248\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-01-09T21:05:04.6209569\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-f684-4d60-a17b-5d99fae7cd67\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant new file mode 100644 index 000000000000..0c1ae279ad14 Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant.json deleted file mode 100644 index a01696c3d99f..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"6a07326c-90d0-4643-b7ac-064e85343c00\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-1600-4b88-ae41-447b107c7da3\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6a07326c-90d0-4643-b7ac-064e85343c00\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:03:49.6210772\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":0,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-1600-4b88-ae41-447b107c7da3\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6a07326c-90d0-4643-b7ac-064e85343c00\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:49.6055049\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-25c5-49ee-97f1-dfc1d5adc569\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-25c5-49ee-97f1-dfc1d5adc569\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-25c5-49ee-97f1-dfc1d5adc569\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6a07326c-90d0-4643-b7ac-064e85343c00\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:03:49.6992769\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-25c5-49ee-97f1-dfc1d5adc569\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-25c5-49ee-97f1-dfc1d5adc569\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-25c5-49ee-97f1-dfc1d5adc569\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-25c5-49ee-97f1-dfc1d5adc569\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6a07326c-90d0-4643-b7ac-064e85343c00\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:49.9804571\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-25c5-49ee-97f1-dfc1d5adc569\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-1600-4b88-ae41-447b107c7da3\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6a07326c-90d0-4643-b7ac-064e85343c00\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:50.2148334\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-1600-4b88-ae41-447b107c7da3\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-25c5-49ee-97f1-dfc1d5adc569\",\"type\":\"Microsoft.Communication.CancelAddParticipantSucceeded\",\"data\":{\"invitationId\":\"b171db3b-b044-49b6-af37-4220f3f7e131\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-25c5-49ee-97f1-dfc1d5adc569\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6a07326c-90d0-4643-b7ac-064e85343c00\",\"publicEventType\":\"Microsoft.Communication.CancelAddParticipantSucceeded\"},\"time\":\"2024-01-09T21:03:54.3398892\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-25c5-49ee-97f1-dfc1d5adc569\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest new file mode 100644 index 000000000000..2f4070067817 Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest.json deleted file mode 100644 index cb6a05006944..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5bd3-449b-99ef-0addb9892373\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:03:37.7295165\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5bd3-449b-99ef-0addb9892373\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:37.7763901\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-ed5f-4f40-9fe2-314d82459301\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:37.8388914\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-ed5f-4f40-9fe2-314d82459301\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:03:37.8545189\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\"}]","{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-21f4-4c05-bece-27ee91f7633b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:03:41.9326961\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-21f4-4c05-bece-27ee91f7633b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:42.1671211\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"type\":\"Microsoft.Communication.AddParticipantSucceeded\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"participant\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-ed5f-4f40-9fe2-314d82459301\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.AddParticipantSucceeded\"},\"time\":\"2024-01-09T21:03:42.1671211\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5bd3-449b-99ef-0addb9892373\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:42.1826965\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-ed5f-4f40-9fe2-314d82459301\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:42.1826965\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":4,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-21f4-4c05-bece-27ee91f7633b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:42.7452538\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":5,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5bd3-449b-99ef-0addb9892373\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:42.7921319\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":4,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-ed5f-4f40-9fe2-314d82459301\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:42.7921319\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":5,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-21f4-4c05-bece-27ee91f7633b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:43.3390119\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":5,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5bd3-449b-99ef-0addb9892373\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:43.3702094\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":5,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-ed5f-4f40-9fe2-314d82459301\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:43.3702094\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5bd3-449b-99ef-0addb9892373\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-01-09T21:03:43.7295949\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5bd3-449b-99ef-0addb9892373\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"type\":\"Microsoft.Communication.RemoveParticipantSucceeded\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"participant\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-ed5f-4f40-9fe2-314d82459301\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.RemoveParticipantSucceeded\"},\"time\":\"2024-01-09T21:03:43.7295949\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":6,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-ed5f-4f40-9fe2-314d82459301\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:43.9579949\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-ed5f-4f40-9fe2-314d82459301\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":6,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-21f4-4c05-bece-27ee91f7633b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"6014f303-1f60-4574-8d01-cf5a7094341f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:43.9170917\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-21f4-4c05-bece-27ee91f7633b\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest new file mode 100644 index 000000000000..82f852406ad1 Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest.json deleted file mode 100644 index 5bf11c7494ba..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"2562a164-fbf0-4099-83f4-b2a049955444\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"2562a164-fbf0-4099-83f4-b2a049955444\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:03:27.6356923\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-3534-498b-b532-bc8b74320875\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"2562a164-fbf0-4099-83f4-b2a049955444\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:03:27.6981964\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"2562a164-fbf0-4099-83f4-b2a049955444\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:27.6825671\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-3534-498b-b532-bc8b74320875\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"2562a164-fbf0-4099-83f4-b2a049955444\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:03:27.6981964\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-71a4-4b16-a298-7f58af72e0a3\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"2562a164-fbf0-4099-83f4-b2a049955444\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-01-09T21:03:29.182541\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-71a4-4b16-a298-7f58af72e0a3\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-3534-498b-b532-bc8b74320875\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"2562a164-fbf0-4099-83f4-b2a049955444\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-01-09T21:03:29.2450325\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-3534-498b-b532-bc8b74320875\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest new file mode 100644 index 000000000000..dd078a2f3c37 Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest.json deleted file mode 100644 index f7d14d55d81f..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"75ebe437-0eb7-4c98-b624-62ced999e1b6\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-b25e-4b2d-8e87-88c0bf87d0a1\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-b25e-4b2d-8e87-88c0bf87d0a1\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-b25e-4b2d-8e87-88c0bf87d0a1\",\"correlationId\":\"75ebe437-0eb7-4c98-b624-62ced999e1b6\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-01-09T21:03:21.7606237\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-b25e-4b2d-8e87-88c0bf87d0a1\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dialogActionInACallAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dialogActionInACallAutomatedTest.json deleted file mode 100644 index b793c7a2e92c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dialogActionInACallAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":0,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5eaa-4811-a663-151188568d3b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:04:01.558788\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5eaa-4811-a663-151188568d3b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:04:01.558788\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-7f1b-46c2-b546-4c6da080daa7\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-7f1b-46c2-b546-4c6da080daa7\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-7f1b-46c2-b546-4c6da080daa7\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:04:01.6056127\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-7f1b-46c2-b546-4c6da080daa7\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-7f1b-46c2-b546-4c6da080daa7\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-7f1b-46c2-b546-4c6da080daa7\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-7f1b-46c2-b546-4c6da080daa7\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:04:01.6056127\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-7f1b-46c2-b546-4c6da080daa7\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5eaa-4811-a663-151188568d3b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:04:02.1369297\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"type\":\"Microsoft.Communication.DialogStarted\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"resultInformation\":{\"code\":200,\"subCode\":0,\"message\":\"Success Result\"},\"dialogInputType\":\"powerVirtualAgents\",\"dialogId\":\"92e08834-b6ee-4ede-8956-9fefa27a691c\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5eaa-4811-a663-151188568d3b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\",\"publicEventType\":\"Microsoft.Communication.DialogStarted\"},\"time\":\"2024-01-09T21:04:03.6212649\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"type\":\"Microsoft.Communication.DialogSensitivityUpdate\",\"data\":{\"sensitiveMask\":false,\"eventSource\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"resultInformation\":{\"code\":200,\"subCode\":0,\"message\":\"Success Result\"},\"dialogInputType\":\"powerVirtualAgents\",\"dialogId\":\"92e08834-b6ee-4ede-8956-9fefa27a691c\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5eaa-4811-a663-151188568d3b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\",\"publicEventType\":\"Microsoft.Communication.DialogSensitivityUpdate\"},\"time\":\"2024-01-09T21:04:04.0275199\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"type\":\"Microsoft.Communication.DialogCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\",\"resultInformation\":{\"code\":200,\"subCode\":0,\"message\":\"Success Result\"},\"dialogInputType\":\"powerVirtualAgents\",\"dialogId\":\"92e08834-b6ee-4ede-8956-9fefa27a691c\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-5eaa-4811-a663-151188568d3b\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"37cd3dbb-c2f1-41c1-84cb-bbfa0697a090\",\"publicEventType\":\"Microsoft.Communication.DialogCompleted\"},\"time\":\"2024-01-09T21:04:05.4063016\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-5eaa-4811-a663-151188568d3b\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest new file mode 100644 index 000000000000..c71c35954ffa Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest.json deleted file mode 100644 index 25635242035c..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-1a5c-4011-9f13-1136d4eab647\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-1a5c-4011-9f13-1136d4eab647\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-1a5c-4011-9f13-1136d4eab647\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"ef86d874-f004-4a85-b378-547c21da1a48\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-01-09T21:04:31.3360183\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-1a5c-4011-9f13-1136d4eab647\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/401f0b00-8e56-4a64-8779-9e5b3b511867\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/401f0b00-8e56-4a64-8779-9e5b3b511867\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"401f0b00-8e56-4a64-8779-9e5b3b511867\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"f241ddd2-ebad-44df-b8d3-83ecc7c481d3\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-01-09T21:04:31.6328875\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/401f0b00-8e56-4a64-8779-9e5b3b511867\"}]","{\"to\":{\"kind\":\"phoneNumber\",\"rawId\":\"REDACTED\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"from\":{\"kind\":\"phoneNumber\",\"rawId\":\"REDACTED\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"547dded6-2b88-4e4e-9851-e8a8c66d6eab\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-cdb8-40d4-8a81-8a96dba00df7\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-cdb8-40d4-8a81-8a96dba00df7\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-cdb8-40d4-8a81-8a96dba00df7\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"547dded6-2b88-4e4e-9851-e8a8c66d6eab\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:34:52.2808004\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-cdb8-40d4-8a81-8a96dba00df7\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-cdb8-40d4-8a81-8a96dba00df7\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-cdb8-40d4-8a81-8a96dba00df7\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"phoneNumber\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-cdb8-40d4-8a81-8a96dba00df7\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"547dded6-2b88-4e4e-9851-e8a8c66d6eab\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:34:52.3589492\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-cdb8-40d4-8a81-8a96dba00df7\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"f814f185-719e-4009-b01f-e1a6c39bf31f\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:34:52.5777085\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"phoneNumber\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"f814f185-719e-4009-b01f-e1a6c39bf31f\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:34:52.5777085\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"type\":\"Microsoft.Communication.SendDtmfTonesCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"f814f185-719e-4009-b01f-e1a6c39bf31f\",\"publicEventType\":\"Microsoft.Communication.SendDtmfTonesCompleted\"},\"time\":\"2024-01-09T21:34:56.9377202\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"type\":\"Microsoft.Communication.ContinuousDtmfRecognitionStopped\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-4eec-4fa4-9d1f-25f1a6321295\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"f814f185-719e-4009-b01f-e1a6c39bf31f\",\"publicEventType\":\"Microsoft.Communication.ContinuousDtmfRecognitionStopped\"},\"time\":\"2024-01-09T21:34:57.48967\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-4eec-4fa4-9d1f-25f1a6321295\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest new file mode 100644 index 000000000000..52f907059656 Binary files /dev/null and b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest differ diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest.json deleted file mode 100644 index 53d7137743f9..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"3c77b30e-2659-4ac7-9823-bf5ba3fd69cb\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-11a8-4208-9b2f-0e0ca42efe11\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-11a8-4208-9b2f-0e0ca42efe11\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-11a8-4208-9b2f-0e0ca42efe11\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"3c77b30e-2659-4ac7-9823-bf5ba3fd69cb\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:35:03.7815358\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-11a8-4208-9b2f-0e0ca42efe11\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-11a8-4208-9b2f-0e0ca42efe11\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-11a8-4208-9b2f-0e0ca42efe11\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-11a8-4208-9b2f-0e0ca42efe11\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"3c77b30e-2659-4ac7-9823-bf5ba3fd69cb\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:35:03.7972242\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-11a8-4208-9b2f-0e0ca42efe11\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-988b-46ca-a631-d6eda1f73091\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"3c77b30e-2659-4ac7-9823-bf5ba3fd69cb\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-01-09T21:35:03.84405\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-988b-46ca-a631-d6eda1f73091\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"3c77b30e-2659-4ac7-9823-bf5ba3fd69cb\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-01-09T21:35:03.9222414\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\",\"type\":\"Microsoft.Communication.PlayCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\",\"resultInformation\":{\"code\":200,\"subCode\":0,\"message\":\"Action completed successfully.\"},\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"421f6900-988b-46ca-a631-d6eda1f73091\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"3c77b30e-2659-4ac7-9823-bf5ba3fd69cb\",\"publicEventType\":\"Microsoft.Communication.PlayCompleted\"},\"time\":\"2024-01-09T21:35:10.1313061\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/421f6900-988b-46ca-a631-d6eda1f73091\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/swagger/README.md b/sdk/communication/azure-communication-callautomation/swagger/README.md index ef67ad58215d..5f46287120ee 100644 --- a/sdk/communication/azure-communication-callautomation/swagger/README.md +++ b/sdk/communication/azure-communication-callautomation/swagger/README.md @@ -21,14 +21,14 @@ There is one swagger for Calling management APIs. ```ps cd -autorest README.md --java --v4 --use=@autorest/java@4.0.20 --use=@autorest/modelerfour@4.15.442 +autorest README.md --java --v4 --use=@autorest/java@4.0.20 --use=@autorest/modelerfour@4.26.0 ``` ### Code generation settings ``` yaml -tag: package-2023-10-03-preview +tag: package-2023-10-15 require: - - https://github.com/Azure/azure-rest-api-specs/blob/77d25dd8426c4ba1619d15582a8c9d9b2f6890e8/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/Azure/azure-rest-api-specs/blob/1fe6a37e8e0dfb02a2184cf220d75ba9fe238108/specification/communication/data-plane/CallAutomation/readme.md java: true output-folder: ../ license-header: MICROSOFT_MIT_SMALL @@ -133,9 +133,6 @@ directive: - rename-model: from: SendDtmfTonesRequest to: SendDtmfTonesRequestInternal -- rename-model: - from: SendDtmfTonesResult - to: SendDtmfTonesResultInternal - rename-model: from: ChannelAffinity to: ChannelAffinityInternal @@ -166,18 +163,6 @@ directive: - rename-model: from: MuteParticipantsResult to: MuteParticipantsResultInternal -- rename-model: - from: UnmuteParticipantsRequest - to: UnmuteParticipantsRequestInternal -- rename-model: - from: UnmuteParticipantsResponse - to: UnmuteParticipantsResponseInternal -- rename-model: - from: StartHoldMusicRequest - to: StartHoldMusicRequestInternal -- rename-model: - from: StopHoldMusicRequest - to: StopHoldMusicRequestInternal - rename-model: from: CollectTonesResult to: CollectTonesResultInternal @@ -197,20 +182,11 @@ directive: from: ContinuousDtmfRecognitionRequest to: ContinuousDtmfRecognitionRequestInternal - rename-model: - from: TranscriptionConfiguration - to: TranscriptionConfigurationInternal -- rename-model: - from: StartTranscriptionRequest - to: StartTranscriptionRequestInternal -- rename-model: - from: StopTranscriptionRequest - to: StopTranscriptionRequestInternal -- rename-model: - from: UpdateTranscriptionRequest - to: UpdateTranscriptionRequestInternal + from: SendDtmfTonesResult + to: SendDtmfTonesResultInternal - rename-model: - from: StartDialogRequest - to: StartDialogRequestInternal + from: SendDtmfTonesRequest + to: SendDtmfTonesRequestInternal # Remove models - remove-model: AddParticipantFailed @@ -238,24 +214,6 @@ directive: - remove-model: SpeechResult - remove-model: CancelAddParticipantSucceeded - remove-model: CancelAddParticipantFailed -- remove-model: DialogCompleted -- remove-model: DialogConsent -- remove-model: DialogFailed -- remove-model: DialogHangup -- remove-model: DialogLanguageChange -- remove-model: DialogSensitivityUpdate -- remove-model: DialogStarted -- remove-model: DialogTransfer -- remove-model: DialogFailed -- remove-model: TeamsComplianceRecordingStateChanged -- remove-model: TeamsRecordingStateChanged -- remove-model: TranscriptionStarted -- remove-model: TranscriptionResumed -- remove-model: TranscriptionStopped -- remove-model: TranscriptionUpdated -- remove-model: TranscriptionFailed - - ``` ### Rename RecordingChannelType to RecordingChannelInternal @@ -376,7 +334,7 @@ directive: $.name = "MediaStreamingContentTypeInternal"; ``` -### Rename MediaStreamingTransportType to MediaStreamingTransportTypeInternal +### Rename MediaStreamingTransportType to MediaStreamingTransportType ``` yaml directive: - from: swagger-document @@ -385,15 +343,6 @@ directive: $.name = "MediaStreamingTransportTypeInternal"; ``` -### Rename TranscriptionTransportType to TranscriptionTransportTypeInternal -``` yaml -directive: -- from: swagger-document - where: $.definitions.TranscriptionTransportType["x-ms-enum"] - transform: > - $.name = "TranscriptionTransportTypeInternal"; -``` - ### Rename RecognitionType to RecognitionTypeInternal ``` yaml directive: diff --git a/sdk/communication/azure-communication-callautomation/tests.yml b/sdk/communication/azure-communication-callautomation/tests.yml index 6faa4c10981e..02949212d53a 100644 --- a/sdk/communication/azure-communication-callautomation/tests.yml +++ b/sdk/communication/azure-communication-callautomation/tests.yml @@ -1,7 +1,7 @@ trigger: none -extends: - template: /sdk/communication/communication-tests-template.yml +stages: +- template: /sdk/communication/communication-tests-template.yml parameters: PackageName: azure-communication-callautomation SafeName: azurecommunicationcallautomation diff --git a/sdk/communication/azure-communication-common-perf/pom.xml b/sdk/communication/azure-communication-common-perf/pom.xml index 5c3f0c3090df..7b0d4628564f 100644 --- a/sdk/communication/azure-communication-common-perf/pom.xml +++ b/sdk/communication/azure-communication-common-perf/pom.xml @@ -28,7 +28,7 @@ com.azure azure-communication-common - 1.4.0-beta.1 + 1.3.2 com.azure diff --git a/sdk/communication/azure-communication-common/CHANGELOG.md b/sdk/communication/azure-communication-common/CHANGELOG.md index 5ccf56f90dd5..fa6882a2176a 100644 --- a/sdk/communication/azure-communication-common/CHANGELOG.md +++ b/sdk/communication/azure-communication-common/CHANGELOG.md @@ -1,14 +1,13 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.3.2 (2024-04-23) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. +- Upgraded `azure-core-http-netty` from `1.14.1` to version `1.14.2`. ## 1.3.1 (2024-03-20) diff --git a/sdk/communication/azure-communication-common/README.md b/sdk/communication/azure-communication-common/README.md index e7381a790072..c095443a71d8 100644 --- a/sdk/communication/azure-communication-common/README.md +++ b/sdk/communication/azure-communication-common/README.md @@ -51,7 +51,7 @@ add the direct dependency to your project as follows. com.azure azure-communication-common - 1.3.0 + 1.3.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/communication/azure-communication-common/pom.xml b/sdk/communication/azure-communication-common/pom.xml index 2b5cd6525135..6999200b6925 100644 --- a/sdk/communication/azure-communication-common/pom.xml +++ b/sdk/communication/azure-communication-common/pom.xml @@ -13,7 +13,7 @@ com.azure azure-communication-common jar - 1.4.0-beta.1 + 1.3.2 Microsoft Azure common library for communication service client diff --git a/sdk/communication/azure-communication-email/CHANGELOG.md b/sdk/communication/azure-communication-email/CHANGELOG.md index 97ce01341f05..62926021c248 100644 --- a/sdk/communication/azure-communication-email/CHANGELOG.md +++ b/sdk/communication/azure-communication-email/CHANGELOG.md @@ -1,15 +1,14 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.12 (2024-04-23) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -- An `EmailMessage` with null recipient addresses can no longer be sent. -### Other Changes +- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. +- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. +- Upgraded `azure-core-http-netty` from `1.14.1` to version `1.14.2`. ## 1.0.11 (2024-03-20) @@ -18,9 +17,8 @@ #### Dependency Updates -- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. +- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. ## 1.0.10 (2024-02-20) @@ -44,6 +42,7 @@ - Upgraded `azure-communication-common` from `1.2.14` to version `1.2.15`. - Upgraded `azure-core` from `1.45.0` to version `1.45.1`. + ## 1.0.8 (2023-11-20) ### Other Changes @@ -54,6 +53,7 @@ - Upgraded `azure-core-http-netty` from `1.13.9` to version `1.13.10`. - Upgraded `azure-communication-common` from `1.2.13` to version `1.2.14`. + ## 1.0.7 (2023-10-20) ### Other Changes @@ -64,6 +64,7 @@ - Upgraded `azure-core-http-netty` from `1.13.7` to version `1.13.9`. - Upgraded `azure-communication-common` from `1.2.12` to version `1.2.13`. + ## 1.0.6 (2023-09-22) ### Other Changes @@ -74,6 +75,7 @@ - Upgraded `azure-core-http-netty` from `1.13.6` to version `1.13.7`. - Upgraded `azure-communication-common` from `1.2.11` to version `1.2.12`. + ## 1.0.5 (2023-08-18) ### Other Changes @@ -82,6 +84,8 @@ - Upgraded `azure-core-http-netty` from `1.13.5` to version `1.13.6`. - Upgraded `azure-core` from `1.41.0` to version `1.42.0`. +- Upgraded `azure-communication-common` from `1.2.10` to version `1.2.11`. + ## 1.0.4 (2023-07-25) @@ -104,6 +108,7 @@ - Upgraded `azure-core-http-netty` from `1.13.3` to version `1.13.4`. - Upgraded `azure-core` from `1.39.0` to version `1.40.0`. + ## 1.0.2 (2023-05-23) ### Other Changes @@ -114,6 +119,7 @@ - Upgraded `azure-communication-common` from `1.2.6` to version `1.2.8`. - Upgraded `azure-core` from `1.38.0` to version `1.39.0`. + ## 1.0.1 (2023-04-25) ### Other Changes diff --git a/sdk/communication/azure-communication-email/README.md b/sdk/communication/azure-communication-email/README.md index a4edb96f1cd8..a117de97888a 100644 --- a/sdk/communication/azure-communication-email/README.md +++ b/sdk/communication/azure-communication-email/README.md @@ -54,7 +54,7 @@ add the direct dependency to your project as follows. com.azure azure-communication-email - 1.0.4 + 1.0.12 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/communication/azure-communication-email/assets.json b/sdk/communication/azure-communication-email/assets.json deleted file mode 100644 index 13cdcb26bb67..000000000000 --- a/sdk/communication/azure-communication-email/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "java", - "TagPrefix": "java/communication/azure-communication-email", - "Tag": "java/communication/azure-communication-email_e70471d340" -} diff --git a/sdk/communication/azure-communication-email/pom.xml b/sdk/communication/azure-communication-email/pom.xml index 7cbdb97a5a6f..a23a2235cec8 100644 --- a/sdk/communication/azure-communication-email/pom.xml +++ b/sdk/communication/azure-communication-email/pom.xml @@ -12,7 +12,7 @@ com.azure azure-communication-email - 1.1.0-beta.1 + 1.0.12 jar Microsoft Azure Communications SDK for Email @@ -46,9 +46,6 @@ 0.70 0.45 true - - --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED - @@ -99,12 +96,6 @@ 1.11.20 test - - com.azure - azure-core-http-vertx - 1.0.0-beta.17 - test - @@ -116,10 +107,10 @@ **/src/samples/java/**/*.java ${project.basedir}/src/samples/java - ${project.basedir}/README.md **/src/main/java/**/*.java ${project.basedir}/src/main/java true + ${project.basedir}/README.md true 120 false @@ -143,21 +134,4 @@ - - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.0.0-beta.12 - test - - - - diff --git a/sdk/communication/azure-communication-email/src/main/java/com/azure/communication/email/EmailAsyncClient.java b/sdk/communication/azure-communication-email/src/main/java/com/azure/communication/email/EmailAsyncClient.java index 2df9abaf69b3..c748d4b60f30 100644 --- a/sdk/communication/azure-communication-email/src/main/java/com/azure/communication/email/EmailAsyncClient.java +++ b/sdk/communication/azure-communication-email/src/main/java/com/azure/communication/email/EmailAsyncClient.java @@ -8,7 +8,6 @@ import com.azure.communication.email.implementation.EmailsImpl; import com.azure.communication.email.implementation.models.EmailContent; import com.azure.communication.email.implementation.models.EmailRecipients; -import com.azure.communication.email.models.EmailAddress; import com.azure.communication.email.models.EmailAttachment; import com.azure.communication.email.models.EmailMessage; import com.azure.communication.email.models.EmailSendResult; @@ -75,10 +74,6 @@ PollerFlux beginSend(EmailMessage message, Con ); } - verifyRecipientEmailAddressesNotNull(message.getToRecipients()); - verifyRecipientEmailAddressesNotNull(message.getCcRecipients()); - verifyRecipientEmailAddressesNotNull(message.getBccRecipients()); - EmailContent content = new EmailContent(message.getSubject()) .setHtml(message.getBodyHtml()) .setPlainText(message.getBodyPlainText()); @@ -122,13 +117,4 @@ PollerFlux beginSend(EmailMessage message, Con TypeReference.createInstance(EmailSendResult.class), TypeReference.createInstance(EmailSendResult.class)); } - - void verifyRecipientEmailAddressesNotNull(List recipients) { - if (recipients != null) { - for (EmailAddress recipient : recipients) { - Objects.requireNonNull(recipient, "recipient 'EmailAddress' cannot be null."); - Objects.requireNonNull(recipient.getAddress(), "EmailAddress 'address' cannot be null."); - } - } - } } diff --git a/sdk/communication/azure-communication-email/src/test/java/com/azure/communication/email/EmailTestBase.java b/sdk/communication/azure-communication-email/src/test/java/com/azure/communication/email/EmailTestBase.java index da8975f5dd59..3d1a597b401f 100644 --- a/sdk/communication/azure-communication-email/src/test/java/com/azure/communication/email/EmailTestBase.java +++ b/sdk/communication/azure-communication-email/src/test/java/com/azure/communication/email/EmailTestBase.java @@ -5,19 +5,20 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.test.TestBase; import com.azure.core.test.TestMode; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.models.CustomMatcher; import com.azure.core.util.Configuration; import org.junit.jupiter.params.provider.Arguments; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; +import java.util.Locale; import java.util.stream.Stream; -public class EmailTestBase extends TestProxyTestBase { +public class EmailTestBase extends TestBase { + protected static final TestMode TEST_MODE = initializeTestMode(); + protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_CONNECTION_STRING_EMAIL", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); @@ -43,11 +44,7 @@ private EmailClientBuilder getEmailClientBuilder(HttpClient httpClient) { EmailClientBuilder emailClientBuilder = new EmailClientBuilder() .connectionString(CONNECTION_STRING) .httpClient(getHttpClientOrUsePlayback(httpClient)); - if (interceptorManager.isPlaybackMode()) { - interceptorManager.addMatchers(Arrays.asList(new CustomMatcher() - .setHeadersKeyOnlyMatch(Arrays.asList("x-ms-content-sha256", "x-ms-hmac-string-to-sign-base64")) - .setComparingBodies(false))); - } + if (getTestMode() == TestMode.RECORD) { HttpPipelinePolicy recordPolicy = interceptorManager.getRecordPolicy(); emailClientBuilder.addPolicy(recordPolicy); @@ -56,6 +53,20 @@ private EmailClientBuilder getEmailClientBuilder(HttpClient httpClient) { return emailClientBuilder; } + private static TestMode initializeTestMode() { + String azureTestMode = Configuration.getGlobalConfiguration().get("AZURE_TEST_MODE"); + if (azureTestMode != null) { + System.out.println("azureTestMode: " + azureTestMode); + try { + return TestMode.valueOf(azureTestMode.toUpperCase(Locale.US)); + } catch (IllegalArgumentException var3) { + return TestMode.PLAYBACK; + } + } else { + return TestMode.PLAYBACK; + } + } + static Stream getTestParameters() { // When this issues is closed, the newer version of junit will have better support for cartesian product of // arguments - https://github.com/junit-team/junit5/issues/1427 diff --git a/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailToMultipleRecipients[1].json b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailToMultipleRecipients[1].json new file mode 100644 index 000000000000..4efe4339d65f --- /dev/null +++ b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailToMultipleRecipients[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.int.communication.azure.net/emails:send?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "19619d69-6c20-4571-8e87-2986ef0a9053", + "Content-Type" : "application/json" + }, + "Response" : { + "x-azure-ref" : "20230315T225423Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000uqar", + "X-Cache" : "CONFIG_NOCACHE", + "Retry-After" : "0", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "d2a5487b-c4c6-4040-ac65-5e53785e04a4", + "Content-Length" : "77", + "StatusCode" : "202", + "Operation-Location" : "https://acs-email-functional-test-acs-resource.int.communication.azure.net/emails/operations/ddd5b3fe-d0da-49be-b02e-42ea63074c49?api-version=2023-03-31", + "Body" : "{\"id\":\"ddd5b3fe-d0da-49be-b02e-42ea63074c49\",\"status\":\"Running\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:54:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/emails/operations/ddd5b3fe-d0da-49be-b02e-42ea63074c49?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "e6cdc4b4-eb02-46a9-aafa-7d4bdd11b03f" + }, + "Response" : { + "Accept-Ranges" : "bytes", + "x-azure-ref" : "20230315T225454Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000uzph", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "54bdd37c-d8e5-44ce-a54b-28187f92fbdc", + "retry-after" : "0", + "Content-Length" : "79", + "StatusCode" : "200", + "Body" : "{\"id\":\"ddd5b3fe-d0da-49be-b02e-42ea63074c49\",\"status\":\"Succeeded\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:54:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailToSingleRecipient[1].json b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailToSingleRecipient[1].json new file mode 100644 index 000000000000..482f88d76661 --- /dev/null +++ b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailToSingleRecipient[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.int.communication.azure.net/emails:send?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "ce857da4-041e-489e-9684-f311aa8fbf1a", + "Content-Type" : "application/json" + }, + "Response" : { + "x-azure-ref" : "20230315T225524Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000vak2", + "X-Cache" : "CONFIG_NOCACHE", + "Retry-After" : "0", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "94859753-7efe-4535-8cf2-4eefc37a2be4", + "Content-Length" : "77", + "StatusCode" : "202", + "Operation-Location" : "https://acs-email-functional-test-acs-resource.int.communication.azure.net/emails/operations/5af42966-e8ea-4bcf-8bcd-3f948f7983f0?api-version=2023-03-31", + "Body" : "{\"id\":\"5af42966-e8ea-4bcf-8bcd-3f948f7983f0\",\"status\":\"Running\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:55:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/emails/operations/5af42966-e8ea-4bcf-8bcd-3f948f7983f0?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "9874f9f8-63fa-4ca3-b7c6-0ec201632c68" + }, + "Response" : { + "Accept-Ranges" : "bytes", + "x-azure-ref" : "20230315T225554Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000vnm0", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "d5e9770f-8138-4abf-94f4-3db3a83e1e65", + "retry-after" : "0", + "Content-Length" : "79", + "StatusCode" : "200", + "Body" : "{\"id\":\"5af42966-e8ea-4bcf-8bcd-3f948f7983f0\",\"status\":\"Succeeded\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:55:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailWithAttachment[1].json b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailWithAttachment[1].json new file mode 100644 index 000000000000..4245ea3537ca --- /dev/null +++ b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailAsyncClientTests.sendEmailWithAttachment[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.int.communication.azure.net/emails:send?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "89ea7138-c0a8-4e31-b930-7a961210cedc", + "Content-Type" : "application/json" + }, + "Response" : { + "x-azure-ref" : "20230315T225454Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000uzqx", + "X-Cache" : "CONFIG_NOCACHE", + "Retry-After" : "0", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "0b2bc103-d069-4232-8972-62b10e16d051", + "Content-Length" : "77", + "StatusCode" : "202", + "Operation-Location" : "https://acs-email-functional-test-acs-resource.int.communication.azure.net/emails/operations/c83cde2a-2d92-4ef1-9f32-b268f4ead6b5?api-version=2023-03-31", + "Body" : "{\"id\":\"c83cde2a-2d92-4ef1-9f32-b268f4ead6b5\",\"status\":\"Running\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:54:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/emails/operations/c83cde2a-2d92-4ef1-9f32-b268f4ead6b5?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "9984ed87-125f-4abc-b580-ad37a989b136" + }, + "Response" : { + "Accept-Ranges" : "bytes", + "x-azure-ref" : "20230315T225524Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000vah2", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "0e5d8799-9d6f-4c9b-ab0e-9388b1de0ee1", + "retry-after" : "0", + "Content-Length" : "79", + "StatusCode" : "200", + "Body" : "{\"id\":\"c83cde2a-2d92-4ef1-9f32-b268f4ead6b5\",\"status\":\"Succeeded\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:55:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailToMultipleRecipients[1].json b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailToMultipleRecipients[1].json new file mode 100644 index 000000000000..7b67b70c7e90 --- /dev/null +++ b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailToMultipleRecipients[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.int.communication.azure.net/emails:send?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "2220c568-3e06-451c-a401-240d393747dc", + "Content-Type" : "application/json" + }, + "Response" : { + "x-azure-ref" : "20230315T225554Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000vnn2", + "X-Cache" : "CONFIG_NOCACHE", + "Retry-After" : "0", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "2e78bf17-3a53-40af-aee2-77c2de156a3b", + "Content-Length" : "77", + "StatusCode" : "202", + "Operation-Location" : "https://acs-email-functional-test-acs-resource.int.communication.azure.net/emails/operations/004b2be9-0a07-49d5-a912-08a7d06f934c?api-version=2023-03-31", + "Body" : "{\"id\":\"004b2be9-0a07-49d5-a912-08a7d06f934c\",\"status\":\"Running\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:55:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/emails/operations/004b2be9-0a07-49d5-a912-08a7d06f934c?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "259e868b-c19f-4127-98b3-b26473337841" + }, + "Response" : { + "Accept-Ranges" : "bytes", + "x-azure-ref" : "20230315T225624Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000vxdg", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "666761a4-1df1-4883-93c4-6a320b147bdc", + "retry-after" : "0", + "Content-Length" : "79", + "StatusCode" : "200", + "Body" : "{\"id\":\"004b2be9-0a07-49d5-a912-08a7d06f934c\",\"status\":\"Succeeded\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:56:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailToSingleRecipient[1].json b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailToSingleRecipient[1].json new file mode 100644 index 000000000000..02af93244f2d --- /dev/null +++ b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailToSingleRecipient[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.int.communication.azure.net/emails:send?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "0e86ae48-27fb-45b9-b794-479bdda82470", + "Content-Type" : "application/json" + }, + "Response" : { + "x-azure-ref" : "20230315T225654Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000w6gx", + "X-Cache" : "CONFIG_NOCACHE", + "Retry-After" : "0", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "64f3463e-edad-417d-b77b-28f115dd5ee9", + "Content-Length" : "77", + "StatusCode" : "202", + "Operation-Location" : "https://acs-email-functional-test-acs-resource.int.communication.azure.net/emails/operations/7d179e81-ea62-485f-9324-b3d025aceee3?api-version=2023-03-31", + "Body" : "{\"id\":\"7d179e81-ea62-485f-9324-b3d025aceee3\",\"status\":\"Running\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:56:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/emails/operations/7d179e81-ea62-485f-9324-b3d025aceee3?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "ab1096ac-6869-40b7-a551-5c8faed449dd" + }, + "Response" : { + "Accept-Ranges" : "bytes", + "x-azure-ref" : "20230315T225725Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000wdxd", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "ce98b8a5-fd0b-4efe-94f4-419e80fbc6c2", + "retry-after" : "0", + "Content-Length" : "79", + "StatusCode" : "200", + "Body" : "{\"id\":\"7d179e81-ea62-485f-9324-b3d025aceee3\",\"status\":\"Succeeded\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:57:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailWithAttachment[1].json b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailWithAttachment[1].json new file mode 100644 index 000000000000..bcba6ff4b29d --- /dev/null +++ b/sdk/communication/azure-communication-email/src/test/resources/session-records/EmailClientTests.sendEmailWithAttachment[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.int.communication.azure.net/emails:send?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "52f147e5-0c4d-4260-9700-ac8f1ad0fd03", + "Content-Type" : "application/json" + }, + "Response" : { + "x-azure-ref" : "20230315T225624Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000vxem", + "X-Cache" : "CONFIG_NOCACHE", + "Retry-After" : "0", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "ce58630d-cfd1-434c-bf74-546bf850aa8e", + "Content-Length" : "77", + "StatusCode" : "202", + "Operation-Location" : "https://acs-email-functional-test-acs-resource.int.communication.azure.net/emails/operations/9eb102cb-7e20-40d5-b1b1-72c7a6cad645?api-version=2023-03-31", + "Body" : "{\"id\":\"9eb102cb-7e20-40d5-b1b1-72c7a6cad645\",\"status\":\"Running\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:56:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/emails/operations/9eb102cb-7e20-40d5-b1b1-72c7a6cad645?api-version=2023-03-31", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-email/1.0.0 (11.0.15; Windows 11; 10.0)", + "x-ms-client-request-id" : "e1bb6bdf-0a58-4c56-9ec8-736241bd2465" + }, + "Response" : { + "Accept-Ranges" : "bytes", + "x-azure-ref" : "20230315T225654Z-ch23ckymu96u79g7vbqgy06mh400000000z000000000w6gc", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-10-01-preview, 2023-01-15-preview, 2023-03-31", + "Connection" : "keep-alive", + "mise-correlation-id" : "453a4677-f812-4e77-a5b8-c3254cb79cca", + "retry-after" : "0", + "Content-Length" : "79", + "StatusCode" : "200", + "Body" : "{\"id\":\"9eb102cb-7e20-40d5-b1b1-72c7a6cad645\",\"status\":\"Succeeded\",\"error\":null}", + "Date" : "Wed, 15 Mar 2023 22:56:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-email/tests.yml b/sdk/communication/azure-communication-email/tests.yml index 05fc0c00a69e..02b3f882b2eb 100644 --- a/sdk/communication/azure-communication-email/tests.yml +++ b/sdk/communication/azure-communication-email/tests.yml @@ -6,28 +6,28 @@ parameters: type: boolean default: false -extends: - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-email - SafeName: azurecommunicationemail - ${{ if eq(parameters.runOnlyPPE, true) }}: - Clouds: 'PPE' - ${{ if eq(parameters.runOnlyPPE, false) }}: - Clouds: 'Public,PPE,Int' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) - PPE: - SubscriptionConfigurations: - - $(sub-config-communication-ppe-test-resources-common) - - $(sub-config-communication-ppe-test-resources-java) - TestResourceDirectories: - - communication/azure-communication-email/ +stages: + - template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-email + SafeName: azurecommunicationemail + ${{ if eq(parameters.runOnlyPPE, true) }}: + Clouds: 'PPE' + ${{ if eq(parameters.runOnlyPPE, false) }}: + Clouds: 'Public,PPE,Int' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-java) + Int: + SubscriptionConfigurations: + - $(sub-config-communication-int-test-resources-common) + - $(sub-config-communication-int-test-resources-java) + PPE: + SubscriptionConfigurations: + - $(sub-config-communication-ppe-test-resources-common) + - $(sub-config-communication-ppe-test-resources-java) + TestResourceDirectories: + - communication/azure-communication-email/ diff --git a/sdk/communication/azure-communication-identity/CHANGELOG.md b/sdk/communication/azure-communication-identity/CHANGELOG.md index d09421af6d31..f845f25b23a2 100644 --- a/sdk/communication/azure-communication-identity/CHANGELOG.md +++ b/sdk/communication/azure-communication-identity/CHANGELOG.md @@ -1,14 +1,13 @@ # Release History -## 1.6.0-beta.1 (Unreleased) +## 1.5.4 (2024-04-23) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. +- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. ## 1.5.3 (2024-03-20) @@ -17,9 +16,7 @@ #### Dependency Updates -- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. ## 1.5.2 (2024-02-20) diff --git a/sdk/communication/azure-communication-identity/README.md b/sdk/communication/azure-communication-identity/README.md index 2085ac3188eb..c7b84fe33ba9 100644 --- a/sdk/communication/azure-communication-identity/README.md +++ b/sdk/communication/azure-communication-identity/README.md @@ -55,7 +55,7 @@ add the direct dependency to your project as follows. com.azure azure-communication-identity - 1.5.0 + 1.5.4 ``` diff --git a/sdk/communication/azure-communication-identity/pom.xml b/sdk/communication/azure-communication-identity/pom.xml index 1f67ddbd39f8..b8010f62888c 100644 --- a/sdk/communication/azure-communication-identity/pom.xml +++ b/sdk/communication/azure-communication-identity/pom.xml @@ -16,7 +16,7 @@ com.azure azure-communication-identity jar - 1.6.0-beta.1 + 1.5.4 Microsoft Azure identity client library for communication @@ -65,6 +65,11 @@ azure-core 1.48.0 + + com.azure + azure-core-http-netty + 1.14.2 + com.azure azure-communication-common @@ -107,15 +112,15 @@ test - com.azure - azure-core-http-okhttp - 1.11.20 + org.mockito + mockito-core + 4.11.0 test com.azure - azure-core-http-vertx - 1.0.0-beta.17 + azure-core-http-okhttp + 1.11.20 test @@ -124,12 +129,6 @@ 1.12.0 test - - com.azure - azure-core-http-netty - 1.14.2 - compile - @@ -164,21 +163,4 @@ - - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.0.0-beta.12 - test - - - - diff --git a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/implementation/IdentityErrorConverterUnitTests.java b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/implementation/IdentityErrorConverterUnitTests.java index ae7eda952e1b..16987116b659 100644 --- a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/implementation/IdentityErrorConverterUnitTests.java +++ b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/implementation/IdentityErrorConverterUnitTests.java @@ -9,18 +9,13 @@ import com.azure.communication.identity.models.IdentityError; import com.azure.communication.identity.models.IdentityErrorResponseException; import com.azure.core.http.HttpResponse; -import com.azure.core.test.http.MockHttpResponse; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.mockito.Mockito; +import static org.junit.jupiter.api.Assertions.*; public class IdentityErrorConverterUnitTests { @@ -29,7 +24,7 @@ public class IdentityErrorConverterUnitTests { @BeforeEach public void setUp() { - httpResponse = new MockHttpResponse(null, 0); + httpResponse = Mockito.mock(HttpResponse.class); } @AfterEach diff --git a/sdk/communication/azure-communication-identity/tests.yml b/sdk/communication/azure-communication-identity/tests.yml index 958d8192c86b..2d5244b67d96 100644 --- a/sdk/communication/azure-communication-identity/tests.yml +++ b/sdk/communication/azure-communication-identity/tests.yml @@ -1,22 +1,22 @@ trigger: none -extends: - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-identity - SafeName: azurecommunicationidentity - Clouds: 'Public,PPE,Int' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) - PPE: - SubscriptionConfigurations: - - $(sub-config-communication-ppe-test-resources-common) - - $(sub-config-communication-ppe-test-resources-java) +stages: + - template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-identity + SafeName: azurecommunicationidentity + Clouds: 'Public,PPE,Int' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-java) + Int: + SubscriptionConfigurations: + - $(sub-config-communication-int-test-resources-common) + - $(sub-config-communication-int-test-resources-java) + PPE: + SubscriptionConfigurations: + - $(sub-config-communication-ppe-test-resources-common) + - $(sub-config-communication-ppe-test-resources-java) diff --git a/sdk/communication/azure-communication-jobrouter/CHANGELOG.md b/sdk/communication/azure-communication-jobrouter/CHANGELOG.md index 46263baf4948..429b03ea60fc 100644 --- a/sdk/communication/azure-communication-jobrouter/CHANGELOG.md +++ b/sdk/communication/azure-communication-jobrouter/CHANGELOG.md @@ -1,52 +1,33 @@ # Release History -## 2.0.0-beta.1 (Unreleased) - -### Features Added - -- Added `MaxConcurrentOffers` to RouterWorker and CreateWorkerOptions -- Added createJobWithClassificationPolicy and createJobWithClassificationPolicyWithResponse to JobRouterClient and JobRouterAsyncClient -- Added updateXX methods that accept and return XX in JobRouterClient, JobRouterAdministrationClient, JobRouterAsyncClient and JobRouterAdministrationAsyncClient - -### Breaking Changes - -- Added value to RouterWorkerSelector/RouterQueueSelector constructor, remove setter -- Change return type of createJobWithResponse to RouterJob instead of BinaryData in JobRouterClient and JobRouterAsyncClient - -### Bugs Fixed - -- Fix Jackson annotations for all models -- JobRouterClient and JobRouterAdminClient no longer throws 401 errors when HmacAuthenticationPolicy is not provided +## 1.1.3 (2024-04-23) ### Other Changes #### Dependency Updates -- Upgraded `azure-core-http-netty` from `1.14.1` to version `1.14.2`. +- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. +- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. -## 1.1.2 (2024-03-28) +## 1.1.2 (2024-03-20) ### Other Changes #### Dependency Updates -- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. - -### Bugs Fixed -## 1.1.1 (2024-02-13) +## 1.1.1 (2024-02-22) ### Other Changes #### Dependency Updates -- Upgraded `azure-communication-common` to `1.3.0` -- Upgraded `azure-core-http-netty` from `1.13.11` to version `1.14.0`. - Upgraded `azure-core` from `1.45.1` to version `1.46.0`. +- Upgraded `azure-communication-common` from `1.2.15` to version `1.3.0`. + ## 1.1.0 (2024-01-04) diff --git a/sdk/communication/azure-communication-jobrouter/README.md b/sdk/communication/azure-communication-jobrouter/README.md index 6b6d1fd6ff01..68b0bc0b9ad0 100644 --- a/sdk/communication/azure-communication-jobrouter/README.md +++ b/sdk/communication/azure-communication-jobrouter/README.md @@ -51,7 +51,7 @@ add the direct dependency to your project as follows. com.azure azure-communication-jobrouter - 2.0.0 + 1.1.3 ``` @@ -245,7 +245,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [source_code]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/communication/azure-communication-jobrouter/src -[router_concepts]: https://learn.microsoft.com/azure/communication-services/concepts/router/concepts [jdk_link]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable [package]: https://search.maven.org/artifact/com.azure/azure-communication-jobrouter [api_documentation]: https://aka.ms/java-docs diff --git a/sdk/communication/azure-communication-jobrouter/assets.json b/sdk/communication/azure-communication-jobrouter/assets.json index b31c312f7260..6d21299a3bab 100644 --- a/sdk/communication/azure-communication-jobrouter/assets.json +++ b/sdk/communication/azure-communication-jobrouter/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/communication/azure-communication-jobrouter", - "Tag": "java/communication/azure-communication-jobrouter_b970df9fcf" + "Tag": "java/communication/azure-communication-jobrouter_5a7c315465" } diff --git a/sdk/communication/azure-communication-jobrouter/customization/pom.xml b/sdk/communication/azure-communication-jobrouter/customization/pom.xml index 81eac8259ae6..81cf970ae4de 100644 --- a/sdk/communication/azure-communication-jobrouter/customization/pom.xml +++ b/sdk/communication/azure-communication-jobrouter/customization/pom.xml @@ -5,7 +5,7 @@ azure-communication-jobrouter com.azure - 2.0.0-beta.1 + 1.1.3 4.0.0 diff --git a/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java b/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java index f85667b535da..f557782d95e0 100644 --- a/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java +++ b/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java @@ -1,10 +1,11 @@ -import com.azure.autorest.customization.*; +import com.azure.autorest.customization.ClassCustomization; +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.LibraryCustomization; +import com.azure.autorest.customization.PackageCustomization; import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.type.ClassOrInterfaceType; import org.slf4j.Logger; -import java.util.ArrayList; -import java.util.List; /** * This class contains the customization code to customize the AutoRest generated code for App Configuration. @@ -13,123 +14,66 @@ public class JobRouterSdkCustomization extends Customization { @Override public void customize(LibraryCustomization customization, Logger logger) { + logger.info("Customizing the JobRouterAdministrationClientBuilder class"); PackageCustomization packageCustomization = customization.getPackage("com.azure.communication.jobrouter"); ClassCustomization classCustomizationForJobRouterAdministrationClientBuilder = packageCustomization.getClass("JobRouterAdministrationClientBuilder"); - addAuthTraits(classCustomizationForJobRouterAdministrationClientBuilder); - addConnectionStringClientMethod(classCustomizationForJobRouterAdministrationClientBuilder, "JobRouterAdministrationClientBuilder"); - addHttpPipelineAuthPolicyMethod(classCustomizationForJobRouterAdministrationClientBuilder); - updateHttpPipelineMethod(classCustomizationForJobRouterAdministrationClientBuilder); + addConnectionStringTrait(classCustomizationForJobRouterAdministrationClientBuilder); + addKeyCredentialTrait(classCustomizationForJobRouterAdministrationClientBuilder); + addTokenCredentialTrait(classCustomizationForJobRouterAdministrationClientBuilder); + logger.info("Customizing the JobRouterClientBuilder class"); ClassCustomization classCustomizationForJobRouterClientBuilder = packageCustomization.getClass("JobRouterClientBuilder"); - addAuthTraits(classCustomizationForJobRouterClientBuilder); - addConnectionStringClientMethod(classCustomizationForJobRouterClientBuilder, "JobRouterClientBuilder"); - addHttpPipelineAuthPolicyMethod(classCustomizationForJobRouterClientBuilder); - updateHttpPipelineMethod(classCustomizationForJobRouterClientBuilder); + addConnectionStringTrait(classCustomizationForJobRouterClientBuilder); + addKeyCredentialTrait(classCustomizationForJobRouterClientBuilder); + addTokenCredentialTrait(classCustomizationForJobRouterClientBuilder); } - private void addAuthTraits(ClassCustomization classCustomization) { - classCustomization.addImports("com.azure.core.client.traits.TokenCredentialTrait"); - classCustomization.addImports("com.azure.core.client.traits.KeyCredentialTrait"); + private void addConnectionStringTrait(ClassCustomization classCustomization) { + // add ConnectionString imports classCustomization.addImports("com.azure.core.client.traits.ConnectionStringTrait"); - classCustomization.customizeAst(compilationUnit -> { - compilationUnit.getClassByName(classCustomization.getClassName()).ifPresent(builderClass -> { - ClassOrInterfaceDeclaration clientBuilderClass = builderClass.asClassOrInterfaceDeclaration(); - NodeList implementedTypes = clientBuilderClass.getImplementedTypes(); - boolean hasTokenCredentialTrait = implementedTypes.stream() - .anyMatch(implementedType -> implementedType.getNameAsString().equals("TokenCredentialTrait")); - if (!hasTokenCredentialTrait) { - clientBuilderClass - .addImplementedType(String.format("TokenCredentialTrait<%s>", classCustomization.getClassName())); - } - - boolean hasKeyCredentialTrait = implementedTypes.stream() - .anyMatch(implementedType -> implementedType.getNameAsString().equals("KeyCredentialTrait")); - if (!hasKeyCredentialTrait) { - clientBuilderClass - .addImplementedType(String.format("KeyCredentialTrait<%s>", classCustomization.getClassName())); - } - boolean hasConnectionStringTrait = implementedTypes.stream() - .anyMatch(implementedType -> implementedType.getNameAsString().equals("ConnectionStringTrait")); - if (!hasConnectionStringTrait) { - clientBuilderClass - .addImplementedType(String.format("ConnectionStringTrait<%s>", classCustomization.getClassName())); - } - }); + // add ConnectionStringTrait<> as implemented type + classCustomization.customizeAst(compilationUnit -> { + ClassOrInterfaceDeclaration jobRouterAdministrationClientBuilderClass = compilationUnit.getClassByName(classCustomization.getClassName()).get().asClassOrInterfaceDeclaration(); + NodeList implementedTypes = jobRouterAdministrationClientBuilderClass.getImplementedTypes(); + boolean hasConnectionStringTrait = implementedTypes.stream().filter(implementedType -> implementedType.getNameAsString().equals("ConnectionStringTrait")).findFirst().isPresent(); + if (!hasConnectionStringTrait) { + jobRouterAdministrationClientBuilderClass.addImplementedType(String.format("ConnectionStringTrait<%s>", classCustomization.getClassName())); + } }); } - private void addConnectionStringClientMethod(ClassCustomization classCustomization, String methodReturnType) { - classCustomization.addImports("com.azure.core.credential.AzureKeyCredential"); - classCustomization.addMethod( - "public "+methodReturnType+" connectionString(String connectionString) {" + - "CommunicationConnectionString connection = new CommunicationConnectionString(connectionString);"+ - "this.credential(new AzureKeyCredential(connection.getAccessKey()));"+ - "this.endpoint(connection.getEndpoint());"+ - "return this;"+ - "}", - List.of( - "com.azure.communication.common.implementation.CommunicationConnectionString" - )); + private void addKeyCredentialTrait(ClassCustomization classCustomization) { + // add KeyCredential imports + classCustomization.addImports("com.azure.core.client.traits.KeyCredentialTrait"); - classCustomization - .getMethod("connectionString") - .getJavadoc() - .setDescription("Set a connection string for authorization.\n" + - "@param connectionString valid connectionString as a string.\n" + - "@return the updated " + methodReturnType + " object."); + // add KeyCredentialTrait<> as implemented type + classCustomization.customizeAst(compilationUnit -> { + ClassOrInterfaceDeclaration jobRouterAdministrationClientBuilderClass = compilationUnit.getClassByName(classCustomization.getClassName()).get().asClassOrInterfaceDeclaration(); + NodeList implementedTypes = jobRouterAdministrationClientBuilderClass.getImplementedTypes(); + boolean hasKeyCredentialTrait = implementedTypes.stream().filter(implementedType -> implementedType.getNameAsString().equals("KeyCredentialTrait")).findFirst().isPresent(); + if (!hasKeyCredentialTrait) { + jobRouterAdministrationClientBuilderClass.addImplementedType(String.format("KeyCredentialTrait<%s>", classCustomization.getClassName())); + } + }); } - private void addHttpPipelineAuthPolicyMethod(ClassCustomization classCustomization) { - classCustomization.addImports("com.azure.communication.common.implementation.HmacAuthenticationPolicy"); - classCustomization.addMethod( - "private HttpPipelinePolicy createHttpPipelineAuthPolicy() {" + - " if (this.tokenCredential != null) {" + - " return new BearerTokenAuthenticationPolicy(this.tokenCredential, \"https://communication.azure.com/.default\");" + - " } else if (this.keyCredential != null) {" + - " return new HmacAuthenticationPolicy(new AzureKeyCredential(this.keyCredential.getKey()));" + - " } else {" + - " throw LOGGER.logExceptionAsError(" + - " new IllegalStateException(\"Missing credential information while building a client.\"));" + - " }" + - " }"); - } + private void addTokenCredentialTrait(ClassCustomization classCustomization) { + // add TokenCredential imports + classCustomization.addImports("com.azure.core.client.traits.TokenCredentialTrait"); - private void updateHttpPipelineMethod(ClassCustomization classCustomization) { - MethodCustomization methodCustomization = classCustomization.getMethod("createHttpPipeline"); - methodCustomization.replaceBody("Configuration buildConfiguration" + - " = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;" + - " HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions;" + - " ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions;" + - " List policies = new ArrayList<>();" + - " String clientName = PROPERTIES.getOrDefault(SDK_NAME, \"UnknownName\");" + - " String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, \"UnknownVersion\");" + - " String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions);" + - " policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));" + - " policies.add(new RequestIdPolicy());" + - " policies.add(new AddHeadersFromContextPolicy());" + - " HttpHeaders headers = new HttpHeaders();" + - " localClientOptions.getHeaders()" + - " .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue()));" + - " if (headers.getSize() > 0) {" + - " policies.add(new AddHeadersPolicy(headers));" + - " }" + - " this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)" + - " .forEach(p -> policies.add(p));" + - " HttpPolicyProviders.addBeforeRetryPolicies(policies);" + - " policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));" + - " policies.add(new AddDatePolicy());" + - " policies.add(createHttpPipelineAuthPolicy());" + - " this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)" + - " .forEach(p -> policies.add(p));" + - " HttpPolicyProviders.addAfterRetryPolicies(policies);" + - " policies.add(new HttpLoggingPolicy(localHttpLogOptions));" + - " HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))" + - " .httpClient(httpClient).clientOptions(localClientOptions).build();" + - " return httpPipeline;"); + // add TokenCredentialTrait<> as implemented type + classCustomization.customizeAst(compilationUnit -> { + ClassOrInterfaceDeclaration jobRouterAdministrationClientBuilderClass = compilationUnit.getClassByName(classCustomization.getClassName()).get().asClassOrInterfaceDeclaration(); + NodeList implementedTypes = jobRouterAdministrationClientBuilderClass.getImplementedTypes(); + boolean hasTokenCredentialTrait = implementedTypes.stream().filter(implementedType -> implementedType.getNameAsString().equals("TokenCredentialTrait")).findFirst().isPresent(); + if (!hasTokenCredentialTrait) { + jobRouterAdministrationClientBuilderClass.addImplementedType(String.format("TokenCredentialTrait<%s>", classCustomization.getClassName())); + } + }); } } diff --git a/sdk/communication/azure-communication-jobrouter/pom.xml b/sdk/communication/azure-communication-jobrouter/pom.xml index a98d754603ce..5aef3c6ab9c6 100644 --- a/sdk/communication/azure-communication-jobrouter/pom.xml +++ b/sdk/communication/azure-communication-jobrouter/pom.xml @@ -14,7 +14,7 @@ com.azure azure-communication-jobrouter - 2.0.0-beta.1 + 1.1.3 Microsoft Azure client library for Azure Communication Services JobRouter application @@ -105,12 +105,6 @@ 1.11.20 test - - com.azure - azure-core-http-vertx - 1.0.0-beta.17 - test - org.slf4j slf4j-simple @@ -156,21 +150,4 @@ - - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.0.0-beta.12 - test - - - - diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationAsyncClient.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationAsyncClient.java index 9ba11fe20c73..daffff60bbd2 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationAsyncClient.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationAsyncClient.java @@ -4,10 +4,26 @@ package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl; +import com.azure.communication.jobrouter.implementation.accesshelpers.ClassificationPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.DistributionPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.ExceptionPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterQueueConstructorProxy; +import com.azure.communication.jobrouter.implementation.converters.ClassificationPolicyAdapter; +import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter; +import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter; +import com.azure.communication.jobrouter.implementation.converters.QueueAdapter; import com.azure.communication.jobrouter.implementation.models.ClassificationPolicyInternal; import com.azure.communication.jobrouter.implementation.models.DistributionPolicyInternal; import com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal; import com.azure.communication.jobrouter.implementation.models.RouterQueueInternal; +import com.azure.communication.jobrouter.models.ClassificationPolicy; +import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions; +import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions; +import com.azure.communication.jobrouter.models.CreateExceptionPolicyOptions; +import com.azure.communication.jobrouter.models.CreateQueueOptions; +import com.azure.communication.jobrouter.models.DistributionPolicy; +import com.azure.communication.jobrouter.models.ExceptionPolicy; +import com.azure.communication.jobrouter.models.RouterQueue; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -27,18 +43,6 @@ import java.util.stream.Collectors; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import com.azure.communication.jobrouter.implementation.converters.ClassificationPolicyAdapter; -import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter; -import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter; -import com.azure.communication.jobrouter.implementation.converters.QueueAdapter; -import com.azure.communication.jobrouter.models.ClassificationPolicy; -import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions; -import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions; -import com.azure.communication.jobrouter.models.CreateExceptionPolicyOptions; -import com.azure.communication.jobrouter.models.CreateQueueOptions; -import com.azure.communication.jobrouter.models.DistributionPolicy; -import com.azure.communication.jobrouter.models.ExceptionPolicy; -import com.azure.communication.jobrouter.models.RouterQueue; /** * Initializes a new instance of the asynchronous JobRouterAdministrationClient type. @@ -61,18 +65,34 @@ public final class JobRouterAdministrationAsyncClient { /** * Creates or updates a distribution policy. - *

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -80,16 +100,15 @@ public final class JobRouterAdministrationAsyncClient {
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
      *     }
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -97,7 +116,6 @@ public final class JobRouterAdministrationAsyncClient {
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -119,7 +137,8 @@ public final class JobRouterAdministrationAsyncClient {
     @ServiceMethod(returns = ReturnType.SINGLE)
     Mono> upsertDistributionPolicyWithResponse(String distributionPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'upsertDistributionPolicy' is 'application/merge-patch+json' and stream-style-serialization is not enabled
+        // Convenience API is not generated, as operation 'upsertDistributionPolicy' is 'application/merge-patch+json'
+        // and stream-style-serialization is not enabled
         return this.serviceClient.upsertDistributionPolicyWithResponseAsync(distributionPolicyId, resource,
             requestOptions);
     }
@@ -268,33 +287,14 @@ public Mono> updateDistributionPolicyWithResponse(String di
      * @param distributionPolicyId The unique identifier of the policy.
      * @param resource The resource instance.
      * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return policy governing how jobs are distributed to workers on successful completion of {@link Mono}.
+     * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion
+     * of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono updateDistributionPolicy(String distributionPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        return this.serviceClient
-            .upsertDistributionPolicyWithResponseAsync(distributionPolicyId, resource, requestOptions)
-            .map(policy -> policy.getValue());
-    }
-
-    /**
-     * Updates a distribution policy.
-     *
-     * @param distributionPolicyId The unique identifier of the policy.
-     * @param distributionPolicy The distribution policy to update.
-     * @return policy governing how jobs are distributed to workers on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono updateDistributionPolicy(String distributionPolicyId,
-        DistributionPolicy distributionPolicy) {
-        return this
-            .updateDistributionPolicyWithResponse(distributionPolicyId, BinaryData.fromObject(distributionPolicy), null)
-            .map(response -> response.getValue().toObject(DistributionPolicy.class));
+        return this.updateDistributionPolicyWithResponse(distributionPolicyId, resource, requestOptions)
+            .map(response -> response.getValue());
     }
 
     /**
@@ -314,8 +314,9 @@ public Mono updateDistributionPolicy(String distributionPoli
             = DistributionPolicyAdapter.convertCreateOptionsToDistributionPolicy(createDistributionPolicyOptions);
         return upsertDistributionPolicyWithResponse(createDistributionPolicyOptions.getDistributionPolicyId(),
             BinaryData.fromObject(distributionPolicy), requestOptions)
-            .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(),
-                response.getHeaders(), response.getValue().toObject(DistributionPolicy.class)));
+            .map(response -> new SimpleResponse(response.getRequest(), response.getStatusCode(),
+                response.getHeaders(), DistributionPolicyConstructorProxy
+                    .create(response.getValue().toObject(DistributionPolicyInternal.class))));
     }
 
     /**
@@ -333,8 +334,9 @@ public Mono updateDistributionPolicy(String distributionPoli
 
     /**
      * Retrieves an existing distribution policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -342,7 +344,6 @@ public Mono updateDistributionPolicy(String distributionPoli
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -368,15 +369,28 @@ public Mono> getDistributionPolicyWithResponse(String distr
 
     /**
      * Retrieves existing distribution policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -384,7 +398,6 @@ public Mono> getDistributionPolicyWithResponse(String distr
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -425,18 +438,34 @@ public Mono> deleteDistributionPolicyWithResponse(String distribu
 
     /**
      * Creates or updates a classification policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -445,22 +474,19 @@ public Mono> deleteDistributionPolicyWithResponse(String distribu
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -469,15 +495,12 @@ public Mono> deleteDistributionPolicyWithResponse(String distribu
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -497,7 +520,8 @@ public Mono> deleteDistributionPolicyWithResponse(String distribu
     @ServiceMethod(returns = ReturnType.SINGLE)
     Mono> upsertClassificationPolicyWithResponse(String classificationPolicyId,
         BinaryData resource, RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'upsertClassificationPolicy' is 'application/merge-patch+json' and stream-style-serialization is not enabled
+        // Convenience API is not generated, as operation 'upsertClassificationPolicy' is 'application/merge-patch+json'
+        // and stream-style-serialization is not enabled
         return this.serviceClient.upsertClassificationPolicyWithResponseAsync(classificationPolicyId, resource,
             requestOptions);
     }
@@ -666,35 +690,14 @@ public Mono> updateClassificationPolicyWithResponse(String
      * @param classificationPolicyId Unique identifier of this policy.
      * @param resource The resource instance.
      * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return a container for the rules that govern how jobs are classified on successful completion of {@link Mono}.
+     * @return result object.
+     * completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono updateClassificationPolicy(String classificationPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        return this.serviceClient
-            .upsertClassificationPolicyWithResponseAsync(classificationPolicyId, resource, requestOptions)
-            .map(policy -> policy.getValue());
-    }
-
-    /**
-     * Updates a classification policy.
-     *
-     * @param classificationPolicyId Unique identifier of this policy.
-     * @param classificationPolicy The classification policy to update.
-     * @return the updated classification policy.
-     * completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono updateClassificationPolicy(String classificationPolicyId,
-        ClassificationPolicy classificationPolicy) {
-        return this
-            .updateClassificationPolicyWithResponse(classificationPolicyId, BinaryData.fromObject(classificationPolicy),
-                null)
-            .map(response -> response.getValue().toObject(ClassificationPolicy.class));
+        return this.updateClassificationPolicyWithResponse(classificationPolicyId, resource, requestOptions)
+            .map(response -> response.getValue());
     }
 
     /**
@@ -714,8 +717,9 @@ public Mono updateClassificationPolicy(String classificati
             .convertCreateOptionsToClassificationPolicyInternal(createClassificationPolicyOptions);
         return upsertClassificationPolicyWithResponse(createClassificationPolicyOptions.getClassificationPolicyId(),
             BinaryData.fromObject(classificationPolicy), requestOptions)
-            .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(),
-                response.getHeaders(), response.getValue().toObject(ClassificationPolicy.class)));
+            .map(response -> new SimpleResponse(response.getRequest(), response.getStatusCode(),
+                response.getHeaders(), ClassificationPolicyConstructorProxy
+                    .create(response.getValue().toObject(ClassificationPolicyInternal.class))));
     }
 
     /**
@@ -736,8 +740,9 @@ public Mono updateClassificationPolicy(String classificati
 
     /**
      * Retrieves an existing classification policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -746,15 +751,12 @@ public Mono updateClassificationPolicy(String classificati
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -778,15 +780,28 @@ public Mono> getClassificationPolicyWithResponse(String cla
 
     /**
      * Retrieves existing classification policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -795,15 +810,12 @@ public Mono> getClassificationPolicyWithResponse(String cla
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -842,18 +854,34 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
 
     /**
      * Creates or updates a exception policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -863,11 +891,9 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -875,9 +901,9 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -887,11 +913,9 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -914,7 +938,8 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
     @ServiceMethod(returns = ReturnType.SINGLE)
     Mono> upsertExceptionPolicyWithResponse(String exceptionPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'upsertExceptionPolicy' is 'application/merge-patch+json' and stream-style-serialization is not enabled
+        // Convenience API is not generated, as operation 'upsertExceptionPolicy' is 'application/merge-patch+json' and
+        // stream-style-serialization is not enabled
         return this.serviceClient.upsertExceptionPolicyWithResponseAsync(exceptionPolicyId, resource, requestOptions);
     }
 
@@ -1077,32 +1102,14 @@ public Mono> updateExceptionPolicyWithResponse(String excep
      * @param exceptionPolicyId The Id of the exception policy.
      * @param resource The resource instance.
      * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return a policy that defines actions to execute when exception are triggered on
+     * @return a policy that defines actions to execute when exception are triggered along with {@link Response} on
      * successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono updateExceptionPolicy(String exceptionPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        return this.serviceClient.upsertExceptionPolicyWithResponseAsync(exceptionPolicyId, resource, requestOptions)
-            .map(policy -> policy.getValue());
-    }
-
-    /**
-     * Updates a exception policy.
-     *
-     * @param exceptionPolicyId The Id of the exception policy.
-     * @param exceptionPolicy The exception policy to update.
-     * @return a policy that defines actions to execute when exception are triggered on
-     * successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono updateExceptionPolicy(String exceptionPolicyId, ExceptionPolicy exceptionPolicy) {
-        return this.updateExceptionPolicyWithResponse(exceptionPolicyId, BinaryData.fromObject(exceptionPolicy), null)
-            .map(response -> response.getValue().toObject(ExceptionPolicy.class));
+        return this.updateExceptionPolicyWithResponse(exceptionPolicyId, resource, requestOptions)
+            .map(response -> response.getValue());
     }
 
     /**
@@ -1122,8 +1129,9 @@ public Mono updateExceptionPolicy(String exceptionPolicyId, Exc
             = ExceptionPolicyAdapter.convertCreateOptionsToExceptionPolicy(createExceptionPolicyOptions);
         return upsertExceptionPolicyWithResponse(createExceptionPolicyOptions.getExceptionPolicyId(),
             BinaryData.fromObject(exceptionPolicy), requestOptions)
-            .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(),
-                response.getHeaders(), response.getValue().toObject(ExceptionPolicy.class)));
+            .map(response -> new SimpleResponse(response.getRequest(), response.getStatusCode(),
+                response.getHeaders(),
+                ExceptionPolicyConstructorProxy.create(response.getValue().toObject(ExceptionPolicyInternal.class))));
     }
 
     /**
@@ -1139,8 +1147,9 @@ public Mono createExceptionPolicy(CreateExceptionPolicyOptions
 
     /**
      * Retrieves an existing exception policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1150,11 +1159,9 @@ public Mono createExceptionPolicy(CreateExceptionPolicyOptions
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1172,7 +1179,6 @@ public Mono createExceptionPolicy(CreateExceptionPolicyOptions
      * @return a policy that defines actions to execute when exception are triggered along with {@link Response} on
      * successful completion of {@link Mono}.
      */
-    @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getExceptionPolicyWithResponse(String exceptionPolicyId,
         RequestOptions requestOptions) {
@@ -1203,7 +1209,6 @@ public Mono> getExceptionPolicyWithResponse(String exceptio
      * 

* Response Body Schema *

- * *
{@code
      * {
      *     etag: String (Required)
@@ -1256,18 +1261,34 @@ public Mono> deleteExceptionPolicyWithResponse(String exceptionPo
 
     /**
      * Creates or updates a queue.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1280,9 +1301,9 @@ public Mono> deleteExceptionPolicyWithResponse(String exceptionPo
      *     exceptionPolicyId: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1310,7 +1331,8 @@ public Mono> deleteExceptionPolicyWithResponse(String exceptionPo
     @ServiceMethod(returns = ReturnType.SINGLE)
     Mono> upsertQueueWithResponse(String queueId, BinaryData resource,
         RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'upsertQueue' is 'application/merge-patch+json' and stream-style-serialization is not enabled
+        // Convenience API is not generated, as operation 'upsertQueue' is 'application/merge-patch+json' and
+        // stream-style-serialization is not enabled
         return this.serviceClient.upsertQueueWithResponseAsync(queueId, resource, requestOptions);
     }
 
@@ -1453,30 +1475,12 @@ public Mono> updateQueueWithResponse(String queueId, Binary
      * @param queueId The Id of this queue.
      * @param resource The resource instance.
      * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return a queue that can contain jobs to be routed on successful completion of {@link Mono}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono updateQueue(String queueId, BinaryData resource, RequestOptions requestOptions) {
-        return this.serviceClient.upsertQueueWithResponseAsync(queueId, resource, requestOptions)
-            .map(queue -> queue.getValue());
-    }
-
-    /**
-     * Updates a queue.
-     *
-     * @param queueId The Id of this queue.
-     * @param queue The queue to update.
-     * @return The updated queue.
+     * @return result object.
      * Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono updateQueue(String queueId, RouterQueue queue) {
-        return this.upsertQueueWithResponse(queueId, BinaryData.fromObject(queue), null)
-            .map(response -> response.getValue().toObject(RouterQueue.class));
+    public Mono updateQueue(String queueId, BinaryData resource, RequestOptions requestOptions) {
+        return this.upsertQueueWithResponse(queueId, resource, requestOptions).map(response -> response.getValue());
     }
 
     /**
@@ -1494,7 +1498,8 @@ public Mono> createQueueWithResponse(CreateQueueOptions cr
         RouterQueueInternal queue = QueueAdapter.convertCreateQueueOptionsToRouterQueueInternal(createQueueOptions);
         return upsertQueueWithResponse(createQueueOptions.getQueueId(), BinaryData.fromObject(queue), requestOptions)
             .map(response -> new SimpleResponse(response.getRequest(), response.getStatusCode(),
-                response.getHeaders(), response.getValue().toObject(RouterQueue.class)));
+                response.getHeaders(),
+                RouterQueueConstructorProxy.create(response.getValue().toObject(RouterQueueInternal.class))));
     }
 
     /**
@@ -1511,13 +1516,15 @@ public Mono createQueue(CreateQueueOptions createQueueOptions) {
         RequestOptions requestOptions = new RequestOptions();
         RouterQueueInternal queue = QueueAdapter.convertCreateQueueOptionsToRouterQueueInternal(createQueueOptions);
         return upsertQueueWithResponse(createQueueOptions.getQueueId(), BinaryData.fromObject(queue), requestOptions)
-            .map(response -> response.getValue().toObject(RouterQueue.class));
+            .map(response -> response.getValue().toObject(RouterQueueInternal.class))
+            .map(internal -> RouterQueueConstructorProxy.create(internal));
     }
 
     /**
      * Retrieves an existing queue by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1548,15 +1555,28 @@ public Mono> getQueueWithResponse(String queueId, RequestOp
 
     /**
      * Retrieves existing queues.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1636,13 +1656,11 @@ public PagedFlux listDistributionPolicies() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listDistributionPolicies(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
+                pagedResponse.getValue().stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DistributionPolicy.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1705,14 +1723,12 @@ public PagedFlux listClassificationPolicies() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listClassificationPolicies(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux
                 .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                     pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                    pagedResponse.getValue()
-                        .stream()
+                    pagedResponse.getValue().stream()
                         .map(protocolMethodData -> protocolMethodData.toObject(ClassificationPolicy.class))
                         .collect(Collectors.toList()),
                     pagedResponse.getContinuationToken(), null));
@@ -1754,6 +1770,7 @@ public Mono deleteClassificationPolicy(String classificationPolicyId) {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono getExceptionPolicy(String exceptionPolicyId) {
+        // Generated convenience method for getExceptionPolicyWithResponse
         RequestOptions requestOptions = new RequestOptions();
         return getExceptionPolicyWithResponse(exceptionPolicyId, requestOptions).flatMap(FluxUtil::toMono)
             .map(protocolMethodData -> protocolMethodData.toObject(ExceptionPolicy.class));
@@ -1775,13 +1792,11 @@ public PagedFlux listExceptionPolicies() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listExceptionPolicies(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
+                pagedResponse.getValue().stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(ExceptionPolicy.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1844,13 +1859,11 @@ public PagedFlux listQueues() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listQueues(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
+                pagedResponse.getValue().stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(RouterQueue.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClient.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClient.java
index a40661c87852..441aed1278c5 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClient.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClient.java
@@ -4,10 +4,26 @@
 package com.azure.communication.jobrouter;
 
 import com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl;
+import com.azure.communication.jobrouter.implementation.accesshelpers.ClassificationPolicyConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.DistributionPolicyConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.ExceptionPolicyConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.RouterQueueConstructorProxy;
+import com.azure.communication.jobrouter.implementation.converters.ClassificationPolicyAdapter;
+import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter;
+import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter;
+import com.azure.communication.jobrouter.implementation.converters.QueueAdapter;
 import com.azure.communication.jobrouter.implementation.models.ClassificationPolicyInternal;
 import com.azure.communication.jobrouter.implementation.models.DistributionPolicyInternal;
 import com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal;
 import com.azure.communication.jobrouter.implementation.models.RouterQueueInternal;
+import com.azure.communication.jobrouter.models.ClassificationPolicy;
+import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions;
+import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions;
+import com.azure.communication.jobrouter.models.CreateExceptionPolicyOptions;
+import com.azure.communication.jobrouter.models.CreateQueueOptions;
+import com.azure.communication.jobrouter.models.DistributionPolicy;
+import com.azure.communication.jobrouter.models.ExceptionPolicy;
+import com.azure.communication.jobrouter.models.RouterQueue;
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.ReturnType;
 import com.azure.core.annotation.ServiceClient;
@@ -21,18 +37,6 @@
 import com.azure.core.http.rest.Response;
 import com.azure.core.http.rest.SimpleResponse;
 import com.azure.core.util.BinaryData;
-import com.azure.communication.jobrouter.implementation.converters.ClassificationPolicyAdapter;
-import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter;
-import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter;
-import com.azure.communication.jobrouter.implementation.converters.QueueAdapter;
-import com.azure.communication.jobrouter.models.ClassificationPolicy;
-import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions;
-import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions;
-import com.azure.communication.jobrouter.models.CreateExceptionPolicyOptions;
-import com.azure.communication.jobrouter.models.CreateQueueOptions;
-import com.azure.communication.jobrouter.models.DistributionPolicy;
-import com.azure.communication.jobrouter.models.ExceptionPolicy;
-import com.azure.communication.jobrouter.models.RouterQueue;
 
 /**
  * Initializes a new instance of the synchronous JobRouterAdministrationClient type.
@@ -55,18 +59,34 @@ public final class JobRouterAdministrationClient {
 
     /**
      * Creates or updates a distribution policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -74,16 +94,15 @@ public final class JobRouterAdministrationClient {
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
      *     }
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -91,7 +110,6 @@ public final class JobRouterAdministrationClient {
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -112,7 +130,8 @@ public final class JobRouterAdministrationClient {
     @ServiceMethod(returns = ReturnType.SINGLE)
     Response upsertDistributionPolicyWithResponse(String distributionPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'upsertDistributionPolicy' is 'application/merge-patch+json' and stream-style-serialization is not enabled
+        // Convenience API is not generated, as operation 'upsertDistributionPolicy' is 'application/merge-patch+json'
+        // and stream-style-serialization is not enabled
         return this.serviceClient.upsertDistributionPolicyWithResponse(distributionPolicyId, resource, requestOptions);
     }
 
@@ -258,31 +277,12 @@ public Response updateDistributionPolicyWithResponse(String distribu
      * @param distributionPolicyId The unique identifier of the policy.
      * @param resource The resource instance.
      * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return policy governing how jobs are distributed to workers.
+     * @return result object.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public BinaryData updateDistributionPolicy(String distributionPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        return this.serviceClient.upsertDistributionPolicyWithResponse(distributionPolicyId, resource, requestOptions)
-            .getValue();
-    }
-
-    /**
-     * Updates a distribution policy.
-     *
-     * @param distributionPolicyId The unique identifier of the policy.
-     * @param distributionPolicy The distribution policy to update.
-     * @return the updated distribution policy.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public DistributionPolicy updateDistributionPolicy(String distributionPolicyId,
-        DistributionPolicy distributionPolicy) {
-        return updateDistributionPolicyWithResponse(distributionPolicyId, BinaryData.fromObject(distributionPolicy),
-            null).getValue().toObject(DistributionPolicy.class);
+        return updateDistributionPolicyWithResponse(distributionPolicyId, resource, requestOptions).getValue();
     }
 
     /**
@@ -303,8 +303,9 @@ public Response createDistributionPolicyWithResponse(
         Response response = this.serviceClient.upsertDistributionPolicyWithResponse(
             createDistributionPolicyOptions.getDistributionPolicyId(), BinaryData.fromObject(distributionPolicy),
             requestOptions);
-        return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(),
-            response.getValue().toObject(DistributionPolicy.class));
+        return new SimpleResponse(response.getRequest(), response.getStatusCode(),
+            response.getHeaders(),
+            DistributionPolicyConstructorProxy.create(response.getValue().toObject(DistributionPolicyInternal.class)));
     }
 
     /**
@@ -325,8 +326,9 @@ public Response createDistributionPolicyWithResponse(
 
     /**
      * Retrieves an existing distribution policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -334,7 +336,6 @@ public Response createDistributionPolicyWithResponse(
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -359,15 +360,28 @@ public Response getDistributionPolicyWithResponse(String distributio
 
     /**
      * Retrieves existing distribution policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -375,7 +389,6 @@ public Response getDistributionPolicyWithResponse(String distributio
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -416,18 +429,34 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
 
     /**
      * Creates or updates a classification policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -436,22 +465,19 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -460,15 +486,12 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -487,7 +510,8 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
     @ServiceMethod(returns = ReturnType.SINGLE)
     Response upsertClassificationPolicyWithResponse(String classificationPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'upsertClassificationPolicy' is 'application/merge-patch+json' and stream-style-serialization is not enabled
+        // Convenience API is not generated, as operation 'upsertClassificationPolicy' is 'application/merge-patch+json'
+        // and stream-style-serialization is not enabled
         return this.serviceClient.upsertClassificationPolicyWithResponse(classificationPolicyId, resource,
             requestOptions);
     }
@@ -655,32 +679,12 @@ public Response updateClassificationPolicyWithResponse(String classi
      * @param classificationPolicyId Unique identifier of this policy.
      * @param resource The resource instance.
      * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return a container for the rules that govern how jobs are classified.
+     * @return result object.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public BinaryData updateClassificationPolicy(String classificationPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        return this.serviceClient
-            .upsertClassificationPolicyWithResponse(classificationPolicyId, resource, requestOptions)
-            .getValue();
-    }
-
-    /**
-     * Updates a classification policy.
-     *
-     * @param classificationPolicyId Unique identifier of this policy.
-     * @param classificationPolicy The classification policy to update.
-     * @return the updated classification policy.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public ClassificationPolicy updateClassificationPolicy(String classificationPolicyId,
-        ClassificationPolicy classificationPolicy) {
-        return updateClassificationPolicyWithResponse(classificationPolicyId,
-            BinaryData.fromObject(classificationPolicy), null).getValue().toObject(ClassificationPolicy.class);
+        return updateClassificationPolicyWithResponse(classificationPolicyId, resource, requestOptions).getValue();
     }
 
     /**
@@ -701,8 +705,9 @@ public Response createClassificationPolicyWithResponse(
         Response response = this.serviceClient.upsertClassificationPolicyWithResponse(
             createClassificationPolicyOptions.getClassificationPolicyId(), BinaryData.fromObject(classificationPolicy),
             requestOptions);
-        return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(),
-            response.getValue().toObject(ClassificationPolicy.class));
+        return new SimpleResponse(response.getRequest(), response.getStatusCode(),
+            response.getHeaders(), ClassificationPolicyConstructorProxy
+                .create(response.getValue().toObject(ClassificationPolicyInternal.class)));
     }
 
     /**
@@ -724,8 +729,9 @@ public Response createClassificationPolicyWithResponse(
 
     /**
      * Retrieves an existing classification policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -734,15 +740,12 @@ public Response createClassificationPolicyWithResponse(
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -765,15 +768,28 @@ public Response getClassificationPolicyWithResponse(String classific
 
     /**
      * Retrieves existing classification policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -782,15 +798,12 @@ public Response getClassificationPolicyWithResponse(String classific
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -829,18 +842,34 @@ public Response deleteClassificationPolicyWithResponse(String classificati
 
     /**
      * Creates or updates a exception policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -850,11 +879,9 @@ public Response deleteClassificationPolicyWithResponse(String classificati
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -862,9 +889,9 @@ public Response deleteClassificationPolicyWithResponse(String classificati
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -874,11 +901,9 @@ public Response deleteClassificationPolicyWithResponse(String classificati
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -900,7 +925,8 @@ public Response deleteClassificationPolicyWithResponse(String classificati
     @ServiceMethod(returns = ReturnType.SINGLE)
     Response upsertExceptionPolicyWithResponse(String exceptionPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'upsertExceptionPolicy' is 'application/merge-patch+json' and stream-style-serialization is not enabled
+        // Convenience API is not generated, as operation 'upsertExceptionPolicy' is 'application/merge-patch+json' and
+        // stream-style-serialization is not enabled
         return this.serviceClient.upsertExceptionPolicyWithResponse(exceptionPolicyId, resource, requestOptions);
     }
 
@@ -1062,31 +1088,12 @@ public Response updateExceptionPolicyWithResponse(String exceptionPo
      * @param exceptionPolicyId The Id of the exception policy.
      * @param resource The resource instance.
      * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return a policy that defines actions to execute when exception are triggered.
+     * @return result object.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public BinaryData updateExceptionPolicy(String exceptionPolicyId, BinaryData resource,
         RequestOptions requestOptions) {
-        return this.serviceClient.upsertExceptionPolicyWithResponse(exceptionPolicyId, resource, requestOptions)
-            .getValue();
-    }
-
-    /**
-     * Updates a exception policy.
-     *
-     * @param exceptionPolicyId The Id of the exception policy.
-     * @param exceptionPolicy The exception policy to update.
-     * @return the updated exception policy.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public ExceptionPolicy updateExceptionPolicy(String exceptionPolicyId, ExceptionPolicy exceptionPolicy) {
-        return this.updateExceptionPolicyWithResponse(exceptionPolicyId, BinaryData.fromObject(exceptionPolicy), null)
-            .getValue()
-            .toObject(ExceptionPolicy.class);
+        return updateExceptionPolicyWithResponse(exceptionPolicyId, resource, requestOptions).getValue();
     }
 
     /**
@@ -1107,8 +1114,9 @@ public Response createExceptionPolicyWithResponse(
         Response response
             = this.serviceClient.upsertExceptionPolicyWithResponse(createExceptionPolicyOptions.getExceptionPolicyId(),
                 BinaryData.fromObject(exceptionPolicy), requestOptions);
-        return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(),
-            response.getValue().toObject(ExceptionPolicy.class));
+        return new SimpleResponse(response.getRequest(), response.getStatusCode(),
+            response.getHeaders(),
+            ExceptionPolicyConstructorProxy.create(response.getValue().toObject(ExceptionPolicyInternal.class)));
     }
 
     /**
@@ -1128,8 +1136,9 @@ public ExceptionPolicy createExceptionPolicy(CreateExceptionPolicyOptions create
 
     /**
      * Retrieves an existing exception policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1139,11 +1148,9 @@ public ExceptionPolicy createExceptionPolicy(CreateExceptionPolicyOptions create
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1160,7 +1167,6 @@ public ExceptionPolicy createExceptionPolicy(CreateExceptionPolicyOptions create
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return a policy that defines actions to execute when exception are triggered along with {@link Response}.
      */
-    @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getExceptionPolicyWithResponse(String exceptionPolicyId,
         RequestOptions requestOptions) {
@@ -1191,7 +1197,6 @@ public Response getExceptionPolicyWithResponse(String exceptionPolic
      * 

* Response Body Schema *

- * *
{@code
      * {
      *     etag: String (Required)
@@ -1243,18 +1248,34 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
 
     /**
      * Creates or updates a queue.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1267,9 +1288,9 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
      *     exceptionPolicyId: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1295,7 +1316,8 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
     Response upsertQueueWithResponse(String queueId, BinaryData resource, RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'upsertQueue' is 'application/merge-patch+json' and stream-style-serialization is not enabled
+        // Convenience API is not generated, as operation 'upsertQueue' is 'application/merge-patch+json' and
+        // stream-style-serialization is not enabled
         return this.serviceClient.upsertQueueWithResponse(queueId, resource, requestOptions);
     }
 
@@ -1437,28 +1459,11 @@ public Response updateQueueWithResponse(String queueId, BinaryData r
      * @param queueId The Id of this queue.
      * @param resource RouterQueue resource.
      * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return a queue that can contain jobs to be routed.
+     * @return a queue that can contain jobs to be routed along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public BinaryData updateQueue(String queueId, BinaryData resource, RequestOptions requestOptions) {
-        return this.serviceClient.upsertQueueWithResponse(queueId, resource, requestOptions).getValue();
-    }
-
-    /**
-     * Updates a queue.
-     *
-     * @param queueId The Id of this queue.
-     * @param queue The queue to update.
-     * @return the updated queue.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public RouterQueue updateQueue(String queueId, RouterQueue queue) {
-        return updateQueueWithResponse(queueId, BinaryData.fromObject(queue), null).getValue()
-            .toObject(RouterQueue.class);
+        return updateQueueWithResponse(queueId, resource, requestOptions).getValue();
     }
 
     /**
@@ -1477,8 +1482,8 @@ public Response createQueueWithResponse(CreateQueueOptions createQu
         RouterQueueInternal queue = QueueAdapter.convertCreateQueueOptionsToRouterQueueInternal(createQueueOptions);
         Response response = this.serviceClient.upsertQueueWithResponse(createQueueOptions.getQueueId(),
             BinaryData.fromObject(queue), requestOptions);
-        return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(),
-            response.getValue().toObject(RouterQueue.class));
+        return new SimpleResponse(response.getRequest(), response.getStatusCode(), response.getHeaders(),
+            RouterQueueConstructorProxy.create(response.getValue().toObject(RouterQueueInternal.class)));
     }
 
     /**
@@ -1498,8 +1503,9 @@ public RouterQueue createQueue(CreateQueueOptions createQueueOptions) {
 
     /**
      * Retrieves an existing queue by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1529,15 +1535,28 @@ public Response getQueueWithResponse(String queueId, RequestOptions
 
     /**
      * Retrieves existing queues.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1595,6 +1614,7 @@ public Response deleteQueueWithResponse(String queueId, RequestOptions req
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public DistributionPolicy getDistributionPolicy(String distributionPolicyId) {
+        // Generated convenience method for getDistributionPolicyWithResponse
         RequestOptions requestOptions = new RequestOptions();
         return getDistributionPolicyWithResponse(distributionPolicyId, requestOptions).getValue()
             .toObject(DistributionPolicy.class);
@@ -1651,6 +1671,7 @@ public void deleteDistributionPolicy(String distributionPolicyId) {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public ClassificationPolicy getClassificationPolicy(String classificationPolicyId) {
+        // Generated convenience method for getClassificationPolicyWithResponse
         RequestOptions requestOptions = new RequestOptions();
         return getClassificationPolicyWithResponse(classificationPolicyId, requestOptions).getValue()
             .toObject(ClassificationPolicy.class);
@@ -1707,6 +1728,7 @@ public void deleteClassificationPolicy(String classificationPolicyId) {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public ExceptionPolicy getExceptionPolicy(String exceptionPolicyId) {
+        // Generated convenience method for getExceptionPolicyWithResponse
         RequestOptions requestOptions = new RequestOptions();
         return getExceptionPolicyWithResponse(exceptionPolicyId, requestOptions).getValue()
             .toObject(ExceptionPolicy.class);
@@ -1724,6 +1746,7 @@ public ExceptionPolicy getExceptionPolicy(String exceptionPolicyId) {
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listExceptionPolicies() {
+        // Generated convenience method for listExceptionPolicies
         RequestOptions requestOptions = new RequestOptions();
         return serviceClient.listExceptionPolicies(requestOptions)
             .mapPage(bodyItemValue -> bodyItemValue.toObject(ExceptionPolicy.class));
@@ -1762,6 +1785,7 @@ public void deleteExceptionPolicy(String exceptionPolicyId) {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public RouterQueue getQueue(String queueId) {
+        // Generated convenience method for getQueueWithResponse
         RequestOptions requestOptions = new RequestOptions();
         return getQueueWithResponse(queueId, requestOptions).getValue().toObject(RouterQueue.class);
     }
@@ -1778,6 +1802,7 @@ public RouterQueue getQueue(String queueId) {
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listQueues() {
+        // Generated convenience method for listQueues
         RequestOptions requestOptions = new RequestOptions();
         return serviceClient.listQueues(requestOptions)
             .mapPage(bodyItemValue -> bodyItemValue.toObject(RouterQueue.class));
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java
index 9dfb6e9abe66..55d42b11f47d 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java
@@ -3,18 +3,18 @@
 // Code generated by Microsoft (R) TypeSpec Code Generator.
 package com.azure.communication.jobrouter;
 
-import com.azure.communication.common.implementation.HmacAuthenticationPolicy;
 import com.azure.communication.common.implementation.CommunicationConnectionString;
-import com.azure.core.credential.AzureKeyCredential;
-import com.azure.core.client.traits.ConnectionStringTrait;
-import com.azure.core.client.traits.KeyCredentialTrait;
-import com.azure.core.client.traits.TokenCredentialTrait;
 import com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl;
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.ServiceClientBuilder;
 import com.azure.core.client.traits.ConfigurationTrait;
+import com.azure.core.client.traits.ConnectionStringTrait;
 import com.azure.core.client.traits.EndpointTrait;
 import com.azure.core.client.traits.HttpTrait;
+import com.azure.core.client.traits.KeyCredentialTrait;
+import com.azure.core.client.traits.TokenCredentialTrait;
+import com.azure.core.credential.KeyCredential;
+import com.azure.core.credential.TokenCredential;
 import com.azure.core.http.HttpClient;
 import com.azure.core.http.HttpHeaderName;
 import com.azure.core.http.HttpHeaders;
@@ -24,9 +24,8 @@
 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.BearerTokenAuthenticationPolicy;
-import com.azure.core.http.policy.HttpLoggingPolicy;
 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;
@@ -43,8 +42,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import com.azure.core.credential.KeyCredential;
-import com.azure.core.credential.TokenCredential;
 
 /**
  * A builder for creating a new instance of the JobRouterAdministrationClient type.
@@ -53,9 +50,9 @@
     serviceClients = { JobRouterAdministrationClient.class, JobRouterAdministrationAsyncClient.class })
 public final class JobRouterAdministrationClientBuilder implements HttpTrait,
     ConfigurationTrait, EndpointTrait,
-    TokenCredentialTrait,
+    ConnectionStringTrait,
     KeyCredentialTrait,
-    ConnectionStringTrait {
+    TokenCredentialTrait {
 
     @Generated
     private static final String SDK_NAME = "name";
@@ -72,7 +69,9 @@ public final class JobRouterAdministrationClientBuilder implements HttpTrait 0) {
             policies.add(new AddHeadersPolicy(headers));
         }
-        this.pipelinePolicies.stream()
-            .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+        this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
             .forEach(p -> policies.add(p));
         HttpPolicyProviders.addBeforeRetryPolicies(policies);
         policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
         policies.add(new AddDatePolicy());
-        policies.add(createHttpPipelineAuthPolicy());
-        this.pipelinePolicies.stream()
-            .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+        this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
             .forEach(p -> policies.add(p));
         HttpPolicyProviders.addAfterRetryPolicies(policies);
         policies.add(new HttpLoggingPolicy(localHttpLogOptions));
         HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
-            .httpClient(httpClient)
-            .clientOptions(localClientOptions)
-            .build();
+            .httpClient(httpClient).clientOptions(localClientOptions).build();
         return httpPipeline;
     }
 
@@ -307,6 +301,19 @@ public JobRouterAdministrationClient buildClient() {
 
     private static final ClientLogger LOGGER = new ClientLogger(JobRouterAdministrationClientBuilder.class);
 
+    /**
+     * Set a connection string for authorization
+     *
+     * @param connectionString valid connectionString as a string
+     * @return the updated RouterAdministrationClientBuilder object
+     */
+    public JobRouterAdministrationClientBuilder connectionString(String connectionString) {
+        this.connectionString = new CommunicationConnectionString(connectionString);
+        this.credential(new KeyCredential(this.connectionString.getAccessKey()));
+        this.endpoint(this.connectionString.getEndpoint());
+        return this;
+    }
+
     /**
      * Sets the {@link TokenCredential} used to authorize requests sent to the service. Refer to the Azure SDK for Java
      * identity and authentication
@@ -328,7 +335,7 @@ public JobRouterAdministrationClientBuilder credential(TokenCredential tokenCred
      * @return the updated RouterAdministrationClientBuilder object
      */
     public JobRouterAdministrationClientBuilder credential(KeyCredential credential) {
-        this.keyCredential = Objects.requireNonNull(credential, "'credential' cannot be null.");
+        this.credential = Objects.requireNonNull(credential, "'credential' cannot be null.");
         return this;
     }
 
@@ -343,29 +350,4 @@ public JobRouterAdministrationClientBuilder serviceVersion(JobRouterServiceVersi
         this.serviceVersion = serviceVersion;
         return this;
     }
-
-    /**
-     * Set a connection string for authorization.
-     *
-     * @param connectionString valid connectionString as a string.
-     * @return the updated JobRouterAdministrationClientBuilder object.
-     */
-    public JobRouterAdministrationClientBuilder connectionString(String connectionString) {
-        CommunicationConnectionString connection = new CommunicationConnectionString(connectionString);
-        this.credential(new AzureKeyCredential(connection.getAccessKey()));
-        this.endpoint(connection.getEndpoint());
-        return this;
-    }
-
-    private HttpPipelinePolicy createHttpPipelineAuthPolicy() {
-        if (this.tokenCredential != null) {
-            return new BearerTokenAuthenticationPolicy(this.tokenCredential,
-                "https://communication.azure.com/.default");
-        } else if (this.keyCredential != null) {
-            return new HmacAuthenticationPolicy(new AzureKeyCredential(this.keyCredential.getKey()));
-        } else {
-            throw LOGGER.logExceptionAsError(
-                new IllegalStateException("Missing credential information while building a client."));
-        }
-    }
 }
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAsyncClient.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAsyncClient.java
index b7fdedcb13f3..4dbff262f8a5 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAsyncClient.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAsyncClient.java
@@ -4,6 +4,10 @@
 package com.azure.communication.jobrouter;
 
 import com.azure.communication.jobrouter.implementation.JobRouterClientImpl;
+import com.azure.communication.jobrouter.implementation.accesshelpers.RouterJobConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.RouterWorkerConstructorProxy;
+import com.azure.communication.jobrouter.implementation.converters.JobAdapter;
+import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter;
 import com.azure.communication.jobrouter.implementation.models.CancelJobOptionsInternal;
 import com.azure.communication.jobrouter.implementation.models.CancelJobResultInternal;
 import com.azure.communication.jobrouter.implementation.models.CloseJobOptionsInternal;
@@ -17,8 +21,13 @@
 import com.azure.communication.jobrouter.implementation.models.RouterJobInternal;
 import com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal;
 import com.azure.communication.jobrouter.models.AcceptJobOfferResult;
+import com.azure.communication.jobrouter.models.CreateJobOptions;
+import com.azure.communication.jobrouter.models.CreateWorkerOptions;
+import com.azure.communication.jobrouter.models.RouterJob;
 import com.azure.communication.jobrouter.models.RouterJobPositionDetails;
 import com.azure.communication.jobrouter.models.RouterJobStatusSelector;
+import com.azure.communication.jobrouter.models.RouterQueueStatistics;
+import com.azure.communication.jobrouter.models.RouterWorker;
 import com.azure.communication.jobrouter.models.RouterWorkerStateSelector;
 import com.azure.communication.jobrouter.models.UnassignJobOptions;
 import com.azure.communication.jobrouter.models.UnassignJobResult;
@@ -42,14 +51,6 @@
 import java.util.stream.Collectors;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
-import com.azure.communication.jobrouter.implementation.converters.JobAdapter;
-import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter;
-import com.azure.communication.jobrouter.models.CreateJobOptions;
-import com.azure.communication.jobrouter.models.CreateJobWithClassificationPolicyOptions;
-import com.azure.communication.jobrouter.models.CreateWorkerOptions;
-import com.azure.communication.jobrouter.models.RouterJob;
-import com.azure.communication.jobrouter.models.RouterQueueStatistics;
-import com.azure.communication.jobrouter.models.RouterWorker;
 
 /**
  * Initializes a new instance of the asynchronous JobRouterClient type.
@@ -72,18 +73,34 @@ public final class JobRouterAsyncClient {
 
     /**
      * Creates or updates a router job.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -133,13 +150,12 @@ public final class JobRouterAsyncClient {
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -189,7 +205,6 @@ public final class JobRouterAsyncClient {
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -206,7 +221,8 @@ public final class JobRouterAsyncClient { @Generated @ServiceMethod(returns = ReturnType.SINGLE) Mono> upsertJobWithResponse(String jobId, BinaryData resource, RequestOptions requestOptions) { - // Convenience API is not generated, as operation 'upsertJob' is 'application/merge-patch+json' and stream-style-serialization is not enabled + // Convenience API is not generated, as operation 'upsertJob' is 'application/merge-patch+json' and + // stream-style-serialization is not enabled return this.serviceClient.upsertJobWithResponseAsync(jobId, resource, requestOptions); } @@ -496,28 +512,11 @@ public Mono> updateJobWithResponse(String jobId, BinaryData * @param jobId The jobId of the job. * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a unit of work to be routed on successful completion of {@link Mono}. + * @return result object. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateJob(String jobId, BinaryData resource, RequestOptions requestOptions) { - return this.serviceClient.upsertJobWithResponseAsync(jobId, resource, requestOptions).map(Response::getValue); - } - - /** - * Updates a router job. - * - * @param jobId The jobId of the job. - * @param job The job to update. - * @return the updated job on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateJob(String jobId, RouterJob job) { - return updateJobWithResponse(jobId, BinaryData.fromObject(job), null) - .map(response -> response.getValue().toObject(RouterJob.class)); + return updateJobWithResponse(jobId, resource, requestOptions).map(response -> response.getValue()); } /** @@ -535,7 +534,8 @@ public Mono> createJobWithResponse(CreateJobOptions createJo RouterJobInternal routerJob = JobAdapter.convertCreateJobOptionsToRouterJob(createJobOptions); return upsertJobWithResponse(createJobOptions.getJobId(), BinaryData.fromObject(routerJob), requestOptions) .map(response -> new SimpleResponse(response.getRequest(), response.getStatusCode(), - response.getHeaders(), response.getValue().toObject(RouterJob.class))); + response.getHeaders(), + RouterJobConstructorProxy.create(response.getValue().toObject(RouterJobInternal.class)))); } /** @@ -552,50 +552,11 @@ public Mono createJob(CreateJobOptions createJobOptions) { return this.createJobWithResponse(createJobOptions).map(response -> response.getValue()); } - /** - * Create a job using a classification policy. - * - * @param createJobWithClassificationPolicyOptions Options to create a RouterJob using a classification policy. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @return a unit of work to be routed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createJobWithClassificationPolicyWithResponse( - CreateJobWithClassificationPolicyOptions createJobWithClassificationPolicyOptions, - RequestOptions requestOptions) { - RouterJobInternal routerJob = JobAdapter - .convertCreateJobWithClassificationPolicyOptionsToRouterJob(createJobWithClassificationPolicyOptions); - return upsertJobWithResponse(createJobWithClassificationPolicyOptions.getJobId(), - BinaryData.fromObject(routerJob), requestOptions) - .map(response -> new SimpleResponse(response.getRequest(), response.getStatusCode(), - response.getHeaders(), response.getValue().toObject(RouterJob.class))); - } - - /** - * Convenience method to create a job using a classification policy. - * - * @param createJobWithClassificationPolicyOptions Options to create a RouterJob using a classification policy. - * @return a unit of work to be routed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createJobWithClassificationPolicy( - CreateJobWithClassificationPolicyOptions createJobWithClassificationPolicyOptions) { - RequestOptions requestOptions = new RequestOptions(); - return this - .createJobWithClassificationPolicyWithResponse(createJobWithClassificationPolicyOptions, requestOptions) - .map(response -> response.getValue()); - } - /** * Retrieves an existing job by Id. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -645,7 +606,6 @@ public Mono createJobWithClassificationPolicy(
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -686,17 +646,16 @@ public Mono> deleteJobWithResponse(String jobId, RequestOptions r *

* Request Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -718,17 +677,16 @@ public Mono> reclassifyJobWithResponse(String jobId, Reques *

* Request Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -746,20 +704,18 @@ public Mono reclassifyJob(String jobId, RequestOptions requestOption *

* Request Body Schema *

- * *
{@code
      * {
      *     note: String (Optional)
      *     dispositionCode: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -781,20 +737,18 @@ public Mono> cancelJobWithResponse(String jobId, RequestOpt *

* Request Body Schema *

- * *
{@code
      * {
      *     note: String (Optional)
      *     dispositionCode: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -809,26 +763,67 @@ public Mono cancelJob(String jobId, RequestOptions requestOptions) { /** * Retrieves list of jobs based on filter parameters. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", - * "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", - * "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by - * classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * before or at given timestamp. Range: (-Inf, scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * at or after given value. Range: [scheduledAfter, +Inf).
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned", + * "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", + * "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, + * scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -878,7 +873,6 @@ public Mono cancelJob(String jobId, RequestOptions requestOptions) {
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -898,8 +892,9 @@ public PagedFlux listJobs(RequestOptions requestOptions) { /** * Gets a job's position details. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     jobId: String (Required)
@@ -926,16 +921,17 @@ public Mono> getQueuePositionWithResponse(String jobId, Req
 
     /**
      * Unassign a job.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     suspendMatching: Boolean (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     jobId: String (Required)
@@ -962,8 +958,9 @@ public Mono> unassignJobWithResponse(String jobId, String a
 
     /**
      * Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     assignmentId: String (Required)
@@ -994,19 +991,17 @@ public Mono> acceptJobOfferWithResponse(String workerId, St
      * 

* Request Body Schema *

- * *
{@code
      * {
      *     retryOfferAt: OffsetDateTime (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param workerId Id of a worker. @@ -1030,19 +1025,17 @@ public Mono> declineJobOfferWithResponse(String workerId, S *

* Request Body Schema *

- * *
{@code
      * {
      *     retryOfferAt: OffsetDateTime (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param workerId Id of a worker. @@ -1059,8 +1052,9 @@ public Mono declineJobOffer(String workerId, String offerId, Request /** * Retrieves a queue's statistics. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     queueId: String (Required)
@@ -1088,18 +1082,34 @@ public Mono> getQueueStatisticsWithResponse(String queueId,
 
     /**
      * Creates or updates a worker.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1141,12 +1151,11 @@ public Mono> getQueueStatisticsWithResponse(String queueId,
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1188,7 +1197,6 @@ public Mono> getQueueStatisticsWithResponse(String queueId,
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -1205,7 +1213,8 @@ public Mono> getQueueStatisticsWithResponse(String queueId, @ServiceMethod(returns = ReturnType.SINGLE) Mono> upsertWorkerWithResponse(String workerId, BinaryData resource, RequestOptions requestOptions) { - // Convenience API is not generated, as operation 'upsertWorker' is 'application/merge-patch+json' and stream-style-serialization is not enabled + // Convenience API is not generated, as operation 'upsertWorker' is 'application/merge-patch+json' and + // stream-style-serialization is not enabled return this.serviceClient.upsertWorkerWithResponseAsync(workerId, resource, requestOptions); } @@ -1282,7 +1291,6 @@ Mono> upsertWorkerWithResponse(String workerId, BinaryData * ] * loadRatio: Double (Optional) * availableForOffers: Boolean (Optional) - * maxConcurrentOffers: Integer (Optional) * } * }
* @@ -1329,7 +1337,6 @@ Mono> upsertWorkerWithResponse(String workerId, BinaryData * ] * loadRatio: Double (Optional) * availableForOffers: Boolean (Optional) - * maxConcurrentOffers: Integer (Optional) * } * }
* @@ -1421,7 +1428,6 @@ public Mono> updateWorkerWithResponse(String workerId, Bina * ] * loadRatio: Double (Optional) * availableForOffers: Boolean (Optional) - * maxConcurrentOffers: Integer (Optional) * } * }
* @@ -1468,63 +1474,17 @@ public Mono> updateWorkerWithResponse(String workerId, Bina * ] * loadRatio: Double (Optional) * availableForOffers: Boolean (Optional) - * maxConcurrentOffers: Integer (Optional) * } * }
* * @param workerId Id of the worker. * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an entity for jobs to be routed to on successful completion of {@link Mono}. + * @return result object. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateWorker(String workerId, BinaryData resource, RequestOptions requestOptions) { - return this.serviceClient.upsertWorkerWithResponseAsync(workerId, resource, requestOptions) - .map(worker -> worker.getValue()); - } - - /** - * Updates a worker. - * - *

- * Header Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - * @param workerId Id of the worker. - * @param worker The worker to update. - * @return the updated worker on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateWorker(String workerId, RouterWorker worker) { - return this.updateWorkerWithResponse(workerId, BinaryData.fromObject(worker), null) - .map(routerWorkerResponse -> routerWorkerResponse.getValue().toObject(RouterWorker.class)); + return this.updateWorkerWithResponse(workerId, resource, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -1543,7 +1503,8 @@ public Mono> createWorkerWithResponse(CreateWorkerOptions return upsertWorkerWithResponse(createWorkerOptions.getWorkerId(), BinaryData.fromObject(routerWorker), requestOptions) .map(response -> new SimpleResponse(response.getRequest(), response.getStatusCode(), - response.getHeaders(), response.getValue().toObject(RouterWorker.class))); + response.getHeaders(), + RouterWorkerConstructorProxy.create(response.getValue().toObject(RouterWorkerInternal.class)))); } /** @@ -1563,8 +1524,9 @@ public Mono createWorker(CreateWorkerOptions createWorkerOptions) /** * Retrieves an existing worker by Id. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1606,7 +1568,6 @@ public Mono createWorker(CreateWorkerOptions createWorkerOptions)
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -1643,24 +1604,54 @@ public Mono> deleteWorkerWithResponse(String workerId, RequestOpt /** * Retrieves existing workers. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: - * "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration - * with this channel.
queueIdStringNoIf specified, select workers who are assigned to this - * queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for - * the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will - * return all workers including workers without any capacity for jobs. Defaults to false.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration with this channel.
queueIdStringNoIf specified, select workers who are assigned to this queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for the channel specified by `channelId` or for any + * channel if `channelId` not specified. If set to false, then will return all workers including workers without any + * capacity for jobs. Defaults to false.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1702,7 +1693,6 @@ public Mono> deleteWorkerWithResponse(String workerId, RequestOpt
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -1824,13 +1814,11 @@ public PagedFlux listJobs(RouterJobStatusSelector status, String queu } PagedFlux pagedFluxResponse = listJobs(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() + pagedResponse.getValue().stream() .map(protocolMethodData -> protocolMethodData.toObject(RouterJob.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); @@ -1853,13 +1841,11 @@ public PagedFlux listJobs() { RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listJobs(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() + pagedResponse.getValue().stream() .map(protocolMethodData -> protocolMethodData.toObject(RouterJob.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); @@ -1990,7 +1976,8 @@ public Mono getWorker(String workerId) { // Generated convenience method for getWorkerWithResponse RequestOptions requestOptions = new RequestOptions(); return getWorkerWithResponse(workerId, requestOptions) - .map(response -> response.getValue().toObject(RouterWorker.class)); + .map(response -> response.getValue().toObject(RouterWorkerInternal.class)) + .map(internal -> RouterWorkerConstructorProxy.create(internal)); } /** @@ -2049,13 +2036,11 @@ public PagedFlux listWorkers(RouterWorkerStateSelector state, Stri } PagedFlux pagedFluxResponse = listWorkers(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() + pagedResponse.getValue().stream() .map(protocolMethodData -> protocolMethodData.toObject(RouterWorker.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); @@ -2078,13 +2063,11 @@ public PagedFlux listWorkers() { RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listWorkers(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() + pagedResponse.getValue().stream() .map(protocolMethodData -> protocolMethodData.toObject(RouterWorker.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); @@ -2122,19 +2105,17 @@ public Mono unassignJob(String jobId, String assignmentId, Un *

* Request Body Schema *

- * *
{@code
      * {
      *     note: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -2158,19 +2139,17 @@ public Mono> completeJobWithResponse(String jobId, String a *

* Request Body Schema *

- * *
{@code
      * {
      *     note: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -2190,7 +2169,6 @@ public Mono completeJob(String jobId, String assignmentId, RequestOp *

* Request Body Schema *

- * *
{@code
      * {
      *     dispositionCode: String (Optional)
@@ -2198,13 +2176,12 @@ public Mono completeJob(String jobId, String assignmentId, RequestOp
      *     note: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -2227,7 +2204,6 @@ public Mono> closeJobWithResponse(String jobId, String assi *

* Request Body Schema *

- * *
{@code
      * {
      *     dispositionCode: String (Optional)
@@ -2235,13 +2211,12 @@ public Mono> closeJobWithResponse(String jobId, String assi
      *     note: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClient.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClient.java index 93fa7cf53ece..bb19f9d05698 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClient.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClient.java @@ -4,6 +4,10 @@ package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.implementation.JobRouterClientImpl; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterJobConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterWorkerConstructorProxy; +import com.azure.communication.jobrouter.implementation.converters.JobAdapter; +import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter; import com.azure.communication.jobrouter.implementation.models.CancelJobOptionsInternal; import com.azure.communication.jobrouter.implementation.models.CancelJobResultInternal; import com.azure.communication.jobrouter.implementation.models.CloseJobOptionsInternal; @@ -17,8 +21,13 @@ import com.azure.communication.jobrouter.implementation.models.RouterJobInternal; import com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal; import com.azure.communication.jobrouter.models.AcceptJobOfferResult; +import com.azure.communication.jobrouter.models.CreateJobOptions; +import com.azure.communication.jobrouter.models.CreateWorkerOptions; +import com.azure.communication.jobrouter.models.RouterJob; import com.azure.communication.jobrouter.models.RouterJobPositionDetails; import com.azure.communication.jobrouter.models.RouterJobStatusSelector; +import com.azure.communication.jobrouter.models.RouterQueueStatistics; +import com.azure.communication.jobrouter.models.RouterWorker; import com.azure.communication.jobrouter.models.RouterWorkerStateSelector; import com.azure.communication.jobrouter.models.UnassignJobOptions; import com.azure.communication.jobrouter.models.UnassignJobResult; @@ -36,14 +45,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import java.time.OffsetDateTime; -import com.azure.communication.jobrouter.implementation.converters.JobAdapter; -import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter; -import com.azure.communication.jobrouter.models.CreateJobOptions; -import com.azure.communication.jobrouter.models.CreateJobWithClassificationPolicyOptions; -import com.azure.communication.jobrouter.models.CreateWorkerOptions; -import com.azure.communication.jobrouter.models.RouterJob; -import com.azure.communication.jobrouter.models.RouterQueueStatistics; -import com.azure.communication.jobrouter.models.RouterWorker; /** * Initializes a new instance of the synchronous JobRouterClient type. @@ -66,18 +67,34 @@ public final class JobRouterClient { /** * Creates or updates a router job. - *

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -127,13 +144,12 @@ public final class JobRouterClient {
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -183,7 +199,6 @@ public final class JobRouterClient {
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -200,7 +215,8 @@ public final class JobRouterClient { @Generated @ServiceMethod(returns = ReturnType.SINGLE) Response upsertJobWithResponse(String jobId, BinaryData resource, RequestOptions requestOptions) { - // Convenience API is not generated, as operation 'upsertJob' is 'application/merge-patch+json' and stream-style-serialization is not enabled + // Convenience API is not generated, as operation 'upsertJob' is 'application/merge-patch+json' and + // stream-style-serialization is not enabled return this.serviceClient.upsertJobWithResponse(jobId, resource, requestOptions); } @@ -354,7 +370,7 @@ public Response updateJobWithResponse(String jobId, BinaryData resou } /** - * Updates a router job. + * Creates or updates a router job. * *

* Header Parameters @@ -494,54 +510,11 @@ public Response updateJobWithResponse(String jobId, BinaryData resou * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a unit of work to be routed. + * @return BinaryData. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData updateJob(String jobId, BinaryData resource, RequestOptions requestOptions) { - return this.serviceClient.upsertJobWithResponse(jobId, resource, requestOptions).getValue(); - } - - /** - * Creates or updates a router job. - * - *

- * Header Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - * @param jobId The jobId of the job. - * @param job The job instance to update. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the updated job. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouterJob updateJob(String jobId, RouterJob job) { - return this.updateJobWithResponse(jobId, BinaryData.fromObject(job), null).getValue().toObject(RouterJob.class); + return this.updateJobWithResponse(jobId, resource, requestOptions).getValue(); } /** @@ -555,12 +528,15 @@ public RouterJob updateJob(String jobId, RouterJob job) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createJobWithResponse(CreateJobOptions createJobOptions, RequestOptions requestOptions) { + public Response createJobWithResponse(CreateJobOptions createJobOptions, + RequestOptions requestOptions) { + // Note: Update return type to Response in version 2. RouterJobInternal routerJob = JobAdapter.convertCreateJobOptionsToRouterJob(createJobOptions); Response response = this.serviceClient.upsertJobWithResponse(createJobOptions.getJobId(), BinaryData.fromObject(routerJob), requestOptions); - return new SimpleResponse(response.getRequest(), response.getStatusCode(), response.getHeaders(), - response.getValue().toObject(RouterJob.class)); + return new SimpleResponse(response.getRequest(), response.getStatusCode(), response.getHeaders(), + BinaryData + .fromObject(RouterJobConstructorProxy.create(response.getValue().toObject(RouterJobInternal.class)))); } /** @@ -575,53 +551,14 @@ public Response createJobWithResponse(CreateJobOptions createJobOptio @ServiceMethod(returns = ReturnType.SINGLE) public RouterJob createJob(CreateJobOptions createJobOptions) { RequestOptions requestOptions = new RequestOptions(); - return this.createJobWithResponse(createJobOptions, requestOptions).getValue(); - } - - /** - * Create a job using a classification policy. - * - * @param createJobWithClassificationPolicyOptions Options to create a RouterJob using a classification policy. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @return a unit of work to be routed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createJobWithClassificationPolicyWithResponse( - CreateJobWithClassificationPolicyOptions createJobWithClassificationPolicyOptions, - RequestOptions requestOptions) { - RouterJobInternal routerJob = JobAdapter - .convertCreateJobWithClassificationPolicyOptionsToRouterJob(createJobWithClassificationPolicyOptions); - Response response = this.serviceClient.upsertJobWithResponse( - createJobWithClassificationPolicyOptions.getJobId(), BinaryData.fromObject(routerJob), requestOptions); - return new SimpleResponse(response.getRequest(), response.getStatusCode(), response.getHeaders(), - response.getValue().toObject(RouterJob.class)); - } - - /** - * Convenience method to create a job using a classification policy. - * - * @param createJobWithClassificationPolicyOptions Options to create a RouterJob using a classification policy. - * @return a unit of work to be routed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouterJob createJobWithClassificationPolicy( - CreateJobWithClassificationPolicyOptions createJobWithClassificationPolicyOptions) { - RequestOptions requestOptions = new RequestOptions(); - return this - .createJobWithClassificationPolicyWithResponse(createJobWithClassificationPolicyOptions, requestOptions) - .getValue(); + return this.createJobWithResponse(createJobOptions, requestOptions).getValue().toObject(RouterJob.class); } /** * Retrieves an existing job by Id. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -671,7 +608,6 @@ public RouterJob createJobWithClassificationPolicy(
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -712,17 +648,16 @@ public Response deleteJobWithResponse(String jobId, RequestOptions request *

* Request Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -743,17 +678,16 @@ public Response reclassifyJobWithResponse(String jobId, RequestOptio *

* Request Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -774,20 +708,18 @@ public BinaryData reclassifyJob(String jobId, RequestOptions requestOptions) { *

* Request Body Schema *

- * *
{@code
      * {
      *     note: String (Optional)
      *     dispositionCode: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -808,20 +740,18 @@ public Response cancelJobWithResponse(String jobId, RequestOptions r *

* Request Body Schema *

- * *
{@code
      * {
      *     note: String (Optional)
      *     dispositionCode: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -839,26 +769,67 @@ public BinaryData cancelJob(String jobId, RequestOptions requestOptions) { /** * Retrieves list of jobs based on filter parameters. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", - * "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", - * "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by - * classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * before or at given timestamp. Range: (-Inf, scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * at or after given value. Range: [scheduledAfter, +Inf).
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned", + * "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", + * "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, + * scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -908,7 +879,6 @@ public BinaryData cancelJob(String jobId, RequestOptions requestOptions) {
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -928,8 +898,9 @@ public PagedIterable listJobs(RequestOptions requestOptions) { /** * Gets a job's position details. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     jobId: String (Required)
@@ -956,16 +927,17 @@ public Response getQueuePositionWithResponse(String jobId, RequestOp
 
     /**
      * Unassign a job.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     suspendMatching: Boolean (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     jobId: String (Required)
@@ -991,8 +963,9 @@ public Response unassignJobWithResponse(String jobId, String assignm
 
     /**
      * Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     assignmentId: String (Required)
@@ -1023,19 +996,17 @@ public Response acceptJobOfferWithResponse(String workerId, String o
      * 

* Request Body Schema *

- * *
{@code
      * {
      *     retryOfferAt: OffsetDateTime (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param workerId Id of a worker. @@ -1058,19 +1029,17 @@ public Response declineJobOfferWithResponse(String workerId, String *

* Request Body Schema *

- * *
{@code
      * {
      *     retryOfferAt: OffsetDateTime (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param workerId Id of a worker. @@ -1089,8 +1058,9 @@ public BinaryData declineJobOffer(String workerId, String offerId, RequestOption /** * Retrieves a queue's statistics. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     queueId: String (Required)
@@ -1118,18 +1088,34 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
 
     /**
      * Creates or updates a worker.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1171,12 +1157,11 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1218,7 +1203,6 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -1234,7 +1218,8 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque @Generated @ServiceMethod(returns = ReturnType.SINGLE) Response upsertWorkerWithResponse(String workerId, BinaryData resource, RequestOptions requestOptions) { - // Convenience API is not generated, as operation 'upsertWorker' is 'application/merge-patch+json' and stream-style-serialization is not enabled + // Convenience API is not generated, as operation 'upsertWorker' is 'application/merge-patch+json' and + // stream-style-serialization is not enabled return this.serviceClient.upsertWorkerWithResponse(workerId, resource, requestOptions); } @@ -1311,7 +1296,6 @@ Response upsertWorkerWithResponse(String workerId, BinaryData resour * ] * loadRatio: Double (Optional) * availableForOffers: Boolean (Optional) - * maxConcurrentOffers: Integer (Optional) * } * }
* @@ -1358,7 +1342,6 @@ Response upsertWorkerWithResponse(String workerId, BinaryData resour * ] * loadRatio: Double (Optional) * availableForOffers: Boolean (Optional) - * maxConcurrentOffers: Integer (Optional) * } * }
* @@ -1450,7 +1433,6 @@ public Response updateWorkerWithResponse(String workerId, BinaryData * ] * loadRatio: Double (Optional) * availableForOffers: Boolean (Optional) - * maxConcurrentOffers: Integer (Optional) * } * }
* @@ -1497,7 +1479,6 @@ public Response updateWorkerWithResponse(String workerId, BinaryData * ] * loadRatio: Double (Optional) * availableForOffers: Boolean (Optional) - * maxConcurrentOffers: Integer (Optional) * } * }
* @@ -1508,29 +1489,11 @@ public Response updateWorkerWithResponse(String workerId, BinaryData * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an entity for jobs to be routed. + * @return BinaryData. */ @ServiceMethod(returns = ReturnType.SINGLE) public BinaryData updateWorker(String workerId, BinaryData resource, RequestOptions requestOptions) { - return this.serviceClient.upsertWorkerWithResponse(workerId, resource, requestOptions).getValue(); - } - - /** - * Updates a worker. - * - * @param workerId Id of the worker. - * @param worker The worker to update. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return an entity for jobs to be routed to. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RouterWorker updateWorker(String workerId, RouterWorker worker) { - return this.updateWorkerWithResponse(workerId, BinaryData.fromObject(worker), null) - .getValue() - .toObject(RouterWorker.class); + return this.updateWorkerWithResponse(workerId, resource, requestOptions).getValue(); } /** @@ -1550,7 +1513,7 @@ public Response createWorkerWithResponse(CreateWorkerOptions creat Response response = this.serviceClient.upsertWorkerWithResponse(createWorkerOptions.getWorkerId(), BinaryData.fromObject(routerWorker), requestOptions); return new SimpleResponse(response.getRequest(), response.getStatusCode(), response.getHeaders(), - response.getValue().toObject(RouterWorker.class)); + RouterWorkerConstructorProxy.create(response.getValue().toObject(RouterWorkerInternal.class))); } /** @@ -1570,8 +1533,9 @@ public RouterWorker createWorker(CreateWorkerOptions createWorkerOptions) { /** * Retrieves an existing worker by Id. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1613,7 +1577,6 @@ public RouterWorker createWorker(CreateWorkerOptions createWorkerOptions) {
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -1650,24 +1613,54 @@ public Response deleteWorkerWithResponse(String workerId, RequestOptions r /** * Retrieves existing workers. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: - * "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration - * with this channel.
queueIdStringNoIf specified, select workers who are assigned to this - * queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for - * the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will - * return all workers including workers without any capacity for jobs. Defaults to false.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration with this channel.
queueIdStringNoIf specified, select workers who are assigned to this queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for the channel specified by `channelId` or for any + * channel if `channelId` not specified. If set to false, then will return all workers including workers without any + * capacity for jobs. Defaults to false.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1709,7 +1702,6 @@ public Response deleteWorkerWithResponse(String workerId, RequestOptions r
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -1740,6 +1732,7 @@ public PagedIterable listWorkers(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) public RouterJob getJob(String jobId) { + // Generated convenience method for getJobWithResponse RequestOptions requestOptions = new RequestOptions(); return getJobWithResponse(jobId, requestOptions).getValue().toObject(RouterJob.class); } @@ -1804,6 +1797,7 @@ CancelJobResultInternal cancelJob(String jobId) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listJobs(RouterJobStatusSelector status, String queueId, String channelId, String classificationPolicyId, OffsetDateTime scheduledBefore, OffsetDateTime scheduledAfter) { + // Generated convenience method for listJobs RequestOptions requestOptions = new RequestOptions(); if (status != null) { requestOptions.addQueryParam("status", status.toString(), false); @@ -1838,6 +1832,7 @@ public PagedIterable listJobs(RouterJobStatusSelector status, String */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listJobs() { + // Generated convenience method for listJobs RequestOptions requestOptions = new RequestOptions(); return serviceClient.listJobs(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(RouterJob.class)); } @@ -2072,19 +2067,17 @@ public UnassignJobResult unassignJob(String jobId, String assignmentId, Unassign *

* Request Body Schema *

- * *
{@code
      * {
      *     note: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -2107,19 +2100,17 @@ public Response completeJobWithResponse(String jobId, String assignm *

* Request Body Schema *

- * *
{@code
      * {
      *     note: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -2141,7 +2132,6 @@ public BinaryData completeJob(String jobId, String assignmentId, RequestOptions *

* Request Body Schema *

- * *
{@code
      * {
      *     dispositionCode: String (Optional)
@@ -2149,13 +2139,12 @@ public BinaryData completeJob(String jobId, String assignmentId, RequestOptions
      *     note: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -2177,7 +2166,6 @@ public Response closeJobWithResponse(String jobId, String assignment *

* Request Body Schema *

- * *
{@code
      * {
      *     dispositionCode: String (Optional)
@@ -2185,13 +2173,12 @@ public Response closeJobWithResponse(String jobId, String assignment
      *     note: String (Optional)
      * }
      * }
- * *

* Response Body Schema *

- * *
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java index dbcfeb2613cc..1b2ca0cc07a9 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter; -import com.azure.communication.common.implementation.HmacAuthenticationPolicy; import com.azure.communication.common.implementation.CommunicationConnectionString; -import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.client.traits.ConnectionStringTrait; -import com.azure.core.client.traits.KeyCredentialTrait; -import com.azure.core.client.traits.TokenCredentialTrait; import com.azure.communication.jobrouter.implementation.JobRouterClientImpl; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.ConnectionStringTrait; import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; @@ -24,9 +24,8 @@ 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.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.HttpLoggingPolicy; 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; @@ -43,8 +42,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import com.azure.core.credential.KeyCredential; -import com.azure.core.credential.TokenCredential; /** * A builder for creating a new instance of the JobRouterClient type. @@ -52,8 +49,8 @@ @ServiceClientBuilder(serviceClients = { JobRouterClient.class, JobRouterAsyncClient.class }) public final class JobRouterClientBuilder implements HttpTrait, ConfigurationTrait, - EndpointTrait, TokenCredentialTrait, - KeyCredentialTrait, ConnectionStringTrait { + EndpointTrait, ConnectionStringTrait, + KeyCredentialTrait, TokenCredentialTrait { @Generated private static final String SDK_NAME = "name"; @@ -70,7 +67,9 @@ public final class JobRouterClientBuilder private TokenCredential tokenCredential; - private KeyCredential keyCredential; + private KeyCredential credential; + + private CommunicationConnectionString connectionString; /** * Create an instance of the JobRouterClientBuilder. @@ -93,7 +92,7 @@ public JobRouterClientBuilder() { @Override public JobRouterClientBuilder pipeline(HttpPipeline pipeline) { if (this.pipeline != null && pipeline == null) { - LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + LOGGER.info("HttpPipeline is being set to 'null' when it was previously configured."); } this.pipeline = pipeline; return this; @@ -264,22 +263,17 @@ private HttpPipeline createHttpPipeline() { if (headers.getSize() > 0) { policies.add(new AddHeadersPolicy(headers)); } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) .forEach(p -> policies.add(p)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); policies.add(new AddDatePolicy()); - policies.add(createHttpPipelineAuthPolicy()); - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(localHttpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); + .httpClient(httpClient).clientOptions(localClientOptions).build(); return httpPipeline; } @@ -326,44 +320,32 @@ public JobRouterClientBuilder credential(TokenCredential tokenCredential) { * @return the updated RouterClientBuilder object */ public JobRouterClientBuilder credential(KeyCredential credential) { - this.keyCredential = Objects.requireNonNull(credential, "'credential' cannot be null."); + this.credential = Objects.requireNonNull(credential, "'credential' cannot be null."); return this; } /** - * Sets Service version. + * Set a connection string for authorization * - * @param serviceVersion the serviceVersion value. - * @return the JobRouterClientBuilder. + * @param connectionString valid token credential as a string + * @return the updated RouterClientBuilder object */ - @Generated - public JobRouterClientBuilder serviceVersion(JobRouterServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; + public JobRouterClientBuilder connectionString(String connectionString) { + this.connectionString = new CommunicationConnectionString(connectionString); + this.credential(new KeyCredential(this.connectionString.getAccessKey())); + this.endpoint(this.connectionString.getEndpoint()); return this; } /** - * Set a connection string for authorization. + * Sets Service version. * - * @param connectionString valid connectionString as a string. - * @return the updated JobRouterClientBuilder object. + * @param serviceVersion the serviceVersion value. + * @return the JobRouterClientBuilder. */ - public JobRouterClientBuilder connectionString(String connectionString) { - CommunicationConnectionString connection = new CommunicationConnectionString(connectionString); - this.credential(new AzureKeyCredential(connection.getAccessKey())); - this.endpoint(connection.getEndpoint()); + @Generated + public JobRouterClientBuilder serviceVersion(JobRouterServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; return this; } - - private HttpPipelinePolicy createHttpPipelineAuthPolicy() { - if (this.tokenCredential != null) { - return new BearerTokenAuthenticationPolicy(this.tokenCredential, - "https://communication.azure.com/.default"); - } else if (this.keyCredential != null) { - return new HmacAuthenticationPolicy(new AzureKeyCredential(this.keyCredential.getKey())); - } else { - throw LOGGER.logExceptionAsError( - new IllegalStateException("Missing credential information while building a client.")); - } - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterServiceVersion.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterServiceVersion.java index 749ebc32d978..9a25d4df04be 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterServiceVersion.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterServiceVersion.java @@ -13,12 +13,7 @@ public enum JobRouterServiceVersion implements ServiceVersion { /** * Enum value 2023-11-01. */ - V2023_11_01("2023-11-01"), - - /** - * Enum value 2024-01-18-preview. - */ - V2024_01_18_PREVIEW("2024-01-18-preview"); + V2023_11_01("2023-11-01"); private final String version; @@ -40,6 +35,6 @@ public String getVersion() { * @return The latest {@link JobRouterServiceVersion}. */ public static JobRouterServiceVersion getLatest() { - return V2024_01_18_PREVIEW; + return V2023_11_01; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java index d08757099075..1ee22ed8e203 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java @@ -589,18 +589,34 @@ Response listQueuesNextSync(@PathParam(value = "nextLink", encoded = /** * Creates or updates a distribution policy. - *

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -608,16 +624,15 @@ Response listQueuesNextSync(@PathParam(value = "nextLink", encoded =
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
      *     }
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -625,7 +640,6 @@ Response listQueuesNextSync(@PathParam(value = "nextLink", encoded =
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -655,18 +669,34 @@ public Mono> upsertDistributionPolicyWithResponseAsync(Stri
 
     /**
      * Creates or updates a distribution policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -674,16 +704,15 @@ public Mono> upsertDistributionPolicyWithResponseAsync(Stri
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
      *     }
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -691,7 +720,6 @@ public Mono> upsertDistributionPolicyWithResponseAsync(Stri
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -719,8 +747,9 @@ public Response upsertDistributionPolicyWithResponse(String distribu
 
     /**
      * Retrieves an existing distribution policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -728,7 +757,6 @@ public Response upsertDistributionPolicyWithResponse(String distribu
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -755,8 +783,9 @@ public Mono> getDistributionPolicyWithResponseAsync(String
 
     /**
      * Retrieves an existing distribution policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -764,7 +793,6 @@ public Mono> getDistributionPolicyWithResponseAsync(String
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -790,15 +818,28 @@ public Response getDistributionPolicyWithResponse(String distributio
 
     /**
      * Retrieves existing distribution policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -806,7 +847,6 @@ public Response getDistributionPolicyWithResponse(String distributio
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -834,15 +874,28 @@ private Mono> listDistributionPoliciesSinglePageAsync(
 
     /**
      * Retrieves existing distribution policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -850,7 +903,6 @@ private Mono> listDistributionPoliciesSinglePageAsync(
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -896,15 +948,28 @@ public PagedFlux listDistributionPoliciesAsync(RequestOptions reques
 
     /**
      * Retrieves existing distribution policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -912,7 +977,6 @@ public PagedFlux listDistributionPoliciesAsync(RequestOptions reques
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -938,15 +1002,28 @@ private PagedResponse listDistributionPoliciesSinglePage(RequestOpti
 
     /**
      * Retrieves existing distribution policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -954,7 +1031,6 @@ private PagedResponse listDistributionPoliciesSinglePage(RequestOpti
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -1038,18 +1114,34 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
 
     /**
      * Creates or updates a classification policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1058,22 +1150,19 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1082,15 +1171,12 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -1118,18 +1204,34 @@ public Mono> upsertClassificationPolicyWithResponseAsync(St
 
     /**
      * Creates or updates a classification policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1138,22 +1240,19 @@ public Mono> upsertClassificationPolicyWithResponseAsync(St
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1162,15 +1261,12 @@ public Mono> upsertClassificationPolicyWithResponseAsync(St
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -1196,8 +1292,9 @@ public Response upsertClassificationPolicyWithResponse(String classi
 
     /**
      * Retrieves an existing classification policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1206,15 +1303,12 @@ public Response upsertClassificationPolicyWithResponse(String classi
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -1239,8 +1333,9 @@ public Mono> getClassificationPolicyWithResponseAsync(Strin
 
     /**
      * Retrieves an existing classification policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1249,15 +1344,12 @@ public Mono> getClassificationPolicyWithResponseAsync(Strin
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -1281,15 +1373,28 @@ public Response getClassificationPolicyWithResponse(String classific
 
     /**
      * Retrieves existing classification policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1298,15 +1403,12 @@ public Response getClassificationPolicyWithResponse(String classific
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -1332,15 +1434,28 @@ private Mono> listClassificationPoliciesSinglePageAsyn
 
     /**
      * Retrieves existing classification policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1349,15 +1464,12 @@ private Mono> listClassificationPoliciesSinglePageAsyn
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -1401,15 +1513,28 @@ public PagedFlux listClassificationPoliciesAsync(RequestOptions requ
 
     /**
      * Retrieves existing classification policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1418,15 +1543,12 @@ public PagedFlux listClassificationPoliciesAsync(RequestOptions requ
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -1450,15 +1572,28 @@ private PagedResponse listClassificationPoliciesSinglePage(RequestOp
 
     /**
      * Retrieves existing classification policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1467,15 +1602,12 @@ private PagedResponse listClassificationPoliciesSinglePage(RequestOp
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -1557,18 +1689,34 @@ public Response deleteClassificationPolicyWithResponse(String classificati
 
     /**
      * Creates or updates a exception policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1578,11 +1726,9 @@ public Response deleteClassificationPolicyWithResponse(String classificati
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1590,9 +1736,9 @@ public Response deleteClassificationPolicyWithResponse(String classificati
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1602,11 +1748,9 @@ public Response deleteClassificationPolicyWithResponse(String classificati
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1637,18 +1781,34 @@ public Mono> upsertExceptionPolicyWithResponseAsync(String
 
     /**
      * Creates or updates a exception policy.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1658,11 +1818,9 @@ public Mono> upsertExceptionPolicyWithResponseAsync(String
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1670,9 +1828,9 @@ public Mono> upsertExceptionPolicyWithResponseAsync(String
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1682,11 +1840,9 @@ public Mono> upsertExceptionPolicyWithResponseAsync(String
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1715,8 +1871,9 @@ public Response upsertExceptionPolicyWithResponse(String exceptionPo
 
     /**
      * Retrieves an existing exception policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1726,11 +1883,9 @@ public Response upsertExceptionPolicyWithResponse(String exceptionPo
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1758,8 +1913,9 @@ public Mono> getExceptionPolicyWithResponseAsync(String exc
 
     /**
      * Retrieves an existing exception policy by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1769,11 +1925,9 @@ public Mono> getExceptionPolicyWithResponseAsync(String exc
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1800,15 +1954,28 @@ public Response getExceptionPolicyWithResponse(String exceptionPolic
 
     /**
      * Retrieves existing exception policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1818,11 +1985,9 @@ public Response getExceptionPolicyWithResponse(String exceptionPolic
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1851,15 +2016,28 @@ private Mono> listExceptionPoliciesSinglePageAsync(Req
 
     /**
      * Retrieves existing exception policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1869,11 +2047,9 @@ private Mono> listExceptionPoliciesSinglePageAsync(Req
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1920,15 +2096,28 @@ public PagedFlux listExceptionPoliciesAsync(RequestOptions requestOp
 
     /**
      * Retrieves existing exception policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1938,11 +2127,9 @@ public PagedFlux listExceptionPoliciesAsync(RequestOptions requestOp
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -1969,15 +2156,28 @@ private PagedResponse listExceptionPoliciesSinglePage(RequestOptions
 
     /**
      * Retrieves existing exception policies.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1987,11 +2187,9 @@ private PagedResponse listExceptionPoliciesSinglePage(RequestOptions
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -2075,18 +2273,34 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
 
     /**
      * Creates or updates a queue.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2099,9 +2313,9 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
      *     exceptionPolicyId: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2136,18 +2350,34 @@ public Mono> upsertQueueWithResponseAsync(String queueId, B
 
     /**
      * Creates or updates a queue.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2160,9 +2390,9 @@ public Mono> upsertQueueWithResponseAsync(String queueId, B
      *     exceptionPolicyId: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2196,8 +2426,9 @@ public Response upsertQueueWithResponse(String queueId, BinaryData r
 
     /**
      * Retrieves an existing queue by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2229,8 +2460,9 @@ public Mono> getQueueWithResponseAsync(String queueId, Requ
 
     /**
      * Retrieves an existing queue by Id.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2261,15 +2493,28 @@ public Response getQueueWithResponse(String queueId, RequestOptions
 
     /**
      * Retrieves existing queues.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2303,15 +2548,28 @@ private Mono> listQueuesSinglePageAsync(RequestOptions
 
     /**
      * Retrieves existing queues.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2363,15 +2621,28 @@ public PagedFlux listQueuesAsync(RequestOptions requestOptions) {
 
     /**
      * Retrieves existing queues.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2403,15 +2674,28 @@ private PagedResponse listQueuesSinglePage(RequestOptions requestOpt
 
     /**
      * Retrieves existing queues.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2501,8 +2785,9 @@ public Response deleteQueueWithResponse(String queueId, RequestOptions req
      * Retrieves existing distribution policies.
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2510,7 +2795,6 @@ public Response deleteQueueWithResponse(String queueId, RequestOptions req
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -2544,8 +2828,9 @@ private Mono> listDistributionPoliciesNextSinglePageAs
      * Retrieves existing distribution policies.
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2553,7 +2838,6 @@ private Mono> listDistributionPoliciesNextSinglePageAs
      *     name: String (Optional)
      *     offerExpiresAfterSeconds: Double (Optional)
      *     mode (Optional): {
-     *         kind: String(bestWorker/longestIdle/roundRobin) (Required)
      *         minConcurrentOffers: Integer (Optional)
      *         maxConcurrentOffers: Integer (Optional)
      *         bypassSelectors: Boolean (Optional)
@@ -2585,8 +2869,9 @@ private PagedResponse listDistributionPoliciesNextSinglePage(String
      * Retrieves existing classification policies.
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2595,15 +2880,12 @@ private PagedResponse listDistributionPoliciesNextSinglePage(String
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -2635,8 +2917,9 @@ private Mono> listClassificationPoliciesNextSinglePage
      * Retrieves existing classification policies.
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2645,15 +2928,12 @@ private Mono> listClassificationPoliciesNextSinglePage
      *     fallbackQueueId: String (Optional)
      *     queueSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      *     prioritizationRule (Optional): {
-     *         kind: String(directMap/expression/function/static/webhook) (Required)
      *     }
      *     workerSelectorAttachments (Optional): [
      *          (Optional){
-     *             kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Required)
      *         }
      *     ]
      * }
@@ -2683,8 +2963,9 @@ private PagedResponse listClassificationPoliciesNextSinglePage(Strin
      * Retrieves existing exception policies.
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2694,11 +2975,9 @@ private PagedResponse listClassificationPoliciesNextSinglePage(Strin
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -2732,8 +3011,9 @@ private Mono> listExceptionPoliciesNextSinglePageAsync
      * Retrieves existing exception policies.
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2743,11 +3023,9 @@ private Mono> listExceptionPoliciesNextSinglePageAsync
      *          (Optional){
      *             id: String (Required)
      *             trigger (Required): {
-     *                 kind: String(queueLength/waitTime) (Required)
      *             }
      *             actions (Required): [
      *                  (Required){
-     *                     kind: String(cancel/manualReclassify/reclassify) (Required)
      *                     id: String (Optional)
      *                 }
      *             ]
@@ -2780,8 +3058,9 @@ private PagedResponse listExceptionPoliciesNextSinglePage(String nex
      * Retrieves existing queues.
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2821,8 +3100,9 @@ private Mono> listQueuesNextSinglePageAsync(String nex
      * Retrieves existing queues.
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java
index 0a51937a50ad..4ef16e75e5c8 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java
@@ -559,18 +559,34 @@ Response listWorkersNextSync(@PathParam(value = "nextLink", encoded
 
     /**
      * Creates or updates a router job.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -620,13 +636,12 @@ Response listWorkersNextSync(@PathParam(value = "nextLink", encoded
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -676,7 +691,6 @@ Response listWorkersNextSync(@PathParam(value = "nextLink", encoded
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -701,18 +715,34 @@ public Mono> upsertJobWithResponseAsync(String jobId, Binar /** * Creates or updates a router job. - *

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -762,13 +792,12 @@ public Mono> upsertJobWithResponseAsync(String jobId, Binar
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -818,7 +847,6 @@ public Mono> upsertJobWithResponseAsync(String jobId, Binar
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -843,8 +871,9 @@ public Response upsertJobWithResponse(String jobId, BinaryData resou /** * Retrieves an existing job by Id. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -894,7 +923,6 @@ public Response upsertJobWithResponse(String jobId, BinaryData resou
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -916,8 +944,9 @@ public Mono> getJobWithResponseAsync(String jobId, RequestO /** * Retrieves an existing job by Id. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -967,7 +996,6 @@ public Mono> getJobWithResponseAsync(String jobId, RequestO
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -1025,16 +1053,19 @@ public Response deleteJobWithResponse(String jobId, RequestOptions request /** * Reclassify a job. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -1061,16 +1092,19 @@ public Mono> reclassifyJobWithResponseAsync(String jobId, R /** * Reclassify a job. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -1096,19 +1130,21 @@ public Response reclassifyJobWithResponse(String jobId, RequestOptio /** * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     note: String (Optional)
      *     dispositionCode: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -1135,19 +1171,21 @@ public Mono> cancelJobWithResponseAsync(String jobId, Reque /** * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     note: String (Optional)
      *     dispositionCode: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -1173,18 +1211,20 @@ public Response cancelJobWithResponse(String jobId, RequestOptions r /** * Completes an assigned job. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     note: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -1213,18 +1253,20 @@ public Mono> completeJobWithResponseAsync(String jobId, Str /** * Completes an assigned job. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     note: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -1252,8 +1294,9 @@ public Response completeJobWithResponse(String jobId, String assignm /** * Closes a completed job. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     dispositionCode: String (Optional)
@@ -1261,11 +1304,12 @@ public Response completeJobWithResponse(String jobId, String assignm
      *     note: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -1293,8 +1337,9 @@ public Mono> closeJobWithResponseAsync(String jobId, String /** * Closes a completed job. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     dispositionCode: String (Optional)
@@ -1302,11 +1347,12 @@ public Mono> closeJobWithResponseAsync(String jobId, String
      *     note: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param jobId Id of a job. @@ -1333,26 +1379,67 @@ public Response closeJobWithResponse(String jobId, String assignment /** * Retrieves list of jobs based on filter parameters. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", - * "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", - * "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by - * classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * before or at given timestamp. Range: (-Inf, scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * at or after given value. Range: [scheduledAfter, +Inf).
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned", + * "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", + * "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, + * scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1402,7 +1489,6 @@ public Response closeJobWithResponse(String jobId, String assignment
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -1427,26 +1513,67 @@ private Mono> listJobsSinglePageAsync(RequestOptions r /** * Retrieves list of jobs based on filter parameters. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", - * "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", - * "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by - * classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * before or at given timestamp. Range: (-Inf, scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * at or after given value. Range: [scheduledAfter, +Inf).
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned", + * "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", + * "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, + * scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1496,7 +1623,6 @@ private Mono> listJobsSinglePageAsync(RequestOptions r
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -1539,26 +1665,67 @@ public PagedFlux listJobsAsync(RequestOptions requestOptions) { /** * Retrieves list of jobs based on filter parameters. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", - * "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", - * "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by - * classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * before or at given timestamp. Range: (-Inf, scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * at or after given value. Range: [scheduledAfter, +Inf).
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned", + * "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", + * "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, + * scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1608,7 +1775,6 @@ public PagedFlux listJobsAsync(RequestOptions requestOptions) {
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -1631,26 +1797,67 @@ private PagedResponse listJobsSinglePage(RequestOptions requestOptio /** * Retrieves list of jobs based on filter parameters. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", - * "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", - * "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by - * classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * before or at given timestamp. Range: (-Inf, scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled - * at or after given value. Range: [scheduledAfter, +Inf).
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
statusStringNoIf specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned", + * "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", + * "scheduleFailed", "waitingForActivation", "active".
queueIdStringNoIf specified, filter jobs by queue.
channelIdStringNoIf specified, filter jobs by channel.
classificationPolicyIdStringNoIf specified, filter jobs by classificationPolicy.
scheduledBeforeOffsetDateTimeNoIf specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, + * scheduledBefore].
scheduledAfterOffsetDateTimeNoIf specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -1700,7 +1907,6 @@ private PagedResponse listJobsSinglePage(RequestOptions requestOptio
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -1743,8 +1949,9 @@ public PagedIterable listJobs(RequestOptions requestOptions) { /** * Gets a job's position details. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     jobId: String (Required)
@@ -1772,8 +1979,9 @@ public Mono> getQueuePositionWithResponseAsync(String jobId
 
     /**
      * Gets a job's position details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     jobId: String (Required)
@@ -1801,16 +2009,17 @@ public Response getQueuePositionWithResponse(String jobId, RequestOp
 
     /**
      * Unassign a job.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     suspendMatching: Boolean (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     jobId: String (Required)
@@ -1844,16 +2053,17 @@ public Mono> unassignJobWithResponseAsync(String jobId, Str
 
     /**
      * Unassign a job.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     suspendMatching: Boolean (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     jobId: String (Required)
@@ -1886,8 +2096,9 @@ public Response unassignJobWithResponse(String jobId, String assignm
 
     /**
      * Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     assignmentId: String (Required)
@@ -1916,8 +2127,9 @@ public Mono> acceptJobOfferWithResponseAsync(String workerI
 
     /**
      * Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     assignmentId: String (Required)
@@ -1946,18 +2158,20 @@ public Response acceptJobOfferWithResponse(String workerId, String o
 
     /**
      * Declines an offer to work on a job.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     retryOfferAt: OffsetDateTime (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param workerId Id of a worker. @@ -1986,18 +2200,20 @@ public Mono> declineJobOfferWithResponseAsync(String worker /** * Declines an offer to work on a job. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     retryOfferAt: OffsetDateTime (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
-     * { }
+     * {
+     * }
      * }
* * @param workerId Id of a worker. @@ -2025,8 +2241,9 @@ public Response declineJobOfferWithResponse(String workerId, String /** * Retrieves a queue's statistics. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     queueId: String (Required)
@@ -2056,8 +2273,9 @@ public Mono> getQueueStatisticsWithResponseAsync(String que
 
     /**
      * Retrieves a queue's statistics.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     queueId: String (Required)
@@ -2086,18 +2304,34 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
 
     /**
      * Creates or updates a worker.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2139,12 +2373,11 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2186,7 +2419,6 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -2210,18 +2442,34 @@ public Mono> upsertWorkerWithResponseAsync(String workerId, /** * Creates or updates a worker. - *

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this - * string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the - * entity was not modified after this time.
NameTypeRequiredDescription
If-MatchStringNoThe request should only proceed if an entity matches this string.
If-Unmodified-SinceOffsetDateTimeNoThe request should only proceed if the entity was not modified after this time.
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2263,12 +2511,11 @@ public Mono> upsertWorkerWithResponseAsync(String workerId,
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2310,7 +2557,6 @@ public Mono> upsertWorkerWithResponseAsync(String workerId,
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -2334,8 +2580,9 @@ public Response upsertWorkerWithResponse(String workerId, BinaryData /** * Retrieves an existing worker by Id. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2377,7 +2624,6 @@ public Response upsertWorkerWithResponse(String workerId, BinaryData
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -2398,8 +2644,9 @@ public Mono> getWorkerWithResponseAsync(String workerId, Re /** * Retrieves an existing worker by Id. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2441,7 +2688,6 @@ public Mono> getWorkerWithResponseAsync(String workerId, Re
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -2498,24 +2744,54 @@ public Response deleteWorkerWithResponse(String workerId, RequestOptions r /** * Retrieves existing workers. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: - * "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration - * with this channel.
queueIdStringNoIf specified, select workers who are assigned to this - * queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for - * the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will - * return all workers including workers without any capacity for jobs. Defaults to false.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration with this channel.
queueIdStringNoIf specified, select workers who are assigned to this queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for the channel specified by `channelId` or for any + * channel if `channelId` not specified. If set to false, then will return all workers including workers without any + * capacity for jobs. Defaults to false.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2557,7 +2833,6 @@ public Response deleteWorkerWithResponse(String workerId, RequestOptions r
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -2581,24 +2856,54 @@ private Mono> listWorkersSinglePageAsync(RequestOption /** * Retrieves existing workers. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: - * "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration - * with this channel.
queueIdStringNoIf specified, select workers who are assigned to this - * queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for - * the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will - * return all workers including workers without any capacity for jobs. Defaults to false.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration with this channel.
queueIdStringNoIf specified, select workers who are assigned to this queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for the channel specified by `channelId` or for any + * channel if `channelId` not specified. If set to false, then will return all workers including workers without any + * capacity for jobs. Defaults to false.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2640,7 +2945,6 @@ private Mono> listWorkersSinglePageAsync(RequestOption
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -2682,24 +2986,54 @@ public PagedFlux listWorkersAsync(RequestOptions requestOptions) { /** * Retrieves existing workers. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: - * "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration - * with this channel.
queueIdStringNoIf specified, select workers who are assigned to this - * queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for - * the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will - * return all workers including workers without any capacity for jobs. Defaults to false.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration with this channel.
queueIdStringNoIf specified, select workers who are assigned to this queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for the channel specified by `channelId` or for any + * channel if `channelId` not specified. If set to false, then will return all workers including workers without any + * capacity for jobs. Defaults to false.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2741,7 +3075,6 @@ public PagedFlux listWorkersAsync(RequestOptions requestOptions) {
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -2763,24 +3096,54 @@ private PagedResponse listWorkersSinglePage(RequestOptions requestOp /** * Retrieves existing workers. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: - * "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration - * with this channel.
queueIdStringNoIf specified, select workers who are assigned to this - * queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for - * the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will - * return all workers including workers without any capacity for jobs. Defaults to false.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
stateStringNoIf specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
channelIdStringNoIf specified, select workers who have a channel configuration with this channel.
queueIdStringNoIf specified, select workers who are assigned to this queue.
hasCapacityBooleanNoIf set to true, select only workers who have capacity for the channel specified by `channelId` or for any + * channel if `channelId` not specified. If set to false, then will return all workers including workers without any + * capacity for jobs. Defaults to false.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2822,7 +3185,6 @@ private PagedResponse listWorkersSinglePage(RequestOptions requestOp
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -2866,8 +3228,9 @@ public PagedIterable listWorkers(RequestOptions requestOptions) { * Retrieves list of jobs based on filter parameters. * * Get the next page of items. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2917,7 +3280,6 @@ public PagedIterable listWorkers(RequestOptions requestOptions) {
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -2947,8 +3309,9 @@ private Mono> listJobsNextSinglePageAsync(String nextL * Retrieves list of jobs based on filter parameters. * * Get the next page of items. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -2998,7 +3361,6 @@ private Mono> listJobsNextSinglePageAsync(String nextL
      *     ]
      *     scheduledAt: OffsetDateTime (Optional)
      *     matchingMode (Optional): {
-     *         kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Required)
      *     }
      * }
      * }
@@ -3026,8 +3388,9 @@ private PagedResponse listJobsNextSinglePage(String nextLink, Reques * Retrieves existing workers. * * Get the next page of items. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -3069,7 +3432,6 @@ private PagedResponse listJobsNextSinglePage(String nextLink, Reques
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* @@ -3099,8 +3461,9 @@ private Mono> listWorkersNextSinglePageAsync(String ne * Retrieves existing workers. * * Get the next page of items. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     etag: String (Required)
@@ -3142,7 +3505,6 @@ private Mono> listWorkersNextSinglePageAsync(String ne
      *     ]
      *     loadRatio: Double (Optional)
      *     availableForOffers: Boolean (Optional)
-     *     maxConcurrentOffers: Integer (Optional)
      * }
      * }
* diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/ClassificationPolicyConstructorProxy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/ClassificationPolicyConstructorProxy.java new file mode 100644 index 000000000000..1ee337a5f43f --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/ClassificationPolicyConstructorProxy.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.jobrouter.implementation.accesshelpers; + +import com.azure.communication.jobrouter.implementation.models.ClassificationPolicyInternal; +import com.azure.communication.jobrouter.models.ClassificationPolicy; + +/** + * Helper class to access private values of {@link ClassificationPolicy} across package boundaries. + */ +public final class ClassificationPolicyConstructorProxy { + + private static ClassificationPolicyConstructorAccessor accessor; + + private ClassificationPolicyConstructorProxy() { } + + /** + * Type defining the methods to set the non-public properties of a {@link ClassificationPolicyConstructorAccessor} + * instance. + */ + public interface ClassificationPolicyConstructorAccessor { + /** + * Creates a new instance of {@link ClassificationPolicy} backed by an internal instance of + * {@link ClassificationPolicy}. + * + * @param internal The internal response. + * @return A new instance of {@link ClassificationPolicy}. + */ + ClassificationPolicy create(ClassificationPolicyInternal internal); + } + + /** + * The method called from {@link ClassificationPolicy} to set it's accessor. + * + * @param accessor The accessor. + */ + public static void setAccessor(final ClassificationPolicyConstructorAccessor accessor) { + ClassificationPolicyConstructorProxy.accessor = accessor; + } + + /** + * Creates a new instance of {@link ClassificationPolicy} backed by an internal instance of + * {@link ClassificationPolicyInternal}. + * + * @param internal The internal response. + * @return A new instance of {@link ClassificationPolicy}. + */ + public static ClassificationPolicy create(ClassificationPolicyInternal internal) { + // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the + // application accesses RouterJob which triggers the accessor to be configured. So, if the accessor + // is null this effectively pokes the class to set up the accessor. + if (accessor == null) { + new ClassificationPolicy(); + } + + assert accessor != null; + return accessor.create(internal); + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/DistributionPolicyConstructorProxy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/DistributionPolicyConstructorProxy.java new file mode 100644 index 000000000000..f536d300b8d9 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/DistributionPolicyConstructorProxy.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.jobrouter.implementation.accesshelpers; + +import com.azure.communication.jobrouter.implementation.models.DistributionPolicyInternal; +import com.azure.communication.jobrouter.models.DistributionPolicy; + +/** + * Helper class to access private values of {@link DistributionPolicy} across package boundaries. + */ +public final class DistributionPolicyConstructorProxy { + + private static DistributionPolicyConstructorAccessor accessor; + + private DistributionPolicyConstructorProxy() { } + + /** + * Type defining the methods to set the non-public properties of a {@link DistributionPolicyConstructorAccessor} + * instance. + */ + public interface DistributionPolicyConstructorAccessor { + /** + * Creates a new instance of {@link DistributionPolicy} backed by an internal instance of + * {@link DistributionPolicy}. + * + * @param internal The internal response. + * @return A new instance of {@link DistributionPolicy}. + */ + DistributionPolicy create(DistributionPolicyInternal internal); + } + + /** + * The method called from {@link DistributionPolicy} to set it's accessor. + * + * @param accessor The accessor. + */ + public static void setAccessor(final DistributionPolicyConstructorAccessor accessor) { + DistributionPolicyConstructorProxy.accessor = accessor; + } + + /** + * Creates a new instance of {@link DistributionPolicy} backed by an internal instance of + * {@link DistributionPolicyInternal}. + * + * @param internal The internal response. + * @return A new instance of {@link DistributionPolicy}. + */ + public static DistributionPolicy create(DistributionPolicyInternal internal) { + // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the + // application accesses RouterJob which triggers the accessor to be configured. So, if the accessor + // is null this effectively pokes the class to set up the accessor. + if (accessor == null) { + new DistributionPolicy(); + } + + assert accessor != null; + return accessor.create(internal); + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/ExceptionPolicyConstructorProxy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/ExceptionPolicyConstructorProxy.java new file mode 100644 index 000000000000..3c2a737853e2 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/ExceptionPolicyConstructorProxy.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.jobrouter.implementation.accesshelpers; + +import com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal; +import com.azure.communication.jobrouter.models.ExceptionPolicy; + +/** + * Helper class to access private values of {@link ExceptionPolicy} across package boundaries. + */ +public final class ExceptionPolicyConstructorProxy { + + private static ExceptionPolicyConstructorAccessor accessor; + + private ExceptionPolicyConstructorProxy() { } + + /** + * Type defining the methods to set the non-public properties of a {@link ExceptionPolicyConstructorAccessor} + * instance. + */ + public interface ExceptionPolicyConstructorAccessor { + /** + * Creates a new instance of {@link ExceptionPolicy} backed by an internal instance of + * {@link ExceptionPolicy}. + * + * @param internal The internal response. + * @return A new instance of {@link ExceptionPolicy}. + */ + ExceptionPolicy create(ExceptionPolicyInternal internal); + } + + /** + * The method called from {@link ExceptionPolicy} to set it's accessor. + * + * @param accessor The accessor. + */ + public static void setAccessor(final ExceptionPolicyConstructorAccessor accessor) { + ExceptionPolicyConstructorProxy.accessor = accessor; + } + + /** + * Creates a new instance of {@link ExceptionPolicy} backed by an internal instance of + * {@link ExceptionPolicyInternal}. + * + * @param internal The internal response. + * @return A new instance of {@link ExceptionPolicy}. + */ + public static ExceptionPolicy create(ExceptionPolicyInternal internal) { + // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the + // application accesses RouterJob which triggers the accessor to be configured. So, if the accessor + // is null this effectively pokes the class to set up the accessor. + if (accessor == null) { + new ExceptionPolicy(); + } + + assert accessor != null; + return accessor.create(internal); + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterJobConstructorProxy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterJobConstructorProxy.java new file mode 100644 index 000000000000..ba78f3b3a373 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterJobConstructorProxy.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.jobrouter.implementation.accesshelpers; + +import com.azure.communication.jobrouter.implementation.models.RouterJobInternal; +import com.azure.communication.jobrouter.models.RouterJob; + +/** + * Helper class to access private values of {@link RouterJob} across package boundaries. + */ +public final class RouterJobConstructorProxy { + + private static RouterJobConstructorAccessor accessor; + + private RouterJobConstructorProxy() { } + + /** + * Type defining the methods to set the non-public properties of a {@link RouterJobConstructorAccessor} + * instance. + */ + public interface RouterJobConstructorAccessor { + /** + * Creates a new instance of {@link RouterJob} backed by an internal instance of + * {@link RouterJob}. + * + * @param internal The internal response. + * @return A new instance of {@link RouterJob}. + */ + RouterJob create(RouterJobInternal internal); + } + + /** + * The method called from {@link RouterJob} to set it's accessor. + * + * @param accessor The accessor. + */ + public static void setAccessor(final RouterJobConstructorAccessor accessor) { + RouterJobConstructorProxy.accessor = accessor; + } + + /** + * Creates a new instance of {@link RouterJob} backed by an internal instance of + * {@link RouterJobInternal}. + * + * @param internal The internal response. + * @return A new instance of {@link RouterJob}. + */ + public static RouterJob create(RouterJobInternal internal) { + // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the + // application accesses RouterJob which triggers the accessor to be configured. So, if the accessor + // is null this effectively pokes the class to set up the accessor. + if (accessor == null) { + new RouterJob(); + } + + assert accessor != null; + return accessor.create(internal); + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterQueueConstructorProxy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterQueueConstructorProxy.java new file mode 100644 index 000000000000..a7b8c71e70d9 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterQueueConstructorProxy.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.jobrouter.implementation.accesshelpers; + +import com.azure.communication.jobrouter.implementation.models.RouterQueueInternal; +import com.azure.communication.jobrouter.models.RouterQueue; + +/** + * Helper class to access private values of {@link RouterQueue} across package boundaries. + */ +public final class RouterQueueConstructorProxy { + + private static RouterQueueConstructorAccessor accessor; + + private RouterQueueConstructorProxy() { } + + /** + * Type defining the methods to set the non-public properties of a {@link RouterQueueConstructorAccessor} + * instance. + */ + public interface RouterQueueConstructorAccessor { + /** + * Creates a new instance of {@link RouterQueue} backed by an internal instance of + * {@link RouterQueue}. + * + * @param internal The internal response. + * @return A new instance of {@link RouterQueue}. + */ + RouterQueue create(RouterQueueInternal internal); + } + + /** + * The method called from {@link RouterQueue} to set it's accessor. + * + * @param accessor The accessor. + */ + public static void setAccessor(final RouterQueueConstructorAccessor accessor) { + RouterQueueConstructorProxy.accessor = accessor; + } + + /** + * Creates a new instance of {@link RouterQueue} backed by an internal instance of + * {@link RouterQueueInternal}. + * + * @param internal The internal response. + * @return A new instance of {@link RouterQueue}. + */ + public static RouterQueue create(RouterQueueInternal internal) { + // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the + // application accesses RouterJob which triggers the accessor to be configured. So, if the accessor + // is null this effectively pokes the class to set up the accessor. + if (accessor == null) { + new RouterQueue(); + } + + assert accessor != null; + return accessor.create(internal); + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterValueConstructorProxy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterValueConstructorProxy.java new file mode 100644 index 000000000000..aeaa478f21dd --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterValueConstructorProxy.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.jobrouter.implementation.accesshelpers; + +import com.azure.communication.jobrouter.models.RouterValue; + +/** + * Helper class to access private values of {@link RouterValue} across package boundaries. + */ +public final class RouterValueConstructorProxy { + + private static RouterValueConstructorAccessor accessor; + + private RouterValueConstructorProxy() { } + + /** + * Type defining the methods to set the non-public properties of a {@link RouterValueConstructorAccessor} + * instance. + */ + public interface RouterValueConstructorAccessor { + /** + * Creates a new instance of {@link RouterValue} backed by an internal instance of + * {@link RouterValue}. + * + * @param internal The internal response. + * @return A new instance of {@link RouterValue}. + */ + RouterValue create(Object internal); + } + + /** + * The method called from {@link RouterValue} to set it's accessor. + * + * @param accessor The accessor. + */ + public static void setAccessor(final RouterValueConstructorAccessor accessor) { + RouterValueConstructorProxy.accessor = accessor; + } + + /** + * Creates a new instance of {@link RouterValue} backed by an internal instance of + * {@link Object}. + * + * @param internal The internal response. + * @return A new instance of {@link RouterValue}. + */ + public static RouterValue create(Object internal) { + // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the + // application accesses LabelValue which triggers the accessor to be configured. So, if the accessor + // is null this effectively pokes the class to set up the accessor. + if (accessor == null) { + new RouterValue(""); + } + + assert accessor != null; + return accessor.create(internal); + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterWorkerConstructorProxy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterWorkerConstructorProxy.java new file mode 100644 index 000000000000..438f02ff0f0a --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/accesshelpers/RouterWorkerConstructorProxy.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.jobrouter.implementation.accesshelpers; + +import com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal; +import com.azure.communication.jobrouter.models.RouterWorker; + +/** + * Helper class to access private values of {@link RouterWorker} across package boundaries. + */ +public final class RouterWorkerConstructorProxy { + + private static RouterWorkerConstructorAccessor accessor; + + private RouterWorkerConstructorProxy() { } + + /** + * Type defining the methods to set the non-public properties of a {@link RouterWorkerConstructorAccessor} + * instance. + */ + public interface RouterWorkerConstructorAccessor { + /** + * Creates a new instance of {@link RouterWorker} backed by an internal instance of + * {@link RouterWorker}. + * + * @param internal The internal response. + * @return A new instance of {@link RouterWorker}. + */ + RouterWorker create(RouterWorkerInternal internal); + } + + /** + * The method called from {@link RouterWorker} to set it's accessor. + * + * @param accessor The accessor. + */ + public static void setAccessor(final RouterWorkerConstructorAccessor accessor) { + RouterWorkerConstructorProxy.accessor = accessor; + } + + /** + * Creates a new instance of {@link RouterWorker} backed by an internal instance of + * {@link RouterWorkerInternal}. + * + * @param internal The internal response. + * @return A new instance of {@link RouterWorker}. + */ + public static RouterWorker create(RouterWorkerInternal internal) { + // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the + // application accesses RouterJob which triggers the accessor to be configured. So, if the accessor + // is null this effectively pokes the class to set up the accessor. + if (accessor == null) { + new RouterWorker(); + } + + assert accessor != null; + return accessor.create(internal); + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/ClassificationPolicyAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/ClassificationPolicyAdapter.java index 6cb7d698b940..c1db8f954646 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/ClassificationPolicyAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/ClassificationPolicyAdapter.java @@ -29,13 +29,22 @@ public static ClassificationPolicyInternal convertCreateOptionsToClassificationP .setName(options.getName()) .setPrioritizationRule(prioritizationRuleInternal) .setFallbackQueueId(options.getFallbackQueueId()) - .setQueueSelectorAttachments(options.getQueueSelectors() != null - ? options.getQueueSelectors().stream() - .map(LabelSelectorAdapter::convertQueueSelectorAttachmentToInternal).collect(Collectors.toList()) - : null) - .setWorkerSelectorAttachments(options.getWorkerSelectors() != null - ? options.getWorkerSelectors().stream() - .map(LabelSelectorAdapter::convertWorkerSelectorAttachmentToInternal).collect(Collectors.toList()) - : null); + .setQueueSelectorAttachments(options.getQueueSelectors().stream() + .map(LabelSelectorAdapter::convertQueueSelectorAttachmentToInternal).collect(Collectors.toList())) + .setWorkerSelectorAttachments(options.getWorkerSelectors().stream() + .map(LabelSelectorAdapter::convertWorkerSelectorAttachmentToInternal).collect(Collectors.toList())); + } + + public static ClassificationPolicyInternal convertClassificationPolicyToClassificationPolicyInternal(ClassificationPolicy classificationPolicy) { + return new ClassificationPolicyInternal() + .setEtag(classificationPolicy.getEtag()) + .setId(classificationPolicy.getId()) + .setName(classificationPolicy.getName()) + .setWorkerSelectorAttachments(classificationPolicy.getWorkerSelectorAttachments().stream() + .map(LabelSelectorAdapter::convertWorkerSelectorAttachmentToInternal).collect(Collectors.toList())) + .setQueueSelectorAttachments(classificationPolicy.getQueueSelectorAttachments().stream() + .map(LabelSelectorAdapter::convertQueueSelectorAttachmentToInternal).collect(Collectors.toList())) + .setFallbackQueueId(classificationPolicy.getFallbackQueueId()) + .setPrioritizationRule(getRouterRuleInternal(classificationPolicy.getPrioritizationRule())); } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/DistributionPolicyAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/DistributionPolicyAdapter.java index 3812c223a3b6..044ac01f8761 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/DistributionPolicyAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/DistributionPolicyAdapter.java @@ -58,4 +58,38 @@ public static DistributionModeInternal convertDistributionModeToInternal(Distrib return null; } + public static DistributionMode convertDistributionModeToPublic(DistributionModeInternal mode) { + if (mode instanceof BestWorkerModeInternal) { + BestWorkerModeInternal bestWorker = (BestWorkerModeInternal) mode; + return new BestWorkerMode() + .setMinConcurrentOffers(bestWorker.getMinConcurrentOffers()) + .setMaxConcurrentOffers(bestWorker.getMaxConcurrentOffers()) + .setBypassSelectors(bestWorker.isBypassSelectors()) + .setScoringRule(RouterRuleAdapter.convertRouterRuleToPublic(bestWorker.getScoringRule())) + .setScoringRuleOptions(bestWorker.getScoringRuleOptions()); + } else if (mode instanceof RoundRobinModeInternal) { + RoundRobinModeInternal roundRobin = (RoundRobinModeInternal) mode; + return new RoundRobinMode() + .setMinConcurrentOffers(roundRobin.getMinConcurrentOffers()) + .setMaxConcurrentOffers(roundRobin.getMaxConcurrentOffers()) + .setBypassSelectors(roundRobin.isBypassSelectors()); + } else if (mode instanceof LongestIdleModeInternal) { + LongestIdleModeInternal longestIdle = (LongestIdleModeInternal) mode; + return new LongestIdleMode() + .setMinConcurrentOffers(longestIdle.getMinConcurrentOffers()) + .setMaxConcurrentOffers(longestIdle.getMaxConcurrentOffers()) + .setBypassSelectors(longestIdle.isBypassSelectors()); + } + + return null; + } + + public static DistributionPolicyInternal convertDistributionPolicyToInternal(DistributionPolicy distributionPolicy) { + return new DistributionPolicyInternal() + .setEtag(distributionPolicy.getEtag()) + .setId(distributionPolicy.getId()) + .setName(distributionPolicy.getName()) + .setMode(convertDistributionModeToInternal(distributionPolicy.getMode())) + .setOfferExpiresAfterSeconds(Double.valueOf(distributionPolicy.getOfferExpiresAfter().getSeconds())); + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/ExceptionPolicyAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/ExceptionPolicyAdapter.java index 928c8b55f681..196f6167d3a9 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/ExceptionPolicyAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/ExceptionPolicyAdapter.java @@ -3,6 +3,7 @@ package com.azure.communication.jobrouter.implementation.converters; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterValueConstructorProxy; import com.azure.communication.jobrouter.implementation.models.CancelExceptionActionInternal; import com.azure.communication.jobrouter.implementation.models.ExceptionActionInternal; import com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal; @@ -23,6 +24,8 @@ import com.azure.communication.jobrouter.models.ReclassifyExceptionAction; import com.azure.communication.jobrouter.models.WaitTimeExceptionTrigger; +import java.time.Duration; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -39,11 +42,9 @@ public class ExceptionPolicyAdapter { public static ExceptionPolicyInternal convertCreateOptionsToExceptionPolicy(CreateExceptionPolicyOptions createExceptionPolicyOptions) { return new ExceptionPolicyInternal() .setName(createExceptionPolicyOptions.getName()) - .setExceptionRules(createExceptionPolicyOptions != null - ? createExceptionPolicyOptions.getExceptionRules() + .setExceptionRules(createExceptionPolicyOptions.getExceptionRules() .stream().map(rule -> convertExceptionRule(rule)) - .collect(Collectors.toList()) - : null); + .collect(Collectors.toList())); } private static ExceptionTriggerInternal convertExceptionTrigger(ExceptionTrigger exceptionTrigger) { @@ -64,29 +65,16 @@ private static ExceptionActionInternal convertExceptionAction(ExceptionAction ex CancelExceptionAction cancelExceptionAction = (CancelExceptionAction) exceptionAction; exceptionActionInternal = new CancelExceptionActionInternal() .setNote(cancelExceptionAction.getNote()) - .setId(cancelExceptionAction.getId()) .setDispositionCode(cancelExceptionAction.getDispositionCode()); } else if (exceptionAction.getClass() == ManualReclassifyExceptionAction.class) { ManualReclassifyExceptionAction manualReclassifyExceptionAction = (ManualReclassifyExceptionAction) exceptionAction; exceptionActionInternal = new ManualReclassifyExceptionActionInternal() .setPriority(manualReclassifyExceptionAction.getPriority()) .setQueueId(manualReclassifyExceptionAction.getQueueId()) - .setId(manualReclassifyExceptionAction.getId()) - .setWorkerSelectors(manualReclassifyExceptionAction.getWorkerSelectors() != null - ? manualReclassifyExceptionAction.getWorkerSelectors() - .stream() - .map(LabelSelectorAdapter::convertWorkerSelectorToInternal) - .collect(Collectors.toList()) - : null); - } else if (exceptionAction.getClass() == ReclassifyExceptionAction.class) { - ReclassifyExceptionAction reclassifyExceptionAction = (ReclassifyExceptionAction) exceptionAction; - exceptionActionInternal = new ReclassifyExceptionActionInternal() - .setClassificationPolicyId(reclassifyExceptionAction.getClassificationPolicyId()) - .setId(reclassifyExceptionAction.getId()) - .setLabelsToUpsert(reclassifyExceptionAction.getLabelsToUpsert() != null - ? reclassifyExceptionAction.getLabelsToUpsert().entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getKey, v -> RouterValueAdapter.getValue(v.getValue()))) - : null); + .setWorkerSelectors(manualReclassifyExceptionAction.getWorkerSelectors() + .stream() + .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToInternal(ws)) + .collect(Collectors.toList())); } return exceptionActionInternal; } @@ -94,13 +82,69 @@ private static ExceptionActionInternal convertExceptionAction(ExceptionAction ex private static ExceptionRuleInternal convertExceptionRule(ExceptionRule exceptionRule) { String id = exceptionRule.getId(); ExceptionTriggerInternal exceptionTriggerInternal = convertExceptionTrigger(exceptionRule.getTrigger()); - List exceptionActionInternalList = exceptionRule.getActions() != null - ? exceptionRule.getActions() - .stream() - .map(action -> convertExceptionAction(action)) - .collect(Collectors.toList()) - : null; + List exceptionActionInternalList = exceptionRule.getActions() + .stream() + .map(action -> convertExceptionAction(action)) + .collect(Collectors.toList()); return new ExceptionRuleInternal(id, exceptionTriggerInternal, exceptionActionInternalList); } + public static ExceptionTrigger convertExceptionTriggerToPublic(ExceptionTriggerInternal trigger) { + if (trigger instanceof QueueLengthExceptionTriggerInternal) { + QueueLengthExceptionTriggerInternal queueLength = (QueueLengthExceptionTriggerInternal) trigger; + return new QueueLengthExceptionTrigger(queueLength.getThreshold()); + } else if (trigger instanceof WaitTimeExceptionTriggerInternal) { + WaitTimeExceptionTriggerInternal waitTime = (WaitTimeExceptionTriggerInternal) trigger; + return new WaitTimeExceptionTrigger(Duration.ofSeconds((long) waitTime.getThresholdSeconds())); + } + + return null; + } + + public static ExceptionAction convertExceptionActionToPublic(ExceptionActionInternal action) { + if (action instanceof CancelExceptionActionInternal) { + CancelExceptionActionInternal cancel = (CancelExceptionActionInternal) action; + return new CancelExceptionAction() + .setNote(cancel.getNote()) + .setDispositionCode(cancel.getDispositionCode()); + } else if (action instanceof ManualReclassifyExceptionActionInternal) { + ManualReclassifyExceptionActionInternal manualReclassify = (ManualReclassifyExceptionActionInternal) action; + return new ManualReclassifyExceptionAction() + .setPriority(manualReclassify.getPriority()) + .setQueueId(manualReclassify.getQueueId()) + .setWorkerSelectors(manualReclassify.getWorkerSelectors().stream() + .map(LabelSelectorAdapter::convertWorkerSelectorToPublic).collect(Collectors.toList())); + } else if (action instanceof ReclassifyExceptionActionInternal) { + ReclassifyExceptionActionInternal reclassify = (ReclassifyExceptionActionInternal) action; + return new ReclassifyExceptionAction() + .setClassificationPolicyId(reclassify.getClassificationPolicyId()) + .setLabelsToUpsert(reclassify.getLabelsToUpsert().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); + } + + return null; + } + + public static List convertExceptionRulesToPublic(List rules) { + return rules != null ? rules.stream() + .map(rule -> { + ExceptionTrigger trigger = convertExceptionTriggerToPublic(rule.getTrigger()); + List actions = rule.getActions().stream() + .map(action -> convertExceptionActionToPublic(action)) + .collect(Collectors.toList()); + return new ExceptionRule(rule.getId(), trigger, actions); + }) + .collect(Collectors.toList()) : new ArrayList(); + } + + public static ExceptionPolicyInternal convertExceptionPolicyToInternal(ExceptionPolicy exceptionPolicy) { + return new ExceptionPolicyInternal() + .setEtag(exceptionPolicy.getEtag()) + .setId(exceptionPolicy.getId()) + .setName(exceptionPolicy.getName()) + .setExceptionRules(exceptionPolicy.getExceptionRules().stream() + .map(exceptionRule -> convertExceptionRule(exceptionRule)) + .collect(Collectors.toList()) + ); + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/JobAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/JobAdapter.java index c9be5ca536ea..b890b29fae95 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/JobAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/JobAdapter.java @@ -10,13 +10,15 @@ import com.azure.communication.jobrouter.implementation.models.ScheduleAndSuspendModeInternal; import com.azure.communication.jobrouter.implementation.models.SuspendModeInternal; import com.azure.communication.jobrouter.models.CreateJobOptions; -import com.azure.communication.jobrouter.models.CreateJobWithClassificationPolicyOptions; -import com.azure.communication.jobrouter.models.JobMatchingModeKind; +import com.azure.communication.jobrouter.models.JobMatchingMode; +import com.azure.communication.jobrouter.models.QueueAndMatchMode; import com.azure.communication.jobrouter.models.RouterJob; import com.azure.communication.jobrouter.models.RouterJobNote; import com.azure.communication.jobrouter.models.RouterValue; import com.azure.communication.jobrouter.models.ScheduleAndSuspendMode; +import com.azure.communication.jobrouter.models.SuspendMode; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -37,7 +39,7 @@ public static RouterJobInternal convertCreateJobOptionsToRouterJob(CreateJobOpti Map labelValueMap = createJobOptions.getLabels(); Map labels = labelValueMap != null ? labelValueMap.entrySet().stream() .collect(Collectors.toMap(entry -> entry.getKey(), entry -> getValue(entry.getValue()))) : null; - Map tagValueMap = createJobOptions.getTags(); + Map tagValueMap = createJobOptions.getLabels(); Map tags = tagValueMap != null ? tagValueMap.entrySet().stream() .collect(Collectors.toMap(entry -> entry.getKey(), entry -> getValue(entry.getValue()))) : null; List jobNotes = createJobOptions.getNotes(); @@ -53,20 +55,24 @@ public static RouterJobInternal convertCreateJobOptionsToRouterJob(CreateJobOpti .setStatus(workerSelector.getStatus()) ) .collect(Collectors.toList()) : null; - JobMatchingModeKind jobMatchingModeKind; + String jobMatchingModeKind; jobMatchingModeKind = createJobOptions.getMatchingMode() != null ? createJobOptions.getMatchingMode().getKind() : null; JobMatchingModeInternal jobMatchingModeInternal = null; if (jobMatchingModeKind != null) { - if (jobMatchingModeKind.equals(JobMatchingModeKind.SCHEDULE_AND_SUSPEND)) { - ScheduleAndSuspendMode scheduleAndSuspendMode = (ScheduleAndSuspendMode) createJobOptions.getMatchingMode(); - jobMatchingModeInternal = new ScheduleAndSuspendModeInternal(scheduleAndSuspendMode.getScheduleAt()); - } else if (jobMatchingModeKind.equals(JobMatchingModeKind.QUEUE_AND_MATCH)) { - jobMatchingModeInternal = new QueueAndMatchModeInternal(); - } else if (jobMatchingModeKind.equals(JobMatchingModeKind.SUSPEND)) { - jobMatchingModeInternal = new SuspendModeInternal(); - } else { - throw new IllegalStateException("Unknown kind for JobMatchingMode."); + switch (jobMatchingModeKind) { + case "scheduleAndSuspend": + ScheduleAndSuspendMode scheduleAndSuspendMode = (ScheduleAndSuspendMode) createJobOptions.getMatchingMode(); + jobMatchingModeInternal = new ScheduleAndSuspendModeInternal(scheduleAndSuspendMode.getScheduleAt()); + break; + case "queueAndMatch": + jobMatchingModeInternal = new QueueAndMatchModeInternal(); + break; + case "suspend": + jobMatchingModeInternal = new SuspendModeInternal(); + break; + default: + throw new IllegalStateException("Unknown kind for JobMatchingMode."); } } @@ -84,58 +90,58 @@ public static RouterJobInternal convertCreateJobOptionsToRouterJob(CreateJobOpti } /** - * Converts {@link CreateJobWithClassificationPolicyOptions} to {@link RouterJob}. - * @param createJobOptions Container with options to create {@link RouterJob} - * @return RouterJob + * Converts jobMatchingMode internal to external + * @param jobMatchingModeInternal internal model. + * @return JobMatchingMode. */ - public static RouterJobInternal convertCreateJobWithClassificationPolicyOptionsToRouterJob(CreateJobWithClassificationPolicyOptions createJobOptions) { - Map labelValueMap = createJobOptions.getLabels(); - Map labels = labelValueMap != null ? labelValueMap.entrySet().stream() - .collect(Collectors.toMap(entry -> entry.getKey(), entry -> getValue(entry.getValue()))) : null; - Map tagValueMap = createJobOptions.getTags(); - Map tags = tagValueMap != null ? tagValueMap.entrySet().stream() - .collect(Collectors.toMap(entry -> entry.getKey(), entry -> getValue(entry.getValue()))) : null; - List jobNotes = createJobOptions.getNotes(); - List workerSelectors; - workerSelectors = createJobOptions.getRequestedWorkerSelectors() != null ? createJobOptions.getRequestedWorkerSelectors() - .stream() - .map(workerSelector -> - new RouterWorkerSelectorInternal(workerSelector.getKey(), workerSelector.getLabelOperator()) - .setValue(getValue(workerSelector.getValue())) - .setExpedite(workerSelector.isExpedite()) - .setExpiresAt(workerSelector.getExpiresAt()) - .setExpiresAfterSeconds(workerSelector.getExpiresAfter() != null ? Double.valueOf(workerSelector.getExpiresAfter().getSeconds()) : null) - .setStatus(workerSelector.getStatus()) - ) - .collect(Collectors.toList()) : null; - JobMatchingModeKind jobMatchingModeKind; - jobMatchingModeKind = createJobOptions.getMatchingMode() != null ? createJobOptions.getMatchingMode().getKind() : null; - JobMatchingModeInternal jobMatchingModeInternal = null; - - if (jobMatchingModeKind != null) { - if (jobMatchingModeKind.equals(JobMatchingModeKind.SCHEDULE_AND_SUSPEND)) { - ScheduleAndSuspendMode scheduleAndSuspendMode = (ScheduleAndSuspendMode) createJobOptions.getMatchingMode(); - jobMatchingModeInternal = new ScheduleAndSuspendModeInternal(scheduleAndSuspendMode.getScheduleAt()); - } else if (jobMatchingModeKind.equals(JobMatchingModeKind.QUEUE_AND_MATCH)) { - jobMatchingModeInternal = new QueueAndMatchModeInternal(); - } else if (jobMatchingModeKind.equals(JobMatchingModeKind.SUSPEND)) { - jobMatchingModeInternal = new SuspendModeInternal(); - } else { - throw new IllegalStateException("Unknown kind for JobMatchingMode."); - } + public static JobMatchingMode convertJobMatchingModeToPublic(JobMatchingModeInternal jobMatchingModeInternal) { + if (jobMatchingModeInternal.getClass() == ScheduleAndSuspendModeInternal.class) { + ScheduleAndSuspendModeInternal scheduleAndSuspendModeInternal = + (ScheduleAndSuspendModeInternal) jobMatchingModeInternal; + return new ScheduleAndSuspendMode(scheduleAndSuspendModeInternal.getScheduleAt()); + } else if (jobMatchingModeInternal.getClass() == QueueAndMatchModeInternal.class) { + return new QueueAndMatchMode(); + } else if (jobMatchingModeInternal.getClass() == SuspendModeInternal.class) { + return new SuspendMode(); } + throw new IllegalStateException(String.format("Unknown type of jobMatchingMode %s", jobMatchingModeInternal.getClass().getTypeName())); + } + public static RouterJobInternal convertRouterJobToInternal(RouterJob routerJob) { return new RouterJobInternal() - .setClassificationPolicyId(createJobOptions.getClassificationPolicyId()) - .setChannelId(createJobOptions.getChannelId()) - .setChannelReference(createJobOptions.getChannelReference()) - .setQueueId(createJobOptions.getQueueId()) - .setLabels(labels) - .setNotes(jobNotes) - .setPriority(createJobOptions.getPriority()) - .setDispositionCode(createJobOptions.getDispositionCode()) - .setRequestedWorkerSelectors(workerSelectors) - .setTags(tags) - .setMatchingMode(jobMatchingModeInternal); + .setEtag(routerJob.getEtag()) + .setId(routerJob.getId()) + .setEnqueuedAt(routerJob.getEnqueuedAt()) + .setStatus(routerJob.getStatus()) + .setDispositionCode(routerJob.getDispositionCode()) + .setNotes(routerJob.getNotes()) + .setChannelId(routerJob.getChannelId()) + .setChannelReference(routerJob.getChannelReference()) + .setLabels(convertRouterValueLabelsToInternal(routerJob.getLabels())) + .setTags(convertRouterValueLabelsToInternal(routerJob.getTags())) + .setAttachedWorkerSelectors( + routerJob.getAttachedWorkerSelectors() + .stream() + .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToInternal(ws)) + .collect(Collectors.toList()) + ) + .setRequestedWorkerSelectors( + routerJob.getRequestedWorkerSelectors() + .stream() + .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToInternal(ws)) + .collect(Collectors.toList()) + ) + .setScheduledAt(routerJob.getScheduledAt()) + .setAssignments(routerJob.getAssignments()) + .setPriority(routerJob.getPriority()) + .setClassificationPolicyId(routerJob.getClassificationPolicyId()); + } + + private static Map convertRouterValueLabelsToInternal(Map labels) { + Map result = new HashMap(); + labels.entrySet() + .stream() + .forEach(entry -> result.put(entry.getKey(), RouterValueAdapter.getValue(entry.getValue()))); + return result; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/LabelSelectorAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/LabelSelectorAdapter.java index 6011c8bafc67..95f36e51ef74 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/LabelSelectorAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/LabelSelectorAdapter.java @@ -3,6 +3,7 @@ package com.azure.communication.jobrouter.implementation.converters; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterValueConstructorProxy; import com.azure.communication.jobrouter.implementation.models.ConditionalQueueSelectorAttachmentInternal; import com.azure.communication.jobrouter.implementation.models.ConditionalWorkerSelectorAttachmentInternal; import com.azure.communication.jobrouter.implementation.models.PassThroughQueueSelectorAttachmentInternal; @@ -21,9 +22,11 @@ import com.azure.communication.jobrouter.implementation.models.WorkerWeightedAllocationInternal; import com.azure.communication.jobrouter.models.ConditionalQueueSelectorAttachment; import com.azure.communication.jobrouter.models.ConditionalWorkerSelectorAttachment; +import com.azure.communication.jobrouter.models.LabelOperator; import com.azure.communication.jobrouter.models.PassThroughQueueSelectorAttachment; import com.azure.communication.jobrouter.models.PassThroughWorkerSelectorAttachment; import com.azure.communication.jobrouter.models.QueueSelectorAttachment; +import com.azure.communication.jobrouter.models.QueueWeightedAllocation; import com.azure.communication.jobrouter.models.RouterQueueSelector; import com.azure.communication.jobrouter.models.RouterWorkerSelector; import com.azure.communication.jobrouter.models.RuleEngineQueueSelectorAttachment; @@ -33,7 +36,9 @@ import com.azure.communication.jobrouter.models.WeightedAllocationQueueSelectorAttachment; import com.azure.communication.jobrouter.models.WeightedAllocationWorkerSelectorAttachment; import com.azure.communication.jobrouter.models.WorkerSelectorAttachment; +import com.azure.communication.jobrouter.models.WorkerWeightedAllocation; +import java.time.Duration; import java.util.stream.Collectors; import static com.azure.communication.jobrouter.implementation.converters.RouterRuleAdapter.getRouterRuleInternal; @@ -75,9 +80,8 @@ public static QueueSelectorAttachmentInternal convertQueueSelectorAttachmentToIn } else if (attachment instanceof ConditionalQueueSelectorAttachment) { ConditionalQueueSelectorAttachment conditional = (ConditionalQueueSelectorAttachment) attachment; return new ConditionalQueueSelectorAttachmentInternal(getRouterRuleInternal(conditional.getCondition()), - conditional.getQueueSelectors() != null - ? conditional.getQueueSelectors().stream().map(LabelSelectorAdapter::convertQueueSelectorToInternal) - .collect(Collectors.toList()) : null); + conditional.getQueueSelectors().stream() + .map(LabelSelectorAdapter::convertQueueSelectorToInternal).collect(Collectors.toList())); } else if (attachment instanceof PassThroughQueueSelectorAttachment) { PassThroughQueueSelectorAttachment passThrough = (PassThroughQueueSelectorAttachment) attachment; return new PassThroughQueueSelectorAttachmentInternal(passThrough.getKey(), @@ -88,13 +92,12 @@ public static QueueSelectorAttachmentInternal convertQueueSelectorAttachmentToIn } else if (attachment instanceof WeightedAllocationQueueSelectorAttachment) { WeightedAllocationQueueSelectorAttachment weighted = (WeightedAllocationQueueSelectorAttachment) attachment; return new WeightedAllocationQueueSelectorAttachmentInternal( - weighted.getAllocations() != null - ? weighted.getAllocations().stream() - .map(a -> new QueueWeightedAllocationInternal(a.getWeight(), a.getQueueSelectors() != null - ? a.getQueueSelectors().stream() + weighted.getAllocations().stream() + .map(a -> new QueueWeightedAllocationInternal(a.getWeight(), + a.getQueueSelectors().stream() .map(qs -> LabelSelectorAdapter.convertQueueSelectorToInternal(qs)) - .collect(Collectors.toList()) : null)) - .collect(Collectors.toList()) : null); + .collect(Collectors.toList()))) + .collect(Collectors.toList())); } return null; @@ -109,34 +112,102 @@ public static WorkerSelectorAttachmentInternal convertWorkerSelectorAttachmentTo ConditionalWorkerSelectorAttachment conditional = (ConditionalWorkerSelectorAttachment) attachment; return new ConditionalWorkerSelectorAttachmentInternal( getRouterRuleInternal(conditional.getCondition()), - conditional.getWorkerSelectors() != null ? conditional.getWorkerSelectors().stream() - .map(LabelSelectorAdapter::convertWorkerSelectorToInternal).collect(Collectors.toList()) : null); + conditional.getWorkerSelectors().stream() + .map(LabelSelectorAdapter::convertWorkerSelectorToInternal).collect(Collectors.toList())); } else if (attachment instanceof PassThroughWorkerSelectorAttachment) { PassThroughWorkerSelectorAttachment passThrough = (PassThroughWorkerSelectorAttachment) attachment; - PassThroughWorkerSelectorAttachmentInternal result = new PassThroughWorkerSelectorAttachmentInternal( + return new PassThroughWorkerSelectorAttachmentInternal( passThrough.getKey(), passThrough.getLabelOperator() - ); - if (passThrough.getExpiresAfter() != null) { - result.setExpiresAfterSeconds((double) passThrough.getExpiresAfter().getSeconds()); - } - return result; + ) + .setExpiresAfterSeconds((double) passThrough.getExpiresAfter().getSeconds()); } else if (attachment instanceof RuleEngineWorkerSelectorAttachment) { RuleEngineWorkerSelectorAttachment rule = (RuleEngineWorkerSelectorAttachment) attachment; return new RuleEngineWorkerSelectorAttachmentInternal(getRouterRuleInternal(rule.getRule())); } else if (attachment instanceof WeightedAllocationWorkerSelectorAttachment) { WeightedAllocationWorkerSelectorAttachment weighted = (WeightedAllocationWorkerSelectorAttachment) attachment; return new WeightedAllocationWorkerSelectorAttachmentInternal( - weighted.getAllocations() != null ? weighted.getAllocations().stream() + weighted.getAllocations().stream() .map(a -> new WorkerWeightedAllocationInternal( a.getWeight(), - a.getWorkerSelectors() != null ? a.getWorkerSelectors().stream() + a.getWorkerSelectors().stream() .map(qs -> LabelSelectorAdapter.convertWorkerSelectorToInternal(qs)) - .collect(Collectors.toList()) : null)) - .collect(Collectors.toList()) : null); + .collect(Collectors.toList()))) + .collect(Collectors.toList())); } return null; } + public static RouterWorkerSelector convertWorkerSelectorToPublic(RouterWorkerSelectorInternal ws) { + RouterWorkerSelector workerSelector = new RouterWorkerSelector(ws.getKey(), + LabelOperator.fromString(ws.getLabelOperator().toString())) + .setValue(RouterValueConstructorProxy.create(ws)) + .setExpedite(ws.isExpedite()) + .setExpiresAfter(ws.getExpiresAfterSeconds() != null + ? Duration.ofSeconds(ws.getExpiresAfterSeconds().longValue()) : null); + + return workerSelector; + } + + public static RouterQueueSelector convertQueueSelectorToPublic(RouterQueueSelectorInternal qs) { + return new RouterQueueSelector(qs.getKey(), LabelOperator.fromString(qs.getLabelOperator().toString())) + .setValue(RouterValueConstructorProxy.create(qs.getValue())); + } + + public static QueueSelectorAttachment convertQueueSelectorAttachmentToPublic(QueueSelectorAttachmentInternal attachment) { + if (attachment instanceof StaticQueueSelectorAttachmentInternal) { + StaticQueueSelectorAttachmentInternal staticAttach = (StaticQueueSelectorAttachmentInternal) attachment; + return new StaticQueueSelectorAttachment(LabelSelectorAdapter.convertQueueSelectorToPublic(staticAttach.getQueueSelector())); + } else if (attachment instanceof ConditionalQueueSelectorAttachmentInternal) { + ConditionalQueueSelectorAttachmentInternal conditional = (ConditionalQueueSelectorAttachmentInternal) attachment; + return new ConditionalQueueSelectorAttachment(RouterRuleAdapter.convertRouterRuleToPublic(conditional.getCondition()), + conditional.getQueueSelectors().stream() + .map(LabelSelectorAdapter::convertQueueSelectorToPublic).collect(Collectors.toList())); + } else if (attachment instanceof PassThroughQueueSelectorAttachmentInternal) { + PassThroughQueueSelectorAttachmentInternal passThrough = (PassThroughQueueSelectorAttachmentInternal) attachment; + return new PassThroughQueueSelectorAttachment(passThrough.getKey(), + LabelOperator.fromString(passThrough.getLabelOperator().toString())); + } else if (attachment instanceof RuleEngineQueueSelectorAttachmentInternal) { + RuleEngineQueueSelectorAttachmentInternal rule = (RuleEngineQueueSelectorAttachmentInternal) attachment; + return new RuleEngineQueueSelectorAttachment(RouterRuleAdapter.convertRouterRuleToPublic(rule.getRule())); + } else if (attachment instanceof WeightedAllocationQueueSelectorAttachmentInternal) { + WeightedAllocationQueueSelectorAttachmentInternal weighted = (WeightedAllocationQueueSelectorAttachmentInternal) attachment; + return new WeightedAllocationQueueSelectorAttachment(weighted.getAllocations().stream() + .map(a -> new QueueWeightedAllocation(a.getWeight(), a.getQueueSelectors().stream() + .map(qs -> LabelSelectorAdapter.convertQueueSelectorToPublic(qs)) + .collect(Collectors.toList()))) + .collect(Collectors.toList())); + } + + return null; + } + + public static WorkerSelectorAttachment convertWorkerSelectorAttachmentToPublic(WorkerSelectorAttachmentInternal attachment) { + if (attachment instanceof StaticWorkerSelectorAttachmentInternal) { + StaticWorkerSelectorAttachmentInternal staticAttach = (StaticWorkerSelectorAttachmentInternal) attachment; + return new StaticWorkerSelectorAttachment(LabelSelectorAdapter.convertWorkerSelectorToPublic(staticAttach.getWorkerSelector())); + } else if (attachment instanceof ConditionalWorkerSelectorAttachmentInternal) { + ConditionalWorkerSelectorAttachmentInternal conditional = (ConditionalWorkerSelectorAttachmentInternal) attachment; + return new ConditionalWorkerSelectorAttachment(RouterRuleAdapter.convertRouterRuleToPublic(conditional.getCondition()), + conditional.getWorkerSelectors().stream() + .map(LabelSelectorAdapter::convertWorkerSelectorToPublic).collect(Collectors.toList())); + } else if (attachment instanceof PassThroughWorkerSelectorAttachmentInternal) { + PassThroughWorkerSelectorAttachmentInternal passThrough = (PassThroughWorkerSelectorAttachmentInternal) attachment; + return new PassThroughWorkerSelectorAttachment(passThrough.getKey(), LabelOperator.fromString(passThrough.getLabelOperator().toString())) + .setExpiresAfter(Duration.ofSeconds(passThrough.getExpiresAfterSeconds().longValue())); + } else if (attachment instanceof RuleEngineWorkerSelectorAttachmentInternal) { + RuleEngineWorkerSelectorAttachmentInternal rule = (RuleEngineWorkerSelectorAttachmentInternal) attachment; + return new RuleEngineWorkerSelectorAttachment(RouterRuleAdapter.convertRouterRuleToPublic(rule.getRule())); + } else if (attachment instanceof WeightedAllocationWorkerSelectorAttachmentInternal) { + WeightedAllocationWorkerSelectorAttachmentInternal weighted = (WeightedAllocationWorkerSelectorAttachmentInternal) attachment; + return new WeightedAllocationWorkerSelectorAttachment(weighted.getAllocations().stream() + .map(a -> new WorkerWeightedAllocation(a.getWeight(), a.getWorkerSelectors().stream() + .map(qs -> LabelSelectorAdapter.convertWorkerSelectorToPublic(qs)) + .collect(Collectors.toList()))) + .collect(Collectors.toList())); + } + + return null; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/QueueAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/QueueAdapter.java index dad192933426..2a8b0b38b385 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/QueueAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/QueueAdapter.java @@ -32,4 +32,17 @@ public static RouterQueueInternal convertCreateQueueOptionsToRouterQueueInternal .setDistributionPolicyId(createQueueOptions.getDistributionPolicyId()) .setExceptionPolicyId(createQueueOptions.getExceptionPolicyId()); } + + public static RouterQueueInternal convertRouterQueueToRouterQueueInternal(RouterQueue routerQueue) { + Map labels = routerQueue.getLabels() != null ? routerQueue.getLabels() + .entrySet().stream() + .collect(Collectors.toMap(entry -> entry.getKey(), entry -> RouterValueAdapter.getValue(entry.getValue()))) : null; + return new RouterQueueInternal() + .setEtag(routerQueue.getEtag()) + .setId(routerQueue.getId()) + .setName(routerQueue.getName()) + .setLabels(labels) + .setExceptionPolicyId(routerQueue.getExceptionPolicyId()) + .setDistributionPolicyId(routerQueue.getDistributionPolicyId()); + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterRuleAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterRuleAdapter.java index 6aa3187d248b..446e4585f7d7 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterRuleAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterRuleAdapter.java @@ -3,6 +3,7 @@ package com.azure.communication.jobrouter.implementation.converters; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterValueConstructorProxy; import com.azure.communication.jobrouter.implementation.models.DirectMapRouterRuleInternal; import com.azure.communication.jobrouter.implementation.models.ExpressionRouterRuleInternal; import com.azure.communication.jobrouter.implementation.models.FunctionRouterRuleInternal; @@ -30,32 +31,57 @@ public class RouterRuleAdapter { */ public static RouterRuleInternal getRouterRuleInternal(RouterRule routerRule) { RouterRuleInternal prioritizationRuleInternal = null; + if (routerRule.getClass() == ExpressionRouterRule.class) { + ExpressionRouterRule expressionRouterRule = (ExpressionRouterRule) routerRule; + prioritizationRuleInternal = new ExpressionRouterRuleInternal(expressionRouterRule.getExpression()) + .setLanguage(expressionRouterRule.getLanguage()); + } else if (routerRule.getClass() == DirectMapRouterRule.class) { + DirectMapRouterRule directMapRouterRule = (DirectMapRouterRule) routerRule; + prioritizationRuleInternal = new DirectMapRouterRuleInternal(); + } else if (routerRule.getClass() == FunctionRouterRule.class) { + FunctionRouterRule functionRouterRule = (FunctionRouterRule) routerRule; + prioritizationRuleInternal = new FunctionRouterRuleInternal(functionRouterRule.getFunctionUri()) + .setCredential(functionRouterRule.getCredential()); + } else if (routerRule.getClass() == StaticRouterRule.class) { + StaticRouterRule staticRouterRule = (StaticRouterRule) routerRule; + prioritizationRuleInternal = new StaticRouterRuleInternal() + .setValue(RouterValueAdapter.getValue(staticRouterRule.getValue())); + } else if (routerRule.getClass() == WebhookRouterRule.class) { + WebhookRouterRule webhookRouterRule = (WebhookRouterRule) routerRule; + prioritizationRuleInternal = new WebhookRouterRuleInternal() + .setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUri()) + .setClientCredential(webhookRouterRule.getClientCredential()) + .setWebhookUri(webhookRouterRule.getWebhookUri()); + } + return prioritizationRuleInternal; + } - if (routerRule != null) { - if (routerRule.getClass() == ExpressionRouterRule.class) { - ExpressionRouterRule expressionRouterRule = (ExpressionRouterRule) routerRule; - prioritizationRuleInternal = new ExpressionRouterRuleInternal(expressionRouterRule.getExpression()) - .setLanguage(expressionRouterRule.getLanguage()); - } else if (routerRule.getClass() == DirectMapRouterRule.class) { - prioritizationRuleInternal = new DirectMapRouterRuleInternal(); - } else if (routerRule.getClass() == FunctionRouterRule.class) { - FunctionRouterRule functionRouterRule = (FunctionRouterRule) routerRule; - prioritizationRuleInternal = new FunctionRouterRuleInternal(functionRouterRule.getFunctionUri()) - .setCredential(functionRouterRule.getCredential()); - } else if (routerRule.getClass() == StaticRouterRule.class) { - StaticRouterRule staticRouterRule = (StaticRouterRule) routerRule; - prioritizationRuleInternal = new StaticRouterRuleInternal() - .setValue(RouterValueAdapter.getValue(staticRouterRule.getValue())); - } else if (routerRule.getClass() == WebhookRouterRule.class) { - WebhookRouterRule webhookRouterRule = (WebhookRouterRule) routerRule; - prioritizationRuleInternal = new WebhookRouterRuleInternal() - .setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUri()) - .setClientCredential(webhookRouterRule.getClientCredential()) - .setWebhookUri(webhookRouterRule.getWebhookUri()); - } + public static RouterRule convertRouterRuleToPublic(RouterRuleInternal rule) { + if (rule instanceof DirectMapRouterRuleInternal) { + return new DirectMapRouterRule(); + } else if (rule instanceof ExpressionRouterRuleInternal) { + return new ExpressionRouterRule(((ExpressionRouterRuleInternal) rule).getExpression()); + } else if (rule instanceof FunctionRouterRuleInternal) { + FunctionRouterRuleInternal functionRouterRule = (FunctionRouterRuleInternal) rule; + return new FunctionRouterRule(functionRouterRule.getFunctionUri()) + .setCredential(new FunctionRouterRuleCredential() + .setFunctionKey(functionRouterRule.getCredential().getFunctionKey()) + .setAppKey(functionRouterRule.getCredential().getAppKey()) + .setClientId(functionRouterRule.getCredential().getClientId())); + } else if (rule instanceof StaticRouterRuleInternal) { + return new StaticRouterRule() + .setValue(RouterValueConstructorProxy.create(((StaticRouterRuleInternal) rule).getValue())); + } else if (rule instanceof WebhookRouterRuleInternal) { + WebhookRouterRuleInternal webhookRouterRule = (WebhookRouterRuleInternal) rule; + return new WebhookRouterRule() + .setWebhookUri(webhookRouterRule.getWebhookUri()) + .setClientCredential(new OAuth2WebhookClientCredential() + .setClientId(webhookRouterRule.getClientCredential().getClientId()) + .setClientSecret(webhookRouterRule.getClientCredential().getClientSecret())) + .setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUri()); } - return prioritizationRuleInternal; + return null; } public static RouterRuleInternal convertRouterRuleToInternal(RouterRule rule) { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterValueAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterValueAdapter.java index 6a7943d0012a..f257f8e8f6b0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterValueAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterValueAdapter.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.implementation.converters; import com.azure.communication.jobrouter.models.RouterValue; +import com.azure.core.util.logging.ClientLogger; /** * Wrapper class for labels. Supports String, int, double and boolean types. @@ -16,22 +17,21 @@ * 4. boolValue. */ public class RouterValueAdapter { + private static final ClientLogger LOGGER = new ClientLogger(RouterValueAdapter.class); + public static Object getValue(RouterValue routerValue) { - if (routerValue != null) { - if (routerValue.getStringValue() != null) { - return routerValue.getStringValue(); - } - if (routerValue.getIntValue() != null) { - return routerValue.getIntValue(); - } - if (routerValue.getDoubleValue() != null) { - return routerValue.getDoubleValue(); - } - if (routerValue.getBooleanValue() != null) { - return routerValue.getBooleanValue(); - } + if (routerValue.getStringValue() != null) { + return routerValue.getStringValue(); + } + if (routerValue.getIntValue() != null) { + return routerValue.getIntValue(); + } + if (routerValue.getDoubleValue() != null) { + return routerValue.getDoubleValue(); + } + if (routerValue.getBooleanValue() != null) { + return routerValue.getBooleanValue(); } - return null; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/WorkerAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/WorkerAdapter.java index c3cc26eec484..cd86895ef323 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/WorkerAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/WorkerAdapter.java @@ -20,25 +20,21 @@ public class WorkerAdapter { * @return RouterWorker */ public static RouterWorkerInternal convertCreateWorkerOptionsToRouterWorker(CreateWorkerOptions createWorkerOptions) { - Map labels = createWorkerOptions.getLabels() != null - ? createWorkerOptions.getLabels().entrySet() + Map labels = createWorkerOptions.getLabels().entrySet() .stream() - .collect(Collectors.toMap(Map.Entry::getKey, - entry -> RouterValueAdapter.getValue(entry.getValue()))) : null; + .collect(Collectors.toMap(entry -> entry.getKey(), + entry -> RouterValueAdapter.getValue(entry.getValue()))); - Map tags = createWorkerOptions.getTags() != null - ? createWorkerOptions.getTags().entrySet() + Map tags = createWorkerOptions.getTags().entrySet() .stream() - .collect(Collectors.toMap(Map.Entry::getKey, - entry -> RouterValueAdapter.getValue(entry.getValue()))) : null; + .collect(Collectors.toMap(entry -> entry.getKey(), + entry -> RouterValueAdapter.getValue(entry.getValue()))); return new RouterWorkerInternal() - .setQueues(createWorkerOptions.getQueues()) .setLabels(labels) .setTags(tags) .setAvailableForOffers(createWorkerOptions.isAvailableForOffers()) .setChannels(createWorkerOptions.getChannels()) - .setCapacity(createWorkerOptions.getCapacity()) - .setMaxConcurrentOffers(createWorkerOptions.getMaxConcurrentOffers()); + .setCapacity(createWorkerOptions.getCapacity()); } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/BestWorkerModeInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/BestWorkerModeInternal.java index 6abb0b58b87a..7c401158a10b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/BestWorkerModeInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/BestWorkerModeInternal.java @@ -3,25 +3,26 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.DistributionModeKind; import com.azure.communication.jobrouter.models.ScoringRuleOptions; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Jobs are distributed to the worker with the strongest abilities available. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = BestWorkerModeInternal.class, visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("bestWorker") @Fluent public final class BestWorkerModeInternal extends DistributionModeInternal { /* - * Define a scoring rule to use, when calculating a score to determine the best worker. If not set, will use a default scoring formula that uses the number of job labels that the worker labels match, as well as the number of label selectors the worker labels match and/or exceed using a logistic function (https://en.wikipedia.org/wiki/Logistic_function). + * Define a scoring rule to use, when calculating a score to determine the best worker. If not set, will use a + * default scoring formula that uses the number of job labels that the worker labels match, as well as the number + * of label selectors the worker labels match and/or exceed using a logistic function + * (https://en.wikipedia.org/wiki/Logistic_function). */ @Generated @JsonProperty(value = "scoringRule") @@ -120,23 +121,4 @@ public BestWorkerModeInternal setBypassSelectors(Boolean bypassSelectors) { super.setBypassSelectors(bypassSelectors); return this; } - - /* - * The type discriminator describing a sub-type of DistributionMode. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private DistributionModeKind kind = DistributionModeKind.BEST_WORKER; - - /** - * Get the kind property: The type discriminator describing a sub-type of DistributionMode. - * - * @return the kind value. - */ - @Generated - @Override - public DistributionModeKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelExceptionActionInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelExceptionActionInternal.java index 60f3f2ce1efe..f5145c61bbe7 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelExceptionActionInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelExceptionActionInternal.java @@ -3,22 +3,16 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.ExceptionActionKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * An action that marks a job as cancelled. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = CancelExceptionActionInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("cancel") @Fluent public final class CancelExceptionActionInternal extends ExceptionActionInternal { @@ -99,23 +93,4 @@ public CancelExceptionActionInternal setId(String id) { super.setId(id); return this; } - - /* - * The type discriminator describing a sub-type of ExceptionAction. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private ExceptionActionKind kind = ExceptionActionKind.CANCEL; - - /** - * Get the kind property: The type discriminator describing a sub-type of ExceptionAction. - * - * @return the kind value. - */ - @Generated - @Override - public ExceptionActionKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobOptionsInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobOptionsInternal.java index c122ac5912c3..1963aa9cb945 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobOptionsInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobOptionsInternal.java @@ -21,7 +21,8 @@ public final class CancelJobOptionsInternal { private String note; /* - * Indicates the outcome of a job, populate this field with your own custom values. If not provided, default value of "Cancelled" is set. + * Indicates the outcome of a job, populate this field with your own custom values. If not provided, default value + * of "Cancelled" is set. */ @Generated @JsonProperty(value = "dispositionCode") diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ClassificationPolicyInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ClassificationPolicyInternal.java index bd5853e046f9..28eca8431881 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ClassificationPolicyInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ClassificationPolicyInternal.java @@ -204,7 +204,8 @@ public ClassificationPolicyInternal setPrioritizationRule(RouterRuleInternal pri } /** - * Get the workerSelectorAttachments property: Worker selector attachments used to attach worker selectors to a job. + * Get the workerSelectorAttachments property: Worker selector attachments used to attach worker selectors to a + * job. * * @return the workerSelectorAttachments value. */ @@ -214,7 +215,8 @@ public List getWorkerSelectorAttachments() { } /** - * Set the workerSelectorAttachments property: Worker selector attachments used to attach worker selectors to a job. + * Set the workerSelectorAttachments property: Worker selector attachments used to attach worker selectors to a + * job. * * @param workerSelectorAttachments the workerSelectorAttachments value to set. * @return the ClassificationPolicyInternal object itself. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobOptionsInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobOptionsInternal.java index 4d6c8034b633..855d481e6a97 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobOptionsInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobOptionsInternal.java @@ -22,7 +22,8 @@ public final class CloseJobOptionsInternal { private String dispositionCode; /* - * If not provided, worker capacity is released immediately along with a JobClosedEvent notification. If provided, worker capacity is released along with a JobClosedEvent notification at a future time in UTC. + * If not provided, worker capacity is released immediately along with a JobClosedEvent notification. If provided, + * worker capacity is released along with a JobClosedEvent notification at a future time in UTC. */ @Generated @JsonProperty(value = "closeAt") diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ConditionalQueueSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ConditionalQueueSelectorAttachmentInternal.java index 93dc88074254..cfad9de0b64b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ConditionalQueueSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ConditionalQueueSelectorAttachmentInternal.java @@ -3,12 +3,10 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.QueueSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -16,11 +14,7 @@ /** * Describes a set of queue selectors that will be attached if the given condition resolves to true. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = ConditionalQueueSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("conditional") @Immutable public final class ConditionalQueueSelectorAttachmentInternal extends QueueSelectorAttachmentInternal { @@ -30,14 +24,14 @@ public final class ConditionalQueueSelectorAttachmentInternal extends QueueSelec */ @Generated @JsonProperty(value = "condition") - private final RouterRuleInternal condition; + private RouterRuleInternal condition; /* * The queue selectors to attach. */ @Generated @JsonProperty(value = "queueSelectors") - private final List queueSelectors; + private List queueSelectors; /** * Creates an instance of ConditionalQueueSelectorAttachmentInternal class. @@ -72,23 +66,4 @@ public RouterRuleInternal getCondition() { public List getQueueSelectors() { return this.queueSelectors; } - - /* - * The type discriminator describing a sub-type of QueueSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private QueueSelectorAttachmentKind kind = QueueSelectorAttachmentKind.CONDITIONAL; - - /** - * Get the kind property: The type discriminator describing a sub-type of QueueSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public QueueSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ConditionalWorkerSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ConditionalWorkerSelectorAttachmentInternal.java index 352d41bc743e..82963805f34e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ConditionalWorkerSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ConditionalWorkerSelectorAttachmentInternal.java @@ -3,12 +3,10 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.WorkerSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -16,11 +14,7 @@ /** * Describes a set of worker selectors that will be attached if the given condition resolves to true. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = ConditionalWorkerSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("conditional") @Immutable public final class ConditionalWorkerSelectorAttachmentInternal extends WorkerSelectorAttachmentInternal { @@ -30,14 +24,14 @@ public final class ConditionalWorkerSelectorAttachmentInternal extends WorkerSel */ @Generated @JsonProperty(value = "condition") - private final RouterRuleInternal condition; + private RouterRuleInternal condition; /* * The worker selectors to attach. */ @Generated @JsonProperty(value = "workerSelectors") - private final List workerSelectors; + private List workerSelectors; /** * Creates an instance of ConditionalWorkerSelectorAttachmentInternal class. @@ -72,23 +66,4 @@ public RouterRuleInternal getCondition() { public List getWorkerSelectors() { return this.workerSelectors; } - - /* - * The type discriminator describing a sub-type of WorkerSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private WorkerSelectorAttachmentKind kind = WorkerSelectorAttachmentKind.CONDITIONAL; - - /** - * Get the kind property: The type discriminator describing a sub-type of WorkerSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public WorkerSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferOptionsInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferOptionsInternal.java index 4d16e0527533..f8cc38a94d0e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferOptionsInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferOptionsInternal.java @@ -15,7 +15,10 @@ public final class DeclineJobOfferOptionsInternal { /* - * If the RetryOfferAt is not provided, then this job will not be offered again to the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time is provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that declined the job will also be eligible for the job at that time. + * If the RetryOfferAt is not provided, then this job will not be offered again to the worker who declined this job + * unless the worker is de-registered and re-registered. If a RetryOfferAt time is provided, then the job will be + * re-matched to eligible workers at the retry time in UTC. The worker that declined the job will also be eligible + * for the job at that time. */ @Generated @JsonProperty(value = "retryOfferAt") @@ -30,9 +33,9 @@ public DeclineJobOfferOptionsInternal() { /** * Get the retryOfferAt property: If the RetryOfferAt is not provided, then this job will not be offered again to - * the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time is - * provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that declined - * the job will also be eligible for the job at that time. + * the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time + * is provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that + * declined the job will also be eligible for the job at that time. * * @return the retryOfferAt value. */ @@ -43,9 +46,9 @@ public OffsetDateTime getRetryOfferAt() { /** * Set the retryOfferAt property: If the RetryOfferAt is not provided, then this job will not be offered again to - * the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time is - * provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that declined - * the job will also be eligible for the job at that time. + * the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time + * is provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that + * declined the job will also be eligible for the job at that time. * * @param retryOfferAt the retryOfferAt value to set. * @return the DeclineJobOfferOptionsInternal object itself. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DirectMapRouterRuleInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DirectMapRouterRuleInternal.java index a01b9990aed8..50cae711144b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DirectMapRouterRuleInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DirectMapRouterRuleInternal.java @@ -3,22 +3,15 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.RouterRuleKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * A rule that return the same labels as the input labels. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = DirectMapRouterRuleInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("directMap") @Immutable public final class DirectMapRouterRuleInternal extends RouterRuleInternal { @@ -29,23 +22,4 @@ public final class DirectMapRouterRuleInternal extends RouterRuleInternal { @Generated public DirectMapRouterRuleInternal() { } - - /* - * The type discriminator describing a sub-type of RouterRule - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private RouterRuleKind kind = RouterRuleKind.DIRECT_MAP; - - /** - * Get the kind property: The type discriminator describing a sub-type of RouterRule. - * - * @return the kind value. - */ - @Generated - @Override - public RouterRuleKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DistributionModeInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DistributionModeInternal.java index 30aea2751751..d1202eaa5f32 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DistributionModeInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DistributionModeInternal.java @@ -3,12 +3,10 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.DistributionModeKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,9 @@ */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = DistributionModeInternal.class, - visible = true) + defaultImpl = DistributionModeInternal.class) @JsonTypeName("DistributionModeInternal") @JsonSubTypes({ @JsonSubTypes.Type(name = "bestWorker", value = BestWorkerModeInternal.class), @@ -43,7 +41,9 @@ public class DistributionModeInternal { private Integer maxConcurrentOffers; /* - * If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for a job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false. + * If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You + * may get workers that are not qualified for a job they are matched with if you set this variable to true. This + * flag is intended more for temporary usage. By default, set to false. */ @Generated @JsonProperty(value = "bypassSelectors") @@ -54,7 +54,6 @@ public class DistributionModeInternal { */ @Generated public DistributionModeInternal() { - this.kind = DistributionModeKind.fromString("DistributionModeInternal"); } /** @@ -104,9 +103,9 @@ public DistributionModeInternal setMaxConcurrentOffers(Integer maxConcurrentOffe } /** - * Get the bypassSelectors property: If set to true, then router will match workers to jobs even if they don't match - * label selectors. Warning: You may get workers that are not qualified for a job they are matched with if you set - * this variable to true. This flag is intended more for temporary usage. By default, set to false. + * Get the bypassSelectors property: If set to true, then router will match workers to jobs even if they don't + * match label selectors. Warning: You may get workers that are not qualified for a job they are matched with if + * you set this variable to true. This flag is intended more for temporary usage. By default, set to false. * * @return the bypassSelectors value. */ @@ -116,9 +115,9 @@ public Boolean isBypassSelectors() { } /** - * Set the bypassSelectors property: If set to true, then router will match workers to jobs even if they don't match - * label selectors. Warning: You may get workers that are not qualified for a job they are matched with if you set - * this variable to true. This flag is intended more for temporary usage. By default, set to false. + * Set the bypassSelectors property: If set to true, then router will match workers to jobs even if they don't + * match label selectors. Warning: You may get workers that are not qualified for a job they are matched with if + * you set this variable to true. This flag is intended more for temporary usage. By default, set to false. * * @param bypassSelectors the bypassSelectors value to set. * @return the DistributionModeInternal object itself. @@ -128,22 +127,4 @@ public DistributionModeInternal setBypassSelectors(Boolean bypassSelectors) { this.bypassSelectors = bypassSelectors; return this; } - - /* - * The type discriminator describing a sub-type of DistributionMode. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private DistributionModeKind kind; - - /** - * Get the kind property: The type discriminator describing a sub-type of DistributionMode. - * - * @return the kind value. - */ - @Generated - public DistributionModeKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionActionInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionActionInternal.java index e4cc68e97f61..d98350ca93de 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionActionInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionActionInternal.java @@ -3,12 +3,10 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.ExceptionActionKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,9 @@ */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = ExceptionActionInternal.class, - visible = true) + defaultImpl = ExceptionActionInternal.class) @JsonTypeName("ExceptionActionInternal") @JsonSubTypes({ @JsonSubTypes.Type(name = "cancel", value = CancelExceptionActionInternal.class), @@ -40,7 +38,6 @@ public class ExceptionActionInternal { */ @Generated public ExceptionActionInternal() { - this.kind = ExceptionActionKind.fromString("ExceptionActionInternal"); } /** @@ -64,22 +61,4 @@ public ExceptionActionInternal setId(String id) { this.id = id; return this; } - - /* - * The type discriminator describing a sub-type of ExceptionAction. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private ExceptionActionKind kind; - - /** - * Get the kind property: The type discriminator describing a sub-type of ExceptionAction. - * - * @return the kind value. - */ - @Generated - public ExceptionActionKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionActionKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionActionKind.java deleted file mode 100644 index 47a13f16c0b2..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionActionKind.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported exception action types. - */ -public final class ExceptionActionKind extends ExpandableStringEnum { - - /** - * Discriminator value for CancelExceptionAction. - */ - @Generated - public static final ExceptionActionKind CANCEL = fromString("cancel"); - - /** - * Discriminator value for ManualReclassifyExceptionAction. - */ - @Generated - public static final ExceptionActionKind MANUAL_RECLASSIFY = fromString("manualReclassify"); - - /** - * Discriminator value for ReclassifyExceptionAction. - */ - @Generated - public static final ExceptionActionKind RECLASSIFY = fromString("reclassify"); - - /** - * Creates a new instance of ExceptionActionKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ExceptionActionKind() { - } - - /** - * Creates or finds a ExceptionActionKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExceptionActionKind. - */ - @Generated - @JsonCreator - public static ExceptionActionKind fromString(String name) { - return fromString(name, ExceptionActionKind.class); - } - - /** - * Gets known ExceptionActionKind values. - * - * @return known ExceptionActionKind values. - */ - @Generated - public static Collection values() { - return values(ExceptionActionKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionRuleInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionRuleInternal.java index 35237c9c1bc0..ba0655832367 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionRuleInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionRuleInternal.java @@ -20,21 +20,21 @@ public final class ExceptionRuleInternal { */ @Generated @JsonProperty(value = "id") - private final String id; + private String id; /* * The trigger for this exception rule. */ @Generated @JsonProperty(value = "trigger") - private final ExceptionTriggerInternal trigger; + private ExceptionTriggerInternal trigger; /* * A collection of actions to perform once the exception is triggered. */ @Generated @JsonProperty(value = "actions") - private final List actions; + private List actions; /** * Creates an instance of ExceptionRuleInternal class. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionTriggerInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionTriggerInternal.java index 8a7d2434a499..d214de70303e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionTriggerInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionTriggerInternal.java @@ -3,12 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.ExceptionTriggerKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +14,9 @@ */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = ExceptionTriggerInternal.class, - visible = true) + defaultImpl = ExceptionTriggerInternal.class) @JsonTypeName("ExceptionTriggerInternal") @JsonSubTypes({ @JsonSubTypes.Type(name = "queueLength", value = QueueLengthExceptionTriggerInternal.class), @@ -32,24 +29,5 @@ public class ExceptionTriggerInternal { */ @Generated public ExceptionTriggerInternal() { - this.kind = ExceptionTriggerKind.fromString("ExceptionTriggerInternal"); - } - - /* - * The type discriminator describing a sub-type of ExceptionTrigger. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private ExceptionTriggerKind kind; - - /** - * Get the kind property: The type discriminator describing a sub-type of ExceptionTrigger. - * - * @return the kind value. - */ - @Generated - public ExceptionTriggerKind getKind() { - return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionTriggerKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionTriggerKind.java deleted file mode 100644 index 3950bcd96c14..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExceptionTriggerKind.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported exception trigger types. - */ -public final class ExceptionTriggerKind extends ExpandableStringEnum { - - /** - * Discriminator value for QueueLengthExceptionTrigger. - */ - @Generated - public static final ExceptionTriggerKind QUEUE_LENGTH = fromString("queueLength"); - - /** - * Discriminator value for WaitTimeExceptionTrigger. - */ - @Generated - public static final ExceptionTriggerKind WAIT_TIME = fromString("waitTime"); - - /** - * Creates a new instance of ExceptionTriggerKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ExceptionTriggerKind() { - } - - /** - * Creates or finds a ExceptionTriggerKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExceptionTriggerKind. - */ - @Generated - @JsonCreator - public static ExceptionTriggerKind fromString(String name) { - return fromString(name, ExceptionTriggerKind.class); - } - - /** - * Gets known ExceptionTriggerKind values. - * - * @return known ExceptionTriggerKind values. - */ - @Generated - public static Collection values() { - return values(ExceptionTriggerKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExpressionRouterRuleInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExpressionRouterRuleInternal.java index bb708baa7243..bdf81ae4a914 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExpressionRouterRuleInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ExpressionRouterRuleInternal.java @@ -4,23 +4,17 @@ package com.azure.communication.jobrouter.implementation.models; import com.azure.communication.jobrouter.models.ExpressionRouterRuleLanguage; -import com.azure.communication.jobrouter.models.RouterRuleKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * A rule providing inline expression rules. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = ExpressionRouterRuleInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("expression") @Fluent public final class ExpressionRouterRuleInternal extends RouterRuleInternal { @@ -37,7 +31,7 @@ public final class ExpressionRouterRuleInternal extends RouterRuleInternal { */ @Generated @JsonProperty(value = "expression") - private final String expression; + private String expression; /** * Creates an instance of ExpressionRouterRuleInternal class. @@ -81,23 +75,4 @@ public ExpressionRouterRuleInternal setLanguage(ExpressionRouterRuleLanguage lan public String getExpression() { return this.expression; } - - /* - * The type discriminator describing a sub-type of RouterRule - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private RouterRuleKind kind = RouterRuleKind.EXPRESSION; - - /** - * Get the kind property: The type discriminator describing a sub-type of RouterRule. - * - * @return the kind value. - */ - @Generated - @Override - public RouterRuleKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/FunctionRouterRuleInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/FunctionRouterRuleInternal.java index 00f7fb13748e..6d0908fdf80d 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/FunctionRouterRuleInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/FunctionRouterRuleInternal.java @@ -4,23 +4,17 @@ package com.azure.communication.jobrouter.implementation.models; import com.azure.communication.jobrouter.models.FunctionRouterRuleCredential; -import com.azure.communication.jobrouter.models.RouterRuleKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * A rule providing a binding to an HTTP Triggered Azure Function. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = FunctionRouterRuleInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("function") @Fluent public final class FunctionRouterRuleInternal extends RouterRuleInternal { @@ -30,7 +24,7 @@ public final class FunctionRouterRuleInternal extends RouterRuleInternal { */ @Generated @JsonProperty(value = "functionUri") - private final String functionUri; + private String functionUri; /* * Credentials used to access Azure function rule. @@ -81,23 +75,4 @@ public FunctionRouterRuleInternal setCredential(FunctionRouterRuleCredential cre this.credential = credential; return this; } - - /* - * The type discriminator describing a sub-type of RouterRule - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private RouterRuleKind kind = RouterRuleKind.FUNCTION; - - /** - * Get the kind property: The type discriminator describing a sub-type of RouterRule. - * - * @return the kind value. - */ - @Generated - @Override - public RouterRuleKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/JobMatchingModeInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/JobMatchingModeInternal.java index 08429fe6077b..6de389a113f3 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/JobMatchingModeInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/JobMatchingModeInternal.java @@ -3,12 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.JobMatchingModeKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -21,9 +18,9 @@ */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = JobMatchingModeInternal.class, - visible = true) + defaultImpl = JobMatchingModeInternal.class) @JsonTypeName("JobMatchingModeInternal") @JsonSubTypes({ @JsonSubTypes.Type(name = "scheduleAndSuspend", value = ScheduleAndSuspendModeInternal.class), @@ -37,24 +34,5 @@ public class JobMatchingModeInternal { */ @Generated public JobMatchingModeInternal() { - this.kind = JobMatchingModeKind.fromString("JobMatchingModeInternal"); - } - - /* - * The type discriminator describing a sub-type of JobMatchingMode. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private JobMatchingModeKind kind; - - /** - * Get the kind property: The type discriminator describing a sub-type of JobMatchingMode. - * - * @return the kind value. - */ - @Generated - public JobMatchingModeKind getKind() { - return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/LongestIdleModeInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/LongestIdleModeInternal.java index e1415429dad1..08175542f1fa 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/LongestIdleModeInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/LongestIdleModeInternal.java @@ -3,22 +3,15 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.DistributionModeKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Jobs are directed to the worker who has been idle longest. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = LongestIdleModeInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("longestIdle") @Fluent public final class LongestIdleModeInternal extends DistributionModeInternal { @@ -59,23 +52,4 @@ public LongestIdleModeInternal setBypassSelectors(Boolean bypassSelectors) { super.setBypassSelectors(bypassSelectors); return this; } - - /* - * The type discriminator describing a sub-type of DistributionMode. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private DistributionModeKind kind = DistributionModeKind.LONGEST_IDLE; - - /** - * Get the kind property: The type discriminator describing a sub-type of DistributionMode. - * - * @return the kind value. - */ - @Generated - @Override - public DistributionModeKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ManualReclassifyExceptionActionInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ManualReclassifyExceptionActionInternal.java index 9efce01f5ac4..f19b7740d7b7 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ManualReclassifyExceptionActionInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ManualReclassifyExceptionActionInternal.java @@ -3,11 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.ExceptionActionKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -15,11 +13,7 @@ /** * An action that manually reclassifies a job by providing the queue, priority and worker selectors. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = ManualReclassifyExceptionActionInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("manualReclassify") @Fluent public final class ManualReclassifyExceptionActionInternal extends ExceptionActionInternal { @@ -128,23 +122,4 @@ public ManualReclassifyExceptionActionInternal setId(String id) { super.setId(id); return this; } - - /* - * The type discriminator describing a sub-type of ExceptionAction. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private ExceptionActionKind kind = ExceptionActionKind.MANUAL_RECLASSIFY; - - /** - * Get the kind property: The type discriminator describing a sub-type of ExceptionAction. - * - * @return the kind value. - */ - @Generated - @Override - public ExceptionActionKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/PassThroughQueueSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/PassThroughQueueSelectorAttachmentInternal.java index b85b07206553..27cea4455e99 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/PassThroughQueueSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/PassThroughQueueSelectorAttachmentInternal.java @@ -4,23 +4,17 @@ package com.azure.communication.jobrouter.implementation.models; import com.azure.communication.jobrouter.models.LabelOperator; -import com.azure.communication.jobrouter.models.QueueSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Attaches a queue selector where the value is passed through from a job's label with the same key. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = PassThroughQueueSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("passThrough") @Immutable public final class PassThroughQueueSelectorAttachmentInternal extends QueueSelectorAttachmentInternal { @@ -30,14 +24,14 @@ public final class PassThroughQueueSelectorAttachmentInternal extends QueueSelec */ @Generated @JsonProperty(value = "key") - private final String key; + private String key; /* * Describes how the value of the label is compared to the value pass through. */ @Generated @JsonProperty(value = "labelOperator") - private final LabelOperator labelOperator; + private LabelOperator labelOperator; /** * Creates an instance of PassThroughQueueSelectorAttachmentInternal class. @@ -72,23 +66,4 @@ public String getKey() { public LabelOperator getLabelOperator() { return this.labelOperator; } - - /* - * The type discriminator describing a sub-type of QueueSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private QueueSelectorAttachmentKind kind = QueueSelectorAttachmentKind.PASS_THROUGH; - - /** - * Get the kind property: The type discriminator describing a sub-type of QueueSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public QueueSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/PassThroughWorkerSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/PassThroughWorkerSelectorAttachmentInternal.java index ea5d5c403f19..28070824d00d 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/PassThroughWorkerSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/PassThroughWorkerSelectorAttachmentInternal.java @@ -4,23 +4,17 @@ package com.azure.communication.jobrouter.implementation.models; import com.azure.communication.jobrouter.models.LabelOperator; -import com.azure.communication.jobrouter.models.WorkerSelectorAttachmentKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Attaches a worker selector where the value is passed through from a job's label with the same key. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = PassThroughWorkerSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("passThrough") @Fluent public final class PassThroughWorkerSelectorAttachmentInternal extends WorkerSelectorAttachmentInternal { @@ -30,14 +24,14 @@ public final class PassThroughWorkerSelectorAttachmentInternal extends WorkerSel */ @Generated @JsonProperty(value = "key") - private final String key; + private String key; /* * Describes how the value of the label is compared to the value pass through. */ @Generated @JsonProperty(value = "labelOperator") - private final LabelOperator labelOperator; + private LabelOperator labelOperator; /* * Describes how long the attached label selector is valid in seconds. @@ -101,23 +95,4 @@ public PassThroughWorkerSelectorAttachmentInternal setExpiresAfterSeconds(Double this.expiresAfterSeconds = expiresAfterSeconds; return this; } - - /* - * The type discriminator describing a sub-type of WorkerSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private WorkerSelectorAttachmentKind kind = WorkerSelectorAttachmentKind.PASS_THROUGH; - - /** - * Get the kind property: The type discriminator describing a sub-type of WorkerSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public WorkerSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueAndMatchModeInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueAndMatchModeInternal.java index 08f442317836..8f71ae9e1cde 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueAndMatchModeInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueAndMatchModeInternal.java @@ -3,22 +3,15 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.JobMatchingModeKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Describes a matching mode where matching worker to a job is automatically started after job is queued successfully. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = QueueAndMatchModeInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("queueAndMatch") @Immutable public final class QueueAndMatchModeInternal extends JobMatchingModeInternal { @@ -29,23 +22,4 @@ public final class QueueAndMatchModeInternal extends JobMatchingModeInternal { @Generated public QueueAndMatchModeInternal() { } - - /* - * The type discriminator describing a sub-type of JobMatchingMode. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private JobMatchingModeKind kind = JobMatchingModeKind.QUEUE_AND_MATCH; - - /** - * Get the kind property: The type discriminator describing a sub-type of JobMatchingMode. - * - * @return the kind value. - */ - @Generated - @Override - public JobMatchingModeKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueLengthExceptionTriggerInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueLengthExceptionTriggerInternal.java index 63bd9dc72372..9493da70910e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueLengthExceptionTriggerInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueLengthExceptionTriggerInternal.java @@ -3,23 +3,17 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.ExceptionTriggerKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Trigger for an exception action on exceeding queue length. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = QueueLengthExceptionTriggerInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("queueLength") @Immutable public final class QueueLengthExceptionTriggerInternal extends ExceptionTriggerInternal { @@ -29,7 +23,7 @@ public final class QueueLengthExceptionTriggerInternal extends ExceptionTriggerI */ @Generated @JsonProperty(value = "threshold") - private final int threshold; + private int threshold; /** * Creates an instance of QueueLengthExceptionTriggerInternal class. @@ -51,23 +45,4 @@ public QueueLengthExceptionTriggerInternal(@JsonProperty(value = "threshold") in public int getThreshold() { return this.threshold; } - - /* - * The type discriminator describing a sub-type of ExceptionTrigger. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private ExceptionTriggerKind kind = ExceptionTriggerKind.QUEUE_LENGTH; - - /** - * Get the kind property: The type discriminator describing a sub-type of ExceptionTrigger. - * - * @return the kind value. - */ - @Generated - @Override - public ExceptionTriggerKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueSelectorAttachmentInternal.java index 8dfdc793fe53..740b2c0773a4 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueSelectorAttachmentInternal.java @@ -3,12 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.QueueSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +14,9 @@ */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = QueueSelectorAttachmentInternal.class, - visible = true) + defaultImpl = QueueSelectorAttachmentInternal.class) @JsonTypeName("QueueSelectorAttachmentInternal") @JsonSubTypes({ @JsonSubTypes.Type(name = "conditional", value = ConditionalQueueSelectorAttachmentInternal.class), @@ -35,24 +32,5 @@ public class QueueSelectorAttachmentInternal { */ @Generated public QueueSelectorAttachmentInternal() { - this.kind = QueueSelectorAttachmentKind.fromString("QueueSelectorAttachmentInternal"); - } - - /* - * The type discriminator describing a sub-type of QueueSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private QueueSelectorAttachmentKind kind; - - /** - * Get the kind property: The type discriminator describing a sub-type of QueueSelectorAttachment. - * - * @return the kind value. - */ - @Generated - public QueueSelectorAttachmentKind getKind() { - return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueWeightedAllocationInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueWeightedAllocationInternal.java index a2f896a34057..66c5aa43fd45 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueWeightedAllocationInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/QueueWeightedAllocationInternal.java @@ -20,14 +20,14 @@ public final class QueueWeightedAllocationInternal { */ @Generated @JsonProperty(value = "weight") - private final double weight; + private double weight; /* * A collection of queue selectors that will be applied if this allocation is selected. */ @Generated @JsonProperty(value = "queueSelectors") - private final List queueSelectors; + private List queueSelectors; /** * Creates an instance of QueueWeightedAllocationInternal class. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyExceptionActionInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyExceptionActionInternal.java index f10c2bb5627f..d4e9ea103903 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyExceptionActionInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyExceptionActionInternal.java @@ -3,11 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.ExceptionActionKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; @@ -15,11 +13,7 @@ /** * An action that modifies labels on a job and then reclassifies it. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = ReclassifyExceptionActionInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("reclassify") @Fluent public final class ReclassifyExceptionActionInternal extends ExceptionActionInternal { @@ -32,7 +26,8 @@ public final class ReclassifyExceptionActionInternal extends ExceptionActionInte private String classificationPolicyId; /* - * Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primitive values - number, string, boolean. + * Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be + * primitive values - number, string, boolean. */ @Generated @JsonProperty(value = "labelsToUpsert") @@ -70,8 +65,8 @@ public ReclassifyExceptionActionInternal setClassificationPolicyId(String classi } /** - * Get the labelsToUpsert property: Dictionary containing the labels to update (or add if not existing) in key-value - * pairs. Values must be primitive values - number, string, boolean. + * Get the labelsToUpsert property: Dictionary containing the labels to update (or add if not existing) in + * key-value pairs. Values must be primitive values - number, string, boolean. * * @return the labelsToUpsert value. */ @@ -81,8 +76,8 @@ public Map getLabelsToUpsert() { } /** - * Set the labelsToUpsert property: Dictionary containing the labels to update (or add if not existing) in key-value - * pairs. Values must be primitive values - number, string, boolean. + * Set the labelsToUpsert property: Dictionary containing the labels to update (or add if not existing) in + * key-value pairs. Values must be primitive values - number, string, boolean. * * @param labelsToUpsert the labelsToUpsert value to set. * @return the ReclassifyExceptionActionInternal object itself. @@ -102,23 +97,4 @@ public ReclassifyExceptionActionInternal setId(String id) { super.setId(id); return this; } - - /* - * The type discriminator describing a sub-type of ExceptionAction. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private ExceptionActionKind kind = ExceptionActionKind.RECLASSIFY; - - /** - * Get the kind property: The type discriminator describing a sub-type of ExceptionAction. - * - * @return the kind value. - */ - @Generated - @Override - public ExceptionActionKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RoundRobinModeInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RoundRobinModeInternal.java index b504f3f3c1c8..8f7ce8e1b9cc 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RoundRobinModeInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RoundRobinModeInternal.java @@ -3,18 +3,15 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.DistributionModeKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = RoundRobinModeInternal.class, visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("roundRobin") @Fluent public final class RoundRobinModeInternal extends DistributionModeInternal { @@ -55,23 +52,4 @@ public RoundRobinModeInternal setBypassSelectors(Boolean bypassSelectors) { super.setBypassSelectors(bypassSelectors); return this; } - - /* - * The type discriminator describing a sub-type of DistributionMode. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private DistributionModeKind kind = DistributionModeKind.ROUND_ROBIN; - - /** - * Get the kind property: The type discriminator describing a sub-type of DistributionMode. - * - * @return the kind value. - */ - @Generated - @Override - public DistributionModeKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterJobInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterJobInternal.java index b9ca3f53ec46..ba6fbadf6d93 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterJobInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterJobInternal.java @@ -76,7 +76,7 @@ public final class RouterJobInternal { private String queueId; /* - * Priority of this job. Value must be between -100 to 100. + * Priority of this job. */ @Generated @JsonProperty(value = "priority") @@ -97,14 +97,16 @@ public final class RouterJobInternal { private List requestedWorkerSelectors; /* - * A collection of worker selectors attached by a classification policy, which a worker must satisfy in order to process this job. + * A collection of worker selectors attached by a classification policy, which a worker must satisfy in order to + * process this job. */ @Generated @JsonProperty(value = "attachedWorkerSelectors", access = JsonProperty.Access.WRITE_ONLY) private List attachedWorkerSelectors; /* - * A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. + * A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values + * must be primitive values - number, string, boolean. */ @Generated @JsonProperty(value = "labels") @@ -118,7 +120,8 @@ public final class RouterJobInternal { private Map assignments; /* - * A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean. + * A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, + * boolean. */ @Generated @JsonProperty(value = "tags") @@ -281,7 +284,7 @@ public RouterJobInternal setQueueId(String queueId) { } /** - * Get the priority property: Priority of this job. Value must be between -100 to 100. + * Get the priority property: Priority of this job. * * @return the priority value. */ @@ -291,7 +294,7 @@ public Integer getPriority() { } /** - * Set the priority property: Priority of this job. Value must be between -100 to 100. + * Set the priority property: Priority of this job. * * @param priority the priority value to set. * @return the RouterJobInternal object itself. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueInternal.java index 397f48ee1ee6..285a63243a05 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueInternal.java @@ -43,7 +43,8 @@ public final class RouterQueueInternal { private String distributionPolicyId; /* - * A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. + * A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values + * must be primitive values - number, string, boolean. */ @Generated @JsonProperty(value = "labels") diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueSelectorInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueSelectorInternal.java index c6d86f3c8ee6..316fd330b259 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueSelectorInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueSelectorInternal.java @@ -20,17 +20,18 @@ public final class RouterQueueSelectorInternal { */ @Generated @JsonProperty(value = "key") - private final String key; + private String key; /* * Describes how the value of the label is compared to the value defined on the label selector. */ @Generated @JsonProperty(value = "labelOperator") - private final LabelOperator labelOperator; + private LabelOperator labelOperator; /* - * The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean. + * The value to compare against the actual label value with the given operator. Values must be primitive values - + * number, string, boolean. */ @Generated @JsonProperty(value = "value") diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueStatisticsInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueStatisticsInternal.java index 886339edb1f0..e123d397a918 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueStatisticsInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterQueueStatisticsInternal.java @@ -20,14 +20,14 @@ public final class RouterQueueStatisticsInternal { */ @Generated @JsonProperty(value = "queueId") - private final String queueId; + private String queueId; /* * Length of the queue: total number of enqueued jobs. */ @Generated @JsonProperty(value = "length") - private final int length; + private int length; /* * The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority. @@ -89,8 +89,8 @@ public Map getEstimatedWaitTimeMinutes() { } /** - * Get the longestJobWaitTimeMinutes property: The wait time of the job that has been enqueued in this queue for the - * longest. + * Get the longestJobWaitTimeMinutes property: The wait time of the job that has been enqueued in this queue for + * the longest. * * @return the longestJobWaitTimeMinutes value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterRuleInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterRuleInternal.java index 03654ade4a30..063a26041e4a 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterRuleInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterRuleInternal.java @@ -3,12 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.RouterRuleKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -20,7 +17,11 @@ * FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. * WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = RouterRuleInternal.class, visible = true) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = RouterRuleInternal.class) @JsonTypeName("RouterRuleInternal") @JsonSubTypes({ @JsonSubTypes.Type(name = "directMap", value = DirectMapRouterRuleInternal.class), @@ -36,24 +37,5 @@ public class RouterRuleInternal { */ @Generated public RouterRuleInternal() { - this.kind = RouterRuleKind.fromString("RouterRuleInternal"); - } - - /* - * The type discriminator describing a sub-type of RouterRule - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private RouterRuleKind kind; - - /** - * Get the kind property: The type discriminator describing a sub-type of RouterRule. - * - * @return the kind value. - */ - @Generated - public RouterRuleKind getKind() { - return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterWorkerInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterWorkerInternal.java index e970e519ec9b..5f52bc772b33 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterWorkerInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterWorkerInternal.java @@ -55,14 +55,16 @@ public final class RouterWorkerInternal { private Integer capacity; /* - * A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. + * A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values + * must be primitive values - number, string, boolean. */ @Generated @JsonProperty(value = "labels") private Map labels; /* - * A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean. + * A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, + * boolean. */ @Generated @JsonProperty(value = "tags") @@ -90,7 +92,8 @@ public final class RouterWorkerInternal { private List assignedJobs; /* - * A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed. + * A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no + * capacity is currently consumed. */ @Generated @JsonProperty(value = "loadRatio", access = JsonProperty.Access.WRITE_ONLY) @@ -308,35 +311,4 @@ public RouterWorkerInternal setAvailableForOffers(Boolean availableForOffers) { this.availableForOffers = availableForOffers; return this; } - - /* - * If this is set, the worker will only receive up to this many new offers at a time. - */ - @Generated - @JsonProperty(value = "maxConcurrentOffers") - private Integer maxConcurrentOffers; - - /** - * Get the maxConcurrentOffers property: If this is set, the worker will only receive up to this many new offers at - * a time. - * - * @return the maxConcurrentOffers value. - */ - @Generated - public Integer getMaxConcurrentOffers() { - return this.maxConcurrentOffers; - } - - /** - * Set the maxConcurrentOffers property: If this is set, the worker will only receive up to this many new offers at - * a time. - * - * @param maxConcurrentOffers the maxConcurrentOffers value to set. - * @return the RouterWorkerInternal object itself. - */ - @Generated - public RouterWorkerInternal setMaxConcurrentOffers(Integer maxConcurrentOffers) { - this.maxConcurrentOffers = maxConcurrentOffers; - return this; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterWorkerSelectorInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterWorkerSelectorInternal.java index b66e3b580f53..0a6474065d6e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterWorkerSelectorInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RouterWorkerSelectorInternal.java @@ -22,17 +22,18 @@ public final class RouterWorkerSelectorInternal { */ @Generated @JsonProperty(value = "key") - private final String key; + private String key; /* * Describes how the value of the label is compared to the value defined on the worker selector. */ @Generated @JsonProperty(value = "labelOperator") - private final LabelOperator labelOperator; + private LabelOperator labelOperator; /* - * The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean. + * The value to compare against the actual label value with the given operator. Values must be primitive values - + * number, string, boolean. */ @Generated @JsonProperty(value = "value") diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RuleEngineQueueSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RuleEngineQueueSelectorAttachmentInternal.java index 30d962ef5919..2b307b4e9e49 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RuleEngineQueueSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RuleEngineQueueSelectorAttachmentInternal.java @@ -3,23 +3,17 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.QueueSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Attaches queue selectors to a job when the RouterRule is resolved. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = RuleEngineQueueSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("ruleEngine") @Immutable public final class RuleEngineQueueSelectorAttachmentInternal extends QueueSelectorAttachmentInternal { @@ -29,7 +23,7 @@ public final class RuleEngineQueueSelectorAttachmentInternal extends QueueSelect */ @Generated @JsonProperty(value = "rule") - private final RouterRuleInternal rule; + private RouterRuleInternal rule; /** * Creates an instance of RuleEngineQueueSelectorAttachmentInternal class. @@ -51,23 +45,4 @@ public RuleEngineQueueSelectorAttachmentInternal(@JsonProperty(value = "rule") R public RouterRuleInternal getRule() { return this.rule; } - - /* - * The type discriminator describing a sub-type of QueueSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private QueueSelectorAttachmentKind kind = QueueSelectorAttachmentKind.RULE_ENGINE; - - /** - * Get the kind property: The type discriminator describing a sub-type of QueueSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public QueueSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RuleEngineWorkerSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RuleEngineWorkerSelectorAttachmentInternal.java index d2feadd06943..562633495c8e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RuleEngineWorkerSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/RuleEngineWorkerSelectorAttachmentInternal.java @@ -3,23 +3,17 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.WorkerSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Attaches worker selectors to a job when a RouterRule is resolved. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = RuleEngineWorkerSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("ruleEngine") @Immutable public final class RuleEngineWorkerSelectorAttachmentInternal extends WorkerSelectorAttachmentInternal { @@ -29,7 +23,7 @@ public final class RuleEngineWorkerSelectorAttachmentInternal extends WorkerSele */ @Generated @JsonProperty(value = "rule") - private final RouterRuleInternal rule; + private RouterRuleInternal rule; /** * Creates an instance of RuleEngineWorkerSelectorAttachmentInternal class. @@ -51,23 +45,4 @@ public RuleEngineWorkerSelectorAttachmentInternal(@JsonProperty(value = "rule") public RouterRuleInternal getRule() { return this.rule; } - - /* - * The type discriminator describing a sub-type of WorkerSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private WorkerSelectorAttachmentKind kind = WorkerSelectorAttachmentKind.RULE_ENGINE; - - /** - * Get the kind property: The type discriminator describing a sub-type of WorkerSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public WorkerSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ScheduleAndSuspendModeInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ScheduleAndSuspendModeInternal.java index 1d986738174e..e85631ffb446 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ScheduleAndSuspendModeInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ScheduleAndSuspendModeInternal.java @@ -3,12 +3,10 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.JobMatchingModeKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; @@ -17,11 +15,7 @@ * Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching * worker to a job will not start automatically. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = ScheduleAndSuspendModeInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("scheduleAndSuspend") @Immutable public final class ScheduleAndSuspendModeInternal extends JobMatchingModeInternal { @@ -31,7 +25,7 @@ public final class ScheduleAndSuspendModeInternal extends JobMatchingModeInterna */ @Generated @JsonProperty(value = "scheduleAt") - private final OffsetDateTime scheduleAt; + private OffsetDateTime scheduleAt; /** * Creates an instance of ScheduleAndSuspendModeInternal class. @@ -53,23 +47,4 @@ public ScheduleAndSuspendModeInternal(@JsonProperty(value = "scheduleAt") Offset public OffsetDateTime getScheduleAt() { return this.scheduleAt; } - - /* - * The type discriminator describing a sub-type of JobMatchingMode. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private JobMatchingModeKind kind = JobMatchingModeKind.SCHEDULE_AND_SUSPEND; - - /** - * Get the kind property: The type discriminator describing a sub-type of JobMatchingMode. - * - * @return the kind value. - */ - @Generated - @Override - public JobMatchingModeKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticQueueSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticQueueSelectorAttachmentInternal.java index 82b4a960c6a5..9f17328012f9 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticQueueSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticQueueSelectorAttachmentInternal.java @@ -3,23 +3,17 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.QueueSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Describes a queue selector that will be attached to a job. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = StaticQueueSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("static") @Immutable public final class StaticQueueSelectorAttachmentInternal extends QueueSelectorAttachmentInternal { @@ -29,7 +23,7 @@ public final class StaticQueueSelectorAttachmentInternal extends QueueSelectorAt */ @Generated @JsonProperty(value = "queueSelector") - private final RouterQueueSelectorInternal queueSelector; + private RouterQueueSelectorInternal queueSelector; /** * Creates an instance of StaticQueueSelectorAttachmentInternal class. @@ -52,23 +46,4 @@ public StaticQueueSelectorAttachmentInternal( public RouterQueueSelectorInternal getQueueSelector() { return this.queueSelector; } - - /* - * The type discriminator describing a sub-type of QueueSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private QueueSelectorAttachmentKind kind = QueueSelectorAttachmentKind.STATIC; - - /** - * Get the kind property: The type discriminator describing a sub-type of QueueSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public QueueSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticRouterRuleInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticRouterRuleInternal.java index 0dce4502d0ff..3114a507497c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticRouterRuleInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticRouterRuleInternal.java @@ -3,22 +3,16 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.RouterRuleKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * A rule providing static rules that always return the same result, regardless of input. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = StaticRouterRuleInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("static") @Fluent public final class StaticRouterRuleInternal extends RouterRuleInternal { @@ -60,23 +54,4 @@ public StaticRouterRuleInternal setValue(Object value) { this.value = value; return this; } - - /* - * The type discriminator describing a sub-type of RouterRule - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private RouterRuleKind kind = RouterRuleKind.STATIC; - - /** - * Get the kind property: The type discriminator describing a sub-type of RouterRule. - * - * @return the kind value. - */ - @Generated - @Override - public RouterRuleKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticWorkerSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticWorkerSelectorAttachmentInternal.java index 535caec488e8..a1b61872f688 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticWorkerSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/StaticWorkerSelectorAttachmentInternal.java @@ -3,23 +3,17 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.WorkerSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Describes a worker selector that will be attached to a job. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = StaticWorkerSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("static") @Immutable public final class StaticWorkerSelectorAttachmentInternal extends WorkerSelectorAttachmentInternal { @@ -29,7 +23,7 @@ public final class StaticWorkerSelectorAttachmentInternal extends WorkerSelector */ @Generated @JsonProperty(value = "workerSelector") - private final RouterWorkerSelectorInternal workerSelector; + private RouterWorkerSelectorInternal workerSelector; /** * Creates an instance of StaticWorkerSelectorAttachmentInternal class. @@ -52,23 +46,4 @@ public StaticWorkerSelectorAttachmentInternal( public RouterWorkerSelectorInternal getWorkerSelector() { return this.workerSelector; } - - /* - * The type discriminator describing a sub-type of WorkerSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private WorkerSelectorAttachmentKind kind = WorkerSelectorAttachmentKind.STATIC; - - /** - * Get the kind property: The type discriminator describing a sub-type of WorkerSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public WorkerSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/SuspendModeInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/SuspendModeInternal.java index 9cba3fd61971..a837b038e726 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/SuspendModeInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/SuspendModeInternal.java @@ -3,18 +3,15 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.JobMatchingModeKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Describes a matching mode where matching worker to a job is suspended. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = SuspendModeInternal.class, visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("suspend") @Immutable public final class SuspendModeInternal extends JobMatchingModeInternal { @@ -25,23 +22,4 @@ public final class SuspendModeInternal extends JobMatchingModeInternal { @Generated public SuspendModeInternal() { } - - /* - * The type discriminator describing a sub-type of JobMatchingMode. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private JobMatchingModeKind kind = JobMatchingModeKind.SUSPEND; - - /** - * Get the kind property: The type discriminator describing a sub-type of JobMatchingMode. - * - * @return the kind value. - */ - @Generated - @Override - public JobMatchingModeKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WaitTimeExceptionTriggerInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WaitTimeExceptionTriggerInternal.java index 1f236556586e..432f65e450a5 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WaitTimeExceptionTriggerInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WaitTimeExceptionTriggerInternal.java @@ -3,23 +3,17 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.ExceptionTriggerKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Trigger for an exception action on exceeding wait time. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = WaitTimeExceptionTriggerInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("waitTime") @Immutable public final class WaitTimeExceptionTriggerInternal extends ExceptionTriggerInternal { @@ -29,7 +23,7 @@ public final class WaitTimeExceptionTriggerInternal extends ExceptionTriggerInte */ @Generated @JsonProperty(value = "thresholdSeconds") - private final double thresholdSeconds; + private double thresholdSeconds; /** * Creates an instance of WaitTimeExceptionTriggerInternal class. @@ -51,23 +45,4 @@ public WaitTimeExceptionTriggerInternal(@JsonProperty(value = "thresholdSeconds" public double getThresholdSeconds() { return this.thresholdSeconds; } - - /* - * The type discriminator describing a sub-type of ExceptionTrigger. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private ExceptionTriggerKind kind = ExceptionTriggerKind.WAIT_TIME; - - /** - * Get the kind property: The type discriminator describing a sub-type of ExceptionTrigger. - * - * @return the kind value. - */ - @Generated - @Override - public ExceptionTriggerKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WebhookRouterRuleInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WebhookRouterRuleInternal.java index c58894f813b0..12b4c113c2a8 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WebhookRouterRuleInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WebhookRouterRuleInternal.java @@ -4,22 +4,16 @@ package com.azure.communication.jobrouter.implementation.models; import com.azure.communication.jobrouter.models.OAuth2WebhookClientCredential; -import com.azure.communication.jobrouter.models.RouterRuleKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * A rule providing a binding to an external web server. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = WebhookRouterRuleInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("webhook") @Fluent public final class WebhookRouterRuleInternal extends RouterRuleInternal { @@ -32,7 +26,8 @@ public final class WebhookRouterRuleInternal extends RouterRuleInternal { private String authorizationServerUri; /* - * OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ + * OAuth2.0 Credentials used to Contoso's Authorization server. Reference: + * https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ */ @Generated @JsonProperty(value = "clientCredential") @@ -119,23 +114,4 @@ public WebhookRouterRuleInternal setClientCredential(OAuth2WebhookClientCredenti this.clientCredential = clientCredential; return this; } - - /* - * The type discriminator describing a sub-type of RouterRule - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private RouterRuleKind kind = RouterRuleKind.WEBHOOK; - - /** - * Get the kind property: The type discriminator describing a sub-type of RouterRule. - * - * @return the kind value. - */ - @Generated - @Override - public RouterRuleKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WeightedAllocationQueueSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WeightedAllocationQueueSelectorAttachmentInternal.java index 2df7dd948111..a82d69805c32 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WeightedAllocationQueueSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WeightedAllocationQueueSelectorAttachmentInternal.java @@ -3,12 +3,10 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.QueueSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -16,11 +14,7 @@ /** * Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = WeightedAllocationQueueSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("weightedAllocation") @Immutable public final class WeightedAllocationQueueSelectorAttachmentInternal extends QueueSelectorAttachmentInternal { @@ -30,7 +24,7 @@ public final class WeightedAllocationQueueSelectorAttachmentInternal extends Que */ @Generated @JsonProperty(value = "allocations") - private final List allocations; + private List allocations; /** * Creates an instance of WeightedAllocationQueueSelectorAttachmentInternal class. @@ -53,23 +47,4 @@ public WeightedAllocationQueueSelectorAttachmentInternal( public List getAllocations() { return this.allocations; } - - /* - * The type discriminator describing a sub-type of QueueSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private QueueSelectorAttachmentKind kind = QueueSelectorAttachmentKind.WEIGHTED_ALLOCATION; - - /** - * Get the kind property: The type discriminator describing a sub-type of QueueSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public QueueSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WeightedAllocationWorkerSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WeightedAllocationWorkerSelectorAttachmentInternal.java index 1c804b185f03..d0753a41be2e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WeightedAllocationWorkerSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WeightedAllocationWorkerSelectorAttachmentInternal.java @@ -3,12 +3,10 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.WorkerSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -16,11 +14,7 @@ /** * Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = WeightedAllocationWorkerSelectorAttachmentInternal.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("weightedAllocation") @Immutable public final class WeightedAllocationWorkerSelectorAttachmentInternal extends WorkerSelectorAttachmentInternal { @@ -30,7 +24,7 @@ public final class WeightedAllocationWorkerSelectorAttachmentInternal extends Wo */ @Generated @JsonProperty(value = "allocations") - private final List allocations; + private List allocations; /** * Creates an instance of WeightedAllocationWorkerSelectorAttachmentInternal class. @@ -53,23 +47,4 @@ public WeightedAllocationWorkerSelectorAttachmentInternal( public List getAllocations() { return this.allocations; } - - /* - * The type discriminator describing a sub-type of WorkerSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private WorkerSelectorAttachmentKind kind = WorkerSelectorAttachmentKind.WEIGHTED_ALLOCATION; - - /** - * Get the kind property: The type discriminator describing a sub-type of WorkerSelectorAttachment. - * - * @return the kind value. - */ - @Generated - @Override - public WorkerSelectorAttachmentKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WorkerSelectorAttachmentInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WorkerSelectorAttachmentInternal.java index ae4b9da16e88..86d4c6c034d2 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WorkerSelectorAttachmentInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WorkerSelectorAttachmentInternal.java @@ -3,12 +3,9 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation.models; -import com.azure.communication.jobrouter.models.WorkerSelectorAttachmentKind; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +14,9 @@ */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = WorkerSelectorAttachmentInternal.class, - visible = true) + defaultImpl = WorkerSelectorAttachmentInternal.class) @JsonTypeName("WorkerSelectorAttachmentInternal") @JsonSubTypes({ @JsonSubTypes.Type(name = "conditional", value = ConditionalWorkerSelectorAttachmentInternal.class), @@ -35,24 +32,5 @@ public class WorkerSelectorAttachmentInternal { */ @Generated public WorkerSelectorAttachmentInternal() { - this.kind = WorkerSelectorAttachmentKind.fromString("WorkerSelectorAttachmentInternal"); - } - - /* - * The type discriminator describing a sub-type of WorkerSelectorAttachment. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private WorkerSelectorAttachmentKind kind; - - /** - * Get the kind property: The type discriminator describing a sub-type of WorkerSelectorAttachment. - * - * @return the kind value. - */ - @Generated - public WorkerSelectorAttachmentKind getKind() { - return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WorkerWeightedAllocationInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WorkerWeightedAllocationInternal.java index b3eeaa95065a..d6534515e1c7 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WorkerWeightedAllocationInternal.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/WorkerWeightedAllocationInternal.java @@ -20,14 +20,14 @@ public final class WorkerWeightedAllocationInternal { */ @Generated @JsonProperty(value = "weight") - private final double weight; + private double weight; /* * A collection of worker selectors that will be applied if this allocation is selected. */ @Generated @JsonProperty(value = "workerSelectors") - private final List workerSelectors; + private List workerSelectors; /** * Creates an instance of WorkerWeightedAllocationInternal class. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/AcceptJobOfferResult.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/AcceptJobOfferResult.java index ce37afee0224..fe7de5997a2c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/AcceptJobOfferResult.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/AcceptJobOfferResult.java @@ -19,21 +19,21 @@ public final class AcceptJobOfferResult { */ @Generated @JsonProperty(value = "assignmentId") - private final String assignmentId; + private String assignmentId; /* * Id of the job assigned. */ @Generated @JsonProperty(value = "jobId") - private final String jobId; + private String jobId; /* * Id of the worker that has been assigned this job. */ @Generated @JsonProperty(value = "workerId") - private final String workerId; + private String workerId; /** * Creates an instance of AcceptJobOfferResult class. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java index b57f8c5dd8fa..c0f330f01efd 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -20,6 +21,7 @@ public final class BestWorkerMode extends DistributionMode { * of label selectors the worker labels match and/or exceed using a logistic function * (https://en.wikipedia.org/wiki/Logistic_function). */ + @Generated @JsonProperty(value = "scoringRule") private RouterRule scoringRule; @@ -30,9 +32,7 @@ public final class BestWorkerMode extends DistributionMode { private ScoringRuleOptions scoringRuleOptions; /** Creates an instance of BestWorkerMode class. */ - public BestWorkerMode() { - this.kind = DistributionModeKind.BEST_WORKER; - } + public BestWorkerMode() {} /** * Get the scoringRule property: Define a scoring rule to use, when calculating a score to determine the best @@ -81,6 +81,7 @@ public BestWorkerMode setScoringRuleOptions(ScoringRuleOptions scoringRuleOption } /** {@inheritDoc} */ + @Generated @Override public BestWorkerMode setMinConcurrentOffers(Integer minConcurrentOffers) { super.setMinConcurrentOffers(minConcurrentOffers); @@ -88,6 +89,7 @@ public BestWorkerMode setMinConcurrentOffers(Integer minConcurrentOffers) { } /** {@inheritDoc} */ + @Generated @Override public BestWorkerMode setMaxConcurrentOffers(Integer maxConcurrentOffers) { super.setMaxConcurrentOffers(maxConcurrentOffers); @@ -95,6 +97,7 @@ public BestWorkerMode setMaxConcurrentOffers(Integer maxConcurrentOffers) { } /** {@inheritDoc} */ + @Generated @Override public BestWorkerMode setBypassSelectors(Boolean bypassSelectors) { super.setBypassSelectors(bypassSelectors); diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java index 584d3ed1ee92..eacb4f608ad0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,6 +19,7 @@ public final class CancelExceptionAction extends ExceptionAction { * (Optional) A note that will be appended to the jobs' Notes collection with the * current timestamp. */ + @Generated @JsonProperty(value = "note") private String note; @@ -25,13 +27,13 @@ public final class CancelExceptionAction extends ExceptionAction { * (Optional) Indicates the outcome of the job, populate this field with your own * custom values. */ + @Generated @JsonProperty(value = "dispositionCode") private String dispositionCode; /** Creates an instance of CancelExceptionAction class. */ - public CancelExceptionAction() { - this.kind = ExceptionActionKind.CANCEL; - } + @Generated + public CancelExceptionAction() {} /** * Get the note property: (Optional) A note that will be appended to the jobs' Notes collection with the current @@ -39,6 +41,7 @@ public CancelExceptionAction() { * * @return the note value. */ + @Generated public String getNote() { return this.note; } @@ -50,6 +53,7 @@ public String getNote() { * @param note the note value to set. * @return the CancelExceptionAction object itself. */ + @Generated public CancelExceptionAction setNote(String note) { this.note = note; return this; @@ -61,6 +65,7 @@ public CancelExceptionAction setNote(String note) { * * @return the dispositionCode value. */ + @Generated public String getDispositionCode() { return this.dispositionCode; } @@ -72,6 +77,7 @@ public String getDispositionCode() { * @param dispositionCode the dispositionCode value to set. * @return the CancelExceptionAction object itself. */ + @Generated public CancelExceptionAction setDispositionCode(String dispositionCode) { this.dispositionCode = dispositionCode; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelJobOptions.java index 9ecfedcefbe0..5638c43ee824 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelJobOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelJobOptions.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -15,6 +16,7 @@ public final class CancelJobOptions { /* * A note that will be appended to a job's Notes collection with the current timestamp. */ + @Generated @JsonProperty(value = "note") private String note; @@ -22,12 +24,14 @@ public final class CancelJobOptions { * Indicates the outcome of a job, populate this field with your own custom values. If not provided, default value * of "Cancelled" is set. */ + @Generated @JsonProperty(value = "dispositionCode") private String dispositionCode; /** * Creates an instance of CancelJobOptionsInternal class. */ + @Generated public CancelJobOptions() { } @@ -36,6 +40,7 @@ public CancelJobOptions() { * * @return the note value. */ + @Generated public String getNote() { return this.note; } @@ -46,6 +51,7 @@ public String getNote() { * @param note the note value to set. * @return the CancelJobOptionsInternal object itself. */ + @Generated public CancelJobOptions setNote(String note) { this.note = note; return this; @@ -57,6 +63,7 @@ public CancelJobOptions setNote(String note) { * * @return the dispositionCode value. */ + @Generated public String getDispositionCode() { return this.dispositionCode; } @@ -68,6 +75,7 @@ public String getDispositionCode() { * @param dispositionCode the dispositionCode value to set. * @return the CancelJobOptionsInternal object itself. */ + @Generated public CancelJobOptions setDispositionCode(String dispositionCode) { this.dispositionCode = dispositionCode; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicy.java index 173881e3f620..e4e29f9b75ce 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicy.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicy.java @@ -3,26 +3,26 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.communication.jobrouter.implementation.accesshelpers.ClassificationPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.converters.LabelSelectorAdapter; +import com.azure.communication.jobrouter.implementation.converters.RouterRuleAdapter; +import com.azure.communication.jobrouter.implementation.models.ClassificationPolicyInternal; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.stream.Collectors; /** * A container for the rules that govern how jobs are classified. */ @Fluent public final class ClassificationPolicy { - /** - * Create new instance - */ - public ClassificationPolicy() { - } /* * Id of a classification policy. */ - @JsonProperty(value = "id") + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* @@ -43,6 +43,32 @@ public ClassificationPolicy() { @JsonProperty(value = "prioritizationRule") private RouterRule prioritizationRule; + /** + * Creates an instance of ClassificationPolicy class. + */ + public ClassificationPolicy() { + } + + /** + * Package-private constructor of the class, used internally. + * + * @param internal The internal ClassificationPolicy + */ + ClassificationPolicy(ClassificationPolicyInternal internal) { + id = internal.getId(); + setName(internal.getName()); + setPrioritizationRule(RouterRuleAdapter.convertRouterRuleToPublic(internal.getPrioritizationRule())); + setFallbackQueueId(internal.getFallbackQueueId()); + setQueueSelectorAttachments(internal.getQueueSelectorAttachments().stream() + .map(LabelSelectorAdapter::convertQueueSelectorAttachmentToPublic).collect(Collectors.toList())); + setWorkerSelectorAttachments(internal.getWorkerSelectorAttachments().stream() + .map(LabelSelectorAdapter::convertWorkerSelectorAttachmentToPublic).collect(Collectors.toList())); + } + + static { + ClassificationPolicyConstructorProxy.setAccessor(ClassificationPolicy::new); + } + /** * Get the id property: Id of a classification policy. * @@ -106,7 +132,7 @@ public RouterRule getPrioritizationRule() { /* * The entity tag for this resource. */ - @JsonProperty(value = "etag") + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /* diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CloseJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CloseJobOptions.java index ae327621da2f..b8b9545ddcb9 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CloseJobOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CloseJobOptions.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -17,6 +18,7 @@ public final class CloseJobOptions { /* * Indicates the outcome of a job, populate this field with your own custom values. */ + @Generated @JsonProperty(value = "dispositionCode") private String dispositionCode; @@ -24,18 +26,21 @@ public final class CloseJobOptions { * If not provided, worker capacity is released immediately along with a JobClosedEvent notification. If provided, * worker capacity is released along with a JobClosedEvent notification at a future time in UTC. */ + @Generated @JsonProperty(value = "closeAt") private OffsetDateTime closeAt; /* * A note that will be appended to a job's Notes collection with the current timestamp. */ + @Generated @JsonProperty(value = "note") private String note; /** * Creates an instance of CloseJobOptionsInternal class. */ + @Generated public CloseJobOptions() { } @@ -45,6 +50,7 @@ public CloseJobOptions() { * * @return the dispositionCode value. */ + @Generated public String getDispositionCode() { return this.dispositionCode; } @@ -56,6 +62,7 @@ public String getDispositionCode() { * @param dispositionCode the dispositionCode value to set. * @return the CloseJobOptionsInternal object itself. */ + @Generated public CloseJobOptions setDispositionCode(String dispositionCode) { this.dispositionCode = dispositionCode; return this; @@ -68,6 +75,7 @@ public CloseJobOptions setDispositionCode(String dispositionCode) { * * @return the closeAt value. */ + @Generated public OffsetDateTime getCloseAt() { return this.closeAt; } @@ -80,6 +88,7 @@ public OffsetDateTime getCloseAt() { * @param closeAt the closeAt value to set. * @return the CloseJobOptionsInternal object itself. */ + @Generated public CloseJobOptions setCloseAt(OffsetDateTime closeAt) { this.closeAt = closeAt; return this; @@ -90,6 +99,7 @@ public CloseJobOptions setCloseAt(OffsetDateTime closeAt) { * * @return the note value. */ + @Generated public String getNote() { return this.note; } @@ -100,6 +110,7 @@ public String getNote() { * @param note the note value to set. * @return the CloseJobOptionsInternal object itself. */ + @Generated public CloseJobOptions setNote(String note) { this.note = note; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CompleteJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CompleteJobOptions.java index cd3cd64067f3..dcbeb4e29d3d 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CompleteJobOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CompleteJobOptions.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -15,12 +16,14 @@ public final class CompleteJobOptions { /* * A note that will be appended to a job's Notes collection with the current timestamp. */ + @Generated @JsonProperty(value = "note") private String note; /** * Creates an instance of CompleteJobOptionsInternal class. */ + @Generated public CompleteJobOptions() { } @@ -29,6 +32,7 @@ public CompleteJobOptions() { * * @return the note value. */ + @Generated public String getNote() { return this.note; } @@ -39,6 +43,7 @@ public String getNote() { * @param note the note value to set. * @return the CompleteJobOptionsInternal object itself. */ + @Generated public CompleteJobOptions setNote(String note) { this.note = note; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java index 556075b6be11..adca7630e5a2 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java @@ -3,12 +3,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; - import java.util.List; /** Describes a set of queue selectors that will be attached if the given condition resolves to true. */ @@ -32,12 +32,14 @@ public final class ConditionalQueueSelectorAttachment extends QueueSelectorAttac * WebhookRule: A rule providing a binding to a webserver following * OAuth2.0 authentication protocol. */ + @Generated @JsonProperty(value = "condition") private RouterRule condition; /* * The queue selectors to attach */ + @Generated @JsonProperty(value = "queueSelectors") private List queueSelectors; @@ -47,13 +49,13 @@ public final class ConditionalQueueSelectorAttachment extends QueueSelectorAttac * @param condition the condition value to set. * @param queueSelectors the queueSelectors value to set. */ + @Generated @JsonCreator public ConditionalQueueSelectorAttachment( @JsonProperty(value = "condition") RouterRule condition, @JsonProperty(value = "queueSelectors") List queueSelectors) { this.condition = condition; this.queueSelectors = queueSelectors; - this.kind = QueueSelectorAttachmentKind.CONDITIONAL; } /** @@ -66,6 +68,7 @@ public ConditionalQueueSelectorAttachment( * * @return the condition value. */ + @Generated public RouterRule getCondition() { return this.condition; } @@ -75,6 +78,7 @@ public RouterRule getCondition() { * * @return the queueSelectors value. */ + @Generated public List getQueueSelectors() { return this.queueSelectors; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java index 894387412718..04919d68814f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java @@ -3,12 +3,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; - import java.util.List; /** Describes a set of worker selectors that will be attached if the given condition resolves to true. */ @@ -32,12 +32,14 @@ public final class ConditionalWorkerSelectorAttachment extends WorkerSelectorAtt * WebhookRule: A rule providing a binding to a webserver following * OAuth2.0 authentication protocol. */ + @Generated @JsonProperty(value = "condition") private RouterRule condition; /* * The worker selectors to attach */ + @Generated @JsonProperty(value = "workerSelectors") private List workerSelectors; @@ -47,13 +49,13 @@ public final class ConditionalWorkerSelectorAttachment extends WorkerSelectorAtt * @param condition the condition value to set. * @param workerSelectors the workerSelectors value to set. */ + @Generated @JsonCreator public ConditionalWorkerSelectorAttachment( @JsonProperty(value = "condition") RouterRule condition, @JsonProperty(value = "workerSelectors") List workerSelectors) { this.condition = condition; this.workerSelectors = workerSelectors; - this.kind = WorkerSelectorAttachmentKind.CONDITIONAL; } /** @@ -66,6 +68,7 @@ public ConditionalWorkerSelectorAttachment( * * @return the condition value. */ + @Generated public RouterRule getCondition() { return this.condition; } @@ -75,6 +78,7 @@ public RouterRule getCondition() { * * @return the workerSelectors value. */ + @Generated public List getWorkerSelectors() { return this.workerSelectors; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateDistributionPolicyOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateDistributionPolicyOptions.java index f3b60c327213..2548b6ecc177 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateDistributionPolicyOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateDistributionPolicyOptions.java @@ -46,7 +46,6 @@ public CreateDistributionPolicyOptions(String distributionPolicyId, Duration off } /** - * Sets Distribution Policy name. * @param name The human-readable name of the policy. * @return this */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateJobWithClassificationPolicyOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateJobWithClassificationPolicyOptions.java deleted file mode 100644 index 084ed69954a9..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateJobWithClassificationPolicyOptions.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import java.util.List; -import java.util.Map; - -/** - * Request options to create a job using a classification policy. - * Job: A unit of work to be routed. - */ -public final class CreateJobWithClassificationPolicyOptions { - /** - * The id of the job. - */ - private final String jobId; - - /** - * Reference to an external parent context, eg. call ID. - */ - private String channelReference; - - /** - * The channel identifier. eg. voice, chat, etc. - */ - private final String channelId; - - /** - * The Id of the Queue that this job is queued to. - */ - private String queueId; - - /** - * The priority of this job. - */ - private Integer priority; - - /** - * Reason code for cancelled or closed jobs. - */ - private String dispositionCode; - - /** - * A collection of manually specified label selectors, which a worker must - * satisfy in order to process this job. - */ - private List requestedWorkerSelectors; - - /** - * A set of key/value pairs that are identifying attributes used by the - * rules engines to make decisions. - */ - private Map labels; - - /** - * A set of non-identifying attributes attached to this job. - */ - private Map tags; - - /** - * Notes attached to a job, sorted by timestamp. - */ - private List notes; - - /* - * The matchingMode property. - */ - private JobMatchingMode matchingMode; - - /* - * The Id of the classification policy used to classify the job. - */ - private final String classificationPolicyId; - - /** - * Get the matchingMode property: The matchingMode property. - * - * @return the matchingMode value. - */ - public JobMatchingMode getMatchingMode() { - return this.matchingMode; - } - - /** - * Set the matchingMode property: The matchingMode property. - * - * @param matchingMode the matchingMode value to set. - * @return the RouterJobInternal object itself. - */ - public CreateJobWithClassificationPolicyOptions setMatchingMode(JobMatchingMode matchingMode) { - this.matchingMode = matchingMode; - return this; - } - - /** - * Constructor for CreateJobOptions. - * @param jobId The id of the job. - * @param channelId The channel identifier. eg. voice, chat, etc. - * @param classificationPolicyId The Id of the classification policy that will be used to classify the job. - */ - public CreateJobWithClassificationPolicyOptions(String jobId, String channelId, String classificationPolicyId) { - this.jobId = jobId; - this.channelId = channelId; - this.classificationPolicyId = classificationPolicyId; - } - - /** - * Sets job priority. - * @param priority The priority of this job. - * @return this - */ - public CreateJobWithClassificationPolicyOptions setPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Sets queueId. - * @param queueId The Id of the Queue that this job is queued to. - * @return this - */ - public CreateJobWithClassificationPolicyOptions setQueueId(String queueId) { - this.queueId = queueId; - return this; - } - - /** - * Sets channelReference. - * @param channelReference Reference to an external parent context, eg. call ID. - * @return this - */ - public CreateJobWithClassificationPolicyOptions setChannelReference(String channelReference) { - this.channelReference = channelReference; - return this; - } - - /** - * Sets dispositionCode. - * @param dispositionCode Reason code for cancelled or closed jobs. - * @return this - */ - public CreateJobWithClassificationPolicyOptions setDispositionCode(String dispositionCode) { - this.dispositionCode = dispositionCode; - return this; - } - - /** - * Sets requestedWorkerSelectors. - * @param requestedWorkerSelectors A collection of manually specified label selectors, which a worker must - * satisfy in order to process this job. - * @return this - */ - public CreateJobWithClassificationPolicyOptions setRequestedWorkerSelectors(List requestedWorkerSelectors) { - this.requestedWorkerSelectors = requestedWorkerSelectors; - return this; - } - - /** - * Sets labels. - * @param labels A set of key/value pairs that are identifying attributes used by the - * rules engines to make decisions. - * @return this - */ - public CreateJobWithClassificationPolicyOptions setLabels(Map labels) { - this.labels = labels; - return this; - } - - /** - * Sets tags. - * @param tags A set of non-identifying attributes attached to this job. - * @return this - */ - public CreateJobWithClassificationPolicyOptions setTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Sets notes. - * @param notes Notes attached to a job, sorted by timestamp. - * @return this - */ - public CreateJobWithClassificationPolicyOptions setNotes(List notes) { - this.notes = notes; - return this; - } - - /** - * Returns the id of RouterJob. - * @return id. - */ - public String getJobId() { - return this.jobId; - } - - /** - * Returns the reference to an external parent context, eg. call ID. - * @return channelReference - */ - public String getChannelReference() { - return this.channelReference; - } - - /** - * Returns the channel identifier. eg. voice, chat, etc. - * @return channelId - */ - public String getChannelId() { - return this.channelId; - } - - /** - * Returns the Id of the classification policy that will be used to classify the job. - * @return classificationPolicyId - */ - public String getClassificationPolicyId() { - return this.classificationPolicyId; - } - - /** - * Returns the Id of the Queue that this job is queued to. - * @return queueId - */ - public String getQueueId() { - return this.queueId; - } - - /** - * Returns the priority of this job. - * @return priority - */ - public Integer getPriority() { - return this.priority; - } - - /** - * Returns the reason code for cancelled or closed jobs. - * @return dispositionCode - */ - public String getDispositionCode() { - return this.dispositionCode; - } - - /** - * Returns the collection of manually specified label selectors that a worker must - * satisfy in order to process a job. - * @return requestedWorkerSelectors - */ - public List getRequestedWorkerSelectors() { - return this.requestedWorkerSelectors; - } - - /** - * A set of key/value pairs that are identifying attributes used by the - * rules engines to make decisions. - * @return labels - */ - public Map getLabels() { - return this.labels; - } - - /** - * A set of non-identifying attributes attached to this job - * @return tags - */ - public Map getTags() { - return this.tags; - } - - /** - * Notes attached to a job, sorted by timestamp - * @return note - */ - public List getNotes() { - return this.notes; - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateWorkerOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateWorkerOptions.java index 65642e33abea..e3470e0e9d75 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateWorkerOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CreateWorkerOptions.java @@ -49,11 +49,6 @@ public final class CreateWorkerOptions { */ private Boolean availableForOffers; - /* - * If this is set, the worker will only receive up to this many new offers at a time. - */ - private Integer maxConcurrentOffers; - /** * Constructor for CreateWorkerOptions. * @param workerId The id property. @@ -121,18 +116,6 @@ public CreateWorkerOptions setAvailableForOffers(Boolean availableForOffers) { return this; } - /** - * Set the maxConcurrentOffers property: If this is set, the worker will only receive up to this many new offers at - * a time. - * - * @param maxConcurrentOffers the maxConcurrentOffers value to set. - * @return this - */ - public CreateWorkerOptions setMaxConcurrentOffers(Integer maxConcurrentOffers) { - this.maxConcurrentOffers = maxConcurrentOffers; - return this; - } - /** * Returns id. * @return id @@ -188,14 +171,4 @@ public List getChannels() { public Boolean isAvailableForOffers() { return this.availableForOffers; } - - /** - * Get the maxConcurrentOffers property: If this is set, the worker will only receive up to this many new offers at - * a time. - * - * @return the maxConcurrentOffers value. - */ - public Integer getMaxConcurrentOffers() { - return this.maxConcurrentOffers; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DeclineJobOfferOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DeclineJobOfferOptions.java index fe15819cff4d..acebb7ae6b4e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DeclineJobOfferOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DeclineJobOfferOptions.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -20,12 +21,14 @@ public final class DeclineJobOfferOptions { * re-matched to eligible workers at the retry time in UTC. The worker that declined the job will also be eligible * for the job at that time. */ + @Generated @JsonProperty(value = "retryOfferAt") private OffsetDateTime retryOfferAt; /** * Creates an instance of DeclineJobOfferOptionsInternal class. */ + @Generated public DeclineJobOfferOptions() { } @@ -37,6 +40,7 @@ public DeclineJobOfferOptions() { * * @return the retryOfferAt value. */ + @Generated public OffsetDateTime getRetryOfferAt() { return this.retryOfferAt; } @@ -50,6 +54,7 @@ public OffsetDateTime getRetryOfferAt() { * @param retryOfferAt the retryOfferAt value to set. * @return the DeclineJobOfferOptionsInternal object itself. */ + @Generated public DeclineJobOfferOptions setRetryOfferAt(OffsetDateTime retryOfferAt) { this.retryOfferAt = retryOfferAt; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java index 2f84d7a71c45..c0e41ff42f4f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -14,7 +15,6 @@ public final class DirectMapRouterRule extends RouterRule { /** Creates an instance of DirectMapRouterRule class. */ - public DirectMapRouterRule() { - this.kind = RouterRuleKind.DIRECT_MAP; - } + @Generated + public DirectMapRouterRule() {} } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java index 419c15d7fb70..e3a0d421a8f9 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -28,17 +29,19 @@ public abstract class DistributionMode { * kind discriminator. */ @JsonProperty(value = "kind") - protected DistributionModeKind kind; + private String kind; /* * Governs the minimum desired number of active concurrent offers a job can have. */ + @Generated @JsonProperty(value = "minConcurrentOffers") private Integer minConcurrentOffers; /* * Governs the maximum number of active concurrent offers a job can have. */ + @Generated @JsonProperty(value = "maxConcurrentOffers") private Integer maxConcurrentOffers; @@ -47,10 +50,12 @@ public abstract class DistributionMode { * may get workers that are not qualified for the job they are matched with if you set this variable to true. This * flag is intended more for temporary usage. By default, set to false. */ + @Generated @JsonProperty(value = "bypassSelectors") private Boolean bypassSelectors; /** Creates an instance of DistributionMode class. */ + @Generated public DistributionMode() {} /** @@ -59,6 +64,7 @@ public DistributionMode() {} * * @return the minConcurrentOffers value. */ + @Generated public Integer getMinConcurrentOffers() { return this.minConcurrentOffers; } @@ -70,6 +76,7 @@ public Integer getMinConcurrentOffers() { * @param minConcurrentOffers the minConcurrentOffers value to set. * @return the DistributionMode object itself. */ + @Generated public DistributionMode setMinConcurrentOffers(Integer minConcurrentOffers) { this.minConcurrentOffers = minConcurrentOffers; return this; @@ -80,6 +87,7 @@ public DistributionMode setMinConcurrentOffers(Integer minConcurrentOffers) { * * @return the maxConcurrentOffers value. */ + @Generated public Integer getMaxConcurrentOffers() { return this.maxConcurrentOffers; } @@ -90,6 +98,7 @@ public Integer getMaxConcurrentOffers() { * @param maxConcurrentOffers the maxConcurrentOffers value to set. * @return the DistributionMode object itself. */ + @Generated public DistributionMode setMaxConcurrentOffers(Integer maxConcurrentOffers) { this.maxConcurrentOffers = maxConcurrentOffers; return this; @@ -102,6 +111,7 @@ public DistributionMode setMaxConcurrentOffers(Integer maxConcurrentOffers) { * * @return the bypassSelectors value. */ + @Generated public Boolean isBypassSelectors() { return this.bypassSelectors; } @@ -114,6 +124,7 @@ public Boolean isBypassSelectors() { * @param bypassSelectors the bypassSelectors value to set. * @return the DistributionMode object itself. */ + @Generated public DistributionMode setBypassSelectors(Boolean bypassSelectors) { this.bypassSelectors = bypassSelectors; return this; @@ -123,7 +134,7 @@ public DistributionMode setBypassSelectors(Boolean bypassSelectors) { * Returns kind discriminator. * @return kind. */ - public DistributionModeKind getKind() { + public String getKind() { return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionModeKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionModeKind.java deleted file mode 100644 index f1a10434969b..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionModeKind.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported distribution mode types. - */ -public final class DistributionModeKind extends ExpandableStringEnum { - - /** - * Discriminator value for BestWorkerMode. - */ - @Generated - public static final DistributionModeKind BEST_WORKER = fromString("bestWorker"); - - /** - * Discriminator value for LongestIdleMode. - */ - @Generated - public static final DistributionModeKind LONGEST_IDLE = fromString("longestIdle"); - - /** - * Discriminator value for RoundRobinMode. - */ - @Generated - public static final DistributionModeKind ROUND_ROBIN = fromString("roundRobin"); - - /** - * Creates a new instance of DistributionModeKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public DistributionModeKind() { - } - - /** - * Creates or finds a DistributionModeKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding DistributionModeKind. - */ - @Generated - @JsonCreator - public static DistributionModeKind fromString(String name) { - return fromString(name, DistributionModeKind.class); - } - - /** - * Gets known DistributionModeKind values. - * - * @return known DistributionModeKind values. - */ - @Generated - public static Collection values() { - return values(DistributionModeKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionPolicy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionPolicy.java index 4b9717ade693..6af241feae0a 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionPolicy.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionPolicy.java @@ -3,31 +3,30 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.communication.jobrouter.implementation.accesshelpers.DistributionPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter; +import com.azure.communication.jobrouter.implementation.models.DistributionPolicyInternal; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.Duration; /** Policy governing how jobs are distributed to workers. */ @Fluent public final class DistributionPolicy { - /** - * Create new instance - */ - public DistributionPolicy() { - } /* * The unique identifier of the policy. */ - @JsonProperty(value = "id") + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The human readable name of the policy. */ + @Generated @JsonProperty(value = "name") private String name; @@ -35,22 +34,42 @@ public DistributionPolicy() { * The duration after which any offers created under this policy will be * expired. */ - @JsonProperty(value = "offerExpiresAfterSeconds") - @JsonDeserialize(using = DurationDeserializer.class) - @JsonSerialize(using = DurationSerializer.class) private Duration offerExpiresAfter; /* * Abstract base class for defining a distribution mode */ + @Generated @JsonProperty(value = "mode") private DistributionMode mode; + /** Creates an instance of DistributionPolicy class. */ + @Generated + public DistributionPolicy() {} + + /** + * Package-private constructor of the class, used internally. + * + * @param internal The internal DistributionPolicy + */ + DistributionPolicy(DistributionPolicyInternal internal) { + id = internal.getId(); + + setName(internal.getName()); + setMode(DistributionPolicyAdapter.convertDistributionModeToPublic(internal.getMode())); + setOfferExpiresAfter(Duration.ofSeconds(internal.getOfferExpiresAfterSeconds().longValue())); + } + + static { + DistributionPolicyConstructorProxy.setAccessor(internal -> new DistributionPolicy(internal)); + } + /** * Get the id property: The unique identifier of the policy. * * @return the id value. */ + @Generated public String getId() { return this.id; } @@ -60,6 +79,7 @@ public String getId() { * * @return the name value. */ + @Generated public String getName() { return this.name; } @@ -70,6 +90,7 @@ public String getName() { * @param name the name value to set. * @return the DistributionPolicy object itself. */ + @Generated public DistributionPolicy setName(String name) { this.name = name; return this; @@ -102,6 +123,7 @@ public DistributionPolicy setOfferExpiresAfter(Duration offerExpiresAfter) { * * @return the mode value. */ + @Generated public DistributionMode getMode() { return this.mode; } @@ -112,6 +134,7 @@ public DistributionMode getMode() { * @param mode the mode value to set. * @return the DistributionPolicy object itself. */ + @Generated public DistributionPolicy setMode(DistributionMode mode) { this.mode = mode; return this; @@ -120,7 +143,8 @@ public DistributionPolicy setMode(DistributionMode mode) { /* * Concurrency Token. */ - @JsonProperty(value = "etag") + @Generated + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** @@ -128,6 +152,7 @@ public DistributionPolicy setMode(DistributionMode mode) { * * @return the etag value. */ + @Generated public String getEtag() { return this.etag; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationDeserializer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationDeserializer.java deleted file mode 100644 index 0a189487ef22..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationDeserializer.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import com.fasterxml.jackson.core.JacksonException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonNode; - -import java.io.IOException; -import java.time.Duration; - -/** - * This class provides logic to deserialize Duration - */ -final class DurationDeserializer extends JsonDeserializer { - @Override - public Duration deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JacksonException { - Duration result = null; - JsonNode node = p.getCodec().readTree(p); - - if (node.isDouble()) { - result = Duration.ofMillis(Math.round(1000 * node.doubleValue())); - } else if (node.canConvertToInt()) { - result = Duration.ofSeconds(node.intValue()); - } - - return result; - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationMapDeserializer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationMapDeserializer.java deleted file mode 100644 index d9d1a1c80b7c..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationMapDeserializer.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import com.fasterxml.jackson.core.JacksonException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonNode; - -import java.io.IOException; -import java.time.Duration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -/** - * This class provides logic to deserialize Map(Integer, Duration) - */ -final class DurationMapDeserializer extends JsonDeserializer> { - @Override - public Map deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JacksonException { - Map result = new HashMap<>(); - JsonNode root = p.getCodec().readTree(p); - Iterator> iter = root.fields(); - - while (iter.hasNext()) { - Map.Entry entry = iter.next(); - int priority = Integer.parseInt(entry.getKey()); - JsonNode waitTimeSeconds = entry.getValue(); - - if (waitTimeSeconds.isDouble()) { - result.put(priority, Duration.ofSeconds(Math.round(60 * waitTimeSeconds.doubleValue()))); - } else if (waitTimeSeconds.canConvertToInt()) { - result.put(priority, Duration.ofMinutes(waitTimeSeconds.intValue())); - } - } - - return result; - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationMapSerializer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationMapSerializer.java deleted file mode 100644 index fbd2d36ac2e0..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationMapSerializer.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; - -import java.io.IOException; -import java.time.Duration; -import java.util.Map; - -/** - * This class provides logic to serialize Map(Integer, Duration) - */ -final class DurationMapSerializer extends JsonSerializer> { - @Override - public void serialize(Map map, JsonGenerator gen, SerializerProvider serializers) throws IOException { - gen.writeStartObject(); - - for (Map.Entry entry : map.entrySet()) { - if (entry.getValue() != null) { - gen.writeNumberField(String.valueOf(entry.getKey()), entry.getValue().getSeconds() / 60); - } else { - gen.writeNullField(String.valueOf(entry.getKey())); - } - } - - gen.writeEndObject(); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationSerializer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationSerializer.java deleted file mode 100644 index aecfec610f12..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DurationSerializer.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; - -import java.io.IOException; -import java.time.Duration; - -/** - * This class provides logic to serialize Duration - */ -final class DurationSerializer extends JsonSerializer { - @Override - public void serialize(Duration value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - gen.writeNumber(value.getSeconds()); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java index ed9e2a0ebb38..58c0d4ab65c6 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java @@ -3,6 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -17,23 +19,26 @@ @JsonTypeName("ExceptionAction") @JsonSubTypes({ @JsonSubTypes.Type(name = "cancel", value = CancelExceptionAction.class), - @JsonSubTypes.Type(name = "manualReclassify", value = ManualReclassifyExceptionAction.class), + @JsonSubTypes.Type(name = "manual-reclassify", value = ManualReclassifyExceptionAction.class), @JsonSubTypes.Type(name = "reclassify", value = ReclassifyExceptionAction.class) }) +@Immutable public abstract class ExceptionAction { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected ExceptionActionKind kind; + private String kind; /** Creates an instance of ExceptionAction class. */ + @Generated public ExceptionAction() {} /* * Unique Id of the exception action */ - @JsonProperty(value = "id") + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /** @@ -41,6 +46,7 @@ public ExceptionAction() {} * * @return the id value. */ + @Generated public String getId() { return this.id; } @@ -49,7 +55,7 @@ public String getId() { * Returns kind discriminator. * @return kind. */ - public ExceptionActionKind getKind() { + public String getKind() { return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionActionKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionActionKind.java deleted file mode 100644 index 4af73ebb8eed..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionActionKind.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported exception action types. - */ -public final class ExceptionActionKind extends ExpandableStringEnum { - - /** - * Discriminator value for CancelExceptionAction. - */ - @Generated - public static final ExceptionActionKind CANCEL = fromString("cancel"); - - /** - * Discriminator value for ManualReclassifyExceptionAction. - */ - @Generated - public static final ExceptionActionKind MANUAL_RECLASSIFY = fromString("manualReclassify"); - - /** - * Discriminator value for ReclassifyExceptionAction. - */ - @Generated - public static final ExceptionActionKind RECLASSIFY = fromString("reclassify"); - - /** - * Creates a new instance of ExceptionActionKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ExceptionActionKind() { - } - - /** - * Creates or finds a ExceptionActionKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExceptionActionKind. - */ - @Generated - @JsonCreator - public static ExceptionActionKind fromString(String name) { - return fromString(name, ExceptionActionKind.class); - } - - /** - * Gets known ExceptionActionKind values. - * - * @return known ExceptionActionKind values. - */ - @Generated - public static Collection values() { - return values(ExceptionActionKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionPolicy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionPolicy.java index 41f9312b13fd..f7b0ef1014bb 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionPolicy.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionPolicy.java @@ -3,7 +3,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.communication.jobrouter.implementation.accesshelpers.ExceptionPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter; +import com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -11,35 +15,38 @@ /** A policy that defines actions to execute when exception are triggered. */ @Fluent public final class ExceptionPolicy { - /** - * Create new instance - */ - public ExceptionPolicy() { - } /* * The Id of the exception policy */ - @JsonProperty(value = "id") + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of the exception policy. */ + @Generated @JsonProperty(value = "name") private String name; /* * A collection of exception rules on the exception policy. */ + @Generated @JsonProperty(value = "exceptionRules") private List exceptionRules; + /** Creates an instance of ExceptionPolicy class. */ + @Generated + public ExceptionPolicy() {} + /** * Get the id property: The Id of the exception policy. * * @return the id value. */ + @Generated public String getId() { return this.id; } @@ -49,6 +56,7 @@ public String getId() { * * @return the name value. */ + @Generated public String getName() { return this.name; } @@ -59,6 +67,7 @@ public String getName() { * @param name the name value to set. * @return the ExceptionPolicy object itself. */ + @Generated public ExceptionPolicy setName(String name) { this.name = name; return this; @@ -69,6 +78,7 @@ public ExceptionPolicy setName(String name) { * * @return the exceptionRules value. */ + @Generated public List getExceptionRules() { return this.exceptionRules; } @@ -76,7 +86,8 @@ public List getExceptionRules() { /* * The entity tag for this resource. */ - @JsonProperty(value = "etag") + @Generated + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** @@ -84,6 +95,7 @@ public List getExceptionRules() { * * @return the etag value. */ + @Generated public String getEtag() { return this.etag; } @@ -94,8 +106,25 @@ public String getEtag() { * @param exceptionRules the exceptionRules value to set. * @return the ExceptionPolicy object itself. */ + @Generated public ExceptionPolicy setExceptionRules(List exceptionRules) { this.exceptionRules = exceptionRules; return this; } + + /** + * Package-private constructor of the class, used internally. + * + * @param internal The internal ExceptionPolicy + */ + ExceptionPolicy(ExceptionPolicyInternal internal) { + id = internal.getId(); + + setName(internal.getName()); + setExceptionRules(ExceptionPolicyAdapter.convertExceptionRulesToPublic(internal.getExceptionRules())); + } + + static { + ExceptionPolicyConstructorProxy.setAccessor(internal -> new ExceptionPolicy(internal)); + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionRule.java index 2e3ce0b4d9a5..fabde06e21fd 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionRule.java @@ -3,10 +3,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.List; /** A rule that defines actions to execute upon a specific trigger. */ @@ -16,12 +16,14 @@ public final class ExceptionRule { /* * The trigger for this exception rule */ + @Generated @JsonProperty(value = "trigger") private ExceptionTrigger trigger; /* * A collection of actions to perform once the exception is triggered. */ + @Generated @JsonProperty(value = "actions") private List actions; @@ -30,6 +32,7 @@ public final class ExceptionRule { * * @return the trigger value. */ + @Generated public ExceptionTrigger getTrigger() { return this.trigger; } @@ -39,6 +42,7 @@ public ExceptionTrigger getTrigger() { * * @return the actions value. */ + @Generated public List getActions() { return this.actions; } @@ -46,6 +50,7 @@ public List getActions() { /* * Id of the exception rule. */ + @Generated @JsonProperty(value = "id") private String id; @@ -56,6 +61,7 @@ public List getActions() { * @param trigger the trigger value to set. * @param actions the actions value to set. */ + @Generated @JsonCreator public ExceptionRule( @JsonProperty(value = "id") String id, @@ -71,6 +77,7 @@ public ExceptionRule( * * @return the id value. */ + @Generated public String getId() { return this.id; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java index 8bdb47fda3ce..be6f9aa12fd5 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java @@ -3,6 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -19,21 +21,23 @@ @JsonSubTypes.Type(name = "queueLength", value = QueueLengthExceptionTrigger.class), @JsonSubTypes.Type(name = "waitTime", value = WaitTimeExceptionTrigger.class) }) +@Immutable public abstract class ExceptionTrigger { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected ExceptionTriggerKind kind; + private String kind; /** Creates an instance of ExceptionTrigger class. */ + @Generated public ExceptionTrigger() {} /** * Returns kind discriminator. * @return kind. */ - public ExceptionTriggerKind getKind() { + public String getKind() { return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTriggerKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTriggerKind.java deleted file mode 100644 index 1e1e46f0d078..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTriggerKind.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported exception trigger types. - */ -public final class ExceptionTriggerKind extends ExpandableStringEnum { - - /** - * Discriminator value for QueueLengthExceptionTrigger. - */ - @Generated - public static final ExceptionTriggerKind QUEUE_LENGTH = fromString("queueLength"); - - /** - * Discriminator value for WaitTimeExceptionTrigger. - */ - @Generated - public static final ExceptionTriggerKind WAIT_TIME = fromString("waitTime"); - - /** - * Creates a new instance of ExceptionTriggerKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ExceptionTriggerKind() { - } - - /** - * Creates or finds a ExceptionTriggerKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExceptionTriggerKind. - */ - @Generated - @JsonCreator - public static ExceptionTriggerKind fromString(String name) { - return fromString(name, ExceptionTriggerKind.class); - } - - /** - * Gets known ExceptionTriggerKind values. - * - * @return known ExceptionTriggerKind values. - */ - @Generated - public static Collection values() { - return values(ExceptionTriggerKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java index 149e4acaf1c8..d7f25ac7bb3f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -18,12 +19,14 @@ public final class ExpressionRouterRule extends RouterRule { /* * The expression language to compile to and execute */ + @Generated @JsonProperty(value = "language") private ExpressionRouterRuleLanguage language; /* * The string containing the expression to evaluate. Should contain return statement with calculated values. */ + @Generated @JsonProperty(value = "expression") private String expression; @@ -32,10 +35,10 @@ public final class ExpressionRouterRule extends RouterRule { * * @param expression the expression value to set. */ + @Generated @JsonCreator public ExpressionRouterRule(@JsonProperty(value = "expression") String expression) { this.expression = expression; - this.kind = RouterRuleKind.EXPRESSION; } /** @@ -64,6 +67,7 @@ ExpressionRouterRule setLanguage(ExpressionRouterRuleLanguage language) { * * @return the expression value. */ + @Generated public String getExpression() { return this.expression; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java index ada90799bbbb..3f2796077d4e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -18,12 +19,14 @@ public final class FunctionRouterRule extends RouterRule { /* * URL for Azure Function */ + @Generated @JsonProperty(value = "functionUri") private String functionUri; /* * Credentials used to access Azure function rule */ + @Generated @JsonProperty(value = "credential") private FunctionRouterRuleCredential credential; @@ -32,10 +35,10 @@ public final class FunctionRouterRule extends RouterRule { * * @param functionUri the functionUri value to set. */ + @Generated @JsonCreator public FunctionRouterRule(@JsonProperty(value = "functionUri") String functionUri) { this.functionUri = functionUri; - this.kind = RouterRuleKind.FUNCTION; } /** @@ -43,6 +46,7 @@ public FunctionRouterRule(@JsonProperty(value = "functionUri") String functionUr * * @return the functionUri value. */ + @Generated public String getFunctionUri() { return this.functionUri; } @@ -52,6 +56,7 @@ public String getFunctionUri() { * * @return the credential value. */ + @Generated public FunctionRouterRuleCredential getCredential() { return this.credential; } @@ -62,6 +67,7 @@ public FunctionRouterRuleCredential getCredential() { * @param credential the credential value to set. * @return the FunctionRouterRule object itself. */ + @Generated public FunctionRouterRule setCredential(FunctionRouterRuleCredential credential) { this.credential = credential; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRuleCredential.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRuleCredential.java index e5ea4d202509..d1a23e6d3e29 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRuleCredential.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRuleCredential.java @@ -64,8 +64,8 @@ public FunctionRouterRuleCredential setFunctionKey(String functionKey) { } /** - * Get the appKey property: Access key scoped to a Azure Function app. This key grants access to all functions under - * the app. + * Get the appKey property: Access key scoped to a Azure Function app. This key grants access to all functions + * under the app. * * @return the appKey value. */ @@ -75,8 +75,8 @@ public String getAppKey() { } /** - * Set the appKey property: Access key scoped to a Azure Function app. This key grants access to all functions under - * the app. + * Set the appKey property: Access key scoped to a Azure Function app. This key grants access to all functions + * under the app. * * @param appKey the appKey value to set. * @return the FunctionRouterRuleCredential object itself. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingMode.java index 76abfc42a983..ade114a1560e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingMode.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -25,12 +26,13 @@ @JsonSubTypes.Type(name = "scheduleAndSuspend", value = ScheduleAndSuspendMode.class), @JsonSubTypes.Type(name = "queueAndMatch", value = QueueAndMatchMode.class), @JsonSubTypes.Type(name = "suspend", value = SuspendMode.class) }) +@Immutable public abstract class JobMatchingMode { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected JobMatchingModeKind kind; + private String kind; /** * Creates an instance of JobMatchingMode class. @@ -42,7 +44,7 @@ public JobMatchingMode() { * Returns kind discriminator. * @return kind. */ - public JobMatchingModeKind getKind() { + public String getKind() { return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingModeKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingModeKind.java deleted file mode 100644 index 1819a1d85b85..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingModeKind.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported matching mode types. - */ -public final class JobMatchingModeKind extends ExpandableStringEnum { - - /** - * Discriminator value for QueueAndMatchMode. - */ - @Generated - public static final JobMatchingModeKind QUEUE_AND_MATCH = fromString("queueAndMatch"); - - /** - * Discriminator value for ScheduleAndSuspendMode. - */ - @Generated - public static final JobMatchingModeKind SCHEDULE_AND_SUSPEND = fromString("scheduleAndSuspend"); - - /** - * Discriminator value for SuspendMode. - */ - @Generated - public static final JobMatchingModeKind SUSPEND = fromString("suspend"); - - /** - * Creates a new instance of JobMatchingModeKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public JobMatchingModeKind() { - } - - /** - * Creates or finds a JobMatchingModeKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding JobMatchingModeKind. - */ - @Generated - @JsonCreator - public static JobMatchingModeKind fromString(String name) { - return fromString(name, JobMatchingModeKind.class); - } - - /** - * Gets known JobMatchingModeKind values. - * - * @return known JobMatchingModeKind values. - */ - @Generated - public static Collection values() { - return values(JobMatchingModeKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LabelOperator.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LabelOperator.java index efc90a1ffde5..ef347797537a 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LabelOperator.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LabelOperator.java @@ -31,24 +31,12 @@ public final class LabelOperator extends ExpandableStringEnum { @Generated public static final LabelOperator LESS_THAN = fromString("lessThan"); - /** - * Less than or equal. - */ - @Generated - public static final LabelOperator LESS_THAN_OR_EQUAL = fromString("lessThanOrEqual"); - /** * Greater than. */ @Generated public static final LabelOperator GREATER_THAN = fromString("greaterThan"); - /** - * Greater than or equal. - */ - @Generated - public static final LabelOperator GREATER_THAN_OR_EQUAL = fromString("greaterThanOrEqual"); - /** * Creates a new instance of LabelOperator value. * @@ -80,4 +68,16 @@ public static LabelOperator fromString(String name) { public static Collection values() { return values(LabelOperator.class); } + + /** + * Less than or equal. + */ + @Generated + public static final LabelOperator LESS_THAN_OR_EQUAL = fromString("lessThanOrEqual"); + + /** + * Greater than or equal. + */ + @Generated + public static final LabelOperator GREATER_THAN_OR_EQUAL = fromString("greaterThanOrEqual"); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java index a107580c4e96..d348fdfd126b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java @@ -13,9 +13,7 @@ @Fluent public final class LongestIdleMode extends DistributionMode { /** Creates an instance of LongestIdleMode class. */ - public LongestIdleMode() { - this.kind = DistributionModeKind.LONGEST_IDLE; - } + public LongestIdleMode() {} /** {@inheritDoc} */ @Override diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java index df7caef0085f..969305fb58f6 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java @@ -4,46 +4,49 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; - import java.util.List; /** An action that manually reclassifies a job by providing the queue, priority and worker selectors. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("manualReclassify") +@JsonTypeName("manual-reclassify") @Fluent public final class ManualReclassifyExceptionAction extends ExceptionAction { /* * Updated QueueId. */ + @Generated @JsonProperty(value = "queueId") private String queueId; /* * Updated Priority. */ + @Generated @JsonProperty(value = "priority") private Integer priority; /* * Updated WorkerSelectors. */ + @Generated @JsonProperty(value = "workerSelectors") private List workerSelectors; /** Creates an instance of ManualReclassifyExceptionAction class. */ - public ManualReclassifyExceptionAction() { - this.kind = ExceptionActionKind.MANUAL_RECLASSIFY; - } + @Generated + public ManualReclassifyExceptionAction() {} /** * Get the queueId property: Updated QueueId. * * @return the queueId value. */ + @Generated public String getQueueId() { return this.queueId; } @@ -54,6 +57,7 @@ public String getQueueId() { * @param queueId the queueId value to set. * @return the ManualReclassifyExceptionAction object itself. */ + @Generated public ManualReclassifyExceptionAction setQueueId(String queueId) { this.queueId = queueId; return this; @@ -64,6 +68,7 @@ public ManualReclassifyExceptionAction setQueueId(String queueId) { * * @return the priority value. */ + @Generated public Integer getPriority() { return this.priority; } @@ -74,6 +79,7 @@ public Integer getPriority() { * @param priority the priority value to set. * @return the ManualReclassifyExceptionAction object itself. */ + @Generated public ManualReclassifyExceptionAction setPriority(Integer priority) { this.priority = priority; return this; @@ -84,6 +90,7 @@ public ManualReclassifyExceptionAction setPriority(Integer priority) { * * @return the workerSelectors value. */ + @Generated public List getWorkerSelectors() { return this.workerSelectors; } @@ -94,6 +101,7 @@ public List getWorkerSelectors() { * @param workerSelectors the workerSelectors value to set. * @return the ManualReclassifyExceptionAction object itself. */ + @Generated public ManualReclassifyExceptionAction setWorkerSelectors(List workerSelectors) { this.workerSelectors = workerSelectors; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughQueueSelectorAttachment.java index c13ad012cdfd..5eb2dfe65954 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughQueueSelectorAttachment.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -11,19 +12,21 @@ /** Attaches a queue selector where the value is passed through from the job label with the same key. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("passThrough") +@JsonTypeName("pass-through") @Immutable public final class PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { /* * The label key to query against */ + @Generated @JsonProperty(value = "key") private String key; /* * Describes how the value of the label is compared to the value pass through */ + @Generated @JsonProperty(value = "labelOperator") private LabelOperator labelOperator; @@ -33,13 +36,13 @@ public final class PassThroughQueueSelectorAttachment extends QueueSelectorAttac * @param key the key value to set. * @param labelOperator the labelOperator value to set. */ + @Generated @JsonCreator public PassThroughQueueSelectorAttachment( @JsonProperty(value = "key") String key, @JsonProperty(value = "labelOperator") LabelOperator labelOperator) { this.key = key; this.labelOperator = labelOperator; - this.kind = QueueSelectorAttachmentKind.PASS_THROUGH; } /** @@ -47,6 +50,7 @@ public PassThroughQueueSelectorAttachment( * * @return the key value. */ + @Generated public String getKey() { return this.key; } @@ -56,6 +60,7 @@ public String getKey() { * * @return the labelOperator value. */ + @Generated public LabelOperator getLabelOperator() { return this.labelOperator; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughWorkerSelectorAttachment.java index 3d220b9b084f..cdddeefc55c8 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughWorkerSelectorAttachment.java @@ -4,30 +4,31 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.Duration; /** Attaches a worker selector where the value is passed through from the job label with the same key. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("passThrough") +@JsonTypeName("pass-through") @Fluent public final class PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachment { /* * The label key to query against */ + @Generated @JsonProperty(value = "key") private String key; /* * Describes how the value of the label is compared to the value pass through */ + @Generated @JsonProperty(value = "labelOperator") private LabelOperator labelOperator; @@ -35,8 +36,6 @@ public final class PassThroughWorkerSelectorAttachment extends WorkerSelectorAtt * Describes how long the attached label selector is valid in seconds. */ @JsonProperty(value = "expiresAfterSeconds") - @JsonDeserialize(using = DurationDeserializer.class) - @JsonSerialize(using = DurationSerializer.class) private Duration expiresAfter; /** @@ -45,13 +44,13 @@ public final class PassThroughWorkerSelectorAttachment extends WorkerSelectorAtt * @param key the key value to set. * @param labelOperator the labelOperator value to set. */ + @Generated @JsonCreator public PassThroughWorkerSelectorAttachment( @JsonProperty(value = "key") String key, @JsonProperty(value = "labelOperator") LabelOperator labelOperator) { this.key = key; this.labelOperator = labelOperator; - this.kind = WorkerSelectorAttachmentKind.PASS_THROUGH; } /** @@ -59,6 +58,7 @@ public PassThroughWorkerSelectorAttachment( * * @return the key value. */ + @Generated public String getKey() { return this.key; } @@ -68,6 +68,7 @@ public String getKey() { * * @return the labelOperator value. */ + @Generated public LabelOperator getLabelOperator() { return this.labelOperator; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueAndMatchMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueAndMatchMode.java index 7aa3f5ac9aad..710ac284d12c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueAndMatchMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueAndMatchMode.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,7 +19,7 @@ public final class QueueAndMatchMode extends JobMatchingMode { /** * Creates an instance of QueueAndMatchMode class. */ + @Generated public QueueAndMatchMode() { - this.kind = JobMatchingModeKind.QUEUE_AND_MATCH; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueLengthExceptionTrigger.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueLengthExceptionTrigger.java index 0f43ca81063b..fe26accf1185 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueLengthExceptionTrigger.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueLengthExceptionTrigger.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -18,6 +19,7 @@ public final class QueueLengthExceptionTrigger extends ExceptionTrigger { /* * Threshold of number of jobs ahead in the queue to for this trigger to fire. */ + @Generated @JsonProperty(value = "threshold") private int threshold; @@ -26,10 +28,10 @@ public final class QueueLengthExceptionTrigger extends ExceptionTrigger { * * @param threshold the threshold value to set. */ + @Generated @JsonCreator public QueueLengthExceptionTrigger(@JsonProperty(value = "threshold") int threshold) { this.threshold = threshold; - this.kind = ExceptionTriggerKind.QUEUE_LENGTH; } /** @@ -37,6 +39,7 @@ public QueueLengthExceptionTrigger(@JsonProperty(value = "threshold") int thresh * * @return the threshold value. */ + @Generated public int getThreshold() { return this.threshold; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachment.java index af36d7317d86..ec77fae9cf15 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachment.java @@ -3,6 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -17,28 +19,30 @@ @JsonTypeName("QueueSelectorAttachment") @JsonSubTypes({ @JsonSubTypes.Type(name = "conditional", value = ConditionalQueueSelectorAttachment.class), - @JsonSubTypes.Type(name = "passThrough", value = PassThroughQueueSelectorAttachment.class), - @JsonSubTypes.Type(name = "ruleEngine", value = RuleEngineQueueSelectorAttachment.class), + @JsonSubTypes.Type(name = "pass-through", value = PassThroughQueueSelectorAttachment.class), + @JsonSubTypes.Type(name = "rule-engine", value = RuleEngineQueueSelectorAttachment.class), @JsonSubTypes.Type(name = "static", value = StaticQueueSelectorAttachment.class), @JsonSubTypes.Type( - name = "weightedAllocation", + name = "weighted-allocation-queue-selector", value = WeightedAllocationQueueSelectorAttachment.class) }) +@Immutable public abstract class QueueSelectorAttachment { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected QueueSelectorAttachmentKind kind; + private String kind; /** Creates an instance of QueueSelectorAttachment class. */ + @Generated public QueueSelectorAttachment() {} /** * Returns kind discriminator. * @return kind. */ - public QueueSelectorAttachmentKind getKind() { + public String getKind() { return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachmentKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachmentKind.java deleted file mode 100644 index 7f42e78762d2..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachmentKind.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported queue selector attachment types. - */ -public final class QueueSelectorAttachmentKind extends ExpandableStringEnum { - - /** - * Discriminator value for ConditionalQueueSelectorAttachment. - */ - @Generated - public static final QueueSelectorAttachmentKind CONDITIONAL = fromString("conditional"); - - /** - * Discriminator value for PassThroughQueueSelectorAttachment. - */ - @Generated - public static final QueueSelectorAttachmentKind PASS_THROUGH = fromString("passThrough"); - - /** - * Discriminator value for RuleEngineQueueSelectorAttachment. - */ - @Generated - public static final QueueSelectorAttachmentKind RULE_ENGINE = fromString("ruleEngine"); - - /** - * Discriminator value for StaticQueueSelectorAttachment. - */ - @Generated - public static final QueueSelectorAttachmentKind STATIC = fromString("static"); - - /** - * Discriminator value for WeightedAllocationQueueSelectorAttachment. - */ - @Generated - public static final QueueSelectorAttachmentKind WEIGHTED_ALLOCATION = fromString("weightedAllocation"); - - /** - * Creates a new instance of QueueSelectorAttachmentKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public QueueSelectorAttachmentKind() { - } - - /** - * Creates or finds a QueueSelectorAttachmentKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding QueueSelectorAttachmentKind. - */ - @Generated - @JsonCreator - public static QueueSelectorAttachmentKind fromString(String name) { - return fromString(name, QueueSelectorAttachmentKind.class); - } - - /** - * Gets known QueueSelectorAttachmentKind values. - * - * @return known QueueSelectorAttachmentKind values. - */ - @Generated - public static Collection values() { - return values(QueueSelectorAttachmentKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueWeightedAllocation.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueWeightedAllocation.java index 138e3ef151aa..7b0b3052936c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueWeightedAllocation.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueWeightedAllocation.java @@ -3,10 +3,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.List; /** Contains the weight percentage and queue selectors to be applied if selected for weighted distributions. */ @@ -16,6 +16,7 @@ public final class QueueWeightedAllocation { /* * The percentage of this weight, expressed as a fraction of 1. */ + @Generated @JsonProperty(value = "weight") private double weight; @@ -23,6 +24,7 @@ public final class QueueWeightedAllocation { * A collection of queue selectors that will be applied if this allocation is * selected. */ + @Generated @JsonProperty(value = "queueSelectors") private List queueSelectors; @@ -32,6 +34,7 @@ public final class QueueWeightedAllocation { * @param weight the weight value to set. * @param queueSelectors the queueSelectors value to set. */ + @Generated @JsonCreator public QueueWeightedAllocation( @JsonProperty(value = "weight") double weight, @@ -45,6 +48,7 @@ public QueueWeightedAllocation( * * @return the weight value. */ + @Generated public double getWeight() { return this.weight; } @@ -55,6 +59,7 @@ public double getWeight() { * * @return the queueSelectors value. */ + @Generated public List getQueueSelectors() { return this.queueSelectors; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyExceptionAction.java index fa2c57edceb4..40a890eece44 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyExceptionAction.java @@ -4,12 +4,10 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; - import java.util.Map; /** An action that modifies labels on a job and then reclassifies it. */ @@ -22,6 +20,7 @@ public final class ReclassifyExceptionAction extends ExceptionAction { * (optional) The new classification policy that will determine queue, priority * and worker selectors. */ + @Generated @JsonProperty(value = "classificationPolicyId") private String classificationPolicyId; @@ -30,14 +29,11 @@ public final class ReclassifyExceptionAction extends ExceptionAction { * in key-value pairs */ @JsonProperty(value = "labelsToUpsert") - @JsonDeserialize(using = RouterValueMapDeserializer.class) - @JsonSerialize(using = RouterValueMapSerializer.class) private Map labelsToUpsert; /** Creates an instance of ReclassifyExceptionAction class. */ - public ReclassifyExceptionAction() { - this.kind = ExceptionActionKind.RECLASSIFY; - } + @Generated + public ReclassifyExceptionAction() {} /** * Get the classificationPolicyId property: (optional) The new classification policy that will determine queue, @@ -45,6 +41,7 @@ public ReclassifyExceptionAction() { * * @return the classificationPolicyId value. */ + @Generated public String getClassificationPolicyId() { return this.classificationPolicyId; } @@ -56,6 +53,7 @@ public String getClassificationPolicyId() { * @param classificationPolicyId the classificationPolicyId value to set. * @return the ReclassifyExceptionAction object itself. */ + @Generated public ReclassifyExceptionAction setClassificationPolicyId(String classificationPolicyId) { this.classificationPolicyId = classificationPolicyId; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyJobOptions.java index 648bde34544c..3c181f6ed86d 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyJobOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyJobOptions.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; /** Request payload for reclassifying jobs. */ @@ -19,6 +20,7 @@ public final class ReclassifyJobOptions { * Creates an instance of ReclassifyJobOptionsInternal class. * @param jobId jobId. */ + @Generated public ReclassifyJobOptions(String jobId) { this.jobId = jobId; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyJobOptionsInternal.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyJobOptionsInternal.java new file mode 100644 index 000000000000..46c73aa633db --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyJobOptionsInternal.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.communication.jobrouter.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** + * Request payload for reclassifying jobs. + */ +@Immutable +public final class ReclassifyJobOptionsInternal { + + /** + * Creates an instance of ReclassifyJobOptionsInternal class. + */ + @Generated + public ReclassifyJobOptionsInternal() { + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java index c3f6beae9d83..84f1d07df31e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,11 +17,11 @@ public final class RoundRobinMode extends DistributionMode { /** Creates an instance of RoundRobinMode class. */ - public RoundRobinMode() { - this.kind = DistributionModeKind.ROUND_ROBIN; - } + @Generated + public RoundRobinMode() {} /** {@inheritDoc} */ + @Generated @Override public RoundRobinMode setMinConcurrentOffers(Integer minConcurrentOffers) { super.setMinConcurrentOffers(minConcurrentOffers); @@ -28,6 +29,7 @@ public RoundRobinMode setMinConcurrentOffers(Integer minConcurrentOffers) { } /** {@inheritDoc} */ + @Generated @Override public RoundRobinMode setMaxConcurrentOffers(Integer maxConcurrentOffers) { super.setMaxConcurrentOffers(maxConcurrentOffers); @@ -35,6 +37,7 @@ public RoundRobinMode setMaxConcurrentOffers(Integer maxConcurrentOffers) { } /** {@inheritDoc} */ + @Generated @Override public RoundRobinMode setBypassSelectors(Boolean bypassSelectors) { super.setBypassSelectors(bypassSelectors); diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterChannel.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterChannel.java index 6ada7c7cbc0b..90d04ac485d6 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterChannel.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterChannel.java @@ -19,17 +19,17 @@ public final class RouterChannel { */ @Generated @JsonProperty(value = "channelId") - private final String channelId; + private String channelId; /* * The amount of capacity that an instance of a job of this channel will consume of the total worker capacity. */ @Generated @JsonProperty(value = "capacityCostPerJob") - private final int capacityCostPerJob; + private int capacityCostPerJob; /* - * The maximum number of jobs that can be supported concurrently for this channel. Value must be greater than zero. + * The maximum number of jobs that can be supported concurrently for this channel. */ @Generated @JsonProperty(value = "maxNumberOfJobs") @@ -71,8 +71,8 @@ public int getCapacityCostPerJob() { } /** - * Get the maxNumberOfJobs property: The maximum number of jobs that can be supported concurrently for this channel. - * Value must be greater than zero. + * Get the maxNumberOfJobs property: The maximum number of jobs that can be supported concurrently for this + * channel. * * @return the maxNumberOfJobs value. */ @@ -82,8 +82,8 @@ public Integer getMaxNumberOfJobs() { } /** - * Set the maxNumberOfJobs property: The maximum number of jobs that can be supported concurrently for this channel. - * Value must be greater than zero. + * Set the maxNumberOfJobs property: The maximum number of jobs that can be supported concurrently for this + * channel. * * @param maxNumberOfJobs the maxNumberOfJobs value to set. * @return the RouterChannel object itself. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJob.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJob.java index 3057085321cd..b1f000946a58 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJob.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJob.java @@ -3,75 +3,84 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterJobConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterValueConstructorProxy; +import com.azure.communication.jobrouter.implementation.converters.JobAdapter; +import com.azure.communication.jobrouter.implementation.converters.LabelSelectorAdapter; +import com.azure.communication.jobrouter.implementation.models.RouterJobInternal; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** A unit of work to be routed. */ @Fluent public final class RouterJob { - /** - * Create new instance - */ - public RouterJob() { - } /* * The id of the job. */ - @JsonProperty(value = "id") + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * Reference to an external parent context, eg. call ID. */ + @Generated @JsonProperty(value = "channelReference") private String channelReference; /* * The status of the Job. */ - @JsonProperty(value = "status") + @Generated + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private RouterJobStatus status; /* * The time a job was queued in UTC. */ - @JsonProperty(value = "enqueuedAt") + @Generated + @JsonProperty(value = "enqueuedAt", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime enqueuedAt; /* * The channel identifier. eg. voice, chat, etc. */ + @Generated @JsonProperty(value = "channelId") private String channelId; /* * The Id of the Classification policy used for classifying a job. */ + @Generated @JsonProperty(value = "classificationPolicyId") private String classificationPolicyId; /* * The Id of the Queue that this job is queued to. */ + @Generated @JsonProperty(value = "queueId") private String queueId; /* * The priority of this job. */ + @Generated @JsonProperty(value = "priority") private Integer priority; /* * Reason code for cancelled or closed jobs. */ + @Generated @JsonProperty(value = "dispositionCode") private String dispositionCode; @@ -79,6 +88,7 @@ public RouterJob() { * A collection of manually specified label selectors, which a worker must satisfy * in order to process this job. */ + @Generated @JsonProperty(value = "requestedWorkerSelectors") private List requestedWorkerSelectors; @@ -86,7 +96,8 @@ public RouterJob() { * A collection of label selectors attached by a classification policy, which a * worker must satisfy in order to process this job. */ - @JsonProperty(value = "attachedWorkerSelectors") + @Generated + @JsonProperty(value = "attachedWorkerSelectors", access = JsonProperty.Access.WRITE_ONLY) private List attachedWorkerSelectors; /* @@ -94,35 +105,34 @@ public RouterJob() { * engines to make decisions. */ @JsonProperty(value = "labels") - @JsonDeserialize(using = RouterValueMapDeserializer.class) - @JsonSerialize(using = RouterValueMapSerializer.class) private Map labels; /* * A collection of the assignments of the job. * Key is AssignmentId. */ - @JsonProperty(value = "assignments") + @Generated + @JsonProperty(value = "assignments", access = JsonProperty.Access.WRITE_ONLY) private Map assignments; /* * A set of non-identifying attributes attached to this job */ @JsonProperty(value = "tags") - @JsonDeserialize(using = RouterValueMapDeserializer.class) - @JsonSerialize(using = RouterValueMapSerializer.class) private Map tags; /* * Notes attached to a job, sorted by timestamp */ + @Generated @JsonProperty(value = "notes") private List notes; /* * If set, job will be scheduled to be enqueued at a given time */ - @JsonProperty(value = "scheduledAt") + @Generated + @JsonProperty(value = "scheduledAt", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime scheduledAt; /* @@ -139,14 +149,59 @@ public RouterJob() { * SuspendMode: Used when matching workers * to a job needs to be suspended. */ + @Generated @JsonProperty(value = "matchingMode") private JobMatchingMode matchingMode; + /** Creates an instance of RouterJob class. */ + @Generated + public RouterJob() {} + + /** + * Package-private constructor of the class, used internally. + * + * @param internal The internal RouterJob + */ + RouterJob(RouterJobInternal internal) { + id = internal.getId(); + requestedWorkerSelectors = internal.getRequestedWorkerSelectors().stream() + .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToPublic(ws)) + .collect(Collectors.toList()); + attachedWorkerSelectors = internal.getAttachedWorkerSelectors().stream() + .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToPublic(ws)) + .collect(Collectors.toList()); + assignments = internal.getAssignments().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue())); + status = RouterJobStatus.fromString(internal.getStatus().toString()); + enqueuedAt = internal.getEnqueuedAt(); + scheduledAt = internal.getScheduledAt(); + + setChannelId(internal.getChannelId()); + setChannelReference(internal.getChannelReference()); + setQueueId(internal.getQueueId()); + setLabels(internal.getLabels().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setNotes(internal.getNotes()); + setPriority(internal.getPriority()); + setClassificationPolicyId(internal.getClassificationPolicyId()); + setDispositionCode(internal.getDispositionCode()); + setClassificationPolicyId(internal.getClassificationPolicyId()); + setTags(internal.getTags().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setMatchingMode(JobAdapter.convertJobMatchingModeToPublic(internal.getMatchingMode())); + } + + static { + RouterJobConstructorProxy.setAccessor(internal -> new RouterJob(internal)); + } + + /** * Get the id property: The id of the job. * * @return the id value. */ + @Generated public String getId() { return this.id; } @@ -156,6 +211,7 @@ public String getId() { * * @return the channelReference value. */ + @Generated public String getChannelReference() { return this.channelReference; } @@ -166,6 +222,7 @@ public String getChannelReference() { * @param channelReference the channelReference value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setChannelReference(String channelReference) { this.channelReference = channelReference; return this; @@ -176,6 +233,7 @@ public RouterJob setChannelReference(String channelReference) { * * @return the status value. */ + @Generated public RouterJobStatus getStatus() { return this.status; } @@ -185,6 +243,7 @@ public RouterJobStatus getStatus() { * * @return the enqueuedAt value. */ + @Generated public OffsetDateTime getEnqueuedAt() { return this.enqueuedAt; } @@ -194,6 +253,7 @@ public OffsetDateTime getEnqueuedAt() { * * @return the channelId value. */ + @Generated public String getChannelId() { return this.channelId; } @@ -204,6 +264,7 @@ public String getChannelId() { * @param channelId the channelId value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setChannelId(String channelId) { this.channelId = channelId; return this; @@ -214,6 +275,7 @@ public RouterJob setChannelId(String channelId) { * * @return the classificationPolicyId value. */ + @Generated public String getClassificationPolicyId() { return this.classificationPolicyId; } @@ -224,6 +286,7 @@ public String getClassificationPolicyId() { * @param classificationPolicyId the classificationPolicyId value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setClassificationPolicyId(String classificationPolicyId) { this.classificationPolicyId = classificationPolicyId; return this; @@ -234,6 +297,7 @@ public RouterJob setClassificationPolicyId(String classificationPolicyId) { * * @return the queueId value. */ + @Generated public String getQueueId() { return this.queueId; } @@ -244,6 +308,7 @@ public String getQueueId() { * @param queueId the queueId value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setQueueId(String queueId) { this.queueId = queueId; return this; @@ -254,6 +319,7 @@ public RouterJob setQueueId(String queueId) { * * @return the priority value. */ + @Generated public Integer getPriority() { return this.priority; } @@ -264,6 +330,7 @@ public Integer getPriority() { * @param priority the priority value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setPriority(Integer priority) { this.priority = priority; return this; @@ -274,6 +341,7 @@ public RouterJob setPriority(Integer priority) { * * @return the dispositionCode value. */ + @Generated public String getDispositionCode() { return this.dispositionCode; } @@ -284,6 +352,7 @@ public String getDispositionCode() { * @param dispositionCode the dispositionCode value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setDispositionCode(String dispositionCode) { this.dispositionCode = dispositionCode; return this; @@ -295,6 +364,7 @@ public RouterJob setDispositionCode(String dispositionCode) { * * @return the requestedWorkerSelectors value. */ + @Generated public List getRequestedWorkerSelectors() { return this.requestedWorkerSelectors; } @@ -306,6 +376,7 @@ public List getRequestedWorkerSelectors() { * @param requestedWorkerSelectors the requestedWorkerSelectors value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setRequestedWorkerSelectors(List requestedWorkerSelectors) { this.requestedWorkerSelectors = requestedWorkerSelectors; return this; @@ -317,6 +388,7 @@ public RouterJob setRequestedWorkerSelectors(List requeste * * @return the attachedWorkerSelectors value. */ + @Generated public List getAttachedWorkerSelectors() { return this.attachedWorkerSelectors; } @@ -348,6 +420,7 @@ public RouterJob setLabels(Map labels) { * * @return the assignments value. */ + @Generated public Map getAssignments() { return this.assignments; } @@ -377,6 +450,7 @@ public RouterJob setTags(Map tags) { * * @return the notes value. */ + @Generated public List getNotes() { return this.notes; } @@ -386,6 +460,7 @@ public List getNotes() { * * @return the scheduledAt value. */ + @Generated public OffsetDateTime getScheduledAt() { return this.scheduledAt; } @@ -402,6 +477,7 @@ public OffsetDateTime getScheduledAt() { * * @return the matchingMode value. */ + @Generated public JobMatchingMode getMatchingMode() { return this.matchingMode; } @@ -419,6 +495,7 @@ public JobMatchingMode getMatchingMode() { * @param matchingMode the matchingMode value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setMatchingMode(JobMatchingMode matchingMode) { this.matchingMode = matchingMode; return this; @@ -427,7 +504,8 @@ public RouterJob setMatchingMode(JobMatchingMode matchingMode) { /* * Concurrency Token. */ - @JsonProperty(value = "etag") + @Generated + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** @@ -435,6 +513,7 @@ public RouterJob setMatchingMode(JobMatchingMode matchingMode) { * * @return the etag value. */ + @Generated public String getEtag() { return this.etag; } @@ -445,6 +524,7 @@ public String getEtag() { * @param notes the notes value to set. * @return the RouterJob object itself. */ + @Generated public RouterJob setNotes(List notes) { this.notes = notes; return this; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobAssignment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobAssignment.java index d7602b3fa170..ce42ce058118 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobAssignment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobAssignment.java @@ -34,7 +34,7 @@ public final class RouterJobAssignment { */ @Generated @JsonProperty(value = "assignedAt") - private final OffsetDateTime assignedAt; + private OffsetDateTime assignedAt; /* * Timestamp when the job was marked as completed after being assigned in UTC. @@ -50,17 +50,6 @@ public final class RouterJobAssignment { @JsonProperty(value = "closedAt") private OffsetDateTime closedAt; - /** - * Creates an instance of RouterJobAssignment class. - * - * @param assignedAt the assignedAt value to set. - */ - @Generated - @JsonCreator - private RouterJobAssignment(@JsonProperty(value = "assignedAt") OffsetDateTime assignedAt) { - this.assignedAt = assignedAt; - } - /** * Get the assignmentId property: Id of a job assignment. * @@ -110,4 +99,15 @@ public OffsetDateTime getCompletedAt() { public OffsetDateTime getClosedAt() { return this.closedAt; } + + /** + * Creates an instance of RouterJobAssignment class. + * + * @param assignedAt the assignedAt value to set. + */ + @Generated + @JsonCreator + private RouterJobAssignment(@JsonProperty(value = "assignedAt") OffsetDateTime assignedAt) { + this.assignedAt = assignedAt; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobNote.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobNote.java index ca3aeecfb7b6..d34762d6a4c3 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobNote.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobNote.java @@ -4,10 +4,8 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.Objects; /** * A note attached to a job. @@ -15,62 +13,51 @@ @Fluent public final class RouterJobNote { - /* - * The message contained in the note. + /** + * Creates an instance of RouterJobNote class. + * + * @param message The message for the note. */ - @Generated - @JsonProperty(value = "message") - private final String message; + public RouterJobNote(String message) { + this.message = Objects.requireNonNull(message, "'message' cannot be null."); + } - /* - * The time at which the note was added in UTC. If not provided, will default to the current time. + /** + * The time at which the note was added in UTC. */ - @Generated - @JsonProperty(value = "addedAt") private OffsetDateTime addedAt; /** - * Creates an instance of RouterJobNote class. - * - * @param message the message value to set. + * Message for the note. */ - @Generated - @JsonCreator - public RouterJobNote(@JsonProperty(value = "message") String message) { - this.message = message; - } + private final String message; /** - * Get the message property: The message contained in the note. + * setter for time. * - * @return the message value. + * @param addedAt time at which the note was added in UTC. + * @return this */ - @Generated - public String getMessage() { - return this.message; + public RouterJobNote setAddedAt(OffsetDateTime addedAt) { + this.addedAt = addedAt; + return this; } /** - * Get the addedAt property: The time at which the note was added in UTC. If not provided, will default to the - * current time. + * getter for addedAt. * - * @return the addedAt value. + * @return addedAt */ - @Generated public OffsetDateTime getAddedAt() { - return this.addedAt; + return addedAt; } /** - * Set the addedAt property: The time at which the note was added in UTC. If not provided, will default to the - * current time. + * Getter for message. * - * @param addedAt the addedAt value to set. - * @return the RouterJobNote object itself. + * @return message. */ - @Generated - public RouterJobNote setAddedAt(OffsetDateTime addedAt) { - this.addedAt = addedAt; - return this; + public String getMessage() { + return message; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobOffer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobOffer.java index 8c99279fd7bd..81a50b474939 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobOffer.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobOffer.java @@ -27,14 +27,14 @@ public final class RouterJobOffer { */ @Generated @JsonProperty(value = "jobId") - private final String jobId; + private String jobId; /* * The capacity cost consumed by the job offer. */ @Generated @JsonProperty(value = "capacityCost") - private final int capacityCost; + private int capacityCost; /* * Timestamp when the offer was created in UTC. @@ -50,20 +50,6 @@ public final class RouterJobOffer { @JsonProperty(value = "expiresAt") private OffsetDateTime expiresAt; - /** - * Creates an instance of RouterJobOffer class. - * - * @param jobId the jobId value to set. - * @param capacityCost the capacityCost value to set. - */ - @Generated - @JsonCreator - private RouterJobOffer(@JsonProperty(value = "jobId") String jobId, - @JsonProperty(value = "capacityCost") int capacityCost) { - this.jobId = jobId; - this.capacityCost = capacityCost; - } - /** * Get the offerId property: Id of an offer. * @@ -113,4 +99,18 @@ public OffsetDateTime getOfferedAt() { public OffsetDateTime getExpiresAt() { return this.expiresAt; } + + /** + * Creates an instance of RouterJobOffer class. + * + * @param jobId the jobId value to set. + * @param capacityCost the capacityCost value to set. + */ + @Generated + @JsonCreator + private RouterJobOffer(@JsonProperty(value = "jobId") String jobId, + @JsonProperty(value = "capacityCost") int capacityCost) { + this.jobId = jobId; + this.capacityCost = capacityCost; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobPositionDetails.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobPositionDetails.java index 5f07eab7ca8e..61a70bd154d2 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobPositionDetails.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobPositionDetails.java @@ -19,35 +19,35 @@ public final class RouterJobPositionDetails { */ @Generated @JsonProperty(value = "jobId") - private final String jobId; + private String jobId; /* * Position of the job in question within that queue. */ @Generated @JsonProperty(value = "position") - private final int position; + private int position; /* * Id of the queue this job is enqueued in. */ @Generated @JsonProperty(value = "queueId") - private final String queueId; + private String queueId; /* * Length of the queue: total number of enqueued jobs. */ @Generated @JsonProperty(value = "queueLength") - private final int queueLength; + private int queueLength; /* * Estimated wait time of the job rounded up to the nearest minute. */ @Generated @JsonProperty(value = "estimatedWaitTimeMinutes") - private final double estimatedWaitTimeMinutes; + private double estimatedWaitTimeMinutes; /** * Creates an instance of RouterJobPositionDetails class. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueue.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueue.java index 096bfbef1afa..d1e7b7a08c87 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueue.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueue.java @@ -3,31 +3,31 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterQueueConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterValueConstructorProxy; +import com.azure.communication.jobrouter.implementation.models.RouterQueueInternal; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.Map; +import java.util.stream.Collectors; /** A queue that can contain jobs to be routed. */ @Fluent public final class RouterQueue { - /** - * Create new instance - */ - public RouterQueue() { - } /* * The Id of this queue */ - @JsonProperty(value = "id") + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of this queue. */ + @Generated @JsonProperty(value = "name") private String name; @@ -35,6 +35,7 @@ public RouterQueue() { * The ID of the distribution policy that will determine how a job is distributed * to workers. */ + @Generated @JsonProperty(value = "distributionPolicyId") private String distributionPolicyId; @@ -43,22 +44,46 @@ public RouterQueue() { * engines to make decisions. */ @JsonProperty(value = "labels") - @JsonDeserialize(using = RouterValueMapDeserializer.class) - @JsonSerialize(using = RouterValueMapSerializer.class) private Map labels; /* * (Optional) The ID of the exception policy that determines various job * escalation rules. */ + @Generated @JsonProperty(value = "exceptionPolicyId") private String exceptionPolicyId; + static { + RouterQueueConstructorProxy.setAccessor(internal -> new RouterQueue(internal)); + } + + /** + * Package-private constructor of the class, used internally. + * + * @param internal The internal RouterQueue + */ + RouterQueue(RouterQueueInternal internal) { + id = internal.getId(); + + setName(internal.getName()); + setDistributionPolicyId(internal.getDistributionPolicyId()); + setExceptionPolicyId(internal.getExceptionPolicyId()); + setLabels(internal.getLabels().entrySet().stream() + .collect(Collectors.toMap(entry -> entry.getKey(), entry -> RouterValueConstructorProxy.create(entry.getValue())))); + } + + + /** Creates an instance of RouterQueue class. */ + @Generated + public RouterQueue() {} + /** * Get the id property: The Id of this queue. * * @return the id value. */ + @Generated public String getId() { return this.id; } @@ -68,6 +93,7 @@ public String getId() { * * @return the name value. */ + @Generated public String getName() { return this.name; } @@ -78,6 +104,7 @@ public String getName() { * @param name the name value to set. * @return the RouterQueue object itself. */ + @Generated public RouterQueue setName(String name) { this.name = name; return this; @@ -89,6 +116,7 @@ public RouterQueue setName(String name) { * * @return the distributionPolicyId value. */ + @Generated public String getDistributionPolicyId() { return this.distributionPolicyId; } @@ -100,6 +128,7 @@ public String getDistributionPolicyId() { * @param distributionPolicyId the distributionPolicyId value to set. * @return the RouterQueue object itself. */ + @Generated public RouterQueue setDistributionPolicyId(String distributionPolicyId) { this.distributionPolicyId = distributionPolicyId; return this; @@ -133,6 +162,7 @@ public RouterQueue setLabels(Map labels) { * * @return the exceptionPolicyId value. */ + @Generated public String getExceptionPolicyId() { return this.exceptionPolicyId; } @@ -144,6 +174,7 @@ public String getExceptionPolicyId() { * @param exceptionPolicyId the exceptionPolicyId value to set. * @return the RouterQueue object itself. */ + @Generated public RouterQueue setExceptionPolicyId(String exceptionPolicyId) { this.exceptionPolicyId = exceptionPolicyId; return this; @@ -152,7 +183,8 @@ public RouterQueue setExceptionPolicyId(String exceptionPolicyId) { /* * Concurrency Token. */ - @JsonProperty(value = "etag") + @Generated + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** @@ -160,6 +192,7 @@ public RouterQueue setExceptionPolicyId(String exceptionPolicyId) { * * @return the etag value. */ + @Generated public String getEtag() { return this.etag; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueSelector.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueSelector.java index c87baebe6736..a0c6fe71bb47 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueSelector.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueSelector.java @@ -4,10 +4,9 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; /** Describes a condition that must be met against a set of labels for queue selection. */ @Fluent @@ -16,6 +15,7 @@ public final class RouterQueueSelector { /* * The label key to query against */ + @Generated @JsonProperty(value = "key") private String key; @@ -23,6 +23,7 @@ public final class RouterQueueSelector { * Describes how the value of the label is compared to the value defined on the * label selector */ + @Generated @JsonProperty(value = "labelOperator") private LabelOperator labelOperator; @@ -30,8 +31,6 @@ public final class RouterQueueSelector { * The value to compare against the actual label value with the given operator */ @JsonProperty(value = "value") - @JsonDeserialize(using = RouterValueDeserializer.class) - @JsonSerialize(using = RouterValueSerializer.class) private RouterValue value; /** @@ -39,16 +38,14 @@ public final class RouterQueueSelector { * * @param key the key value to set. * @param labelOperator the labelOperator value to set. - * @param value the value value to set. */ + @Generated @JsonCreator public RouterQueueSelector( @JsonProperty(value = "key") String key, - @JsonProperty(value = "labelOperator") LabelOperator labelOperator, - @JsonProperty(value = "value") RouterValue value) { + @JsonProperty(value = "labelOperator") LabelOperator labelOperator) { this.key = key; this.labelOperator = labelOperator; - this.value = value; } /** @@ -56,6 +53,7 @@ public RouterQueueSelector( * * @return the key value. */ + @Generated public String getKey() { return this.key; } @@ -66,6 +64,7 @@ public String getKey() { * * @return the labelOperator value. */ + @Generated public LabelOperator getLabelOperator() { return this.labelOperator; } @@ -78,4 +77,15 @@ public LabelOperator getLabelOperator() { public RouterValue getValue() { return this.value; } + + /** + * Set the value property: The value to compare against the actual label value with the given operator. + * + * @param value the value value to set. + * @return the RouterQueueSelector object itself. + */ + public RouterQueueSelector setValue(RouterValue value) { + this.value = value; + return this; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueStatistics.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueStatistics.java index afd3f4364b19..9de9dfe86180 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueStatistics.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueStatistics.java @@ -3,11 +3,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.Duration; import java.util.Map; @@ -19,12 +18,14 @@ public final class RouterQueueStatistics { /* * Id of the queue these details are about. */ + @Generated @JsonProperty(value = "queueId") private String queueId; /* * Length of the queue: total number of enqueued jobs. */ + @Generated @JsonProperty(value = "length") private int length; @@ -33,13 +34,12 @@ public final class RouterQueueStatistics { * by job priority */ @JsonProperty(value = "estimatedWaitTimeMinutes") - @JsonDeserialize(using = DurationMapDeserializer.class) - @JsonSerialize(using = DurationMapSerializer.class) private Map estimatedWaitTimes; /* * The wait time of the job that has been enqueued in this queue for the longest. */ + @Generated @JsonProperty(value = "longestJobWaitTimeMinutes") private Double longestJobWaitTimeMinutes; @@ -49,6 +49,7 @@ public final class RouterQueueStatistics { * @param queueId the queueId value to set. * @param length the length value to set. */ + @Generated @JsonCreator private RouterQueueStatistics( @JsonProperty(value = "queueId") String queueId, @JsonProperty(value = "length") int length) { @@ -61,6 +62,7 @@ private RouterQueueStatistics( * * @return the queueId value. */ + @Generated public String getQueueId() { return this.queueId; } @@ -70,6 +72,7 @@ public String getQueueId() { * * @return the length value. */ + @Generated public int getLength() { return this.length; } @@ -90,6 +93,7 @@ public Map getEstimatedWaitTime() { * * @return the longestJobWaitTimeMinutes value. */ + @Generated public Double getLongestJobWaitTimeMinutes() { return this.longestJobWaitTimeMinutes; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java index 0b10a599eb29..9cb7821ab865 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java @@ -3,6 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -27,22 +29,24 @@ @JsonSubTypes.Type(name = "static", value = StaticRouterRule.class), @JsonSubTypes.Type(name = "webhook", value = WebhookRouterRule.class) }) +@Immutable public abstract class RouterRule { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected RouterRuleKind kind; + private String kind; /** Creates an instance of RouterRule class. */ + @Generated public RouterRule() {} /** * Returns kind discriminator. * @return kind. */ - public RouterRuleKind getKind() { + public String getKind() { return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRuleKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRuleKind.java deleted file mode 100644 index 4e5f9ed8d2f5..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRuleKind.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported router rule types. - */ -public final class RouterRuleKind extends ExpandableStringEnum { - - /** - * Discriminator value for DirectMapRouterRule. - */ - @Generated - public static final RouterRuleKind DIRECT_MAP = fromString("directMap"); - - /** - * Discriminator value for ExpressionRouterRule. - */ - @Generated - public static final RouterRuleKind EXPRESSION = fromString("expression"); - - /** - * Discriminator value for FunctionRouterRule. - */ - @Generated - public static final RouterRuleKind FUNCTION = fromString("function"); - - /** - * Discriminator value for StaticRouterRule. - */ - @Generated - public static final RouterRuleKind STATIC = fromString("static"); - - /** - * Discriminator value for WebhookRouterRule. - */ - @Generated - public static final RouterRuleKind WEBHOOK = fromString("webhook"); - - /** - * Creates a new instance of RouterRuleKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public RouterRuleKind() { - } - - /** - * Creates or finds a RouterRuleKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding RouterRuleKind. - */ - @Generated - @JsonCreator - public static RouterRuleKind fromString(String name) { - return fromString(name, RouterRuleKind.class); - } - - /** - * Gets known RouterRuleKind values. - * - * @return known RouterRuleKind values. - */ - @Generated - public static Collection values() { - return values(RouterRuleKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValue.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValue.java index 96d4e0fd48c5..ace682da1289 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValue.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValue.java @@ -3,7 +3,8 @@ package com.azure.communication.jobrouter.models; -import com.azure.core.annotation.Immutable; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterValueConstructorProxy; +import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,8 +18,8 @@ * 3. doubleValue. * 4. boolValue. */ -@Immutable public final class RouterValue { + private static final ClientLogger LOGGER = new ClientLogger(RouterValue.class); /** * String Value to pass to server. @@ -62,6 +63,10 @@ public final class RouterValue { this.boolValue = boolValue; } + static { + RouterValueConstructorProxy.setAccessor(internal -> new RouterValue(internal)); + } + /** * String constructor. * @param stringValue stringValue. @@ -94,6 +99,25 @@ public RouterValue(Boolean boolValue) { this(null, null, null, boolValue); } + /** + * Package-protected constructor. + * @param objectValue objectValue. + */ + RouterValue(Object objectValue) { + if (objectValue.getClass() == String.class) { + this.stringValue = (String) objectValue; + } + if (objectValue.getClass() == Integer.class) { + this.intValue = (int) objectValue; + } + if (objectValue.getClass() == Double.class) { + this.doubleValue = (double) objectValue; + } + if (objectValue.getClass() == Boolean.class) { + this.boolValue = (Boolean) objectValue; + } + } + /** * Returns stringValue * @return stringValue. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueDeserializer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueDeserializer.java deleted file mode 100644 index 984b20190e4e..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueDeserializer.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import com.fasterxml.jackson.core.JacksonException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonNode; - -import java.io.IOException; - -/** - * This class provides logic to deserialize RouterValue - */ -final class RouterValueDeserializer extends JsonDeserializer { - - @Override - public RouterValue deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JacksonException { - RouterValue result = null; - JsonNode node = p.getCodec().readTree(p); - JsonNode valueNode = node.get("value"); - if (valueNode != null) { - node = valueNode; - } - - if (node.isDouble()) { - result = new RouterValue(node.doubleValue()); - } else if (node.isBoolean()) { - result = new RouterValue(node.booleanValue()); - } else if (node.canConvertToInt()) { - result = new RouterValue(node.intValue()); - } else if (node.isTextual()) { - result = new RouterValue(node.textValue()); - } - - return result; - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueMapDeserializer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueMapDeserializer.java deleted file mode 100644 index e87915ab90ce..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueMapDeserializer.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonNode; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -/** - * This class provides logic to deserialize Map(String, RouterValue) - */ -final class RouterValueMapDeserializer extends JsonDeserializer> { - - @Override - public Map deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Map result = new HashMap<>(); - JsonNode root = p.getCodec().readTree(p); - Iterator> iter = root.fields(); - - while (iter.hasNext()) { - Map.Entry entry = iter.next(); - JsonNode node = entry.getValue(); - JsonNode valueNode = node.get("value"); - if (valueNode != null) { - node = valueNode; - } - - if (node.isDouble()) { - result.put(entry.getKey(), new RouterValue(node.doubleValue())); - } else if (node.isBoolean()) { - result.put(entry.getKey(), new RouterValue(node.booleanValue())); - } else if (node.canConvertToInt()) { - result.put(entry.getKey(), new RouterValue(node.intValue())); - } else if (node.isTextual()) { - result.put(entry.getKey(), new RouterValue(node.textValue())); - } - } - - return result; - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueMapSerializer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueMapSerializer.java deleted file mode 100644 index a6385fbbe78e..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueMapSerializer.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; - -import java.io.IOException; -import java.util.Map; - -/** - * This class provides logic to serialize Map(String, RouterValue) - */ -final class RouterValueMapSerializer extends JsonSerializer> { - @Override - public void serialize(Map map, JsonGenerator gen, SerializerProvider serializers) throws IOException { - gen.writeStartObject(); - - for (Map.Entry entry : map.entrySet()) { - String key = entry.getKey(); - RouterValue value = entry.getValue(); - - if (value.getDoubleValue() != null) { - gen.writeNumberField(key, value.getDoubleValue()); - } else if (value.getBooleanValue() != null) { - gen.writeBooleanField(key, value.getBooleanValue()); - } else if (value.getIntValue() != null) { - gen.writeNumberField(key, value.getIntValue()); - } else if (value.getStringValue() != null) { - gen.writeStringField(key, value.getStringValue()); - } else { - gen.writeNullField(key); - } - } - - gen.writeEndObject(); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueSerializer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueSerializer.java deleted file mode 100644 index 9cf5105e0629..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterValueSerializer.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.jobrouter.models; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; - -import java.io.IOException; - -/** - * This class provides logic to serialize RouterValue - */ -final class RouterValueSerializer extends JsonSerializer { - @Override - public void serialize(RouterValue value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - if (value.getDoubleValue() != null) { - gen.writeNumber(value.getDoubleValue()); - } else if (value.getBooleanValue() != null) { - gen.writeBoolean(value.getBooleanValue()); - } else if (value.getIntValue() != null) { - gen.writeNumber(value.getIntValue()); - } else if (value.getStringValue() != null) { - gen.writeString(value.getStringValue()); - } else { - gen.writeNull(); - } - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorker.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorker.java index feda9de9a4ca..5c77730a2205 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorker.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorker.java @@ -3,33 +3,33 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterValueConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterWorkerConstructorProxy; +import com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** An entity for jobs to be routed to. */ @Fluent public final class RouterWorker { - /** - * Create new instance - */ - public RouterWorker() { - } /* * Id of the worker. */ - @JsonProperty(value = "id") + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The current state of the worker. */ - @JsonProperty(value = "state") + @Generated + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private RouterWorkerState state; /* @@ -37,48 +37,80 @@ public RouterWorker() { * engines to make decisions. */ @JsonProperty(value = "labels") - @JsonDeserialize(using = RouterValueMapDeserializer.class) - @JsonSerialize(using = RouterValueMapSerializer.class) private Map labels; /* * A set of non-identifying attributes attached to this worker. */ @JsonProperty(value = "tags") - @JsonDeserialize(using = RouterValueMapDeserializer.class) - @JsonSerialize(using = RouterValueMapSerializer.class) private Map tags; /* * A list of active offers issued to this worker. */ - @JsonProperty(value = "offers") + @Generated + @JsonProperty(value = "offers", access = JsonProperty.Access.WRITE_ONLY) private List offers; /* * A list of assigned jobs attached to this worker. */ - @JsonProperty(value = "assignedJobs") + @Generated + @JsonProperty(value = "assignedJobs", access = JsonProperty.Access.WRITE_ONLY) private List assignedJobs; /* * A value indicating the workers capacity. A value of '1' means all capacity is * consumed. A value of '0' means no capacity is currently consumed. */ - @JsonProperty(value = "loadRatio") + @Generated + @JsonProperty(value = "loadRatio", access = JsonProperty.Access.WRITE_ONLY) private Double loadRatio; /* * A flag indicating this worker is open to receive offers or not. */ + @Generated @JsonProperty(value = "availableForOffers") private Boolean availableForOffers; + /** Creates an instance of RouterWorker class. */ + @Generated + public RouterWorker() {} + + /** + * Package-private constructor of the class, used internally. + * + * @param internal The internal RouterWorker + */ + RouterWorker(RouterWorkerInternal internal) { + id = internal.getId(); + state = RouterWorkerState.fromString(internal.getState().toString()); + offers = internal.getOffers(); + assignedJobs = internal.getAssignedJobs(); + loadRatio = internal.getLoadRatio(); + + setLabels(internal.getLabels().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setTags(internal.getTags().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setQueues(internal.getQueues()); + setAvailableForOffers(internal.isAvailableForOffers()); + setChannels(internal.getChannels()); + setCapacity(internal.getCapacity()); + } + + static { + RouterWorkerConstructorProxy.setAccessor(internal -> new RouterWorker(internal)); + } + + /** * Get the id property: Id of the worker. * * @return the id value. */ + @Generated public String getId() { return this.id; } @@ -88,6 +120,7 @@ public String getId() { * * @return the state value. */ + @Generated public RouterWorkerState getState() { return this.state; } @@ -139,6 +172,7 @@ public RouterWorker setTags(Map tags) { * * @return the offers value. */ + @Generated public List getOffers() { return this.offers; } @@ -148,6 +182,7 @@ public List getOffers() { * * @return the assignedJobs value. */ + @Generated public List getAssignedJobs() { return this.assignedJobs; } @@ -158,6 +193,7 @@ public List getAssignedJobs() { * * @return the loadRatio value. */ + @Generated public Double getLoadRatio() { return this.loadRatio; } @@ -167,6 +203,7 @@ public Double getLoadRatio() { * * @return the availableForOffers value. */ + @Generated public Boolean isAvailableForOffers() { return this.availableForOffers; } @@ -177,6 +214,7 @@ public Boolean isAvailableForOffers() { * @param availableForOffers the availableForOffers value to set. * @return the RouterWorker object itself. */ + @Generated public RouterWorker setAvailableForOffers(Boolean availableForOffers) { this.availableForOffers = availableForOffers; return this; @@ -185,38 +223,37 @@ public RouterWorker setAvailableForOffers(Boolean availableForOffers) { /* * Concurrency Token. */ - @JsonProperty(value = "etag") + @Generated + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /* * The queue(s) that this worker can receive work from. */ + @Generated @JsonProperty(value = "queues") private List queues; /* * The total capacity score this worker has to manage multiple concurrent jobs. */ + @Generated @JsonProperty(value = "capacity") private Integer capacity; /* * The channel(s) this worker can handle and their impact on the workers capacity. */ + @Generated @JsonProperty(value = "channels") private List channels; - /* - * If this is set, the worker will only receive up to this many new offers at a time. - */ - @JsonProperty(value = "maxConcurrentOffers") - private Integer maxConcurrentOffers; - /** * Get the etag property: Concurrency Token. * * @return the etag value. */ + @Generated public String getEtag() { return this.etag; } @@ -226,6 +263,7 @@ public String getEtag() { * * @return the queues value. */ + @Generated public List getQueues() { return this.queues; } @@ -236,6 +274,7 @@ public List getQueues() { * @param queues the queues value to set. * @return the RouterWorker object itself. */ + @Generated public RouterWorker setQueues(List queues) { this.queues = queues; return this; @@ -246,6 +285,7 @@ public RouterWorker setQueues(List queues) { * * @return the capacity value. */ + @Generated public Integer getCapacity() { return this.capacity; } @@ -256,6 +296,7 @@ public Integer getCapacity() { * @param capacity the capacity value to set. * @return the RouterWorker object itself. */ + @Generated public RouterWorker setCapacity(Integer capacity) { this.capacity = capacity; return this; @@ -266,6 +307,7 @@ public RouterWorker setCapacity(Integer capacity) { * * @return the channels value. */ + @Generated public List getChannels() { return this.channels; } @@ -276,30 +318,9 @@ public List getChannels() { * @param channels the channels value to set. * @return the RouterWorker object itself. */ + @Generated public RouterWorker setChannels(List channels) { this.channels = channels; return this; } - - /** - * Get the maxConcurrentOffers property: If this is set, the worker will only receive up to this many new offers at - * a time. - * - * @return the maxConcurrentOffers value. - */ - public Integer getMaxConcurrentOffers() { - return this.maxConcurrentOffers; - } - - /** - * Set the maxConcurrentOffers property: If this is set, the worker will only receive up to this many new offers at - * a time. - * - * @param maxConcurrentOffers the maxConcurrentOffers value to set. - * @return the RouterWorkerInternal object itself. - */ - public RouterWorker setMaxConcurrentOffers(Integer maxConcurrentOffers) { - this.maxConcurrentOffers = maxConcurrentOffers; - return this; - } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerAssignment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerAssignment.java index 6f0f8c37de36..47826ed98569 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerAssignment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerAssignment.java @@ -20,28 +20,28 @@ public final class RouterWorkerAssignment { */ @Generated @JsonProperty(value = "assignmentId") - private final String assignmentId; + private String assignmentId; /* * Id of the job assigned. */ @Generated @JsonProperty(value = "jobId") - private final String jobId; + private String jobId; /* * The amount of capacity this assignment has consumed on the worker. */ @Generated @JsonProperty(value = "capacityCost") - private final int capacityCost; + private int capacityCost; /* * The assignment time of the job in UTC. */ @Generated @JsonProperty(value = "assignedAt") - private final OffsetDateTime assignedAt; + private OffsetDateTime assignedAt; /** * Creates an instance of RouterWorkerAssignment class. diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelector.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelector.java index e6c7cd5ec1c4..f53281ca33f4 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelector.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelector.java @@ -4,10 +4,9 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.Duration; import java.time.OffsetDateTime; @@ -19,6 +18,7 @@ public final class RouterWorkerSelector { /* * The label key to query against */ + @Generated @JsonProperty(value = "key") private String key; @@ -26,6 +26,7 @@ public final class RouterWorkerSelector { * Describes how the value of the label is compared to the value defined on the * label selector */ + @Generated @JsonProperty(value = "labelOperator") private LabelOperator labelOperator; @@ -33,34 +34,33 @@ public final class RouterWorkerSelector { * The value to compare against the actual label value with the given operator */ @JsonProperty(value = "value") - @JsonDeserialize(using = RouterValueDeserializer.class) - @JsonSerialize(using = RouterValueSerializer.class) private RouterValue value; /* * Describes how long this label selector is valid in seconds. */ @JsonProperty(value = "expiresAfterSeconds") - @JsonDeserialize(using = DurationDeserializer.class) - @JsonSerialize(using = DurationSerializer.class) private Duration expiresAfter; /* * Pushes the job to the front of the queue as long as this selector is active. */ + @Generated @JsonProperty(value = "expedite") private Boolean expedite; /* * The status of the worker selector. */ - @JsonProperty(value = "status") + @Generated + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private RouterWorkerSelectorStatus status; /* * The time at which this worker selector expires in UTC */ - @JsonProperty(value = "expiresAt") + @Generated + @JsonProperty(value = "expiresAt", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime expiresAt; /** @@ -68,16 +68,14 @@ public final class RouterWorkerSelector { * * @param key the key value to set. * @param labelOperator the labelOperator value to set. - * @param value the RouterValue value to set. */ + @Generated @JsonCreator public RouterWorkerSelector( @JsonProperty(value = "key") String key, - @JsonProperty(value = "labelOperator") LabelOperator labelOperator, - @JsonProperty(value = "value") RouterValue value) { + @JsonProperty(value = "labelOperator") LabelOperator labelOperator) { this.key = key; this.labelOperator = labelOperator; - this.value = value; } /** @@ -85,6 +83,7 @@ public RouterWorkerSelector( * * @return the key value. */ + @Generated public String getKey() { return this.key; } @@ -95,6 +94,7 @@ public String getKey() { * * @return the labelOperator value. */ + @Generated public LabelOperator getLabelOperator() { return this.labelOperator; } @@ -108,6 +108,17 @@ public RouterValue getValue() { return this.value; } + /** + * Set the value property: The value to compare against the actual label value with the given operator. + * + * @param value the value value to set. + * @return the RouterWorkerSelector object itself. + */ + public RouterWorkerSelector setValue(RouterValue value) { + this.value = value; + return this; + } + /** * Get the expiresAfter property: Describes how long this label selector is valid. * @@ -133,6 +144,7 @@ public RouterWorkerSelector setExpiresAfter(Duration expiresAfter) { * * @return the expedite value. */ + @Generated public Boolean isExpedite() { return this.expedite; } @@ -143,6 +155,7 @@ public Boolean isExpedite() { * @param expedite the expedite value to set. * @return the RouterWorkerSelector object itself. */ + @Generated public RouterWorkerSelector setExpedite(Boolean expedite) { this.expedite = expedite; return this; @@ -153,6 +166,7 @@ public RouterWorkerSelector setExpedite(Boolean expedite) { * * @return the status value. */ + @Generated public RouterWorkerSelectorStatus getStatus() { return this.status; } @@ -162,6 +176,7 @@ public RouterWorkerSelectorStatus getStatus() { * * @return the expiresAt value. */ + @Generated public OffsetDateTime getExpiresAt() { return this.expiresAt; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java index 33953961bc8a..b9acff00c72f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -11,7 +12,7 @@ /** Attaches queue selectors to a job when the RouterRule is resolved. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("ruleEngine") +@JsonTypeName("rule-engine") @Immutable public final class RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { @@ -30,6 +31,7 @@ public final class RuleEngineQueueSelectorAttachment extends QueueSelectorAttach * WebhookRule: A rule providing a binding to a webserver following * OAuth2.0 authentication protocol. */ + @Generated @JsonProperty(value = "rule") private RouterRule rule; @@ -38,10 +40,10 @@ public final class RuleEngineQueueSelectorAttachment extends QueueSelectorAttach * * @param rule the rule value to set. */ + @Generated @JsonCreator public RuleEngineQueueSelectorAttachment(@JsonProperty(value = "rule") RouterRule rule) { this.rule = rule; - this.kind = QueueSelectorAttachmentKind.RULE_ENGINE; } /** @@ -54,6 +56,7 @@ public RuleEngineQueueSelectorAttachment(@JsonProperty(value = "rule") RouterRul * * @return the rule value. */ + @Generated public RouterRule getRule() { return this.rule; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java index dc8333074855..ecf509730c8c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -11,7 +12,7 @@ /** Attaches worker selectors to a job when a RouterRule is resolved. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("ruleEngine") +@JsonTypeName("rule-engine") @Immutable public final class RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { @@ -30,6 +31,7 @@ public final class RuleEngineWorkerSelectorAttachment extends WorkerSelectorAtta * WebhookRule: A rule providing a binding to a webserver following * OAuth2.0 authentication protocol. */ + @Generated @JsonProperty(value = "rule") private RouterRule rule; @@ -38,10 +40,10 @@ public final class RuleEngineWorkerSelectorAttachment extends WorkerSelectorAtta * * @param rule the rule value to set. */ + @Generated @JsonCreator public RuleEngineWorkerSelectorAttachment(@JsonProperty(value = "rule") RouterRule rule) { this.rule = rule; - this.kind = WorkerSelectorAttachmentKind.RULE_ENGINE; } /** @@ -54,6 +56,7 @@ public RuleEngineWorkerSelectorAttachment(@JsonProperty(value = "rule") RouterRu * * @return the rule value. */ + @Generated public RouterRule getRule() { return this.rule; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScheduleAndSuspendMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScheduleAndSuspendMode.java index 5ba96243fb99..d573a8a480a7 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScheduleAndSuspendMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScheduleAndSuspendMode.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -23,6 +24,7 @@ public final class ScheduleAndSuspendMode extends JobMatchingMode { /* * Requested schedule time. */ + @Generated @JsonProperty(value = "scheduleAt") private OffsetDateTime scheduleAt; @@ -31,10 +33,10 @@ public final class ScheduleAndSuspendMode extends JobMatchingMode { * * @param scheduleAt the scheduleAt value to set. */ + @Generated @JsonCreator public ScheduleAndSuspendMode(@JsonProperty(value = "scheduleAt") OffsetDateTime scheduleAt) { this.scheduleAt = scheduleAt; - this.kind = JobMatchingModeKind.SCHEDULE_AND_SUSPEND; } /** @@ -42,6 +44,7 @@ public ScheduleAndSuspendMode(@JsonProperty(value = "scheduleAt") OffsetDateTime * * @return the scheduleAt value. */ + @Generated public OffsetDateTime getScheduleAt() { return this.scheduleAt; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java index 397e403ac548..21b3c42885b1 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java @@ -4,6 +4,7 @@ package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -16,24 +17,31 @@ public final class ScoringRuleOptions { /* * Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured. */ + @Generated @JsonProperty(value = "batchSize") private Integer batchSize; /* - * List of extra parameters from a job that will be sent as part of the payload to scoring rule. If not set, a job's labels (sent in the payload as `job`) and a job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload. + * List of extra parameters from a job that will be sent as part of the payload to scoring rule. If not set, a + * job's labels (sent in the payload as `job`) and a job's worker selectors (sent in the payload as `selectors`) + * are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring + * payload. */ + @Generated @JsonProperty(value = "scoringParameters") private List scoringParameters; /* * If false, will sort scores by ascending order. By default, set to true. */ + @Generated @JsonProperty(value = "descendingOrder") private Boolean descendingOrder; /** * Creates an instance of ScoringRuleOptions class. */ + @Generated public ScoringRuleOptions() { } @@ -43,6 +51,7 @@ public ScoringRuleOptions() { * * @return the batchSize value. */ + @Generated public Integer getBatchSize() { return this.batchSize; } @@ -54,6 +63,7 @@ public Integer getBatchSize() { * @param batchSize the batchSize value to set. * @return the ScoringRuleOptions object itself. */ + @Generated public ScoringRuleOptions setBatchSize(Integer batchSize) { this.batchSize = batchSize; return this; @@ -67,6 +77,7 @@ public ScoringRuleOptions setBatchSize(Integer batchSize) { * * @return the scoringParameters value. */ + @Generated public List getScoringParameters() { return this.scoringParameters; } @@ -80,6 +91,7 @@ public List getScoringParameters() { * @param scoringParameters the scoringParameters value to set. * @return the ScoringRuleOptions object itself. */ + @Generated public ScoringRuleOptions setScoringParameters(List scoringParameters) { this.scoringParameters = scoringParameters; return this; @@ -90,6 +102,7 @@ public ScoringRuleOptions setScoringParameters(List allocations; @@ -28,11 +29,11 @@ public final class WeightedAllocationQueueSelectorAttachment extends QueueSelect * * @param allocations the allocations value to set. */ + @Generated @JsonCreator public WeightedAllocationQueueSelectorAttachment( @JsonProperty(value = "allocations") List allocations) { this.allocations = allocations; - this.kind = QueueSelectorAttachmentKind.WEIGHTED_ALLOCATION; } /** @@ -40,6 +41,7 @@ public WeightedAllocationQueueSelectorAttachment( * * @return the allocations value. */ + @Generated public List getAllocations() { return this.allocations; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java index 9cdaceac4b01..e7a2f0259c1b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java @@ -3,23 +3,24 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; - import java.util.List; /** Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("weightedAllocation") +@JsonTypeName("weighted-allocation-worker-selector") @Immutable public final class WeightedAllocationWorkerSelectorAttachment extends WorkerSelectorAttachment { /* * A collection of percentage based weighted allocations. */ + @Generated @JsonProperty(value = "allocations") private List allocations; @@ -28,11 +29,11 @@ public final class WeightedAllocationWorkerSelectorAttachment extends WorkerSele * * @param allocations the allocations value to set. */ + @Generated @JsonCreator public WeightedAllocationWorkerSelectorAttachment( @JsonProperty(value = "allocations") List allocations) { this.allocations = allocations; - this.kind = WorkerSelectorAttachmentKind.WEIGHTED_ALLOCATION; } /** @@ -40,6 +41,7 @@ public WeightedAllocationWorkerSelectorAttachment( * * @return the allocations value. */ + @Generated public List getAllocations() { return this.allocations; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java index 8834c28f447c..418456ee2ba8 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java @@ -3,6 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -17,28 +19,30 @@ @JsonTypeName("WorkerSelectorAttachment") @JsonSubTypes({ @JsonSubTypes.Type(name = "conditional", value = ConditionalWorkerSelectorAttachment.class), - @JsonSubTypes.Type(name = "passThrough", value = PassThroughWorkerSelectorAttachment.class), - @JsonSubTypes.Type(name = "ruleEngine", value = RuleEngineWorkerSelectorAttachment.class), + @JsonSubTypes.Type(name = "pass-through", value = PassThroughWorkerSelectorAttachment.class), + @JsonSubTypes.Type(name = "rule-engine", value = RuleEngineWorkerSelectorAttachment.class), @JsonSubTypes.Type(name = "static", value = StaticWorkerSelectorAttachment.class), @JsonSubTypes.Type( - name = "weightedAllocation", + name = "weighted-allocation-worker-selector", value = WeightedAllocationWorkerSelectorAttachment.class) }) +@Immutable public abstract class WorkerSelectorAttachment { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected WorkerSelectorAttachmentKind kind; + private String kind; /** Creates an instance of WorkerSelectorAttachment class. */ + @Generated public WorkerSelectorAttachment() {} /** * Returns kind discriminator. * @return kind. */ - public WorkerSelectorAttachmentKind getKind() { + public String getKind() { return this.kind; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachmentKind.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachmentKind.java deleted file mode 100644 index 227ce29199e4..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachmentKind.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.jobrouter.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Discriminators for supported worker selector attachment types. - */ -public final class WorkerSelectorAttachmentKind extends ExpandableStringEnum { - - /** - * Discriminator value for ConditionalWorkerSelectorAttachment. - */ - @Generated - public static final WorkerSelectorAttachmentKind CONDITIONAL = fromString("conditional"); - - /** - * Discriminator value for PassThroughWorkerSelectorAttachment. - */ - @Generated - public static final WorkerSelectorAttachmentKind PASS_THROUGH = fromString("passThrough"); - - /** - * Discriminator value for RuleEngineWorkerSelectorAttachment. - */ - @Generated - public static final WorkerSelectorAttachmentKind RULE_ENGINE = fromString("ruleEngine"); - - /** - * Discriminator value for StaticWorkerSelectorAttachment. - */ - @Generated - public static final WorkerSelectorAttachmentKind STATIC = fromString("static"); - - /** - * Discriminator value for WeightedAllocationWorkerSelectorAttachment. - */ - @Generated - public static final WorkerSelectorAttachmentKind WEIGHTED_ALLOCATION = fromString("weightedAllocation"); - - /** - * Creates a new instance of WorkerSelectorAttachmentKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public WorkerSelectorAttachmentKind() { - } - - /** - * Creates or finds a WorkerSelectorAttachmentKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding WorkerSelectorAttachmentKind. - */ - @Generated - @JsonCreator - public static WorkerSelectorAttachmentKind fromString(String name) { - return fromString(name, WorkerSelectorAttachmentKind.class); - } - - /** - * Gets known WorkerSelectorAttachmentKind values. - * - * @return known WorkerSelectorAttachmentKind values. - */ - @Generated - public static Collection values() { - return values(WorkerSelectorAttachmentKind.class); - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerWeightedAllocation.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerWeightedAllocation.java index 2ecb53112684..6b5624943abc 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerWeightedAllocation.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerWeightedAllocation.java @@ -3,10 +3,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.List; /** Contains the weight percentage and worker selectors to be applied if selected for weighted distributions. */ @@ -16,6 +16,7 @@ public final class WorkerWeightedAllocation { /* * The percentage of this weight, expressed as a fraction of 1. */ + @Generated @JsonProperty(value = "weight") private double weight; @@ -23,6 +24,7 @@ public final class WorkerWeightedAllocation { * A collection of worker selectors that will be applied if this allocation is * selected. */ + @Generated @JsonProperty(value = "workerSelectors") private List workerSelectors; @@ -32,6 +34,7 @@ public final class WorkerWeightedAllocation { * @param weight the weight value to set. * @param workerSelectors the workerSelectors value to set. */ + @Generated @JsonCreator public WorkerWeightedAllocation( @JsonProperty(value = "weight") double weight, @@ -45,6 +48,7 @@ public WorkerWeightedAllocation( * * @return the weight value. */ + @Generated public double getWeight() { return this.weight; } @@ -55,6 +59,7 @@ public double getWeight() { * * @return the workerSelectors value. */ + @Generated public List getWorkerSelectors() { return this.workerSelectors; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/resources/META-INF/azure-communication-jobrouter_apiview_properties.json b/sdk/communication/azure-communication-jobrouter/src/main/resources/META-INF/azure-communication-jobrouter_apiview_properties.json deleted file mode 100644 index 1e1790f41040..000000000000 --- a/sdk/communication/azure-communication-jobrouter/src/main/resources/META-INF/azure-communication-jobrouter_apiview_properties.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "flavor": "azure", - "CrossLanguageDefinitionId": { - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient": "AzureCommunicationRoutingService.JobRouterAdministrationClient", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteClassificationPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteClassificationPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteClassificationPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteClassificationPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteDistributionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteDistributionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteDistributionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteDistributionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteExceptionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteExceptionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteExceptionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteExceptionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteQueue": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.deleteQueueWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.getClassificationPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getClassificationPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.getClassificationPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getClassificationPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.getDistributionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getDistributionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.getDistributionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getDistributionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.getExceptionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getExceptionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.getExceptionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getExceptionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.getQueue": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.getQueueWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.listClassificationPolicies": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.listClassificationPolicies", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.listDistributionPolicies": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.listDistributionPolicies", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.listExceptionPolicies": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.listExceptionPolicies", - "com.azure.communication.jobrouter.JobRouterAdministrationAsyncClient.listQueues": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.listQueues", - "com.azure.communication.jobrouter.JobRouterAdministrationClient": "AzureCommunicationRoutingService.JobRouterAdministrationClient", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteClassificationPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteClassificationPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteClassificationPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteClassificationPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteDistributionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteDistributionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteDistributionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteDistributionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteExceptionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteExceptionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteExceptionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteExceptionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteQueue": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.deleteQueueWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.deleteQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.getClassificationPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getClassificationPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.getClassificationPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getClassificationPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.getDistributionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getDistributionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.getDistributionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getDistributionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.getExceptionPolicy": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getExceptionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.getExceptionPolicyWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getExceptionPolicy", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.getQueue": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.getQueueWithResponse": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.getQueue", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.listClassificationPolicies": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.listClassificationPolicies", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.listDistributionPolicies": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.listDistributionPolicies", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.listExceptionPolicies": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.listExceptionPolicies", - "com.azure.communication.jobrouter.JobRouterAdministrationClient.listQueues": "ClientForAcsJobRouter.JobRouterAdministrationRestClient.listQueues", - "com.azure.communication.jobrouter.JobRouterAdministrationClientBuilder": "AzureCommunicationRoutingService.JobRouterAdministrationClient", - "com.azure.communication.jobrouter.JobRouterAsyncClient": "AzureCommunicationRoutingService.JobRouterClient", - "com.azure.communication.jobrouter.JobRouterAsyncClient.acceptJobOffer": "ClientForAcsJobRouter.JobRouterRestClient.accept", - "com.azure.communication.jobrouter.JobRouterAsyncClient.acceptJobOfferWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.accept", - "com.azure.communication.jobrouter.JobRouterAsyncClient.cancelJob": "ClientForAcsJobRouter.JobRouterRestClient.cancel", - "com.azure.communication.jobrouter.JobRouterAsyncClient.cancelJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.cancel", - "com.azure.communication.jobrouter.JobRouterAsyncClient.closeJob": "ClientForAcsJobRouter.JobRouterRestClient.close", - "com.azure.communication.jobrouter.JobRouterAsyncClient.closeJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.close", - "com.azure.communication.jobrouter.JobRouterAsyncClient.completeJob": "ClientForAcsJobRouter.JobRouterRestClient.complete", - "com.azure.communication.jobrouter.JobRouterAsyncClient.completeJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.complete", - "com.azure.communication.jobrouter.JobRouterAsyncClient.declineJobOffer": "ClientForAcsJobRouter.JobRouterRestClient.decline", - "com.azure.communication.jobrouter.JobRouterAsyncClient.declineJobOfferWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.decline", - "com.azure.communication.jobrouter.JobRouterAsyncClient.deleteJob": "ClientForAcsJobRouter.JobRouterRestClient.deleteJob", - "com.azure.communication.jobrouter.JobRouterAsyncClient.deleteJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.deleteJob", - "com.azure.communication.jobrouter.JobRouterAsyncClient.deleteWorker": "ClientForAcsJobRouter.JobRouterRestClient.deleteWorker", - "com.azure.communication.jobrouter.JobRouterAsyncClient.deleteWorkerWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.deleteWorker", - "com.azure.communication.jobrouter.JobRouterAsyncClient.getJob": "ClientForAcsJobRouter.JobRouterRestClient.getJob", - "com.azure.communication.jobrouter.JobRouterAsyncClient.getJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.getJob", - "com.azure.communication.jobrouter.JobRouterAsyncClient.getQueuePosition": "ClientForAcsJobRouter.JobRouterRestClient.getQueuePosition", - "com.azure.communication.jobrouter.JobRouterAsyncClient.getQueuePositionWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.getQueuePosition", - "com.azure.communication.jobrouter.JobRouterAsyncClient.getQueueStatistics": "ClientForAcsJobRouter.JobRouterRestClient.getQueueStatistics", - "com.azure.communication.jobrouter.JobRouterAsyncClient.getQueueStatisticsWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.getQueueStatistics", - "com.azure.communication.jobrouter.JobRouterAsyncClient.getWorker": "ClientForAcsJobRouter.JobRouterRestClient.getWorker", - "com.azure.communication.jobrouter.JobRouterAsyncClient.getWorkerWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.getWorker", - "com.azure.communication.jobrouter.JobRouterAsyncClient.listJobs": "ClientForAcsJobRouter.JobRouterRestClient.listJobs", - "com.azure.communication.jobrouter.JobRouterAsyncClient.listWorkers": "ClientForAcsJobRouter.JobRouterRestClient.listWorkers", - "com.azure.communication.jobrouter.JobRouterAsyncClient.reclassifyJob": "ClientForAcsJobRouter.JobRouterRestClient.reclassify", - "com.azure.communication.jobrouter.JobRouterAsyncClient.reclassifyJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.reclassify", - "com.azure.communication.jobrouter.JobRouterAsyncClient.unassignJob": "ClientForAcsJobRouter.JobRouterRestClient.unassign", - "com.azure.communication.jobrouter.JobRouterAsyncClient.unassignJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.unassign", - "com.azure.communication.jobrouter.JobRouterClient": "AzureCommunicationRoutingService.JobRouterClient", - "com.azure.communication.jobrouter.JobRouterClient.acceptJobOffer": "ClientForAcsJobRouter.JobRouterRestClient.accept", - "com.azure.communication.jobrouter.JobRouterClient.acceptJobOfferWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.accept", - "com.azure.communication.jobrouter.JobRouterClient.cancelJob": "ClientForAcsJobRouter.JobRouterRestClient.cancel", - "com.azure.communication.jobrouter.JobRouterClient.cancelJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.cancel", - "com.azure.communication.jobrouter.JobRouterClient.closeJob": "ClientForAcsJobRouter.JobRouterRestClient.close", - "com.azure.communication.jobrouter.JobRouterClient.closeJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.close", - "com.azure.communication.jobrouter.JobRouterClient.completeJob": "ClientForAcsJobRouter.JobRouterRestClient.complete", - "com.azure.communication.jobrouter.JobRouterClient.completeJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.complete", - "com.azure.communication.jobrouter.JobRouterClient.declineJobOffer": "ClientForAcsJobRouter.JobRouterRestClient.decline", - "com.azure.communication.jobrouter.JobRouterClient.declineJobOfferWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.decline", - "com.azure.communication.jobrouter.JobRouterClient.deleteJob": "ClientForAcsJobRouter.JobRouterRestClient.deleteJob", - "com.azure.communication.jobrouter.JobRouterClient.deleteJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.deleteJob", - "com.azure.communication.jobrouter.JobRouterClient.deleteWorker": "ClientForAcsJobRouter.JobRouterRestClient.deleteWorker", - "com.azure.communication.jobrouter.JobRouterClient.deleteWorkerWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.deleteWorker", - "com.azure.communication.jobrouter.JobRouterClient.getJob": "ClientForAcsJobRouter.JobRouterRestClient.getJob", - "com.azure.communication.jobrouter.JobRouterClient.getJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.getJob", - "com.azure.communication.jobrouter.JobRouterClient.getQueuePosition": "ClientForAcsJobRouter.JobRouterRestClient.getQueuePosition", - "com.azure.communication.jobrouter.JobRouterClient.getQueuePositionWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.getQueuePosition", - "com.azure.communication.jobrouter.JobRouterClient.getQueueStatistics": "ClientForAcsJobRouter.JobRouterRestClient.getQueueStatistics", - "com.azure.communication.jobrouter.JobRouterClient.getQueueStatisticsWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.getQueueStatistics", - "com.azure.communication.jobrouter.JobRouterClient.getWorker": "ClientForAcsJobRouter.JobRouterRestClient.getWorker", - "com.azure.communication.jobrouter.JobRouterClient.getWorkerWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.getWorker", - "com.azure.communication.jobrouter.JobRouterClient.listJobs": "ClientForAcsJobRouter.JobRouterRestClient.listJobs", - "com.azure.communication.jobrouter.JobRouterClient.listWorkers": "ClientForAcsJobRouter.JobRouterRestClient.listWorkers", - "com.azure.communication.jobrouter.JobRouterClient.reclassifyJob": "ClientForAcsJobRouter.JobRouterRestClient.reclassify", - "com.azure.communication.jobrouter.JobRouterClient.reclassifyJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.reclassify", - "com.azure.communication.jobrouter.JobRouterClient.unassignJob": "ClientForAcsJobRouter.JobRouterRestClient.unassign", - "com.azure.communication.jobrouter.JobRouterClient.unassignJobWithResponse": "ClientForAcsJobRouter.JobRouterRestClient.unassign", - "com.azure.communication.jobrouter.JobRouterClientBuilder": "AzureCommunicationRoutingService.JobRouterClient", - "com.azure.communication.jobrouter.implementation.models.BestWorkerModeInternal": "AzureCommunicationRoutingService.BestWorkerMode", - "com.azure.communication.jobrouter.implementation.models.CancelExceptionActionInternal": "AzureCommunicationRoutingService.CancelExceptionAction", - "com.azure.communication.jobrouter.implementation.models.CancelJobOptionsInternal": "AzureCommunicationRoutingService.CancelJobOptions", - "com.azure.communication.jobrouter.implementation.models.CancelJobResultInternal": "AzureCommunicationRoutingService.CancelJobResult", - "com.azure.communication.jobrouter.implementation.models.ClassificationPolicyInternal": "AzureCommunicationRoutingService.ClassificationPolicy", - "com.azure.communication.jobrouter.implementation.models.CloseJobOptionsInternal": "AzureCommunicationRoutingService.CloseJobOptions", - "com.azure.communication.jobrouter.implementation.models.CloseJobResultInternal": "AzureCommunicationRoutingService.CloseJobResult", - "com.azure.communication.jobrouter.implementation.models.CompleteJobOptionsInternal": "AzureCommunicationRoutingService.CompleteJobOptions", - "com.azure.communication.jobrouter.implementation.models.CompleteJobResultInternal": "AzureCommunicationRoutingService.CompleteJobResult", - "com.azure.communication.jobrouter.implementation.models.ConditionalQueueSelectorAttachmentInternal": "AzureCommunicationRoutingService.ConditionalQueueSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.ConditionalWorkerSelectorAttachmentInternal": "AzureCommunicationRoutingService.ConditionalWorkerSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.DeclineJobOfferOptionsInternal": "AzureCommunicationRoutingService.DeclineJobOfferOptions", - "com.azure.communication.jobrouter.implementation.models.DeclineJobOfferResultInternal": "AzureCommunicationRoutingService.DeclineJobOfferResult", - "com.azure.communication.jobrouter.implementation.models.DirectMapRouterRuleInternal": "AzureCommunicationRoutingService.DirectMapRouterRule", - "com.azure.communication.jobrouter.implementation.models.DistributionModeInternal": "AzureCommunicationRoutingService.DistributionMode", - "com.azure.communication.jobrouter.implementation.models.DistributionPolicyInternal": "AzureCommunicationRoutingService.DistributionPolicy", - "com.azure.communication.jobrouter.implementation.models.ExceptionActionInternal": "AzureCommunicationRoutingService.ExceptionAction", - "com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal": "AzureCommunicationRoutingService.ExceptionPolicy", - "com.azure.communication.jobrouter.implementation.models.ExceptionRuleInternal": "AzureCommunicationRoutingService.ExceptionRule", - "com.azure.communication.jobrouter.implementation.models.ExceptionTriggerInternal": "AzureCommunicationRoutingService.ExceptionTrigger", - "com.azure.communication.jobrouter.implementation.models.ExpressionRouterRuleInternal": "AzureCommunicationRoutingService.ExpressionRouterRule", - "com.azure.communication.jobrouter.implementation.models.FunctionRouterRuleInternal": "AzureCommunicationRoutingService.FunctionRouterRule", - "com.azure.communication.jobrouter.implementation.models.JobMatchingModeInternal": "AzureCommunicationRoutingService.JobMatchingMode", - "com.azure.communication.jobrouter.implementation.models.LongestIdleModeInternal": "AzureCommunicationRoutingService.LongestIdleMode", - "com.azure.communication.jobrouter.implementation.models.ManualReclassifyExceptionActionInternal": "AzureCommunicationRoutingService.ManualReclassifyExceptionAction", - "com.azure.communication.jobrouter.implementation.models.PassThroughQueueSelectorAttachmentInternal": "AzureCommunicationRoutingService.PassThroughQueueSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.PassThroughWorkerSelectorAttachmentInternal": "AzureCommunicationRoutingService.PassThroughWorkerSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.QueueAndMatchModeInternal": "AzureCommunicationRoutingService.QueueAndMatchMode", - "com.azure.communication.jobrouter.implementation.models.QueueLengthExceptionTriggerInternal": "AzureCommunicationRoutingService.QueueLengthExceptionTrigger", - "com.azure.communication.jobrouter.implementation.models.QueueSelectorAttachmentInternal": "AzureCommunicationRoutingService.QueueSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.QueueWeightedAllocationInternal": "AzureCommunicationRoutingService.QueueWeightedAllocation", - "com.azure.communication.jobrouter.implementation.models.ReclassifyExceptionActionInternal": "AzureCommunicationRoutingService.ReclassifyExceptionAction", - "com.azure.communication.jobrouter.implementation.models.ReclassifyJobOptionsInternal": "AzureCommunicationRoutingService.ReclassifyJobOptions", - "com.azure.communication.jobrouter.implementation.models.ReclassifyJobResultInternal": "AzureCommunicationRoutingService.ReclassifyJobResult", - "com.azure.communication.jobrouter.implementation.models.RoundRobinModeInternal": "AzureCommunicationRoutingService.RoundRobinMode", - "com.azure.communication.jobrouter.implementation.models.RouterJobInternal": "AzureCommunicationRoutingService.RouterJob", - "com.azure.communication.jobrouter.implementation.models.RouterQueueInternal": "AzureCommunicationRoutingService.RouterQueue", - "com.azure.communication.jobrouter.implementation.models.RouterQueueSelectorInternal": "AzureCommunicationRoutingService.RouterQueueSelector", - "com.azure.communication.jobrouter.implementation.models.RouterQueueStatisticsInternal": "AzureCommunicationRoutingService.RouterQueueStatistics", - "com.azure.communication.jobrouter.implementation.models.RouterRuleInternal": "AzureCommunicationRoutingService.RouterRule", - "com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal": "AzureCommunicationRoutingService.RouterWorker", - "com.azure.communication.jobrouter.implementation.models.RouterWorkerSelectorInternal": "AzureCommunicationRoutingService.RouterWorkerSelector", - "com.azure.communication.jobrouter.implementation.models.RuleEngineQueueSelectorAttachmentInternal": "AzureCommunicationRoutingService.RuleEngineQueueSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.RuleEngineWorkerSelectorAttachmentInternal": "AzureCommunicationRoutingService.RuleEngineWorkerSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.ScheduleAndSuspendModeInternal": "AzureCommunicationRoutingService.ScheduleAndSuspendMode", - "com.azure.communication.jobrouter.implementation.models.StaticQueueSelectorAttachmentInternal": "AzureCommunicationRoutingService.StaticQueueSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.StaticRouterRuleInternal": "AzureCommunicationRoutingService.StaticRouterRule", - "com.azure.communication.jobrouter.implementation.models.StaticWorkerSelectorAttachmentInternal": "AzureCommunicationRoutingService.StaticWorkerSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.SuspendModeInternal": "AzureCommunicationRoutingService.SuspendMode", - "com.azure.communication.jobrouter.implementation.models.WaitTimeExceptionTriggerInternal": "AzureCommunicationRoutingService.WaitTimeExceptionTrigger", - "com.azure.communication.jobrouter.implementation.models.WebhookRouterRuleInternal": "AzureCommunicationRoutingService.WebhookRouterRule", - "com.azure.communication.jobrouter.implementation.models.WeightedAllocationQueueSelectorAttachmentInternal": "AzureCommunicationRoutingService.WeightedAllocationQueueSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.WeightedAllocationWorkerSelectorAttachmentInternal": "AzureCommunicationRoutingService.WeightedAllocationWorkerSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.WorkerSelectorAttachmentInternal": "AzureCommunicationRoutingService.WorkerSelectorAttachment", - "com.azure.communication.jobrouter.implementation.models.WorkerWeightedAllocationInternal": "AzureCommunicationRoutingService.WorkerWeightedAllocation", - "com.azure.communication.jobrouter.models.AcceptJobOfferResult": "AzureCommunicationRoutingService.AcceptJobOfferResult", - "com.azure.communication.jobrouter.models.DistributionModeKind": "AzureCommunicationRoutingService.DistributionModeKind", - "com.azure.communication.jobrouter.models.ExceptionActionKind": "AzureCommunicationRoutingService.ExceptionActionKind", - "com.azure.communication.jobrouter.models.ExceptionTriggerKind": "AzureCommunicationRoutingService.ExceptionTriggerKind", - "com.azure.communication.jobrouter.models.ExpressionRouterRuleLanguage": "AzureCommunicationRoutingService.ExpressionRouterRuleLanguage", - "com.azure.communication.jobrouter.models.FunctionRouterRuleCredential": "AzureCommunicationRoutingService.FunctionRouterRuleCredential", - "com.azure.communication.jobrouter.models.JobMatchingModeKind": "AzureCommunicationRoutingService.JobMatchingModeKind", - "com.azure.communication.jobrouter.models.LabelOperator": "AzureCommunicationRoutingService.LabelOperator", - "com.azure.communication.jobrouter.models.OAuth2WebhookClientCredential": "AzureCommunicationRoutingService.OAuth2WebhookClientCredential", - "com.azure.communication.jobrouter.models.QueueSelectorAttachmentKind": "AzureCommunicationRoutingService.QueueSelectorAttachmentKind", - "com.azure.communication.jobrouter.models.RouterChannel": "AzureCommunicationRoutingService.RouterChannel", - "com.azure.communication.jobrouter.models.RouterJobAssignment": "AzureCommunicationRoutingService.RouterJobAssignment", - "com.azure.communication.jobrouter.models.RouterJobNote": "AzureCommunicationRoutingService.RouterJobNote", - "com.azure.communication.jobrouter.models.RouterJobOffer": "AzureCommunicationRoutingService.RouterJobOffer", - "com.azure.communication.jobrouter.models.RouterJobPositionDetails": "AzureCommunicationRoutingService.RouterJobPositionDetails", - "com.azure.communication.jobrouter.models.RouterJobStatus": "AzureCommunicationRoutingService.RouterJobStatus", - "com.azure.communication.jobrouter.models.RouterJobStatusSelector": "AzureCommunicationRoutingService.RouterJobStatusSelector", - "com.azure.communication.jobrouter.models.RouterRuleKind": "AzureCommunicationRoutingService.RouterRuleKind", - "com.azure.communication.jobrouter.models.RouterWorkerAssignment": "AzureCommunicationRoutingService.RouterWorkerAssignment", - "com.azure.communication.jobrouter.models.RouterWorkerSelectorStatus": "AzureCommunicationRoutingService.RouterWorkerSelectorStatus", - "com.azure.communication.jobrouter.models.RouterWorkerState": "AzureCommunicationRoutingService.RouterWorkerState", - "com.azure.communication.jobrouter.models.RouterWorkerStateSelector": "AzureCommunicationRoutingService.RouterWorkerStateSelector", - "com.azure.communication.jobrouter.models.ScoringRuleOptions": "AzureCommunicationRoutingService.ScoringRuleOptions", - "com.azure.communication.jobrouter.models.ScoringRuleParameterSelector": "AzureCommunicationRoutingService.ScoringRuleParameterSelector", - "com.azure.communication.jobrouter.models.UnassignJobOptions": "AzureCommunicationRoutingService.UnassignJobOptions", - "com.azure.communication.jobrouter.models.UnassignJobResult": "AzureCommunicationRoutingService.UnassignJobResult", - "com.azure.communication.jobrouter.models.WorkerSelectorAttachmentKind": "AzureCommunicationRoutingService.WorkerSelectorAttachmentKind" - } -} diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyAsyncLiveTests.java index b180abf99367..797c85061c85 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyAsyncLiveTests.java @@ -4,18 +4,13 @@ package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.models.ClassificationPolicy; -import com.azure.communication.jobrouter.models.ConditionalQueueSelectorAttachment; -import com.azure.communication.jobrouter.models.ConditionalWorkerSelectorAttachment; import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions; import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions; -import com.azure.communication.jobrouter.models.CreateJobWithClassificationPolicyOptions; import com.azure.communication.jobrouter.models.CreateQueueOptions; import com.azure.communication.jobrouter.models.DistributionPolicy; import com.azure.communication.jobrouter.models.LabelOperator; import com.azure.communication.jobrouter.models.LongestIdleMode; -import com.azure.communication.jobrouter.models.PassThroughWorkerSelectorAttachment; import com.azure.communication.jobrouter.models.QueueSelectorAttachment; -import com.azure.communication.jobrouter.models.RouterJob; import com.azure.communication.jobrouter.models.RouterQueue; import com.azure.communication.jobrouter.models.RouterQueueSelector; import com.azure.communication.jobrouter.models.RouterValue; @@ -25,9 +20,6 @@ import com.azure.communication.jobrouter.models.StaticWorkerSelectorAttachment; import com.azure.communication.jobrouter.models.WorkerSelectorAttachment; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -38,21 +30,17 @@ import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class ClassificationPolicyAsyncLiveTests extends JobRouterTestBase { private JobRouterAdministrationAsyncClient administrationAsyncClient; - private JobRouterAsyncClient routerAsyncClient; @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void createClassificationPolicy(HttpClient httpClient) throws InterruptedException { + public void createClassificationPolicy(HttpClient httpClient) { // Setup - routerAsyncClient = getRouterAsyncClient(httpClient); administrationAsyncClient = getRouterAdministrationAsyncClient(httpClient); - String testName = "classification-policy-test-async"; - String distributionPolicyId = String.format("%s-%s-DistributionPolicy", JAVA_LIVE_TESTS, testName); + String distributionPolicyId = String.format("%s-DistributionPolicy", JAVA_LIVE_TESTS); + String distributionPolicyName = String.format("%s-Name", distributionPolicyId); CreateDistributionPolicyOptions createDistributionPolicyOptions = new CreateDistributionPolicyOptions( @@ -66,10 +54,9 @@ public void createClassificationPolicy(HttpClient httpClient) throws Interrupted DistributionPolicy distributionPolicy = administrationAsyncClient.createDistributionPolicy(createDistributionPolicyOptions).block(); - String queueId = String.format("%s-%s-Queue", JAVA_LIVE_TESTS, testName); - String fallbackQueueId = String.format("%s-%s-FallbackQueue", JAVA_LIVE_TESTS, testName); - String queueName = String.format("%s-Name", queueId); + String queueId = String.format("%s-Queue", JAVA_LIVE_TESTS); + String queueName = String.format("%s-Name", queueId); Map queueLabels = new HashMap() { { put("Label_1", new RouterValue("Value_1")); @@ -81,122 +68,57 @@ public void createClassificationPolicy(HttpClient httpClient) throws Interrupted .setName(queueName); RouterQueue jobQueue = administrationAsyncClient.createQueue(createQueueOptions).block(); - RouterQueue fallbackQueue = administrationAsyncClient.createQueue( - new CreateQueueOptions(fallbackQueueId, distributionPolicyId)).block(); - String classificationPolicyId = String.format("%s-%s-ClassificationPolicy", JAVA_LIVE_TESTS, testName); + String classificationPolicyId = String.format("%s-ClassificationPolicy", JAVA_LIVE_TESTS); String classificationPolicyName = String.format("%s-Name", classificationPolicyId); + /** + * Create queue selectors. + */ StaticQueueSelectorAttachment staticQueueSelector = new StaticQueueSelectorAttachment( - new RouterQueueSelector("Id", LabelOperator.EQUAL, new RouterValue(queueId))); + new RouterQueueSelector("queueId", LabelOperator.EQUAL) + .setValue(new RouterValue(queueId))); List queueSelectors = new ArrayList() { { add(staticQueueSelector); - add(new ConditionalQueueSelectorAttachment(new StaticRouterRule().setValue(new RouterValue(false)), new ArrayList() { - { - add(new RouterQueueSelector("Name", LabelOperator.NOT_EQUAL, new RouterValue(true))); - } - })); } }; + + /** + * Create worker selectors. + */ StaticWorkerSelectorAttachment staticWorkerSelector = new StaticWorkerSelectorAttachment( - new RouterWorkerSelector("key", LabelOperator.EQUAL, new RouterValue("value")) - .setExpedite(true).setExpiresAfter(Duration.ofSeconds(10))); + new RouterWorkerSelector("key", LabelOperator.EQUAL) + .setValue(new RouterValue("value"))); List workerSelectors = new ArrayList() { { add(staticWorkerSelector); - add(new ConditionalWorkerSelectorAttachment(new StaticRouterRule().setValue(new RouterValue(true)), - new ArrayList() { - { - add(new RouterWorkerSelector("Name", LabelOperator.NOT_EQUAL, new RouterValue(true))); - } - })); - add(new PassThroughWorkerSelectorAttachment("Key", LabelOperator.NOT_EQUAL)); } }; + /** + * Create classification policy + */ CreateClassificationPolicyOptions createClassificationPolicyOptions = new CreateClassificationPolicyOptions( classificationPolicyId) .setName(classificationPolicyName) .setPrioritizationRule(new StaticRouterRule().setValue(new RouterValue(1))) .setWorkerSelectors(workerSelectors) .setQueueSelectors(queueSelectors) - .setFallbackQueueId(fallbackQueue.getId()); - - String jobId = String.format("%s-%s-Job", JAVA_LIVE_TESTS, testName); - String channelId = String.format("%s-%s-Channel", JAVA_LIVE_TESTS, testName); + .setFallbackQueueId(jobQueue.getId()); // Action - ClassificationPolicy policy = administrationAsyncClient.createClassificationPolicy(createClassificationPolicyOptions).block(); - RouterJob job = routerAsyncClient.createJobWithClassificationPolicy( - new CreateJobWithClassificationPolicyOptions(jobId, channelId, classificationPolicyId) - .setLabels(new HashMap() { - { - put("Key", new RouterValue("abc")); - } - })).block(); - - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } + ClassificationPolicy result = administrationAsyncClient.createClassificationPolicy(createClassificationPolicyOptions).block(); // Verify - assertEquals(classificationPolicyId, policy.getId()); - assertEquals(classificationPolicyName, policy.getName()); - assertEquals(StaticRouterRule.class, policy.getPrioritizationRule().getClass()); - assertNotNull(policy.getEtag()); - assertEquals(1, ((StaticRouterRule) policy.getPrioritizationRule()).getValue().getIntValue()); - assertEquals(3, policy.getWorkerSelectorAttachments().size()); - assertEquals(Duration.ofSeconds(10), ((StaticWorkerSelectorAttachment) policy.getWorkerSelectorAttachments().get(0)).getWorkerSelector().getExpiresAfter()); - assertEquals(2, policy.getQueueSelectorAttachments().size()); - assertEquals(fallbackQueueId, policy.getFallbackQueueId()); - - Response binaryData = administrationAsyncClient.getClassificationPolicyWithResponse(policy.getId(), null).block(); - ClassificationPolicy deserialized = binaryData.getValue().toObject(ClassificationPolicy.class); - - assertEquals(classificationPolicyId, deserialized.getId()); - assertEquals(classificationPolicyName, deserialized.getName()); - assertEquals(StaticRouterRule.class, deserialized.getPrioritizationRule().getClass()); - assertEquals(policy.getEtag(), deserialized.getEtag()); - assertEquals(1, ((StaticRouterRule) deserialized.getPrioritizationRule()).getValue().getIntValue()); - assertEquals(3, deserialized.getWorkerSelectorAttachments().size()); - assertEquals(Duration.ofSeconds(10), ((StaticWorkerSelectorAttachment) deserialized.getWorkerSelectorAttachments().get(0)).getWorkerSelector().getExpiresAfter()); - assertEquals(2, deserialized.getQueueSelectorAttachments().size()); - assertEquals(fallbackQueueId, deserialized.getFallbackQueueId()); - - job = routerAsyncClient.getJob(job.getId()).block(); - - assertEquals(jobId, job.getId()); - assertEquals(classificationPolicyId, job.getClassificationPolicyId()); - assertEquals(queueId, job.getQueueId()); - assertEquals(channelId, job.getChannelId()); - assertEquals(1, job.getPriority()); - assertEquals(3, job.getAttachedWorkerSelectors().size()); - - deserialized.setPrioritizationRule(null); - deserialized.setQueueSelectorAttachments(new ArrayList<>()); - ClassificationPolicy updatedPolicy = administrationAsyncClient.updateClassificationPolicy( - deserialized.getId(), deserialized).block(); - - assertEquals(classificationPolicyId, updatedPolicy.getId()); - assertEquals(classificationPolicyName, updatedPolicy.getName()); - assertEquals(StaticRouterRule.class, updatedPolicy.getPrioritizationRule().getClass()); - assertNotEquals(policy.getEtag(), updatedPolicy.getEtag()); - assertEquals(1, ((StaticRouterRule) updatedPolicy.getPrioritizationRule()).getValue().getIntValue()); - assertEquals(3, updatedPolicy.getWorkerSelectorAttachments().size()); - assertEquals(Duration.ofSeconds(10), ((StaticWorkerSelectorAttachment) updatedPolicy.getWorkerSelectorAttachments().get(0)).getWorkerSelector().getExpiresAfter()); - assertEquals(0, updatedPolicy.getQueueSelectorAttachments().size()); - assertEquals(fallbackQueueId, updatedPolicy.getFallbackQueueId()); + assertEquals(classificationPolicyId, result.getId()); // Cleanup - routerAsyncClient.cancelJob(job.getId()).block(); - routerAsyncClient.deleteJob(job.getId()).block(); administrationAsyncClient.deleteClassificationPolicy(classificationPolicyId).block(); administrationAsyncClient.deleteQueue(queueId).block(); - administrationAsyncClient.deleteQueue(fallbackQueueId).block(); administrationAsyncClient.deleteDistributionPolicy(distributionPolicyId).block(); } } diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyLiveTests.java index 5639631436e9..2e06564f109c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyLiveTests.java @@ -4,16 +4,10 @@ package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.models.ClassificationPolicy; -import com.azure.communication.jobrouter.models.ConditionalQueueSelectorAttachment; -import com.azure.communication.jobrouter.models.ConditionalWorkerSelectorAttachment; import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions; -import com.azure.communication.jobrouter.models.CreateJobWithClassificationPolicyOptions; -import com.azure.communication.jobrouter.models.CreateQueueOptions; import com.azure.communication.jobrouter.models.DistributionPolicy; import com.azure.communication.jobrouter.models.LabelOperator; -import com.azure.communication.jobrouter.models.PassThroughWorkerSelectorAttachment; import com.azure.communication.jobrouter.models.QueueSelectorAttachment; -import com.azure.communication.jobrouter.models.RouterJob; import com.azure.communication.jobrouter.models.RouterQueue; import com.azure.communication.jobrouter.models.RouterQueueSelector; import com.azure.communication.jobrouter.models.RouterValue; @@ -23,148 +17,78 @@ import com.azure.communication.jobrouter.models.StaticWorkerSelectorAttachment; import com.azure.communication.jobrouter.models.WorkerSelectorAttachment; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import java.time.Duration; import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class ClassificationPolicyLiveTests extends JobRouterTestBase { private JobRouterAdministrationClient routerAdminClient; - private JobRouterClient routerClient; @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void createClassificationPolicy(HttpClient httpClient) throws InterruptedException { + public void createClassificationPolicy(HttpClient httpClient) { // Setup - routerClient = getRouterClient(httpClient); routerAdminClient = getRouterAdministrationClient(httpClient); - String testName = "classification-policy-test"; - String distributionPolicyId = String.format("%s-%s-DistributionPolicy", JAVA_LIVE_TESTS, testName); + String distributionPolicyId = String.format("%s-DistributionPolicy", JAVA_LIVE_TESTS); DistributionPolicy distributionPolicy = createDistributionPolicy(routerAdminClient, distributionPolicyId); - String queueId = String.format("%s-%s-Queue", JAVA_LIVE_TESTS, testName); - String fallbackQueueId = String.format("%s-%s-FallbackQueue", JAVA_LIVE_TESTS, testName); + String queueId = String.format("%s-Queue", JAVA_LIVE_TESTS); RouterQueue jobQueue = createQueue(routerAdminClient, queueId, distributionPolicy.getId()); - RouterQueue fallbackQueue = routerAdminClient.createQueue( - new CreateQueueOptions(fallbackQueueId, distributionPolicyId)); String classificationPolicyId = String.format("%s-ClassificationPolicy", JAVA_LIVE_TESTS); String classificationPolicyName = String.format("%s-Name", classificationPolicyId); + /** + * Create queue selectors. + */ StaticQueueSelectorAttachment staticQueueSelector = new StaticQueueSelectorAttachment( - new RouterQueueSelector("Id", LabelOperator.EQUAL, new RouterValue(queueId))); + new RouterQueueSelector("queueId", LabelOperator.EQUAL) + .setValue(new RouterValue(queueId))); List queueSelectors = new ArrayList() { { add(staticQueueSelector); - add(new ConditionalQueueSelectorAttachment(new StaticRouterRule().setValue(new RouterValue(false)), new ArrayList() { - { - add(new RouterQueueSelector("Name", LabelOperator.NOT_EQUAL, new RouterValue(true))); - } - })); } }; + + /** + * Create worker selectors. + */ StaticWorkerSelectorAttachment staticWorkerSelector = new StaticWorkerSelectorAttachment( - new RouterWorkerSelector("key", LabelOperator.EQUAL, new RouterValue("value")) - .setExpedite(true).setExpiresAfter(Duration.ofSeconds(10))); + new RouterWorkerSelector("key", LabelOperator.EQUAL) + .setValue(new RouterValue("value"))); List workerSelectors = new ArrayList() { { add(staticWorkerSelector); - add(new ConditionalWorkerSelectorAttachment(new StaticRouterRule().setValue(new RouterValue(true)), - new ArrayList() { - { - add(new RouterWorkerSelector("Name", LabelOperator.NOT_EQUAL, new RouterValue(true))); - } - })); - add(new PassThroughWorkerSelectorAttachment("Key", LabelOperator.NOT_EQUAL)); } }; + /** + * Create classification policy + */ CreateClassificationPolicyOptions createClassificationPolicyOptions = new CreateClassificationPolicyOptions( classificationPolicyId) .setName(classificationPolicyName) .setPrioritizationRule(new StaticRouterRule().setValue(new RouterValue(1))) .setWorkerSelectors(workerSelectors) .setQueueSelectors(queueSelectors) - .setFallbackQueueId(fallbackQueueId); - - String jobId = String.format("%s-%s-Job", JAVA_LIVE_TESTS, testName); - String channelId = String.format("%s-%s-Channel", JAVA_LIVE_TESTS, testName); + .setFallbackQueueId(jobQueue.getId()); // Action - ClassificationPolicy policy = routerAdminClient.createClassificationPolicy(createClassificationPolicyOptions); - RouterJob job = routerClient.createJobWithClassificationPolicy( - new CreateJobWithClassificationPolicyOptions(jobId, channelId, classificationPolicyId)); - - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } + ClassificationPolicy result = routerAdminClient.createClassificationPolicy(createClassificationPolicyOptions); // Verify - assertEquals(classificationPolicyId, policy.getId()); - assertEquals(classificationPolicyName, policy.getName()); - assertEquals(StaticRouterRule.class, policy.getPrioritizationRule().getClass()); - assertNotNull(policy.getEtag()); - assertEquals(1, ((StaticRouterRule) policy.getPrioritizationRule()).getValue().getIntValue()); - assertEquals(3, policy.getWorkerSelectorAttachments().size()); - assertEquals(Duration.ofSeconds(10), ((StaticWorkerSelectorAttachment) policy.getWorkerSelectorAttachments().get(0)).getWorkerSelector().getExpiresAfter()); - assertEquals(2, policy.getQueueSelectorAttachments().size()); - assertEquals(fallbackQueueId, policy.getFallbackQueueId()); - - Response binaryData = routerAdminClient.getClassificationPolicyWithResponse(policy.getId(), null); - ClassificationPolicy deserialized = binaryData.getValue().toObject(ClassificationPolicy.class); - - assertEquals(classificationPolicyId, deserialized.getId()); - assertEquals(classificationPolicyName, deserialized.getName()); - assertEquals(StaticRouterRule.class, deserialized.getPrioritizationRule().getClass()); - assertEquals(policy.getEtag(), deserialized.getEtag()); - assertEquals(1, ((StaticRouterRule) deserialized.getPrioritizationRule()).getValue().getIntValue()); - assertEquals(3, deserialized.getWorkerSelectorAttachments().size()); - assertEquals(Duration.ofSeconds(10), ((StaticWorkerSelectorAttachment) deserialized.getWorkerSelectorAttachments().get(0)).getWorkerSelector().getExpiresAfter()); - assertEquals(2, deserialized.getQueueSelectorAttachments().size()); - assertEquals(fallbackQueueId, deserialized.getFallbackQueueId()); - - job = routerClient.getJob(job.getId()); - - assertEquals(jobId, job.getId()); - assertEquals(classificationPolicyId, job.getClassificationPolicyId()); - assertEquals(queueId, job.getQueueId()); - assertEquals(channelId, job.getChannelId()); - assertEquals(1, job.getPriority()); - assertEquals(3, job.getAttachedWorkerSelectors().size()); - - deserialized.setPrioritizationRule(null); - deserialized.setQueueSelectorAttachments(new ArrayList<>()); - ClassificationPolicy updatedPolicy = routerAdminClient.updateClassificationPolicy( - deserialized.getId(), deserialized); - - assertEquals(classificationPolicyId, updatedPolicy.getId()); - assertEquals(classificationPolicyName, updatedPolicy.getName()); - assertEquals(StaticRouterRule.class, updatedPolicy.getPrioritizationRule().getClass()); - assertNotEquals(policy.getEtag(), updatedPolicy.getEtag()); - assertEquals(1, ((StaticRouterRule) updatedPolicy.getPrioritizationRule()).getValue().getIntValue()); - assertEquals(3, updatedPolicy.getWorkerSelectorAttachments().size()); - assertEquals(Duration.ofSeconds(10), ((StaticWorkerSelectorAttachment) updatedPolicy.getWorkerSelectorAttachments().get(0)).getWorkerSelector().getExpiresAfter()); - assertEquals(0, updatedPolicy.getQueueSelectorAttachments().size()); - assertEquals(fallbackQueueId, updatedPolicy.getFallbackQueueId()); + assertEquals(classificationPolicyId, result.getId()); // Cleanup - routerClient.cancelJob(job.getId()); - routerClient.deleteJob(job.getId()); routerAdminClient.deleteClassificationPolicy(classificationPolicyId); routerAdminClient.deleteQueue(queueId); - routerAdminClient.deleteQueue(fallbackQueueId); routerAdminClient.deleteDistributionPolicy(distributionPolicyId); } } diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/DistributionPolicyAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/DistributionPolicyAsyncLiveTests.java index 21edef0e9d72..3526e0e15095 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/DistributionPolicyAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/DistributionPolicyAsyncLiveTests.java @@ -5,34 +5,25 @@ import com.azure.communication.jobrouter.models.BestWorkerMode; import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions; -import com.azure.communication.jobrouter.models.DistributionModeKind; import com.azure.communication.jobrouter.models.DistributionPolicy; -import com.azure.communication.jobrouter.models.RouterValue; -import com.azure.communication.jobrouter.models.ScoringRuleOptions; -import com.azure.communication.jobrouter.models.ScoringRuleParameterSelector; -import com.azure.communication.jobrouter.models.StaticRouterRule; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import java.time.Duration; -import java.util.ArrayList; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class DistributionPolicyAsyncLiveTests extends JobRouterTestBase { private JobRouterAdministrationAsyncClient administrationAsyncClient; + @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void createDistributionPolicyBestWorkerDefaultScoringRule(HttpClient httpClient) { // Setup administrationAsyncClient = getRouterAdministrationAsyncClient(httpClient); - String bestWorkerModeDistributionPolicyId = String.format("%s-BestWorkerDefaultScoringRuleAsync-DistributionPolicy", JAVA_LIVE_TESTS); + String bestWorkerModeDistributionPolicyId = String.format("%s-BestWorkerDefaultScoringRule-DistributionPolicy", JAVA_LIVE_TESTS); String bestWorkerModeDistributionPolicyName = String.format("%s-Name", bestWorkerModeDistributionPolicyId); CreateDistributionPolicyOptions createDistributionPolicyOptions = new CreateDistributionPolicyOptions( @@ -41,72 +32,14 @@ public void createDistributionPolicyBestWorkerDefaultScoringRule(HttpClient http new BestWorkerMode() .setMinConcurrentOffers(1) .setMaxConcurrentOffers(10) - .setScoringRule(new StaticRouterRule().setValue(new RouterValue(5))) - .setBypassSelectors(true) - .setScoringRuleOptions(new ScoringRuleOptions() - .setBatchScoringEnabled(true) - .setScoringParameters(new ArrayList() { - { - add(ScoringRuleParameterSelector.JOB_LABELS); - } - }) - .setBatchSize(30) - .setDescendingOrder(true)) - ).setName(bestWorkerModeDistributionPolicyName); + ) + .setName(bestWorkerModeDistributionPolicyName); // Action DistributionPolicy result = administrationAsyncClient.createDistributionPolicy(createDistributionPolicyOptions).block(); // Verify assertEquals(bestWorkerModeDistributionPolicyId, result.getId()); - assertNotNull(result.getEtag()); - assertEquals(Duration.ofSeconds(10), result.getOfferExpiresAfter()); - assertEquals(DistributionModeKind.BEST_WORKER, result.getMode().getKind()); - assertEquals(bestWorkerModeDistributionPolicyName, result.getName()); - assertEquals(1, result.getMode().getMinConcurrentOffers()); - assertEquals(10, result.getMode().getMaxConcurrentOffers()); - assertEquals(true, result.getMode().isBypassSelectors()); - assertEquals(5, ((StaticRouterRule) ((BestWorkerMode) result.getMode()).getScoringRule()).getValue().getIntValue()); - assertEquals(30, ((BestWorkerMode) result.getMode()).getScoringRuleOptions().getBatchSize()); - assertEquals(true, ((BestWorkerMode) result.getMode()).getScoringRuleOptions().isDescendingOrder()); - assertEquals(true, ((BestWorkerMode) result.getMode()).getScoringRuleOptions().isBatchScoringEnabled()); - assertEquals(1, ((BestWorkerMode) result.getMode()).getScoringRuleOptions().getScoringParameters().size()); - - Response binaryResponse = administrationAsyncClient.getDistributionPolicyWithResponse(result.getId(), null).block(); - DistributionPolicy deserialized = binaryResponse.getValue().toObject(DistributionPolicy.class); - - assertEquals(bestWorkerModeDistributionPolicyId, deserialized.getId()); - assertEquals(result.getEtag(), deserialized.getEtag()); - assertEquals(Duration.ofSeconds(10), deserialized.getOfferExpiresAfter()); - assertEquals(DistributionModeKind.BEST_WORKER, deserialized.getMode().getKind()); - assertEquals(bestWorkerModeDistributionPolicyName, deserialized.getName()); - assertEquals(1, deserialized.getMode().getMinConcurrentOffers()); - assertEquals(10, deserialized.getMode().getMaxConcurrentOffers()); - assertEquals(true, deserialized.getMode().isBypassSelectors()); - assertEquals(5, ((StaticRouterRule) ((BestWorkerMode) deserialized.getMode()).getScoringRule()).getValue().getIntValue()); - assertEquals(30, ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().getBatchSize()); - assertEquals(true, ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().isDescendingOrder()); - assertEquals(true, ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().isBatchScoringEnabled()); - assertEquals(1, ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().getScoringParameters().size()); - - ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().setScoringParameters(new ArrayList<>()); - deserialized.setOfferExpiresAfter(Duration.ofMinutes(5)); - DistributionPolicy updatedPolicy = administrationAsyncClient.updateDistributionPolicy( - deserialized.getId(), deserialized).block(); - - assertEquals(bestWorkerModeDistributionPolicyId, updatedPolicy.getId()); - assertNotEquals(result.getEtag(), updatedPolicy.getEtag()); - assertEquals(Duration.ofMinutes(5), updatedPolicy.getOfferExpiresAfter()); - assertEquals(DistributionModeKind.BEST_WORKER, updatedPolicy.getMode().getKind()); - assertEquals(bestWorkerModeDistributionPolicyName, updatedPolicy.getName()); - assertEquals(1, updatedPolicy.getMode().getMinConcurrentOffers()); - assertEquals(10, updatedPolicy.getMode().getMaxConcurrentOffers()); - assertEquals(true, updatedPolicy.getMode().isBypassSelectors()); - assertEquals(5, ((StaticRouterRule) ((BestWorkerMode) updatedPolicy.getMode()).getScoringRule()).getValue().getIntValue()); - assertEquals(30, ((BestWorkerMode) updatedPolicy.getMode()).getScoringRuleOptions().getBatchSize()); - assertEquals(true, ((BestWorkerMode) updatedPolicy.getMode()).getScoringRuleOptions().isDescendingOrder()); - assertEquals(true, ((BestWorkerMode) updatedPolicy.getMode()).getScoringRuleOptions().isBatchScoringEnabled()); - assertEquals(0, ((BestWorkerMode) updatedPolicy.getMode()).getScoringRuleOptions().getScoringParameters().size()); // Cleanup administrationAsyncClient.deleteDistributionPolicy(bestWorkerModeDistributionPolicyId).block(); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/DistributionPolicyLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/DistributionPolicyLiveTests.java index c05f1b5a918b..cceb41df40eb 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/DistributionPolicyLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/DistributionPolicyLiveTests.java @@ -5,28 +5,18 @@ import com.azure.communication.jobrouter.models.BestWorkerMode; import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions; -import com.azure.communication.jobrouter.models.DistributionModeKind; import com.azure.communication.jobrouter.models.DistributionPolicy; import com.azure.communication.jobrouter.models.FunctionRouterRule; import com.azure.communication.jobrouter.models.FunctionRouterRuleCredential; import com.azure.communication.jobrouter.models.LongestIdleMode; import com.azure.communication.jobrouter.models.RoundRobinMode; -import com.azure.communication.jobrouter.models.RouterValue; -import com.azure.communication.jobrouter.models.ScoringRuleOptions; -import com.azure.communication.jobrouter.models.ScoringRuleParameterSelector; -import com.azure.communication.jobrouter.models.StaticRouterRule; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import java.time.Duration; -import java.util.ArrayList; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class DistributionPolicyLiveTests extends JobRouterTestBase { private JobRouterAdministrationClient routerAdminClient; @@ -45,17 +35,6 @@ public void createDistributionPolicyBestWorkerDefaultScoringRule(HttpClient http new BestWorkerMode() .setMinConcurrentOffers(1) .setMaxConcurrentOffers(10) - .setScoringRule(new StaticRouterRule().setValue(new RouterValue(5))) - .setBypassSelectors(true) - .setScoringRuleOptions(new ScoringRuleOptions() - .setBatchScoringEnabled(true) - .setScoringParameters(new ArrayList() { - { - add(ScoringRuleParameterSelector.JOB_LABELS); - } - }) - .setBatchSize(30) - .setDescendingOrder(true)) ) .setName(bestWorkerModeDistributionPolicyName); @@ -64,54 +43,6 @@ public void createDistributionPolicyBestWorkerDefaultScoringRule(HttpClient http // Verify assertEquals(bestWorkerModeDistributionPolicyId, result.getId()); - assertNotNull(result.getEtag()); - assertEquals(Duration.ofSeconds(10), result.getOfferExpiresAfter()); - assertEquals(DistributionModeKind.BEST_WORKER, result.getMode().getKind()); - assertEquals(bestWorkerModeDistributionPolicyName, result.getName()); - assertEquals(1, result.getMode().getMinConcurrentOffers()); - assertEquals(10, result.getMode().getMaxConcurrentOffers()); - assertEquals(true, result.getMode().isBypassSelectors()); - assertEquals(5, ((StaticRouterRule) ((BestWorkerMode) result.getMode()).getScoringRule()).getValue().getIntValue()); - assertEquals(30, ((BestWorkerMode) result.getMode()).getScoringRuleOptions().getBatchSize()); - assertEquals(true, ((BestWorkerMode) result.getMode()).getScoringRuleOptions().isDescendingOrder()); - assertEquals(true, ((BestWorkerMode) result.getMode()).getScoringRuleOptions().isBatchScoringEnabled()); - assertEquals(1, ((BestWorkerMode) result.getMode()).getScoringRuleOptions().getScoringParameters().size()); - - Response binaryResponse = routerAdminClient.getDistributionPolicyWithResponse(result.getId(), null); - DistributionPolicy deserialized = binaryResponse.getValue().toObject(DistributionPolicy.class); - - assertEquals(bestWorkerModeDistributionPolicyId, deserialized.getId()); - assertEquals(result.getEtag(), deserialized.getEtag()); - assertEquals(Duration.ofSeconds(10), deserialized.getOfferExpiresAfter()); - assertEquals(DistributionModeKind.BEST_WORKER, deserialized.getMode().getKind()); - assertEquals(bestWorkerModeDistributionPolicyName, deserialized.getName()); - assertEquals(1, deserialized.getMode().getMinConcurrentOffers()); - assertEquals(10, deserialized.getMode().getMaxConcurrentOffers()); - assertEquals(true, deserialized.getMode().isBypassSelectors()); - assertEquals(5, ((StaticRouterRule) ((BestWorkerMode) deserialized.getMode()).getScoringRule()).getValue().getIntValue()); - assertEquals(30, ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().getBatchSize()); - assertEquals(true, ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().isDescendingOrder()); - assertEquals(true, ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().isBatchScoringEnabled()); - assertEquals(1, ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().getScoringParameters().size()); - - ((BestWorkerMode) deserialized.getMode()).getScoringRuleOptions().setScoringParameters(new ArrayList<>()); - deserialized.setOfferExpiresAfter(Duration.ofMinutes(5)); - DistributionPolicy updatedPolicy = routerAdminClient.updateDistributionPolicy( - deserialized.getId(), deserialized); - - assertEquals(bestWorkerModeDistributionPolicyId, updatedPolicy.getId()); - assertNotEquals(result.getEtag(), updatedPolicy.getEtag()); - assertEquals(Duration.ofMinutes(5), updatedPolicy.getOfferExpiresAfter()); - assertEquals(DistributionModeKind.BEST_WORKER, updatedPolicy.getMode().getKind()); - assertEquals(bestWorkerModeDistributionPolicyName, updatedPolicy.getName()); - assertEquals(1, updatedPolicy.getMode().getMinConcurrentOffers()); - assertEquals(10, updatedPolicy.getMode().getMaxConcurrentOffers()); - assertEquals(true, updatedPolicy.getMode().isBypassSelectors()); - assertEquals(5, ((StaticRouterRule) ((BestWorkerMode) updatedPolicy.getMode()).getScoringRule()).getValue().getIntValue()); - assertEquals(30, ((BestWorkerMode) updatedPolicy.getMode()).getScoringRuleOptions().getBatchSize()); - assertEquals(true, ((BestWorkerMode) updatedPolicy.getMode()).getScoringRuleOptions().isDescendingOrder()); - assertEquals(true, ((BestWorkerMode) updatedPolicy.getMode()).getScoringRuleOptions().isBatchScoringEnabled()); - assertEquals(0, ((BestWorkerMode) updatedPolicy.getMode()).getScoringRuleOptions().getScoringParameters().size()); // Cleanup routerAdminClient.deleteDistributionPolicy(bestWorkerModeDistributionPolicyId); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ExceptionPolicyAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ExceptionPolicyAsyncLiveTests.java index 627f06fe6ff1..78e99d943b60 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ExceptionPolicyAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ExceptionPolicyAsyncLiveTests.java @@ -8,27 +8,15 @@ import com.azure.communication.jobrouter.models.ExceptionAction; import com.azure.communication.jobrouter.models.ExceptionPolicy; import com.azure.communication.jobrouter.models.ExceptionRule; -import com.azure.communication.jobrouter.models.LabelOperator; -import com.azure.communication.jobrouter.models.ManualReclassifyExceptionAction; import com.azure.communication.jobrouter.models.QueueLengthExceptionTrigger; -import com.azure.communication.jobrouter.models.ReclassifyExceptionAction; -import com.azure.communication.jobrouter.models.RouterValue; -import com.azure.communication.jobrouter.models.RouterWorkerSelector; -import com.azure.communication.jobrouter.models.WaitTimeExceptionTrigger; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import java.time.Duration; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class ExceptionPolicyAsyncLiveTests extends JobRouterTestBase { private JobRouterAdministrationAsyncClient administrationAsyncClient; @@ -38,7 +26,7 @@ public class ExceptionPolicyAsyncLiveTests extends JobRouterTestBase { public void createExceptionPolicy(HttpClient httpClient) { // Setup administrationAsyncClient = getRouterAdministrationAsyncClient(httpClient); - String exceptionPolicyId = String.format("%s-CreateExceptionPolicyAsync-ExceptionPolicy", JAVA_LIVE_TESTS); + String exceptionPolicyId = String.format("%s-CreateExceptionPolicy-ExceptionPolicy", JAVA_LIVE_TESTS); String exceptionPolicyName = String.format("%s-Name", exceptionPolicyId); CancelExceptionAction exceptionAction = new CancelExceptionAction() @@ -48,11 +36,6 @@ public void createExceptionPolicy(HttpClient httpClient) { List exceptionActions = new ArrayList() { { add(exceptionAction); - add(new ManualReclassifyExceptionAction().setPriority(5).setWorkerSelectors(new ArrayList() { - { - add(new RouterWorkerSelector("IntValue", LabelOperator.EQUAL, new RouterValue(5))); - } - })); } }; @@ -61,15 +44,6 @@ public void createExceptionPolicy(HttpClient httpClient) { List exceptionRules = new ArrayList() { { add(exceptionRule); - add(new ExceptionRule("rule2", new WaitTimeExceptionTrigger(Duration.ofSeconds(100)), new ArrayList() { - { - add(new ReclassifyExceptionAction().setLabelsToUpsert(new HashMap() { - { - put("Label1", new RouterValue(true)); - } - })); - } - })); } }; @@ -82,30 +56,6 @@ public void createExceptionPolicy(HttpClient httpClient) { // Verify assertEquals(exceptionPolicyId, result.getId()); - assertEquals(exceptionPolicyName, result.getName()); - assertNotNull(result.getEtag()); - assertEquals(2, result.getExceptionRules().size()); - assertEquals(2, result.getExceptionRules().get(0).getActions().size()); - assertEquals(1, result.getExceptionRules().get(1).getActions().size()); - - Response binaryResponse = administrationAsyncClient.getExceptionPolicyWithResponse(result.getId(), null).block(); - ExceptionPolicy deserialized = binaryResponse.getValue().toObject(ExceptionPolicy.class); - - assertEquals(exceptionPolicyId, deserialized.getId()); - assertEquals(exceptionPolicyName, deserialized.getName()); - assertEquals(result.getEtag(), deserialized.getEtag()); - assertEquals(2, deserialized.getExceptionRules().size()); - assertEquals(2, deserialized.getExceptionRules().get(0).getActions().size()); - assertEquals(1, deserialized.getExceptionRules().get(1).getActions().size()); - - deserialized.setExceptionRules(new ArrayList<>()); - ExceptionPolicy updatedPolicy = administrationAsyncClient.updateExceptionPolicy( - deserialized.getId(), deserialized).block(); - - assertEquals(exceptionPolicyId, updatedPolicy.getId()); - assertEquals(exceptionPolicyName, updatedPolicy.getName()); - assertNotEquals(result.getEtag(), updatedPolicy.getEtag()); - assertEquals(0, deserialized.getExceptionRules().size()); // Cleanup administrationAsyncClient.deleteExceptionPolicy(exceptionPolicyId).block(); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ExceptionPolicyLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ExceptionPolicyLiveTests.java index 05a2613b46fc..e928983918b4 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ExceptionPolicyLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ExceptionPolicyLiveTests.java @@ -8,27 +8,15 @@ import com.azure.communication.jobrouter.models.ExceptionAction; import com.azure.communication.jobrouter.models.ExceptionPolicy; import com.azure.communication.jobrouter.models.ExceptionRule; -import com.azure.communication.jobrouter.models.LabelOperator; -import com.azure.communication.jobrouter.models.ManualReclassifyExceptionAction; import com.azure.communication.jobrouter.models.QueueLengthExceptionTrigger; -import com.azure.communication.jobrouter.models.ReclassifyExceptionAction; -import com.azure.communication.jobrouter.models.RouterValue; -import com.azure.communication.jobrouter.models.RouterWorkerSelector; -import com.azure.communication.jobrouter.models.WaitTimeExceptionTrigger; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import java.time.Duration; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class ExceptionPolicyLiveTests extends JobRouterTestBase { private JobRouterAdministrationClient routerAdminClient; @@ -48,11 +36,6 @@ public void createExceptionPolicy(HttpClient httpClient) { List exceptionActions = new ArrayList() { { add(exceptionAction); - add(new ManualReclassifyExceptionAction().setPriority(5).setWorkerSelectors(new ArrayList() { - { - add(new RouterWorkerSelector("IntValue", LabelOperator.EQUAL, new RouterValue(5))); - } - })); } }; @@ -61,50 +44,18 @@ public void createExceptionPolicy(HttpClient httpClient) { List exceptionRules = new ArrayList() { { add(exceptionRule); - add(new ExceptionRule("rule2", new WaitTimeExceptionTrigger(Duration.ofSeconds(100)), new ArrayList() { - { - add(new ReclassifyExceptionAction().setLabelsToUpsert(new HashMap() { - { - put("Label1", new RouterValue(true)); - } - })); - } - })); } }; CreateExceptionPolicyOptions createExceptionPolicyOptions = new CreateExceptionPolicyOptions( - exceptionPolicyId, exceptionRules).setName(exceptionPolicyName); + exceptionPolicyId, exceptionRules) + .setName(exceptionPolicyName); // Action ExceptionPolicy result = routerAdminClient.createExceptionPolicy(createExceptionPolicyOptions); // Verify assertEquals(exceptionPolicyId, result.getId()); - assertEquals(exceptionPolicyName, result.getName()); - assertNotNull(result.getEtag()); - assertEquals(2, result.getExceptionRules().size()); - assertEquals(2, result.getExceptionRules().get(0).getActions().size()); - assertEquals(1, result.getExceptionRules().get(1).getActions().size()); - - Response binaryResponse = routerAdminClient.getExceptionPolicyWithResponse(result.getId(), null); - ExceptionPolicy deserialized = binaryResponse.getValue().toObject(ExceptionPolicy.class); - - assertEquals(exceptionPolicyId, deserialized.getId()); - assertEquals(exceptionPolicyName, deserialized.getName()); - assertEquals(result.getEtag(), deserialized.getEtag()); - assertEquals(2, deserialized.getExceptionRules().size()); - assertEquals(2, deserialized.getExceptionRules().get(0).getActions().size()); - assertEquals(1, deserialized.getExceptionRules().get(1).getActions().size()); - - deserialized.setExceptionRules(new ArrayList<>()); - ExceptionPolicy updatedPolicy = routerAdminClient.updateExceptionPolicy( - deserialized.getId(), deserialized); - - assertEquals(exceptionPolicyId, updatedPolicy.getId()); - assertEquals(exceptionPolicyName, updatedPolicy.getName()); - assertNotEquals(result.getEtag(), updatedPolicy.getEtag()); - assertEquals(0, deserialized.getExceptionRules().size()); // Cleanup routerAdminClient.deleteExceptionPolicy(exceptionPolicyId); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/JobRouterTestBase.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/JobRouterTestBase.java index da667ea93815..048f894290c8 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/JobRouterTestBase.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/JobRouterTestBase.java @@ -45,7 +45,7 @@ class JobRouterTestBase extends TestProxyTestBase { protected String getConnectionString() { String connectionString = interceptorManager.isPlaybackMode() ? "endpoint=https://REDACTED.int.communication.azure.net;accessKey=secret" - : Configuration.getGlobalConfiguration().get("COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING"); + : Configuration.getGlobalConfiguration().get("AZURE_TEST_JOBROUTER_CONNECTION_STRING"); Objects.requireNonNull(connectionString); return connectionString; } @@ -151,7 +151,7 @@ protected DistributionPolicy createDistributionPolicy(JobRouterAdministrationCli CreateDistributionPolicyOptions createDistributionPolicyOptions = new CreateDistributionPolicyOptions( id, - Duration.ofSeconds(100), + Duration.ofSeconds(10), new LongestIdleMode() .setMinConcurrentOffers(1) .setMaxConcurrentOffers(10) @@ -168,7 +168,8 @@ protected RouterJob createJob(JobRouterClient jobRouterClient, String queueId) { .setRequestedWorkerSelectors( new ArrayList() { { - new RouterWorkerSelector("Some-skill", LabelOperator.GREATER_THAN, new RouterValue(10)); + new RouterWorkerSelector("Some-skill", LabelOperator.GREATER_THAN) + .setValue(new RouterValue(10)); } } ); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobAsyncLiveTests.java index 92e21536b168..a1a522361c37 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobAsyncLiveTests.java @@ -14,29 +14,24 @@ import com.azure.communication.jobrouter.models.LongestIdleMode; import com.azure.communication.jobrouter.models.RouterChannel; import com.azure.communication.jobrouter.models.RouterJob; -import com.azure.communication.jobrouter.models.RouterJobNote; import com.azure.communication.jobrouter.models.RouterJobOffer; import com.azure.communication.jobrouter.models.RouterQueue; -import com.azure.communication.jobrouter.models.RouterQueueStatistics; import com.azure.communication.jobrouter.models.RouterValue; import com.azure.communication.jobrouter.models.RouterWorker; import com.azure.communication.jobrouter.models.RouterWorkerSelector; import com.azure.communication.jobrouter.models.UnassignJobResult; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; -import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; public class RouterJobAsyncLiveTests extends JobRouterTestBase { @@ -44,144 +39,93 @@ public class RouterJobAsyncLiveTests extends JobRouterTestBase { private JobRouterAdministrationAsyncClient administrationAsyncClient; - @ParameterizedTest +// @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void unassignJob(HttpClient httpClient) throws InterruptedException { + public void unassignJob(HttpClient httpClient) { // Setup jobRouterAsyncClient = getRouterAsyncClient(httpClient); administrationAsyncClient = getRouterAdministrationAsyncClient(httpClient); - String testName = "unassign-job-async-test"; - + String testName = "unassign-job-test"; + /** + * Setup queue + */ String distributionPolicyId = String.format("%s-%s-DistributionPolicy", JAVA_LIVE_TESTS, testName); - DistributionPolicy distributionPolicy = administrationAsyncClient.createDistributionPolicy( - new CreateDistributionPolicyOptions(distributionPolicyId, Duration.ofSeconds(100), new LongestIdleMode())).block(); + String distributionPolicyName = String.format("%s-Name", distributionPolicyId); + + CreateDistributionPolicyOptions createDistributionPolicyOptions = new CreateDistributionPolicyOptions( + distributionPolicyId, + Duration.ofSeconds(10), + new LongestIdleMode() + .setMinConcurrentOffers(1) + .setMaxConcurrentOffers(10) + ) + .setName(distributionPolicyName); + DistributionPolicy distributionPolicy = administrationAsyncClient.createDistributionPolicy(createDistributionPolicyOptions).block(); String queueId = String.format("%s-%s-Queue", JAVA_LIVE_TESTS, testName); - RouterQueue jobQueue = administrationAsyncClient.createQueue(new CreateQueueOptions(queueId, distributionPolicy.getId())).block(); - String workerId = String.format("%s-%s-Worker", JAVA_LIVE_TESTS, testName); - String channelId = String.format("%s-%s-Channel", JAVA_LIVE_TESTS, testName); - - RouterWorker createdWorker = jobRouterAsyncClient.createWorker(new CreateWorkerOptions(workerId, 10) - .setLabels(new HashMap() { - { - put("IntKey", new RouterValue(4)); - put("BoolKey", new RouterValue(true)); - put("StringLabel", new RouterValue("test")); - } - }) - .setTags(new HashMap() { - { - put("IntTag", new RouterValue(5)); - put("BoolTag", new RouterValue(false)); - put("StringTag", new RouterValue("test2")); - } - }) - .setAvailableForOffers(true) - .setChannels(new ArrayList() { - { - add(new RouterChannel(channelId, 1)); - } - }) - .setQueues(new ArrayList() { - { - add(jobQueue.getId()); - } - })).block(); + String queueName = String.format("%s-Name", queueId); + Map queueLabels = new HashMap() { + { + put("Label_1", new RouterValue("Value_1")); + } + }; + + CreateQueueOptions createQueueOptions = new CreateQueueOptions(queueId, distributionPolicyId) + .setLabels(queueLabels) + .setName(queueName); + RouterQueue jobQueue = administrationAsyncClient.createQueue(createQueueOptions).block(); + + /** + * Setup worker + */ + Map labels = new HashMap() { + { + put("Label", new RouterValue("Value")); + } + }; - String jobId = String.format("%s-%s-Job", JAVA_LIVE_TESTS, testName); - CreateJobOptions createJobOptions = new CreateJobOptions(jobId, channelId, queueId) - .setLabels(new HashMap() { - { - put("IntLabel", new RouterValue(10)); - put("BoolLabel", new RouterValue(true)); - put("StringLabel", new RouterValue("test")); - put("DoubleValue", new RouterValue(5.3)); - } - }) - .setTags(new HashMap() { - { - put("IntTag", new RouterValue(5)); - put("BoolTag", new RouterValue(false)); - put("StringTag", new RouterValue("test2")); - } - }) - .setRequestedWorkerSelectors(new ArrayList() { - { - add(new RouterWorkerSelector("IntKey", LabelOperator.GREATER_THAN, new RouterValue(2)) - .setExpedite(true).setExpiresAfter(Duration.ofSeconds(100))); - add(new RouterWorkerSelector("BoolKey", LabelOperator.EQUAL, new RouterValue(true))); - } - }) - .setNotes(new ArrayList() { - { - add(new RouterJobNote("Note1")); - } - }) - .setDispositionCode("code1") - .setChannelReference("ref") - .setPriority(5); - - RouterJob job = jobRouterAsyncClient.createJob(createJobOptions).block(); + Map tags = new HashMap() { + { + put("Tag", new RouterValue("Value")); + } + }; - // Verify - assertEquals(jobId, job.getId()); - assertNotNull(job.getEtag()); - assertEquals(4, job.getLabels().size()); - assertEquals(3, job.getTags().size()); - assertEquals(1, job.getNotes().size()); - assertEquals("code1", job.getDispositionCode()); - assertEquals("ref", job.getChannelReference()); - assertEquals(5, job.getPriority()); - assertEquals(2, job.getRequestedWorkerSelectors().size()); - assertEquals(Duration.ofSeconds(100), job.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - - Response jobResponse = jobRouterAsyncClient.getJobWithResponse(job.getId(), null).block(); - RouterJob jobDeserialized = jobResponse.getValue().toObject(RouterJob.class); + RouterChannel channel = new RouterChannel("router-channel", 1); + List channels = new ArrayList() { + { + add(channel); + } + }; - // Verify - assertEquals(jobId, jobDeserialized.getId()); - assertNotNull(jobDeserialized.getEtag()); - assertEquals(4, jobDeserialized.getLabels().size()); - assertEquals(3, jobDeserialized.getTags().size()); - assertEquals(1, jobDeserialized.getNotes().size()); - assertEquals("code1", jobDeserialized.getDispositionCode()); - assertEquals("ref", jobDeserialized.getChannelReference()); - assertEquals(5, jobDeserialized.getPriority()); - assertEquals(2, jobDeserialized.getRequestedWorkerSelectors().size()); - assertEquals(Duration.ofSeconds(100), jobDeserialized.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } + List queues = new ArrayList() { + { + add(jobQueue.getId()); + } + }; + + String workerId = String.format("%s-%s-Worker", JAVA_LIVE_TESTS, testName); + CreateWorkerOptions createWorkerOptions = new CreateWorkerOptions(workerId, 10) + .setLabels(labels) + .setTags(tags) + .setAvailableForOffers(true) + .setChannels(channels) + .setQueues(queues); - jobDeserialized.setPriority(10); - RouterJob updatedJob = jobRouterAsyncClient.updateJob(jobId, jobDeserialized).block(); + RouterWorker routerWorker = jobRouterAsyncClient.createWorker(createWorkerOptions).block(); - // Verify - assertEquals(jobId, updatedJob.getId()); - assertNotNull(updatedJob.getEtag()); - assertEquals(4, updatedJob.getLabels().size()); - assertEquals(3, updatedJob.getTags().size()); - assertEquals(1, updatedJob.getNotes().size()); - assertEquals("code1", updatedJob.getDispositionCode()); - assertEquals("ref", updatedJob.getChannelReference()); - assertEquals(10, updatedJob.getPriority()); - assertEquals(2, updatedJob.getRequestedWorkerSelectors().size()); - assertEquals(Duration.ofSeconds(100), updatedJob.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - - jobRouterAsyncClient.listJobs(null, queueId, channelId, null, null, null) - .subscribe(listJob -> { - assertEquals(jobId, listJob.getId()); - assertNotNull(listJob.getEtag()); - assertEquals(4, listJob.getLabels().size()); - assertEquals(3, listJob.getTags().size()); - assertEquals(1, listJob.getNotes().size()); - assertEquals("code1", listJob.getDispositionCode()); - assertEquals("ref", listJob.getChannelReference()); - assertEquals(10, listJob.getPriority()); - assertEquals(2, listJob.getRequestedWorkerSelectors().size()); - assertEquals(Duration.ofSeconds(100), listJob.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - }); + String jobId = String.format("%s-%s-Job", JAVA_LIVE_TESTS, testName); + List requestedWorkerSelectors = new ArrayList() { + { + add(new RouterWorkerSelector("Label", LabelOperator.EQUAL) + .setValue(new RouterValue("Value"))); + } + }; + CreateJobOptions createJobOptions = new CreateJobOptions(jobId, channel.getChannelId(), queueId) + .setLabels(labels) + .setTags(tags) + .setRequestedWorkerSelectors(requestedWorkerSelectors); + + RouterJob routerJob = jobRouterAsyncClient.createJob(createJobOptions).block(); List jobOffers = new ArrayList(); long startTimeMillis = System.currentTimeMillis(); @@ -193,7 +137,7 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { } } - assertEquals(1, jobOffers.size()); + assertTrue(jobOffers.size() == 1); RouterJobOffer offer = jobOffers.get(0); @@ -205,40 +149,17 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { UnassignJobResult unassignJobResult = jobRouterAsyncClient.unassignJob(jobId, assignmentId).block(); // Verify - assertTrue(unassignJobResult.getUnassignmentCount() > 0); - - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } - - RouterQueueStatistics queueStatistics = jobRouterAsyncClient.getQueueStatistics(queueId).block(); - - // Verify - assertEquals(queueId, queueStatistics.getQueueId()); - assertEquals(1, queueStatistics.getLength()); - assertTrue(queueStatistics.getLongestJobWaitTimeMinutes() > 0); - assertTrue(queueStatistics.getEstimatedWaitTime().get(10).getSeconds() > 0); - - RouterQueueStatistics deserialized = jobRouterAsyncClient.getQueueStatisticsWithResponse(queueId, null) - .block().getValue().toObject(RouterQueueStatistics.class); - assertEquals(queueId, deserialized.getQueueId()); - assertEquals(1, deserialized.getLength()); - assertTrue(deserialized.getLongestJobWaitTimeMinutes() > 0); - assertTrue(deserialized.getEstimatedWaitTime().get(10).getSeconds() > 0); + assertEquals(1, unassignJobResult.getUnassignmentCount()); RequestOptions requestOptions = new RequestOptions(); CancelJobOptions cancelJobOptions = new CancelJobOptions() .setDispositionCode("dispositionCode") .setNote("note"); requestOptions.setBody(BinaryData.fromObject(cancelJobOptions)); - // Cleanup jobRouterAsyncClient.cancelJob(jobId, requestOptions).block(); jobRouterAsyncClient.deleteJob(jobId).block(); jobRouterAsyncClient.deleteWorker(workerId).block(); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } administrationAsyncClient.deleteQueue(queueId).block(); administrationAsyncClient.deleteDistributionPolicy(distributionPolicyId).block(); } diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobLiveTests.java index 23447f8edab1..7fc272aae413 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobLiveTests.java @@ -8,37 +8,29 @@ import com.azure.communication.jobrouter.models.CreateJobOptions; import com.azure.communication.jobrouter.models.CreateWorkerOptions; import com.azure.communication.jobrouter.models.DistributionPolicy; -import com.azure.communication.jobrouter.models.LabelOperator; import com.azure.communication.jobrouter.models.QueueAndMatchMode; import com.azure.communication.jobrouter.models.RouterChannel; import com.azure.communication.jobrouter.models.RouterJob; -import com.azure.communication.jobrouter.models.RouterJobNote; import com.azure.communication.jobrouter.models.RouterJobOffer; import com.azure.communication.jobrouter.models.RouterJobStatus; import com.azure.communication.jobrouter.models.RouterQueue; -import com.azure.communication.jobrouter.models.RouterQueueStatistics; import com.azure.communication.jobrouter.models.RouterValue; import com.azure.communication.jobrouter.models.RouterWorker; -import com.azure.communication.jobrouter.models.RouterWorkerSelector; import com.azure.communication.jobrouter.models.ScheduleAndSuspendMode; import com.azure.communication.jobrouter.models.UnassignJobResult; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; -import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import java.time.Duration; import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; public class RouterJobLiveTests extends JobRouterTestBase { @@ -46,142 +38,64 @@ public class RouterJobLiveTests extends JobRouterTestBase { private JobRouterAdministrationClient routerAdminClient; - @ParameterizedTest +// @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void unassignJob(HttpClient httpClient) throws InterruptedException { + public void unassignJob(HttpClient httpClient) { // Setup jobRouterClient = getRouterClient(httpClient); routerAdminClient = getRouterAdministrationClient(httpClient); String testName = "unassign-job-test"; - + /** + * Setup queue + */ String distributionPolicyId = String.format("%s-%s-DistributionPolicy", JAVA_LIVE_TESTS, testName); DistributionPolicy distributionPolicy = createDistributionPolicy(routerAdminClient, distributionPolicyId); String queueId = String.format("%s-%s-Queue", JAVA_LIVE_TESTS, testName); RouterQueue jobQueue = createQueue(routerAdminClient, queueId, distributionPolicy.getId()); - String workerId = String.format("%s-%s-Worker", JAVA_LIVE_TESTS, testName); - String channelId = String.format("%s-%s-Channel", JAVA_LIVE_TESTS, testName); - - RouterWorker createdWorker = jobRouterClient.createWorker(new CreateWorkerOptions(workerId, 10) - .setLabels(new HashMap() { - { - put("IntKey", new RouterValue(4)); - put("BoolKey", new RouterValue(true)); - put("StringLabel", new RouterValue("test")); - } - }) - .setTags(new HashMap() { - { - put("IntTag", new RouterValue(5)); - put("BoolTag", new RouterValue(false)); - put("StringTag", new RouterValue("test2")); - } - }) - .setAvailableForOffers(true) - .setChannels(new ArrayList() { - { - add(new RouterChannel(channelId, 1)); - } - }) - .setQueues(new ArrayList() { - { - add(jobQueue.getId()); - } - })); - String jobId = String.format("%s-%s-Job", JAVA_LIVE_TESTS, testName); - CreateJobOptions createJobOptions = new CreateJobOptions(jobId, channelId, queueId) - .setLabels(new HashMap() { - { - put("IntLabel", new RouterValue(10)); - put("BoolLabel", new RouterValue(true)); - put("StringLabel", new RouterValue("test")); - put("DoubleValue", new RouterValue(5.3)); - } - }) - .setTags(new HashMap() { - { - put("IntTag", new RouterValue(5)); - put("BoolTag", new RouterValue(false)); - put("StringTag", new RouterValue("test2")); - } - }) - .setRequestedWorkerSelectors(new ArrayList() { - { - add(new RouterWorkerSelector("IntKey", LabelOperator.GREATER_THAN, new RouterValue(2)) - .setExpedite(true).setExpiresAfter(Duration.ofSeconds(100))); - add(new RouterWorkerSelector("BoolKey", LabelOperator.EQUAL, new RouterValue(true))); - } - }) - .setNotes(new ArrayList() { - { - add(new RouterJobNote("Note1")); - } - }) - .setDispositionCode("code1") - .setChannelReference("ref") - .setPriority(5); - - RouterJob job = jobRouterClient.createJob(createJobOptions); + /** + * Setup worker + */ + Map labels = new HashMap() { + { + put("Label", new RouterValue("Value")); + } + }; - // Verify - assertEquals(jobId, job.getId()); - assertNotNull(job.getEtag()); - assertEquals(4, job.getLabels().size()); - assertEquals(3, job.getTags().size()); - assertEquals(1, job.getNotes().size()); - assertEquals("code1", job.getDispositionCode()); - assertEquals("ref", job.getChannelReference()); - assertEquals(5, job.getPriority()); - assertEquals(2, job.getRequestedWorkerSelectors().size()); - assertEquals(Duration.ofSeconds(100), job.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - - Response jobResponse = jobRouterClient.getJobWithResponse(job.getId(), null); - RouterJob jobDeserialized = jobResponse.getValue().toObject(RouterJob.class); + Map tags = new HashMap() { + { + put("Tag", new RouterValue("Value")); + } + }; - // Verify - assertEquals(jobId, jobDeserialized.getId()); - assertNotNull(jobDeserialized.getEtag()); - assertEquals(4, jobDeserialized.getLabels().size()); - assertEquals(3, jobDeserialized.getTags().size()); - assertEquals(1, jobDeserialized.getNotes().size()); - assertEquals("code1", jobDeserialized.getDispositionCode()); - assertEquals("ref", jobDeserialized.getChannelReference()); - assertEquals(5, jobDeserialized.getPriority()); - assertEquals(2, jobDeserialized.getRequestedWorkerSelectors().size()); - assertEquals(Duration.ofSeconds(100), jobDeserialized.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } + RouterChannel channel = new RouterChannel("router-channel", 1); + List channels = new ArrayList() { + { + add(channel); + } + }; - jobDeserialized.setPriority(10); - RouterJob updatedJob = jobRouterClient.updateJob(jobId, jobDeserialized); + List queues = new ArrayList() { + { + add(jobQueue.getId()); + } + }; - // Verify - assertEquals(jobId, updatedJob.getId()); - assertNotNull(updatedJob.getEtag()); - assertEquals(4, updatedJob.getLabels().size()); - assertEquals(3, updatedJob.getTags().size()); - assertEquals(1, updatedJob.getNotes().size()); - assertEquals("code1", updatedJob.getDispositionCode()); - assertEquals("ref", updatedJob.getChannelReference()); - assertEquals(10, updatedJob.getPriority()); - assertEquals(2, updatedJob.getRequestedWorkerSelectors().size()); - assertEquals(Duration.ofSeconds(100), updatedJob.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - - for (RouterJob listJob : jobRouterClient.listJobs(null, queueId, channelId, null, null, null)) { - assertEquals(jobId, listJob.getId()); - assertNotNull(listJob.getEtag()); - assertEquals(4, listJob.getLabels().size()); - assertEquals(3, listJob.getTags().size()); - assertEquals(1, listJob.getNotes().size()); - assertEquals("code1", listJob.getDispositionCode()); - assertEquals("ref", listJob.getChannelReference()); - assertEquals(10, listJob.getPriority()); - assertEquals(2, listJob.getRequestedWorkerSelectors().size()); - assertEquals(Duration.ofSeconds(100), listJob.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - } + String workerId = String.format("%s-%s-Worker", JAVA_LIVE_TESTS, testName); + CreateWorkerOptions createWorkerOptions = new CreateWorkerOptions(workerId, 10) + .setLabels(labels) + .setTags(tags) + .setAvailableForOffers(true) + .setChannels(channels) + .setQueues(queues); + + jobRouterClient.createWorker(createWorkerOptions); + + String jobId = String.format("%s-%s-Job", JAVA_LIVE_TESTS, testName); + CreateJobOptions createJobOptions = new CreateJobOptions(jobId, "channel1", queueId); + + jobRouterClient.createJob(createJobOptions); List jobOffers = new ArrayList(); long startTimeMillis = System.currentTimeMillis(); @@ -193,7 +107,7 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { } } - assertEquals(1, jobOffers.size()); + assertTrue(jobOffers.size() == 1); RouterJobOffer offer = jobOffers.get(0); @@ -205,46 +119,24 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { UnassignJobResult unassignJobResult = jobRouterClient.unassignJob(jobId, assignmentId); // Verify - assertTrue(unassignJobResult.getUnassignmentCount() > 0); + assertEquals(1, unassignJobResult.getUnassignmentCount()); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } - - RouterQueueStatistics queueStatistics = jobRouterClient.getQueueStatistics(queueId); - - // Verify - assertEquals(queueId, queueStatistics.getQueueId()); - assertEquals(1, queueStatistics.getLength()); - assertTrue(queueStatistics.getLongestJobWaitTimeMinutes() > 0); - assertTrue(queueStatistics.getEstimatedWaitTime().get(10).getSeconds() > 0); - - RouterQueueStatistics deserialized = jobRouterClient.getQueueStatisticsWithResponse(queueId, null) - .getValue().toObject(RouterQueueStatistics.class); - assertEquals(queueId, deserialized.getQueueId()); - assertEquals(1, deserialized.getLength()); - assertTrue(deserialized.getLongestJobWaitTimeMinutes() > 0); - assertTrue(deserialized.getEstimatedWaitTime().get(10).getSeconds() > 0); - - // Cleanup RequestOptions requestOptions = new RequestOptions(); CancelJobOptions cancelJobOptions = new CancelJobOptions() .setDispositionCode("dispositionCode") .setNote("note"); requestOptions.setBody(BinaryData.fromObject(cancelJobOptions)); + // Cleanup jobRouterClient.cancelJob(jobId, requestOptions); jobRouterClient.deleteJob(jobId); jobRouterClient.deleteWorker(workerId); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } routerAdminClient.deleteQueue(queueId); routerAdminClient.deleteDistributionPolicy(distributionPolicyId); } - @ParameterizedTest +// @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void jobScheduling(HttpClient httpClient) throws InterruptedException { + public void jobScheduling(HttpClient httpClient) { // Setup jobRouterClient = getRouterClient(httpClient); routerAdminClient = getRouterAdministrationClient(httpClient); @@ -262,17 +154,15 @@ public void jobScheduling(HttpClient httpClient) throws InterruptedException { RouterJob job = jobRouterClient.createJob(new CreateJobOptions(jobId, testName, queue.getId()) .setMatchingMode(new ScheduleAndSuspendMode( OffsetDateTime.of(2040, 1, 1, 1, 1, 1, 1, ZoneOffset.UTC)))); - assertEquals(RouterJobStatus.PENDING_SCHEDULE, job.getStatus()); - - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } // Action - job.setMatchingMode(new QueueAndMatchMode()); - RouterJob updatedJob = jobRouterClient.updateJob(jobId, job); + RouterJob job2 = jobRouterClient.updateJobWithResponse(jobId, + BinaryData.fromObject(new RouterJob().setMatchingMode(new QueueAndMatchMode())), + new RequestOptions()).getValue().toObject(RouterJob.class); - assertEquals(RouterJobStatus.QUEUED, updatedJob.getStatus()); + // Verify + assertEquals(job.getStatus(), RouterJobStatus.PENDING_SCHEDULE); + assertEquals(job2.getStatus(), RouterJobStatus.QUEUED); // Cleanup jobRouterClient.cancelJob(jobId); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterQueueAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterQueueAsyncLiveTests.java index 1e3a955a79d9..270f3b8fb0d0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterQueueAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterQueueAsyncLiveTests.java @@ -10,9 +10,6 @@ import com.azure.communication.jobrouter.models.RouterQueue; import com.azure.communication.jobrouter.models.RouterValue; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -21,7 +18,6 @@ import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class RouterQueueAsyncLiveTests extends JobRouterTestBase { private JobRouterAsyncClient routerAsyncClient; @@ -34,7 +30,7 @@ public void createQueue(HttpClient httpClient) { // Setup routerAsyncClient = getRouterAsyncClient(httpClient); administrationAsyncClient = getRouterAdministrationAsyncClient(httpClient); - String distributionPolicyId = String.format("%s-CreateQueueAsync-DistributionPolicy", JAVA_LIVE_TESTS); + String distributionPolicyId = String.format("%s-CreateQueue-DistributionPolicy", JAVA_LIVE_TESTS); String distributionPolicyName = String.format("%s-Name", distributionPolicyId); CreateDistributionPolicyOptions createDistributionPolicyOptions = new CreateDistributionPolicyOptions( @@ -47,7 +43,7 @@ public void createQueue(HttpClient httpClient) { .setName(distributionPolicyName); DistributionPolicy distributionPolicy = administrationAsyncClient.createDistributionPolicy(createDistributionPolicyOptions).block(); - String queueId = String.format("%s-CreateQueueAsync-Queue", JAVA_LIVE_TESTS); + String queueId = String.format("%s-CreateQueue-Queue", JAVA_LIVE_TESTS); // Action String queueName = String.format("%s-Name", queueId); @@ -64,67 +60,6 @@ public void createQueue(HttpClient httpClient) { // Verify assertEquals(queueId, jobQueue.getId()); - assertNotNull(jobQueue.getEtag()); - assertEquals(queueId + "-Name", jobQueue.getName()); - assertEquals(distributionPolicyId, jobQueue.getDistributionPolicyId()); - assertEquals(2, jobQueue.getLabels().size()); - - BinaryData binaryData = administrationAsyncClient.getQueueWithResponse(queueId, null).block().getValue(); - RouterQueue deserialized = binaryData.toObject(RouterQueue.class); - - assertEquals(queueId, deserialized.getId()); - assertEquals(jobQueue.getEtag(), deserialized.getEtag()); - assertEquals(queueId + "-Name", deserialized.getName()); - assertEquals(distributionPolicyId, deserialized.getDistributionPolicyId()); - assertEquals(2, deserialized.getLabels().size()); - - // Cleanup - administrationAsyncClient.deleteQueue(queueId).block(); - administrationAsyncClient.deleteDistributionPolicy(distributionPolicyId).block(); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void updateQueue(HttpClient httpClient) { - // Setup - routerAsyncClient = getRouterAsyncClient(httpClient); - administrationAsyncClient = getRouterAdministrationAsyncClient(httpClient); - String distributionPolicyId = String.format("%s-UpdateQueueAsync-DistributionPolicy", JAVA_LIVE_TESTS); - String distributionPolicyName = String.format("%s-Name", distributionPolicyId); - - String queueId = String.format("%s-UpdateQueueAsync-Queue", JAVA_LIVE_TESTS); - - CreateDistributionPolicyOptions createDistributionPolicyOptions = new CreateDistributionPolicyOptions( - distributionPolicyId, - Duration.ofSeconds(10), - new LongestIdleMode() - .setMinConcurrentOffers(1) - .setMaxConcurrentOffers(10) - ) - .setName(distributionPolicyName); - DistributionPolicy distributionPolicy = administrationAsyncClient.createDistributionPolicy(createDistributionPolicyOptions).block(); - - String queueName = String.format("%s-Name", queueId); - Map queueLabels = new HashMap() { - { - put("Label_1", new RouterValue("Value_1")); - } - }; - - CreateQueueOptions createQueueOptions = new CreateQueueOptions(queueId, distributionPolicyId) - .setLabels(queueLabels) - .setName(queueName); - RouterQueue jobQueue = administrationAsyncClient.createQueue(createQueueOptions).block(); - - // Update Label - jobQueue.getLabels().put("Label_1", new RouterValue("UpdatedValue")); - - // Action - Response binaryData = administrationAsyncClient.updateQueueWithResponse(queueId, BinaryData.fromObject(jobQueue), new RequestOptions()).block(); - RouterQueue updatedQueue = binaryData.getValue().toObject(RouterQueue.class); - - // Verify - assertEquals("UpdatedValue", updatedQueue.getLabels().get("Label_1").getStringValue()); // Cleanup administrationAsyncClient.deleteQueue(queueId).block(); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterQueueLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterQueueLiveTests.java index d4930efd4bc3..dec66be0f600 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterQueueLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterQueueLiveTests.java @@ -8,18 +8,17 @@ import com.azure.communication.jobrouter.models.RouterValue; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.slf4j.Logger; import java.util.HashMap; import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public class RouterQueueLiveTests extends JobRouterTestBase { private JobRouterClient jobRouterClient; @@ -34,7 +33,7 @@ public void createQueue(HttpClient httpClient) { // Setup jobRouterClient = getRouterClient(httpClient); routerAdminClient = getRouterAdministrationClient(httpClient); - String distributionPolicyId = String.format("%s-CreateQueueAsync-DistributionPolicy", JAVA_LIVE_TESTS); + String distributionPolicyId = String.format("%s-CreateQueue-DistributionPolicy", JAVA_LIVE_TESTS); DistributionPolicy distributionPolicy = createDistributionPolicy(routerAdminClient, distributionPolicyId); String queueId = String.format("%s-CreateQueue-Queue", JAVA_LIVE_TESTS); @@ -44,19 +43,6 @@ public void createQueue(HttpClient httpClient) { // Verify assertEquals(queueId, jobQueue.getId()); - assertNotNull(jobQueue.getEtag()); - assertEquals(queueId + "-Name", jobQueue.getName()); - assertEquals(distributionPolicyId, jobQueue.getDistributionPolicyId()); - assertEquals(2, jobQueue.getLabels().size()); - - BinaryData binaryData = routerAdminClient.getQueueWithResponse(queueId, null).getValue(); - RouterQueue deserialized = binaryData.toObject(RouterQueue.class); - - assertEquals(queueId, deserialized.getId()); - assertEquals(jobQueue.getEtag(), deserialized.getEtag()); - assertEquals(queueId + "-Name", deserialized.getName()); - assertEquals(distributionPolicyId, deserialized.getDistributionPolicyId()); - assertEquals(2, deserialized.getLabels().size()); // Cleanup routerAdminClient.deleteQueue(queueId); @@ -69,25 +55,26 @@ public void updateQueue(HttpClient httpClient) { // Setup jobRouterClient = getRouterClient(httpClient); routerAdminClient = getRouterAdministrationClient(httpClient); - String distributionPolicyId = String.format("%s-UpdateQueue-DistributionPolicy", JAVA_LIVE_TESTS); + String distributionPolicyId = String.format("%s-CreateQueue-DistributionPolicy", JAVA_LIVE_TESTS); DistributionPolicy distributionPolicy = createDistributionPolicy(routerAdminClient, distributionPolicyId); String queueId = String.format("%s-CreateQueue-Queue", JAVA_LIVE_TESTS); RouterQueue queue = createQueue(routerAdminClient, queueId, distributionPolicy.getId()); + String updatedRouterQueue = "{\"name\":\"JAVA_LIVE_TEST-CreateQueue-Queue\",\"distributionPolicyId\":\"JAVA_LIVE_TEST-CreateQueue-DistributionPolicy\",\"labels\":{\"Label_1\":\"UpdatedValue\"}}"; + Map updatedQueueLabels = new HashMap() { { put("Label_1", new RouterValue("UpdatedValue")); } }; - queue.setLabels(updatedQueueLabels); - // Action - Response binaryData = routerAdminClient.updateQueueWithResponse(queueId, BinaryData.fromObject(queue), new RequestOptions()); - RouterQueue updatedQueue = binaryData.getValue().toObject(RouterQueue.class); + BinaryData updatedQueue = routerAdminClient.updateQueueWithResponse(queueId, BinaryData.fromString(updatedRouterQueue), new RequestOptions()) + .getValue(); + LOGGER.info(updatedQueue.toString()); // Verify - assertEquals("UpdatedValue", updatedQueue.getLabels().get("Label_1").getStringValue()); + assertTrue(updatedQueue.toString().contains("\"Label_1\":\"UpdatedValue\"")); // Cleanup routerAdminClient.deleteQueue(queueId); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerAsyncLiveTests.java index 800d9d47d2f1..71a69d772052 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerAsyncLiveTests.java @@ -13,9 +13,6 @@ import com.azure.communication.jobrouter.models.RouterValue; import com.azure.communication.jobrouter.models.RouterWorker; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -25,10 +22,7 @@ import java.util.List; import java.util.Map; -import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class RouterWorkerAsyncLiveTests extends JobRouterTestBase { private JobRouterAsyncClient routerAsyncClient; @@ -37,14 +31,14 @@ public class RouterWorkerAsyncLiveTests extends JobRouterTestBase { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void createWorker(HttpClient httpClient) throws InterruptedException { + public void createWorker(HttpClient httpClient) { // Setup routerAsyncClient = getRouterAsyncClient(httpClient); administrationAsyncClient = getRouterAdministrationAsyncClient(httpClient); /** * Setup queue */ - String distributionPolicyId = String.format("%s-CreateWorkerAsync-DistributionPolicy", JAVA_LIVE_TESTS); + String distributionPolicyId = String.format("%s-CreateWorker-DistributionPolicy", JAVA_LIVE_TESTS); String distributionPolicyName = String.format("%s-Name", distributionPolicyId); CreateDistributionPolicyOptions createDistributionPolicyOptions = new CreateDistributionPolicyOptions( @@ -105,64 +99,13 @@ public void createWorker(HttpClient httpClient) throws InterruptedException { .setTags(tags) .setAvailableForOffers(false) .setChannels(channels) - .setQueues(queues) - .setMaxConcurrentOffers(1); + .setQueues(queues); // Action RouterWorker result = routerAsyncClient.createWorker(createWorkerOptions).block(); // Verify assertEquals(workerId, result.getId()); - assertEquals(1, result.getMaxConcurrentOffers()); - assertEquals(result.isAvailableForOffers(), false); - assertEquals(labels.size() + 1, result.getLabels().size()); - assertEquals(tags.size(), result.getTags().size()); - assertArrayEquals(queues.toArray(), result.getQueues().toArray()); - assertEquals(channels.size(), result.getChannels().size()); - assertNotNull(result.getEtag()); - - Response getWorker = routerAsyncClient.getWorkerWithResponse(result.getId(), null).block(); - RouterWorker deserialized = getWorker.getValue().toObject(RouterWorker.class); - - assertEquals(workerId, deserialized.getId()); - assertEquals(deserialized.isAvailableForOffers(), false); - assertEquals(labels.size() + 1, deserialized.getLabels().size()); - assertEquals(tags.size(), deserialized.getTags().size()); - assertArrayEquals(queues.toArray(), deserialized.getQueues().toArray()); - assertEquals(channels.size(), deserialized.getChannels().size()); - assertEquals(deserialized.getEtag(), result.getEtag()); - - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } - - deserialized.setAvailableForOffers(true); - deserialized.setChannels(new ArrayList() { - { - add(new RouterChannel("channel1", 5)); - add(new RouterChannel("channel2", 5)); - } - }); - RouterWorker updatedWorker = routerAsyncClient.updateWorker(workerId, deserialized).block(); - - assertEquals(workerId, updatedWorker.getId()); - assertEquals(updatedWorker.isAvailableForOffers(), true); - assertEquals(labels.size() + 1, updatedWorker.getLabels().size()); - assertEquals(tags.size(), updatedWorker.getTags().size()); - assertArrayEquals(queues.toArray(), updatedWorker.getQueues().toArray()); - assertEquals(deserialized.getChannels().size(), updatedWorker.getChannels().size()); - assertNotEquals(deserialized.getEtag(), updatedWorker.getEtag()); - - routerAsyncClient.listWorkers(null, channel.getChannelId(), queueId, null) - .subscribe(listWorker -> { - assertEquals(workerId, listWorker.getId()); - assertEquals(listWorker.isAvailableForOffers(), true); - assertEquals(labels.size() + 1, listWorker.getLabels().size()); - assertEquals(tags.size(), listWorker.getTags().size()); - assertArrayEquals(queues.toArray(), listWorker.getQueues().toArray()); - assertEquals(channels.size(), listWorker.getChannels().size()); - assertEquals(updatedWorker.getEtag(), listWorker.getEtag()); - }); // Cleanup routerAsyncClient.deleteWorker(workerId).block(); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerLiveTests.java index 008f0b3a0eea..6ae200159a0c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerLiveTests.java @@ -10,9 +10,6 @@ import com.azure.communication.jobrouter.models.RouterValue; import com.azure.communication.jobrouter.models.RouterWorker; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; -import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -21,10 +18,7 @@ import java.util.List; import java.util.Map; -import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; public class RouterWorkerLiveTests extends JobRouterTestBase { private JobRouterClient jobRouterClient; @@ -33,7 +27,7 @@ public class RouterWorkerLiveTests extends JobRouterTestBase { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void createWorker(HttpClient httpClient) throws InterruptedException { + public void createWorker(HttpClient httpClient) { // Setup jobRouterClient = getRouterClient(httpClient); routerAdminClient = getRouterAdministrationClient(httpClient); @@ -81,63 +75,13 @@ public void createWorker(HttpClient httpClient) throws InterruptedException { .setTags(tags) .setAvailableForOffers(false) .setChannels(channels) - .setQueues(queues) - .setMaxConcurrentOffers(1); + .setQueues(queues); // Action RouterWorker result = jobRouterClient.createWorker(createWorkerOptions); // Verify assertEquals(workerId, result.getId()); - assertEquals(result.isAvailableForOffers(), false); - assertEquals(labels.size() + 1, result.getLabels().size()); - assertEquals(tags.size(), result.getTags().size()); - assertArrayEquals(queues.toArray(), result.getQueues().toArray()); - assertEquals(channels.size(), result.getChannels().size()); - assertNotNull(result.getEtag()); - assertEquals(1, result.getMaxConcurrentOffers()); - - Response getWorker = jobRouterClient.getWorkerWithResponse(result.getId(), null); - RouterWorker deserialized = getWorker.getValue().toObject(RouterWorker.class); - - assertEquals(workerId, deserialized.getId()); - assertEquals(deserialized.isAvailableForOffers(), false); - assertEquals(labels.size() + 1, deserialized.getLabels().size()); - assertEquals(tags.size(), deserialized.getTags().size()); - assertArrayEquals(queues.toArray(), deserialized.getQueues().toArray()); - assertEquals(channels.size(), deserialized.getChannels().size()); - assertEquals(deserialized.getEtag(), result.getEtag()); - - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } - - deserialized.setAvailableForOffers(true); - deserialized.setChannels(new ArrayList() { - { - add(new RouterChannel("channel1", 5)); - add(new RouterChannel("channel2", 5)); - } - }); - RouterWorker updatedWorker = jobRouterClient.updateWorker(workerId, deserialized); - - assertEquals(workerId, updatedWorker.getId()); - assertEquals(updatedWorker.isAvailableForOffers(), true); - assertEquals(labels.size() + 1, updatedWorker.getLabels().size()); - assertEquals(tags.size(), updatedWorker.getTags().size()); - assertArrayEquals(queues.toArray(), updatedWorker.getQueues().toArray()); - assertEquals(deserialized.getChannels().size(), updatedWorker.getChannels().size()); - assertNotEquals(deserialized.getEtag(), updatedWorker.getEtag()); - - for (RouterWorker listWorker : jobRouterClient.listWorkers(null, channel.getChannelId(), queueId, null)) { - assertEquals(workerId, listWorker.getId()); - assertEquals(listWorker.isAvailableForOffers(), true); - assertEquals(labels.size() + 1, listWorker.getLabels().size()); - assertEquals(tags.size(), listWorker.getTags().size()); - assertArrayEquals(queues.toArray(), listWorker.getQueues().toArray()); - assertEquals(channels.size(), listWorker.getChannels().size()); - assertEquals(updatedWorker.getEtag(), listWorker.getEtag()); - } // Cleanup jobRouterClient.deleteWorker(workerId); diff --git a/sdk/communication/azure-communication-jobrouter/tests.yml b/sdk/communication/azure-communication-jobrouter/tests.yml index 7426940a8985..71e0a12ea8e4 100644 --- a/sdk/communication/azure-communication-jobrouter/tests.yml +++ b/sdk/communication/azure-communication-jobrouter/tests.yml @@ -1,7 +1,7 @@ trigger: none -extends: - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-jobrouter - SafeName: azurecommunicationjobrouter +stages: + - template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-jobrouter + SafeName: azurecommunicationjobrouter diff --git a/sdk/communication/azure-communication-jobrouter/tsp-location.yaml b/sdk/communication/azure-communication-jobrouter/tsp-location.yaml deleted file mode 100644 index 2fc77bc49a18..000000000000 --- a/sdk/communication/azure-communication-jobrouter/tsp-location.yaml +++ /dev/null @@ -1,4 +0,0 @@ -commit: f127337209f2212340008eb4a98d202b66ef48e0 -directory: specification/communication/Communication.JobRouter -additionalDirectories: [] -repo: Azure/azure-rest-api-specs diff --git a/sdk/communication/azure-communication-messages/CHANGELOG.md b/sdk/communication/azure-communication-messages/CHANGELOG.md index 2c131959783a..1e15c8945f02 100644 --- a/sdk/communication/azure-communication-messages/CHANGELOG.md +++ b/sdk/communication/azure-communication-messages/CHANGELOG.md @@ -1,14 +1,14 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.2 (2024-04-23) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. +- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. +- Upgraded `azure-core-http-netty` from `1.14.1` to version `1.14.2`. ## 1.0.1 (2024-03-20) @@ -19,7 +19,6 @@ - Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. ## 1.0.0 (2024-02-29) diff --git a/sdk/communication/azure-communication-messages/README.md b/sdk/communication/azure-communication-messages/README.md index c338095e4788..ebd580acd903 100644 --- a/sdk/communication/azure-communication-messages/README.md +++ b/sdk/communication/azure-communication-messages/README.md @@ -58,7 +58,7 @@ add the direct dependency to your project as follows. com.azure azure-communication-messages - 1.0.0 + 1.0.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/communication/azure-communication-messages/pom.xml b/sdk/communication/azure-communication-messages/pom.xml index 5245010f6df3..6cd1c2b40372 100644 --- a/sdk/communication/azure-communication-messages/pom.xml +++ b/sdk/communication/azure-communication-messages/pom.xml @@ -14,7 +14,7 @@ com.azure azure-communication-messages - 1.1.0-beta.1 + 1.0.2 jar Microsoft Azure client library for Azure Communication Services - Messaging application @@ -111,12 +111,6 @@ 1.11.20 test - - com.azure - azure-core-http-vertx - 1.0.0-beta.17 - test - @@ -155,21 +149,4 @@ - - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.0.0-beta.12 - test - - - - diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateAsyncClient.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateAsyncClient.java index f8731b5b2f9b..20ca21711ac0 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateAsyncClient.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateAsyncClient.java @@ -42,18 +42,30 @@ public final class MessageTemplateAsyncClient { /** * List all templates for given Azure Communication Services channel. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
-     *     kind: String(whatsApp) (Required)
      *     name: String (Required)
      *     language: String (Required)
      *     status: String(approved/rejected/pending/paused) (Required)
@@ -93,14 +105,12 @@ public PagedFlux listTemplates(String channelId) {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listTemplates(channelId, requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux
                 .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                     pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                    pagedResponse.getValue()
-                        .stream()
+                    pagedResponse.getValue().stream()
                         .map(protocolMethodData -> protocolMethodData.toObject(MessageTemplateItem.class))
                         .collect(Collectors.toList()),
                     pagedResponse.getContinuationToken(), null));
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClient.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClient.java
index bebdb920b43a..ca58289a9b1c 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClient.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClient.java
@@ -38,18 +38,30 @@ public final class MessageTemplateClient {
 
     /**
      * List all templates for given Azure Communication Services channel.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
-     *     kind: String(whatsApp) (Required)
      *     name: String (Required)
      *     language: String (Required)
      *     status: String(approved/rejected/pending/paused) (Required)
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClientBuilder.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClientBuilder.java
index d267eee869c2..b8b3adf04743 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClientBuilder.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClientBuilder.java
@@ -3,18 +3,18 @@
 // Code generated by Microsoft (R) TypeSpec Code Generator.
 package com.azure.communication.messages;
 
-import com.azure.communication.common.implementation.HmacAuthenticationPolicy;
-import com.azure.core.credential.AzureKeyCredential;
 import com.azure.communication.common.implementation.CommunicationConnectionString;
-import com.azure.core.client.traits.ConnectionStringTrait;
-import com.azure.core.client.traits.KeyCredentialTrait;
-import com.azure.core.client.traits.TokenCredentialTrait;
+import com.azure.communication.common.implementation.HmacAuthenticationPolicy;
 import com.azure.communication.messages.implementation.MessageTemplateClientImpl;
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.ServiceClientBuilder;
 import com.azure.core.client.traits.ConfigurationTrait;
+import com.azure.core.client.traits.ConnectionStringTrait;
 import com.azure.core.client.traits.EndpointTrait;
 import com.azure.core.client.traits.HttpTrait;
+import com.azure.core.client.traits.KeyCredentialTrait;
+import com.azure.core.client.traits.TokenCredentialTrait;
+import com.azure.core.credential.AzureKeyCredential;
 import com.azure.core.credential.KeyCredential;
 import com.azure.core.credential.TokenCredential;
 import com.azure.core.http.HttpClient;
@@ -27,8 +27,8 @@
 import com.azure.core.http.policy.AddHeadersFromContextPolicy;
 import com.azure.core.http.policy.AddHeadersPolicy;
 import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
-import com.azure.core.http.policy.HttpLoggingPolicy;
 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;
@@ -92,7 +92,7 @@ public MessageTemplateClientBuilder() {
     @Override
     public MessageTemplateClientBuilder pipeline(HttpPipeline pipeline) {
         if (this.pipeline != null && pipeline == null) {
-            LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured.");
+            LOGGER.info("HttpPipeline is being set to 'null' when it was previously configured.");
         }
         this.pipeline = pipeline;
         return this;
@@ -307,22 +307,18 @@ private HttpPipeline createHttpPipeline() {
         if (headers.getSize() > 0) {
             policies.add(new AddHeadersPolicy(headers));
         }
-        this.pipelinePolicies.stream()
-            .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+        this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
             .forEach(p -> policies.add(p));
         HttpPolicyProviders.addBeforeRetryPolicies(policies);
         policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
         policies.add(new AddDatePolicy());
         policies.add(createHttpPipelineAuthPolicy());
-        this.pipelinePolicies.stream()
-            .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+        this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
             .forEach(p -> policies.add(p));
         HttpPolicyProviders.addAfterRetryPolicies(policies);
         policies.add(new HttpLoggingPolicy(localHttpLogOptions));
         HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
-            .httpClient(httpClient)
-            .clientOptions(localClientOptions)
-            .build();
+            .httpClient(httpClient).clientOptions(localClientOptions).build();
         return httpPipeline;
     }
 
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java
index 0156f64e316c..305e3f701042 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java
@@ -41,29 +41,45 @@ public final class NotificationMessagesAsyncClient {
 
     /**
      * Sends a notification message from Business to User.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as HTTP-date
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
-     *     kind: String(text/image/template) (Required)
      *     channelRegistrationId: String (Required)
      *     to (Required): [
      *         String (Required)
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     receipts (Required): [
@@ -92,8 +108,9 @@ public Mono> sendWithResponse(BinaryData notificationConten
 
     /**
      * Download the Media payload from a User to Business message.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * BinaryData
      * }
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java index 357420668aed..b4e49073108a 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java @@ -39,29 +39,45 @@ public final class NotificationMessagesClient { /** * Sends a notification message from Business to User. - *

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as HTTP-date
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
-     *     kind: String(text/image/template) (Required)
      *     channelRegistrationId: String (Required)
      *     to (Required): [
      *         String (Required)
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     receipts (Required): [
@@ -89,8 +105,9 @@ public Response sendWithResponse(BinaryData notificationContent, Req
 
     /**
      * Download the Media payload from a User to Business message.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * BinaryData
      * }
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClientBuilder.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClientBuilder.java index 2bb174993835..cd8cb8776fa5 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClientBuilder.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClientBuilder.java @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.messages; -import com.azure.communication.common.implementation.HmacAuthenticationPolicy; -import com.azure.core.credential.AzureKeyCredential; import com.azure.communication.common.implementation.CommunicationConnectionString; -import com.azure.core.client.traits.ConnectionStringTrait; -import com.azure.core.client.traits.KeyCredentialTrait; -import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.communication.common.implementation.HmacAuthenticationPolicy; import com.azure.communication.messages.implementation.NotificationMessagesClientImpl; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.ConnectionStringTrait; import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.AzureKeyCredential; import com.azure.core.credential.KeyCredential; import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; @@ -27,8 +27,8 @@ import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.HttpLoggingPolicy; 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; @@ -92,7 +92,7 @@ public NotificationMessagesClientBuilder() { @Override public NotificationMessagesClientBuilder pipeline(HttpPipeline pipeline) { if (this.pipeline != null && pipeline == null) { - LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + LOGGER.info("HttpPipeline is being set to 'null' when it was previously configured."); } this.pipeline = pipeline; return this; @@ -307,22 +307,18 @@ private HttpPipeline createHttpPipeline() { if (headers.getSize() > 0) { policies.add(new AddHeadersPolicy(headers)); } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) .forEach(p -> policies.add(p)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); policies.add(new AddDatePolicy()); policies.add(createHttpPipelineAuthPolicy()); - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(localHttpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); + .httpClient(httpClient).clientOptions(localClientOptions).build(); return httpPipeline; } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java index f40800a3e72a..65c262030300 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java @@ -149,8 +149,8 @@ public MessageTemplateClientImpl(HttpPipeline httpPipeline, SerializerAdapter se } /** - * The interface defining all the services for MessageTemplateClient to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for MessageTemplateClient to be used by the proxy service to perform + * REST calls. */ @Host("{endpoint}") @ServiceInterface(name = "MessageTemplateClien") @@ -198,18 +198,30 @@ Response listTemplatesNextSync(@PathParam(value = "nextLink", encode /** * List all templates for given Azure Communication Services channel. - *

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
-     *     kind: String(whatsApp) (Required)
      *     name: String (Required)
      *     language: String (Required)
      *     status: String(approved/rejected/pending/paused) (Required)
@@ -238,18 +250,30 @@ private Mono> listTemplatesSinglePageAsync(String chan
 
     /**
      * List all templates for given Azure Communication Services channel.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
-     *     kind: String(whatsApp) (Required)
      *     name: String (Required)
      *     language: String (Required)
      *     status: String(approved/rejected/pending/paused) (Required)
@@ -295,18 +319,30 @@ public PagedFlux listTemplatesAsync(String channelId, RequestOptions
 
     /**
      * List all templates for given Azure Communication Services channel.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
-     *     kind: String(whatsApp) (Required)
      *     name: String (Required)
      *     language: String (Required)
      *     status: String(approved/rejected/pending/paused) (Required)
@@ -332,18 +368,30 @@ private PagedResponse listTemplatesSinglePage(String channelId, Requ
 
     /**
      * List all templates for given Azure Communication Services channel.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
NameTypeRequiredDescription
maxpagesizeIntegerNoNumber of objects to return per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
-     *     kind: String(whatsApp) (Required)
      *     name: String (Required)
      *     language: String (Required)
      *     status: String(approved/rejected/pending/paused) (Required)
@@ -389,11 +437,11 @@ public PagedIterable listTemplates(String channelId, RequestOptions
 
     /**
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
-     *     kind: String(whatsApp) (Required)
      *     name: String (Required)
      *     language: String (Required)
      *     status: String(approved/rejected/pending/paused) (Required)
@@ -424,11 +472,11 @@ private Mono> listTemplatesNextSinglePageAsync(String
 
     /**
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
-     *     kind: String(whatsApp) (Required)
      *     name: String (Required)
      *     language: String (Required)
      *     status: String(approved/rejected/pending/paused) (Required)
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java
index 52c29cf620c1..a7d5ad3ec367 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java
@@ -147,8 +147,8 @@ public NotificationMessagesClientImpl(HttpPipeline httpPipeline, SerializerAdapt
     }
 
     /**
-     * The interface defining all the services for NotificationMessagesClient to be used by the proxy service to perform
-     * REST calls.
+     * The interface defining all the services for NotificationMessagesClient to be used by the proxy service to
+     * perform REST calls.
      */
     @Host("{endpoint}")
     @ServiceInterface(name = "NotificationMessages")
@@ -198,29 +198,45 @@ Response downloadMediaSync(@HostParam("endpoint") String endpoint,
 
     /**
      * Sends a notification message from Business to User.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as HTTP-date
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
-     *     kind: String(text/image/template) (Required)
      *     channelRegistrationId: String (Required)
      *     to (Required): [
      *         String (Required)
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     receipts (Required): [
@@ -250,14 +266,14 @@ public Mono> sendWithResponseAsync(BinaryData notificationC
         String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-request-id")) == null) {
-                requestLocal.getHeaders()
-                    .set(HttpHeaderName.fromString("repeatability-request-id"), repeatabilityRequestId);
+                requestLocal.getHeaders().set(HttpHeaderName.fromString("repeatability-request-id"),
+                    repeatabilityRequestId);
             }
         });
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-first-sent")) == null) {
-                requestLocal.getHeaders()
-                    .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent);
+                requestLocal.getHeaders().set(HttpHeaderName.fromString("repeatability-first-sent"),
+                    repeatabilityFirstSent);
             }
         });
         return FluxUtil.withContext(context -> service.send(this.getEndpoint(), this.getServiceVersion().getVersion(),
@@ -266,29 +282,45 @@ public Mono> sendWithResponseAsync(BinaryData notificationC
 
     /**
      * Sends a notification message from Business to User.
-     * 

Header Parameters

+ *

+ * Header Parameters + *

* * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Header Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as HTTP-date
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
-     *     kind: String(text/image/template) (Required)
      *     channelRegistrationId: String (Required)
      *     to (Required): [
      *         String (Required)
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     receipts (Required): [
@@ -316,14 +348,14 @@ public Response sendWithResponse(BinaryData notificationContent, Req
         String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-request-id")) == null) {
-                requestLocal.getHeaders()
-                    .set(HttpHeaderName.fromString("repeatability-request-id"), repeatabilityRequestId);
+                requestLocal.getHeaders().set(HttpHeaderName.fromString("repeatability-request-id"),
+                    repeatabilityRequestId);
             }
         });
         requestOptionsLocal.addRequestCallback(requestLocal -> {
             if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-first-sent")) == null) {
-                requestLocal.getHeaders()
-                    .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent);
+                requestLocal.getHeaders().set(HttpHeaderName.fromString("repeatability-first-sent"),
+                    repeatabilityFirstSent);
             }
         });
         return service.sendSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, notificationContent,
@@ -332,8 +364,9 @@ public Response sendWithResponse(BinaryData notificationContent, Req
 
     /**
      * Download the Media payload from a User to Business message.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * BinaryData
      * }
@@ -355,8 +388,9 @@ public Mono> downloadMediaWithResponseAsync(String mediaId, /** * Download the Media payload from a User to Business message. - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * BinaryData
      * }
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/models/MessageDataStream.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/models/MessageDataStream.java index 00a651e0f1e1..c13663bee822 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/models/MessageDataStream.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/models/MessageDataStream.java @@ -27,7 +27,7 @@ public final class MessageDataStream { */ @Generated @JsonProperty(value = "body") - private final byte[] body; + private byte[] body; /** * Creates an instance of MessageDataStream class. diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessageKind.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessageKind.java deleted file mode 100644 index 0ad052b3bcf0..000000000000 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessageKind.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.messages.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * The type of message. Supports text, image, template. - */ -public final class CommunicationMessageKind extends ExpandableStringEnum { - - /** - * Text message type. - */ - @Generated - public static final CommunicationMessageKind TEXT = fromString("text"); - - /** - * Image message type. - */ - @Generated - public static final CommunicationMessageKind IMAGE = fromString("image"); - - /** - * Template message type. - */ - @Generated - public static final CommunicationMessageKind TEMPLATE = fromString("template"); - - /** - * Creates a new instance of CommunicationMessageKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public CommunicationMessageKind() { - } - - /** - * Creates or finds a CommunicationMessageKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding CommunicationMessageKind. - */ - @Generated - @JsonCreator - public static CommunicationMessageKind fromString(String name) { - return fromString(name, CommunicationMessageKind.class); - } - - /** - * Gets known CommunicationMessageKind values. - * - * @return known CommunicationMessageKind values. - */ - @Generated - public static Collection values() { - return values(CommunicationMessageKind.class); - } -} diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessagesChannel.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessagesChannel.java deleted file mode 100644 index b945820e4220..000000000000 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessagesChannel.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.messages.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * The type of the communication messages channel. - */ -public final class CommunicationMessagesChannel extends ExpandableStringEnum { - - /** - * The WhatsApp communication messages channel type. - */ - @Generated - public static final CommunicationMessagesChannel WHATS_APP = fromString("whatsApp"); - - /** - * Creates a new instance of CommunicationMessagesChannel value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public CommunicationMessagesChannel() { - } - - /** - * Creates or finds a CommunicationMessagesChannel from its string representation. - * - * @param name a name to look for. - * @return the corresponding CommunicationMessagesChannel. - */ - @Generated - @JsonCreator - public static CommunicationMessagesChannel fromString(String name) { - return fromString(name, CommunicationMessagesChannel.class); - } - - /** - * Gets known CommunicationMessagesChannel values. - * - * @return known CommunicationMessagesChannel values. - */ - @Generated - public static Collection values() { - return values(CommunicationMessagesChannel.class); - } -} diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MediaNotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MediaNotificationContent.java index 9ded92a5a314..9e9b6d55910a 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MediaNotificationContent.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MediaNotificationContent.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -15,11 +14,7 @@ /** * A request to send a media notification. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = MediaNotificationContent.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("image") @Fluent public final class MediaNotificationContent extends NotificationContent { @@ -36,7 +31,7 @@ public final class MediaNotificationContent extends NotificationContent { */ @Generated @JsonProperty(value = "mediaUri") - private final String mediaUrl; + private String mediaUrl; /** * Creates an instance of MediaNotificationContent class. @@ -85,23 +80,4 @@ public MediaNotificationContent setContent(String content) { public String getMediaUrl() { return this.mediaUrl; } - - /* - * The type discriminator describing a notification type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private CommunicationMessageKind kind = CommunicationMessageKind.IMAGE; - - /** - * Get the kind property: The type discriminator describing a notification type. - * - * @return the kind value. - */ - @Generated - @Override - public CommunicationMessageKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageReceipt.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageReceipt.java index b3c4cfdf222b..eb8b3314bf78 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageReceipt.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageReceipt.java @@ -19,14 +19,14 @@ public final class MessageReceipt { */ @Generated @JsonProperty(value = "messageId") - private final String messageId; + private String messageId; /* * The native external platform user identifier of the recipient. */ @Generated @JsonProperty(value = "to") - private final String to; + private String to; /** * Creates an instance of MessageReceipt class. diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplate.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplate.java index 5c4fbb4c707b..f9b8f1d92a2a 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplate.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplate.java @@ -20,14 +20,15 @@ public final class MessageTemplate { */ @Generated @JsonProperty(value = "name") - private final String name; + private String name; /* - * The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'. + * The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional + * two-letter country code, e.g., 'en' or 'en_US'. */ @Generated @JsonProperty(value = "language") - private final String language; + private String language; /* * The template values. diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateBindings.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateBindings.java index 414b33a5ef8d..8e75dc6d7cfa 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateBindings.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateBindings.java @@ -6,9 +6,7 @@ import com.azure.communication.messages.models.channels.WhatsAppMessageTemplateBindings; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,9 @@ */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = MessageTemplateBindings.class, - visible = true) + defaultImpl = MessageTemplateBindings.class) @JsonTypeName("MessageTemplateBindings") @JsonSubTypes({ @JsonSubTypes.Type(name = "whatsApp", value = WhatsAppMessageTemplateBindings.class) }) @Immutable @@ -30,24 +28,5 @@ public class MessageTemplateBindings { */ @Generated public MessageTemplateBindings() { - this.kind = MessageTemplateBindingsKind.fromString("MessageTemplateBindings"); - } - - /* - * The type discriminator describing a template bindings type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private MessageTemplateBindingsKind kind; - - /** - * Get the kind property: The type discriminator describing a template bindings type. - * - * @return the kind value. - */ - @Generated - public MessageTemplateBindingsKind getKind() { - return this.kind; } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateBindingsKind.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateBindingsKind.java deleted file mode 100644 index c42dc4cb13a2..000000000000 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateBindingsKind.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.messages.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * The type of the message template. - */ -public final class MessageTemplateBindingsKind extends ExpandableStringEnum { - - /** - * The WhatsApp template type. - */ - @Generated - public static final MessageTemplateBindingsKind WHATS_APP = fromString("whatsApp"); - - /** - * Creates a new instance of MessageTemplateBindingsKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public MessageTemplateBindingsKind() { - } - - /** - * Creates or finds a MessageTemplateBindingsKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding MessageTemplateBindingsKind. - */ - @Generated - @JsonCreator - public static MessageTemplateBindingsKind fromString(String name) { - return fromString(name, MessageTemplateBindingsKind.class); - } - - /** - * Gets known MessageTemplateBindingsKind values. - * - * @return known MessageTemplateBindingsKind values. - */ - @Generated - public static Collection values() { - return values(MessageTemplateBindingsKind.class); - } -} diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateDocument.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateDocument.java index 493f464a0954..8dd369aa9833 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateDocument.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateDocument.java @@ -7,18 +7,13 @@ import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The message template's document value information. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = MessageTemplateDocument.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("document") @Fluent public final class MessageTemplateDocument extends MessageTemplateValue { @@ -28,7 +23,7 @@ public final class MessageTemplateDocument extends MessageTemplateValue { */ @Generated @JsonProperty(value = "url") - private final String url; + private String url; /* * The [optional] caption of the media object. @@ -111,23 +106,4 @@ public MessageTemplateDocument setFileName(String fileName) { this.fileName = fileName; return this; } - - /* - * The type discriminator describing a template parameter type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private MessageTemplateValueKind kind = MessageTemplateValueKind.DOCUMENT; - - /** - * Get the kind property: The type discriminator describing a template parameter type. - * - * @return the kind value. - */ - @Generated - @Override - public MessageTemplateValueKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateImage.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateImage.java index 5c5ca8e3fb66..86bcfc40e0eb 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateImage.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateImage.java @@ -7,14 +7,13 @@ import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The message template's image value information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MessageTemplateImage.class, visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("image") @Fluent public final class MessageTemplateImage extends MessageTemplateValue { @@ -24,7 +23,7 @@ public final class MessageTemplateImage extends MessageTemplateValue { */ @Generated @JsonProperty(value = "url") - private final String url; + private String url; /* * The [optional] caption of the media object. @@ -107,23 +106,4 @@ public MessageTemplateImage setFileName(String fileName) { this.fileName = fileName; return this; } - - /* - * The type discriminator describing a template parameter type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private MessageTemplateValueKind kind = MessageTemplateValueKind.IMAGE; - - /** - * Get the kind property: The type discriminator describing a template parameter type. - * - * @return the kind value. - */ - @Generated - @Override - public MessageTemplateValueKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateItem.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateItem.java index d0d5b9c88c5e..3647a7703d6c 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateItem.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateItem.java @@ -9,14 +9,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The message template as returned from the service. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MessageTemplateItem.class, visible = true) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = MessageTemplateItem.class) @JsonTypeName("MessageTemplateItem") @JsonSubTypes({ @JsonSubTypes.Type(name = "whatsApp", value = WhatsAppMessageTemplateItem.class) }) @Immutable @@ -30,18 +33,19 @@ public abstract class MessageTemplateItem { private String name; /* - * The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'. + * The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional + * two-letter country code, e.g., 'en' or 'en_US'. */ @Generated @JsonProperty(value = "language") - private final String language; + private String language; /* * The aggregated template status. */ @Generated @JsonProperty(value = "status") - private final MessageTemplateStatus status; + private MessageTemplateStatus status; /** * Creates an instance of MessageTemplateItem class. @@ -53,7 +57,6 @@ public abstract class MessageTemplateItem { @JsonCreator protected MessageTemplateItem(@JsonProperty(value = "language") String language, @JsonProperty(value = "status") MessageTemplateStatus status) { - this.kind = CommunicationMessagesChannel.fromString("MessageTemplateItem"); this.language = language; this.status = status; } @@ -88,22 +91,4 @@ public String getLanguage() { public MessageTemplateStatus getStatus() { return this.status; } - - /* - * The type discriminator describing a template type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private CommunicationMessagesChannel kind; - - /** - * Get the kind property: The type discriminator describing a template type. - * - * @return the kind value. - */ - @Generated - public CommunicationMessagesChannel getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateLocation.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateLocation.java index 679734c069ce..4795f995b677 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateLocation.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateLocation.java @@ -3,23 +3,18 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.messages.models; -import com.azure.core.models.GeoPosition; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.models.GeoPosition; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The message template's location value information. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = MessageTemplateLocation.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("location") @Fluent public final class MessageTemplateLocation extends MessageTemplateValue { @@ -43,14 +38,14 @@ public final class MessageTemplateLocation extends MessageTemplateValue { */ @Generated @JsonProperty(value = "latitude") - private final double latitude; + private double latitude; /* * The longitude of the location. */ @Generated @JsonProperty(value = "longitude") - private final double longitude; + private double longitude; /** * Creates an instance of MessageTemplateLocation class. @@ -118,23 +113,4 @@ public MessageTemplateLocation setAddress(String address) { public GeoPosition getPosition() { return new GeoPosition(this.longitude, this.latitude); } - - /* - * The type discriminator describing a template parameter type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private MessageTemplateValueKind kind = MessageTemplateValueKind.LOCATION; - - /** - * Get the kind property: The type discriminator describing a template parameter type. - * - * @return the kind value. - */ - @Generated - @Override - public MessageTemplateValueKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateQuickAction.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateQuickAction.java index de7d3a09498f..7a6dbef64e80 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateQuickAction.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateQuickAction.java @@ -7,18 +7,13 @@ import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The message template's quick action value information. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = MessageTemplateQuickAction.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("quickAction") @Fluent public final class MessageTemplateQuickAction extends MessageTemplateValue { @@ -91,23 +86,4 @@ public MessageTemplateQuickAction setPayload(String payload) { this.payload = payload; return this; } - - /* - * The type discriminator describing a template parameter type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private MessageTemplateValueKind kind = MessageTemplateValueKind.QUICK_ACTION; - - /** - * Get the kind property: The type discriminator describing a template parameter type. - * - * @return the kind value. - */ - @Generated - @Override - public MessageTemplateValueKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateText.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateText.java index 5a42e4c25591..614ac5f083f2 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateText.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateText.java @@ -7,14 +7,13 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The message template's text value information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MessageTemplateText.class, visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("text") @Immutable public final class MessageTemplateText extends MessageTemplateValue { @@ -24,7 +23,7 @@ public final class MessageTemplateText extends MessageTemplateValue { */ @Generated @JsonProperty(value = "text") - private final String text; + private String text; /** * Creates an instance of MessageTemplateText class. @@ -49,23 +48,4 @@ public MessageTemplateText(@JsonProperty(value = "name") String refValue, public String getText() { return this.text; } - - /* - * The type discriminator describing a template parameter type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private MessageTemplateValueKind kind = MessageTemplateValueKind.TEXT; - - /** - * Get the kind property: The type discriminator describing a template parameter type. - * - * @return the kind value. - */ - @Generated - @Override - public MessageTemplateValueKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateValue.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateValue.java index 98c96d824ce6..8bd743c3a719 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateValue.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateValue.java @@ -8,14 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The class describes a parameter of a template. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MessageTemplateValue.class, visible = true) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = MessageTemplateValue.class) @JsonTypeName("MessageTemplateValue") @JsonSubTypes({ @JsonSubTypes.Type(name = "text", value = MessageTemplateText.class), @@ -32,7 +35,7 @@ public abstract class MessageTemplateValue { */ @Generated @JsonProperty(value = "name") - private final String refValue; + private String refValue; /** * Creates an instance of MessageTemplateValue class. @@ -42,7 +45,6 @@ public abstract class MessageTemplateValue { @Generated @JsonCreator protected MessageTemplateValue(@JsonProperty(value = "name") String refValue) { - this.kind = MessageTemplateValueKind.fromString("MessageTemplateValue"); this.refValue = refValue; } @@ -55,22 +57,4 @@ protected MessageTemplateValue(@JsonProperty(value = "name") String refValue) { public String getRefValue() { return this.refValue; } - - /* - * The type discriminator describing a template parameter type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private MessageTemplateValueKind kind; - - /** - * Get the kind property: The type discriminator describing a template parameter type. - * - * @return the kind value. - */ - @Generated - public MessageTemplateValueKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateValueKind.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateValueKind.java deleted file mode 100644 index 3a5366dfef07..000000000000 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateValueKind.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.communication.messages.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * The type of the template parameter. - */ -public final class MessageTemplateValueKind extends ExpandableStringEnum { - - /** - * The text template parameter type. - */ - @Generated - public static final MessageTemplateValueKind TEXT = fromString("text"); - - /** - * The image template parameter type. - */ - @Generated - public static final MessageTemplateValueKind IMAGE = fromString("image"); - - /** - * The document template parameter type. - */ - @Generated - public static final MessageTemplateValueKind DOCUMENT = fromString("document"); - - /** - * The video template parameter type. - */ - @Generated - public static final MessageTemplateValueKind VIDEO = fromString("video"); - - /** - * The location template parameter type. - */ - @Generated - public static final MessageTemplateValueKind LOCATION = fromString("location"); - - /** - * The quick action template parameter type. - */ - @Generated - public static final MessageTemplateValueKind QUICK_ACTION = fromString("quickAction"); - - /** - * Creates a new instance of MessageTemplateValueKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public MessageTemplateValueKind() { - } - - /** - * Creates or finds a MessageTemplateValueKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding MessageTemplateValueKind. - */ - @Generated - @JsonCreator - public static MessageTemplateValueKind fromString(String name) { - return fromString(name, MessageTemplateValueKind.class); - } - - /** - * Gets known MessageTemplateValueKind values. - * - * @return known MessageTemplateValueKind values. - */ - @Generated - public static Collection values() { - return values(MessageTemplateValueKind.class); - } -} diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateVideo.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateVideo.java index 4f59128477a2..e2dbf8220477 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateVideo.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MessageTemplateVideo.java @@ -7,14 +7,13 @@ import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * The message template's video value information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MessageTemplateVideo.class, visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("video") @Fluent public final class MessageTemplateVideo extends MessageTemplateValue { @@ -24,7 +23,7 @@ public final class MessageTemplateVideo extends MessageTemplateValue { */ @Generated @JsonProperty(value = "url") - private final String url; + private String url; /* * The [optional] caption of the media object. @@ -107,23 +106,4 @@ public MessageTemplateVideo setFileName(String fileName) { this.fileName = fileName; return this; } - - /* - * The type discriminator describing a template parameter type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private MessageTemplateValueKind kind = MessageTemplateValueKind.VIDEO; - - /** - * Get the kind property: The type discriminator describing a template parameter type. - * - * @return the kind value. - */ - @Generated - @Override - public MessageTemplateValueKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/NotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/NotificationContent.java index 55df2e03f14b..a5d15b252f74 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/NotificationContent.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/NotificationContent.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -16,7 +15,11 @@ /** * Details of the message to send. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = NotificationContent.class, visible = true) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = NotificationContent.class) @JsonTypeName("NotificationContent") @JsonSubTypes({ @JsonSubTypes.Type(name = "text", value = TextNotificationContent.class), @@ -30,14 +33,14 @@ public abstract class NotificationContent { */ @Generated @JsonProperty(value = "channelRegistrationId") - private final String channelRegistrationId; + private String channelRegistrationId; /* * The native external platform user identifiers of the recipient. */ @Generated @JsonProperty(value = "to") - private final List to; + private List to; /** * Creates an instance of NotificationContent class. @@ -49,7 +52,6 @@ public abstract class NotificationContent { @JsonCreator protected NotificationContent(@JsonProperty(value = "channelRegistrationId") String channelRegistrationId, @JsonProperty(value = "to") List to) { - this.kind = CommunicationMessageKind.fromString("NotificationContent"); this.channelRegistrationId = channelRegistrationId; this.to = to; } @@ -73,22 +75,4 @@ public String getChannelRegistrationId() { public List getTo() { return this.to; } - - /* - * The type discriminator describing a notification type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private CommunicationMessageKind kind; - - /** - * Get the kind property: The type discriminator describing a notification type. - * - * @return the kind value. - */ - @Generated - public CommunicationMessageKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/SendMessageResult.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/SendMessageResult.java index e9ac5b4b3e45..1b84855cc9e6 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/SendMessageResult.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/SendMessageResult.java @@ -20,7 +20,7 @@ public final class SendMessageResult { */ @Generated @JsonProperty(value = "receipts") - private final List receipts; + private List receipts; /** * Creates an instance of SendMessageResult class. diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/TemplateNotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/TemplateNotificationContent.java index b8eb3f55f833..1d5ecd5b0e75 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/TemplateNotificationContent.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/TemplateNotificationContent.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -15,11 +14,7 @@ /** * A request to send a template notification. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = TemplateNotificationContent.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("template") @Immutable public final class TemplateNotificationContent extends NotificationContent { @@ -29,7 +24,7 @@ public final class TemplateNotificationContent extends NotificationContent { */ @Generated @JsonProperty(value = "template") - private final MessageTemplate template; + private MessageTemplate template; /** * Creates an instance of TemplateNotificationContent class. @@ -55,23 +50,4 @@ public TemplateNotificationContent(@JsonProperty(value = "channelRegistrationId" public MessageTemplate getTemplate() { return this.template; } - - /* - * The type discriminator describing a notification type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private CommunicationMessageKind kind = CommunicationMessageKind.TEMPLATE; - - /** - * Get the kind property: The type discriminator describing a notification type. - * - * @return the kind value. - */ - @Generated - @Override - public CommunicationMessageKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/TextNotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/TextNotificationContent.java index 4419f21f4ec5..26172050593b 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/TextNotificationContent.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/TextNotificationContent.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -15,11 +14,7 @@ /** * A request to send a text notification. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = TextNotificationContent.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("text") @Immutable public final class TextNotificationContent extends NotificationContent { @@ -29,7 +24,7 @@ public final class TextNotificationContent extends NotificationContent { */ @Generated @JsonProperty(value = "content") - private final String content; + private String content; /** * Creates an instance of TextNotificationContent class. @@ -55,23 +50,4 @@ public TextNotificationContent(@JsonProperty(value = "channelRegistrationId") St public String getContent() { return this.content; } - - /* - * The type discriminator describing a notification type. - */ - @Generated - @JsonTypeId - @JsonProperty(value = "kind") - private CommunicationMessageKind kind = CommunicationMessageKind.TEXT; - - /** - * Get the kind property: The type discriminator describing a notification type. - * - * @return the kind value. - */ - @Generated - @Override - public CommunicationMessageKind getKind() { - return this.kind; - } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/channels/WhatsAppMessageTemplateBindings.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/channels/WhatsAppMessageTemplateBindings.java index 4e29d1596a39..1e7c09255a0c 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/channels/WhatsAppMessageTemplateBindings.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/channels/WhatsAppMessageTemplateBindings.java @@ -4,11 +4,9 @@ package com.azure.communication.messages.models.channels; import com.azure.communication.messages.models.MessageTemplateBindings; -import com.azure.communication.messages.models.MessageTemplateBindingsKind; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -16,11 +14,7 @@ /** * The template bindings for WhatsApp. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = WhatsAppMessageTemplateBindings.class, - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("whatsApp") @Fluent public final class WhatsAppMessageTemplateBindings extends MessageTemplateBindings { @@ -148,23 +142,4 @@ public WhatsAppMessageTemplateBindings setButtons(List com.azure azure-communication-phonenumbers - 1.1.4 + 1.1.12 ``` @@ -326,7 +326,7 @@ Check out other client libraries for Azure communication service [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com [product_docs]: https://docs.microsoft.com/azure/communication-services/ -[package]: https://central.sonatype.com/artifact/com.azure/azure-communication-phonenumbers +[package]: https://search.maven.org/artifact/com.azure/azure-communication-phonenumbers [api_documentation]: https://aka.ms/java-docs [source]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/communication/azure-communication-phonenumbers/src diff --git a/sdk/communication/azure-communication-phonenumbers/assets.json b/sdk/communication/azure-communication-phonenumbers/assets.json deleted file mode 100644 index 407d713a0173..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "java", - "TagPrefix": "java/communication/azure-communication-phonenumbers", - "Tag": "java/communication/azure-communication-phonenumbers_737e64b52b" -} diff --git a/sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json b/sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json index 46a5386a8f96..559c5367d0e3 100644 --- a/sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json +++ b/sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json @@ -5,24 +5,22 @@ "matrix": { "Agent": { "ubuntu-20.04": { - "OSVmImage": "env:LINUXVMIMAGE", - "Pool": "env:LINUXPOOL", + "OSVmImage": "MMSUbuntu20.04", + "Pool": "azsdk-pool-mms-ubuntu-2004-general", "JavaTestVersion": "1.8", "AZURE_TEST_HTTP_CLIENTS": "okhttp", "AZURE_TEST_AGENT": "UBUNTU_2004_JAVA8" }, "macos-11": { - "OSVmImage": "env:MACVMIMAGE", - "Pool": "env:MACPOOL", - "JavaTestVersion": "1.21", + "OSVmImage": "macos-11", + "Pool": "Azure Pipelines", + "JavaTestVersion": "1.11", "AZURE_TEST_HTTP_CLIENTS": "netty", "AZURE_TEST_AGENT": "MACOS_1015_JAVA11" } }, "SKIP_UPDATE_CAPABILITIES_LIVE_TESTS": "false", - "SKIP_SIP_ROUTING_LIVE_TESTS": "false", "TestFromSource": false, - "RunAggregateReports": false, "TestGoals": "surefire:test", "TestOptions": "" }, @@ -30,35 +28,31 @@ { "Agent": { "ubuntu-20.04": { - "OSVmImage": "env:LINUXVMIMAGE", - "Pool": "env:LINUXPOOL" + "OSVmImage": "MMSUbuntu20.04", + "Pool": "azsdk-pool-mms-ubuntu-2004-general" } }, - "JavaTestVersion": "1.21", + "JavaTestVersion": "1.11", "AZURE_TEST_HTTP_CLIENTS": "netty", "TestFromSource": true, "TestGoals": "verify", - "RunAggregateReports": false, "TestOptions": "-DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false", "SKIP_UPDATE_CAPABILITIES_LIVE_TESTS": "false", - "SKIP_SIP_ROUTING_LIVE_TESTS": "false", "AZURE_TEST_AGENT": "UBUNTU_2004_JAVA11" }, { "Agent": { "windows-2022": { - "OSVmImage": "env:WINDOWSVMIMAGE", - "Pool": "env:WINDOWSPOOL" + "OSVmImage": "windows-2022", + "Pool": "azsdk-pool-mms-win-2022-general" } }, - "JavaTestVersion": "1.21", - "RunAggregateReports": true, + "JavaTestVersion": "1.11", "AZURE_TEST_HTTP_CLIENTS": "netty", "TestFromSource": false, "TestGoals": "verify", "TestOptions": "-DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false", "SKIP_UPDATE_CAPABILITIES_LIVE_TESTS": "false", - "SKIP_SIP_ROUTING_LIVE_TESTS": "false", "AZURE_TEST_AGENT": "WINDOWS_2019_JAVA11" } ] diff --git a/sdk/communication/azure-communication-phonenumbers/pom.xml b/sdk/communication/azure-communication-phonenumbers/pom.xml index 4608d6f09a7b..f6610de11406 100644 --- a/sdk/communication/azure-communication-phonenumbers/pom.xml +++ b/sdk/communication/azure-communication-phonenumbers/pom.xml @@ -16,7 +16,7 @@ com.azure azure-communication-phonenumbers jar - 1.2.0-beta.4 + 1.1.12 Microsoft Azure client phone numbers library for communication @@ -49,13 +49,12 @@ src/main src/test - 0.60 - 0.60 + 0.68 + 0.66 false --add-opens com.azure.communication.phonenumbers/com.azure.communication.phonenumbers=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED @@ -132,12 +131,6 @@ 1.11.20 test - - com.azure - azure-core-http-vertx - 1.0.0-beta.17 - test - com.azure azure-identity @@ -155,15 +148,6 @@ com/azure/communication/phonenumbers/*.class - com/azure/communication/phonenumbers/implementation/*.class - com/azure/communication/phonenumbers/implementation/converters/*.class - com/azure/communication/phonenumbers/implementation/models/*.class - com/azure/communication/phonenumbers/models/*.class - com/azure/communication/phonenumbers/siprouting/*.class - com/azure/communication/phonenumbers/siprouting/implementation/*.class - com/azure/communication/phonenumbers/siprouting/implementation/converters/*.class - com/azure/communication/phonenumbers/siprouting/implementation/models/*.class - com/azure/communication/phonenumbers/siprouting/models/*.class @@ -192,21 +176,4 @@ - - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.0.0-beta.12 - test - - - - diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/CodeCoverageAnnotation.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/CodeCoverageAnnotation.java deleted file mode 100644 index b87d03ccda8a..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/CodeCoverageAnnotation.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.phonenumbers; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** Class used for code coverage. */ -public class CodeCoverageAnnotation { - /** Annotation used to exclude from code coverage */ - @Documented - @Retention(RetentionPolicy.RUNTIME) - @Target({ ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR }) - public @interface Generated { - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClient.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClient.java index d772c29147de..db9390db88a3 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClient.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClient.java @@ -14,9 +14,6 @@ import com.azure.communication.phonenumbers.implementation.models.PhoneNumbersReleasePhoneNumberResponse; import com.azure.communication.phonenumbers.implementation.models.PhoneNumberCapabilitiesRequest; import com.azure.communication.phonenumbers.implementation.models.PhoneNumbersUpdateCapabilitiesResponse; -import com.azure.communication.phonenumbers.implementation.models.OperatorInformationRequest; -import com.azure.communication.phonenumbers.models.OperatorInformationResult; -import com.azure.communication.phonenumbers.models.OperatorInformationOptions; import com.azure.communication.phonenumbers.models.PhoneNumberAreaCode; import com.azure.communication.phonenumbers.models.PurchasedPhoneNumber; import com.azure.communication.phonenumbers.models.ReleasePhoneNumberResult; @@ -48,7 +45,6 @@ import reactor.core.publisher.Mono; import java.time.Duration; -import java.util.List; import java.util.Objects; import java.util.function.BiFunction; import java.util.function.Function; @@ -65,7 +61,7 @@ * * - * + * *
  * PhoneNumbersAsyncClient phoneNumberAsyncClient = new PhoneNumbersClientBuilder()
  *         .endpoint(endpoint)
@@ -73,7 +69,7 @@
  *         .httpClient(httpClient)
  *         .buildAsyncClient();
  * 
- * + * * * * @see PhoneNumbersClientBuilder @@ -103,13 +99,13 @@ public final class PhoneNumbersAsyncClient { * * - * + * *
      * PurchasedPhoneNumber phoneNumber = phoneNumberAsyncClient.getPurchasedPhoneNumber("+18001234567").block();
      * System.out.println("Phone Number Value: " + phoneNumber.getPhoneNumber());
      * System.out.println("Phone Number Country Code: " + phoneNumber.getCountryCode());
      * 
- * + * * * * @param phoneNumber The phone number id in E.164 format. The leading plus can @@ -137,7 +133,7 @@ public Mono getPurchasedPhoneNumber(String phoneNumber) { * * - * + * *
      * Response<PurchasedPhoneNumber> response = phoneNumberAsyncClient
      *         .getPurchasedPhoneNumberWithResponse("+18001234567").block();
@@ -145,7 +141,7 @@ public Mono getPurchasedPhoneNumber(String phoneNumber) {
      * System.out.println("Phone Number Value: " + phoneNumber.getPhoneNumber());
      * System.out.println("Phone Number Country Code: " + phoneNumber.getCountryCode());
      * 
- * + * * * @@ -174,14 +170,14 @@ public Mono> getPurchasedPhoneNumberWithResponse( * * - * + * *
      * PagedFlux<PurchasedPhoneNumber> phoneNumbers = phoneNumberAsyncClient.listPurchasedPhoneNumbers();
      * PurchasedPhoneNumber phoneNumber = phoneNumbers.blockFirst();
      * System.out.println("Phone Number Value: " + phoneNumber.getPhoneNumber());
      * System.out.println("Phone Number Country Code: " + phoneNumber.getCountryCode());
      * 
- * + * * * * @return A {@link PagedFlux} of {@link PurchasedPhoneNumber} instances @@ -205,7 +201,7 @@ public PagedFlux listPurchasedPhoneNumbers() { * * - * + * *
      * PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities()
      *         .setCalling(PhoneNumberCapabilityType.INBOUND)
@@ -225,7 +221,7 @@ public PagedFlux listPurchasedPhoneNumbers() {
      *     System.out.println("Phone number costs:" + searchResult.getCost().getAmount());
      * }
      * 
- * + * * * @@ -256,7 +252,7 @@ public PollerFlux beginSearchAvai * - * + * *
      * PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities()
      *         .setCalling(PhoneNumberCapabilityType.INBOUND)
@@ -276,7 +272,7 @@ public PollerFlux beginSearchAvai
      *     System.out.println("Phone number costs:" + searchResult.getCost().getAmount());
      * }
      * 
- * + * * @@ -410,13 +406,13 @@ private Function, Mono - * + * *
      * AsyncPollResponse<PhoneNumberOperation, PurchasePhoneNumbersResult> purchaseResponse = phoneNumberAsyncClient
      *         .beginPurchasePhoneNumbers(searchId).blockFirst();
      * System.out.println("Purchase phone numbers is complete: " + purchaseResponse.getStatus());
      * 
- * + * * * * @param searchId ID of the search. @@ -476,13 +472,13 @@ private Function, Mono - * + * *
      * AsyncPollResponse<PhoneNumberOperation, ReleasePhoneNumberResult> releaseResponse = phoneNumberAsyncClient
      *         .beginReleasePhoneNumber("+18001234567").blockFirst();
      * System.out.println("Release phone number is complete: " + releaseResponse.getStatus());
      * 
- * + * * * * @param phoneNumber The phone number id in E.164 format. The leading plus can @@ -538,7 +534,7 @@ private Function, Mono - * + * *
      * PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities();
      * capabilities
@@ -555,7 +551,7 @@ private Function, Mono
-     *
+     * 
      * 
      *
@@ -719,40 +715,6 @@ public PagedFlux listAvailableOfferings(String countryCode,
         }
     }
 
-    /**
-     * Searches for operator information for a given list of phone numbers.
-     *
-     * @param phoneNumbers The phone number(s) whose operator information should be searched.
-     *
-     * @return A {@link OperatorInformationResult} which contains the results of the search.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono searchOperatorInformation(List phoneNumbers) {
-        OperatorInformationRequest request = new OperatorInformationRequest();
-        request.setPhoneNumbers(phoneNumbers);
-        request.setOptions(new OperatorInformationOptions().setIncludeAdditionalOperatorDetails(false));
-        return client.operatorInformationSearchAsync(request)
-                .onErrorMap(CommunicationErrorResponseException.class, e -> translateException(e));
-    }
-
-    /**
-     * Searches for operator information for a given list of phone numbers.
-     *
-     * @param phoneNumbers The phone number(s) whose operator information should be searched.
-     * @param requestOptions Modifies the search to include additional fields in the response.
-     *                  Please note: use of options will affect the cost of the search.
-     *
-     * @return A {@link OperatorInformationResult} which contains the results of the search.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> searchOperatorInformationWithResponse(List phoneNumbers, OperatorInformationOptions requestOptions) {
-        OperatorInformationRequest request = new OperatorInformationRequest();
-        request.setPhoneNumbers(phoneNumbers);
-        request.setOptions(requestOptions);
-        return client.operatorInformationSearchWithResponseAsync(request)
-                .onErrorMap(CommunicationErrorResponseException.class, e -> translateException(e));
-    }
-
     private Mono getOperation(String operationId) {
         return client.getOperationAsync(operationId)
                 .onErrorMap(CommunicationErrorResponseException.class, e -> translateException(e))
diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersClient.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersClient.java
index a1b43dac22d3..87d302a15e66 100644
--- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersClient.java
+++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersClient.java
@@ -2,14 +2,10 @@
 // Licensed under the MIT License.
 package com.azure.communication.phonenumbers;
 
-import java.util.List;
 import java.util.Objects;
 
 import com.azure.communication.phonenumbers.implementation.PhoneNumberAdminClientImpl;
 import com.azure.communication.phonenumbers.implementation.PhoneNumbersImpl;
-import com.azure.communication.phonenumbers.implementation.models.OperatorInformationRequest;
-import com.azure.communication.phonenumbers.models.OperatorInformationResult;
-import com.azure.communication.phonenumbers.models.OperatorInformationOptions;
 import com.azure.communication.phonenumbers.models.PhoneNumberAreaCode;
 import com.azure.communication.phonenumbers.models.PhoneNumberAssignmentType;
 import com.azure.communication.phonenumbers.models.PhoneNumberCapabilities;
@@ -108,7 +104,7 @@ public PurchasedPhoneNumber getPurchasedPhoneNumber(String phoneNumber) {
      *
      * 
-     *
+     * 
      * 
      * Response<PurchasedPhoneNumber> response = phoneNumberClient
      *         .getPurchasedPhoneNumberWithResponse("+18001234567", Context.NONE);
@@ -116,7 +112,7 @@ public PurchasedPhoneNumber getPurchasedPhoneNumber(String phoneNumber) {
      * System.out.println("Phone Number Value: " + phoneNumber.getPhoneNumber());
      * System.out.println("Phone Number Country Code: " + phoneNumber.getCountryCode());
      * 
- * + * * * @@ -168,14 +164,14 @@ public PagedIterable listPurchasedPhoneNumbers() { * * - * + * *
      * PagedIterable<PurchasedPhoneNumber> phoneNumbers = phoneNumberClient.listPurchasedPhoneNumbers(Context.NONE);
      * PurchasedPhoneNumber phoneNumber = phoneNumbers.iterator().next();
      * System.out.println("Phone Number Value: " + phoneNumber.getPhoneNumber());
      * System.out.println("Phone Number Country Code: " + phoneNumber.getCountryCode());
      * 
- * + * * * @@ -202,7 +198,7 @@ public PagedIterable listPurchasedPhoneNumbers(Context con * * - * + * *
      * PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities()
      *         .setCalling(PhoneNumberCapabilityType.INBOUND)
@@ -222,7 +218,7 @@ public PagedIterable listPurchasedPhoneNumbers(Context con
      *     System.out.println("Phone number costs:" + searchResult.getCost().getAmount());
      * }
      * 
- * + * * * * @param countryCode The ISO 3166-2 country code. @@ -257,7 +253,7 @@ public SyncPoller beginSearchAvai * - * + * *
      * PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities()
      *         .setCalling(PhoneNumberCapabilityType.INBOUND)
@@ -278,7 +274,7 @@ public SyncPoller beginSearchAvai
      *     System.out.println("Phone number costs:" + searchResult.getCost().getAmount());
      * }
      * 
- * + * * @@ -346,13 +342,13 @@ public SyncPoller beginPurchas * * - * + * *
      * PollResponse<PhoneNumberOperation> purchaseResponse = phoneNumberClient
      *         .beginPurchasePhoneNumbers(searchId, Context.NONE).waitForCompletion();
      * System.out.println("Purchase phone numbers is complete: " + purchaseResponse.getStatus());
      * 
- * + * * * @@ -410,13 +406,13 @@ public SyncPoller beginReleasePh * * - * + * *
      * PollResponse<PhoneNumberOperation> releaseResponse = phoneNumberClient
      *         .beginReleasePhoneNumber("+18001234567", Context.NONE).waitForCompletion();
      * System.out.println("Release phone number is complete: " + releaseResponse.getStatus());
      * 
- * + * * * @@ -446,7 +442,7 @@ public SyncPoller beginReleasePh * * - * + * *
      * PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities();
      * capabilities
@@ -463,7 +459,7 @@ public SyncPoller beginReleasePh
      *     System.out.println("Phone Number SMS capabilities: " + phoneNumber.getCapabilities().getSms());
      * }
      * 
- * + * * * @@ -495,7 +491,7 @@ public SyncPoller beginUpdatePhoneNu * - * + * *
      * PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities();
      * capabilities
@@ -512,7 +508,7 @@ public SyncPoller beginUpdatePhoneNu
      *     System.out.println("Phone Number SMS capabilities: " + phoneNumber.getCapabilities().getSms());
      * }
      * 
- * + * * @@ -699,40 +695,4 @@ public PagedIterable listAvailableOfferings(String countryC context = context == null ? Context.NONE : context; return client.listOfferings(countryCode, null, null, phoneNumberType, assignmentType, acceptLanguage, context); } - - /** - * Searches for operator information for a given list of phone numbers. - * - * @param phoneNumbers The phone number(s) whose operator information should be searched. - * - * @return A {@link OperatorInformationResult} which contains the results of the search. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperatorInformationResult searchOperatorInformation(List phoneNumbers) { - OperatorInformationRequest request = new OperatorInformationRequest(); - request.setPhoneNumbers(phoneNumbers); - request.setOptions(new OperatorInformationOptions().setIncludeAdditionalOperatorDetails(false)); - return client.operatorInformationSearch(request); - } - - /** - * Searches for operator information for a given list of phone numbers. - * - * @param phoneNumbers The phone number(s) whose operator information should be searched. - * @param requestOptions Modifies the search to include additional fields in the response. - * Please note: use of options will affect the cost of the search. - * @param context A {@link Context} representing the request context. - * - * @return A {@link OperatorInformationResult} which contains the results of the search. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response searchOperatorInformationWithResponse(List phoneNumbers, - OperatorInformationOptions requestOptions, - Context context) { - context = context == null ? Context.NONE : context; - OperatorInformationRequest request = new OperatorInformationRequest(); - request.setPhoneNumbers(phoneNumbers); - request.setOptions(requestOptions); - return client.operatorInformationSearchWithResponse(request, context); - } } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersServiceVersion.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersServiceVersion.java index ac4b94ed4bc3..31e2a47be246 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersServiceVersion.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/PhoneNumbersServiceVersion.java @@ -12,12 +12,7 @@ public enum PhoneNumbersServiceVersion implements ServiceVersion { /** * Service version {@code 2021-03-07}. */ - V2021_03_07("2021-03-07"), - - /** - * Number Lookup update to public preview {@code 2024-03-01-preview} - */ - V2024_03_01_PREVIEW("2024-03-01-preview"); + V2021_03_07("2021-03-07"); private final String version; @@ -42,6 +37,6 @@ public String getVersion() { */ public static PhoneNumbersServiceVersion getLatest() { - return V2024_03_01_PREVIEW; + return V2021_03_07; } } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumberAdminClientImpl.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumberAdminClientImpl.java index 0e399024be73..6513b87288d5 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumberAdminClientImpl.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumberAdminClientImpl.java @@ -74,31 +74,23 @@ public PhoneNumbersImpl getPhoneNumbers() { return this.phoneNumbers; } - /** - * Initializes an instance of PhoneNumberAdminClient client. - * - * @param endpoint The communication resource, for example https://resourcename.communication.azure.com. - * @param apiVersion Api Version. - */ - PhoneNumberAdminClientImpl(String endpoint, String apiVersion) { + /** Initializes an instance of PhoneNumberAdminClient client. */ + PhoneNumberAdminClientImpl(String endpoint) { this( new HttpPipelineBuilder() .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) .build(), JacksonAdapter.createDefaultSerializerAdapter(), - endpoint, - apiVersion); + endpoint); } /** * Initializes an instance of PhoneNumberAdminClient client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint The communication resource, for example https://resourcename.communication.azure.com. - * @param apiVersion Api Version. */ - PhoneNumberAdminClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion); + PhoneNumberAdminClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -106,15 +98,12 @@ public PhoneNumbersImpl getPhoneNumbers() { * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint The communication resource, for example https://resourcename.communication.azure.com. - * @param apiVersion Api Version. */ - PhoneNumberAdminClientImpl( - HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, String apiVersion) { + PhoneNumberAdminClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.apiVersion = apiVersion; + this.apiVersion = "2022-12-01"; this.phoneNumbers = new PhoneNumbersImpl(this); } } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumberAdminClientImplBuilder.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumberAdminClientImplBuilder.java index 3df8f784d61d..425704ad03a3 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumberAdminClientImplBuilder.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumberAdminClientImplBuilder.java @@ -4,182 +4,55 @@ package com.azure.communication.phonenumbers.implementation; -import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; -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.http.HttpClient; -import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; /** A builder for creating a new instance of the PhoneNumberAdminClient type. */ @ServiceClientBuilder(serviceClients = {PhoneNumberAdminClientImpl.class}) -public final class PhoneNumberAdminClientImplBuilder - implements HttpTrait, - ConfigurationTrait, - EndpointTrait { - @Generated private static final String SDK_NAME = "name"; - - @Generated private static final String SDK_VERSION = "version"; - - @Generated private final Map properties = new HashMap<>(); - - @Generated private final List pipelinePolicies; - - /** Create an instance of the PhoneNumberAdminClientImplBuilder. */ - @Generated - public PhoneNumberAdminClientImplBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public PhoneNumberAdminClientImplBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public PhoneNumberAdminClientImplBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PhoneNumberAdminClientImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - +public final class PhoneNumberAdminClientImplBuilder { /* - * The client options such as application ID and custom headers to set on a - * request. + * The communication resource, for example + * https://resourcename.communication.azure.com */ - @Generated private ClientOptions clientOptions; + private String endpoint; - /** {@inheritDoc}. */ - @Generated - @Override - public PhoneNumberAdminClientImplBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public PhoneNumberAdminClientImplBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public PhoneNumberAdminClientImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service - * client. - */ - @Generated private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public PhoneNumberAdminClientImplBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint + /** + * Sets The communication resource, for example https://resourcename.communication.azure.com. + * + * @param endpoint the endpoint value. + * @return the PhoneNumberAdminClientImplBuilder. */ - @Generated private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override public PhoneNumberAdminClientImplBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } /* - * Api Version + * The HTTP pipeline to send requests through */ - @Generated private String apiVersion; + private HttpPipeline pipeline; /** - * Sets Api Version. + * Sets The HTTP pipeline to send requests through. * - * @param apiVersion the apiVersion value. + * @param pipeline the pipeline value. * @return the PhoneNumberAdminClientImplBuilder. */ - @Generated - public PhoneNumberAdminClientImplBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; + public PhoneNumberAdminClientImplBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* * The serializer to serialize an object into a string */ - @Generated private SerializerAdapter serializerAdapter; + private SerializerAdapter serializerAdapter; /** * Sets The serializer to serialize an object into a string. @@ -187,93 +60,27 @@ public PhoneNumberAdminClientImplBuilder apiVersion(String apiVersion) { * @param serializerAdapter the serializerAdapter value. * @return the PhoneNumberAdminClientImplBuilder. */ - @Generated public PhoneNumberAdminClientImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } - /* - * The retry policy that will attempt to retry failed requests, if - * applicable. - */ - @Generated private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the PhoneNumberAdminClientImplBuilder. - */ - @Generated - public PhoneNumberAdminClientImplBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - /** * Builds an instance of PhoneNumberAdminClientImpl with the provided parameters. * * @return an instance of PhoneNumberAdminClientImpl. */ - @Generated public PhoneNumberAdminClientImpl buildClient() { if (pipeline == null) { - this.pipeline = createHttpPipeline(); - } - if (apiVersion == null) { - this.apiVersion = "2024-03-01-preview"; + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); } if (serializerAdapter == null) { this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter(); } - PhoneNumberAdminClientImpl client = - new PhoneNumberAdminClientImpl(pipeline, serializerAdapter, endpoint, apiVersion); + PhoneNumberAdminClientImpl client = new PhoneNumberAdminClientImpl(pipeline, serializerAdapter, endpoint); return client; } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - if (httpLogOptions == null) { - httpLogOptions = new HttpLogOptions(); - } - if (clientOptions == null) { - clientOptions = new ClientOptions(); - } - List policies = new ArrayList<>(); - String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(clientOptions) - .build(); - return httpPipeline; - } } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumbersImpl.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumbersImpl.java index dd2e8c5c0f01..8f37bf040525 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumbersImpl.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/PhoneNumbersImpl.java @@ -6,7 +6,6 @@ import com.azure.communication.phonenumbers.implementation.models.CommunicationErrorResponseException; import com.azure.communication.phonenumbers.implementation.models.OfferingsResponse; -import com.azure.communication.phonenumbers.implementation.models.OperatorInformationRequest; import com.azure.communication.phonenumbers.implementation.models.PhoneNumberAreaCodes; import com.azure.communication.phonenumbers.implementation.models.PhoneNumberCapabilitiesRequest; import com.azure.communication.phonenumbers.implementation.models.PhoneNumberCountries; @@ -20,7 +19,6 @@ import com.azure.communication.phonenumbers.implementation.models.PhoneNumbersSearchAvailablePhoneNumbersResponse; import com.azure.communication.phonenumbers.implementation.models.PhoneNumbersUpdateCapabilitiesResponse; import com.azure.communication.phonenumbers.implementation.models.PurchasedPhoneNumbers; -import com.azure.communication.phonenumbers.models.OperatorInformationResult; import com.azure.communication.phonenumbers.models.PhoneNumberAreaCode; import com.azure.communication.phonenumbers.models.PhoneNumberAssignmentType; import com.azure.communication.phonenumbers.models.PhoneNumberCountry; @@ -94,7 +92,6 @@ Mono> listAreaCodes( @QueryParam("administrativeDivision") String administrativeDivision, @QueryParam("api-version") String apiVersion, @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Accept") String accept, Context context); @Get("/availablePhoneNumbers/countries") @@ -106,7 +103,6 @@ Mono> listAvailableCountries( @QueryParam("maxPageSize") Integer maxPageSize, @QueryParam("api-version") String apiVersion, @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Accept") String accept, Context context); @Get("/availablePhoneNumbers/countries/{countryCode}/localities") @@ -120,7 +116,6 @@ Mono> listAvailableLocalities( @QueryParam("administrativeDivision") String administrativeDivision, @QueryParam("api-version") String apiVersion, @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Accept") String accept, Context context); @Get("/availablePhoneNumbers/countries/{countryCode}/offerings") @@ -135,7 +130,6 @@ Mono> listOfferings( @QueryParam("assignmentType") PhoneNumberAssignmentType assignmentType, @QueryParam("api-version") String apiVersion, @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Accept") String accept, Context context); @Post("/availablePhoneNumbers/countries/{countryCode}/:search") @@ -146,7 +140,6 @@ Mono searchAvailablePhoneNumber @PathParam("countryCode") String countryCode, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PhoneNumberSearchRequest body, - @HeaderParam("Accept") String accept, Context context); @Get("/availablePhoneNumbers/searchResults/{searchId}") @@ -156,7 +149,6 @@ Mono> getSearchResult( @HostParam("endpoint") String endpoint, @PathParam("searchId") String searchId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); @Post("/availablePhoneNumbers/:purchase") @@ -166,7 +158,6 @@ Mono purchasePhoneNumbers( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PhoneNumberPurchaseRequest body, - @HeaderParam("Accept") String accept, Context context); @Get("/phoneNumbers/operations/{operationId}") @@ -176,7 +167,6 @@ Mono getOperation( @HostParam("endpoint") String endpoint, @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); @Delete("/phoneNumbers/operations/{operationId}") @@ -186,7 +176,6 @@ Mono> cancelOperation( @HostParam("endpoint") String endpoint, @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); @Patch("/phoneNumbers/{phoneNumber}/capabilities") @@ -197,7 +186,6 @@ Mono updateCapabilities( @PathParam("phoneNumber") String phoneNumber, @QueryParam("api-version") String apiVersion, @BodyParam("application/merge-patch+json") PhoneNumberCapabilitiesRequest body, - @HeaderParam("Accept") String accept, Context context); @Get("/phoneNumbers/{phoneNumber}") @@ -207,7 +195,6 @@ Mono> getByNumber( @HostParam("endpoint") String endpoint, @PathParam("phoneNumber") String phoneNumber, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); @Delete("/phoneNumbers/{phoneNumber}") @@ -217,7 +204,6 @@ Mono releasePhoneNumber( @HostParam("endpoint") String endpoint, @PathParam("phoneNumber") String phoneNumber, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); @Get("/phoneNumbers") @@ -228,78 +214,48 @@ Mono> listPhoneNumbers( @QueryParam("skip") Integer skip, @QueryParam("top") Integer top, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Post("/operatorInformation/:search") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono> operatorInformationSearch( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") OperatorInformationRequest body, - @HeaderParam("Accept") String accept, Context context); @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) Mono> listAreaCodesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, - @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) Mono> listAvailableCountriesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, - @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) Mono> listAvailableLocalitiesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, - @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) Mono> listOfferingsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, - @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) Mono> listPhoneNumbersNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } /** * Gets the list of available area codes. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. + * @param phoneNumberType Represents the number type of the offering. * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param assignmentType Represents the assignment type of the offering. * @param locality The name of locality or town in which to search for the area code. This is required if the number * type is Geographic. * @param administrativeDivision The name of the state or province in which to search for the area code. @@ -307,8 +263,7 @@ Mono> listPhoneNumbersNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available area codes along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of available area codes. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAreaCodesSinglePageAsync( @@ -320,7 +275,6 @@ public Mono> listAreaCodesSinglePageAsync( String locality, String administrativeDivision, String acceptLanguage) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.listAreaCodes( @@ -334,7 +288,6 @@ public Mono> listAreaCodesSinglePageAsync( administrativeDivision, this.client.getApiVersion(), acceptLanguage, - accept, context)) .map( res -> @@ -351,11 +304,11 @@ public Mono> listAreaCodesSinglePageAsync( * Gets the list of available area codes. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. + * @param phoneNumberType Represents the number type of the offering. * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param assignmentType Represents the assignment type of the offering. * @param locality The name of locality or town in which to search for the area code. This is required if the number * type is Geographic. * @param administrativeDivision The name of the state or province in which to search for the area code. @@ -364,8 +317,7 @@ public Mono> listAreaCodesSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available area codes along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of available area codes. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAreaCodesSinglePageAsync( @@ -378,7 +330,6 @@ public Mono> listAreaCodesSinglePageAsync( String administrativeDivision, String acceptLanguage, Context context) { - final String accept = "application/json"; return service.listAreaCodes( this.client.getEndpoint(), countryCode, @@ -390,7 +341,6 @@ public Mono> listAreaCodesSinglePageAsync( administrativeDivision, this.client.getApiVersion(), acceptLanguage, - accept, context) .map( res -> @@ -407,11 +357,11 @@ public Mono> listAreaCodesSinglePageAsync( * Gets the list of available area codes. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. + * @param phoneNumberType Represents the number type of the offering. * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param assignmentType Represents the assignment type of the offering. * @param locality The name of locality or town in which to search for the area code. This is required if the number * type is Geographic. * @param administrativeDivision The name of the state or province in which to search for the area code. @@ -419,7 +369,7 @@ public Mono> listAreaCodesSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available area codes as paginated response with {@link PagedFlux}. + * @return the list of available area codes. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAreaCodesAsync( @@ -442,18 +392,18 @@ public PagedFlux listAreaCodesAsync( locality, administrativeDivision, acceptLanguage), - nextLink -> listAreaCodesNextSinglePageAsync(nextLink, acceptLanguage)); + nextLink -> listAreaCodesNextSinglePageAsync(nextLink)); } /** * Gets the list of available area codes. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. + * @param phoneNumberType Represents the number type of the offering. * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param assignmentType Represents the assignment type of the offering. * @param locality The name of locality or town in which to search for the area code. This is required if the number * type is Geographic. * @param administrativeDivision The name of the state or province in which to search for the area code. @@ -462,7 +412,7 @@ public PagedFlux listAreaCodesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available area codes as paginated response with {@link PagedFlux}. + * @return the list of available area codes. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAreaCodesAsync( @@ -487,18 +437,18 @@ public PagedFlux listAreaCodesAsync( administrativeDivision, acceptLanguage, context), - nextLink -> listAreaCodesNextSinglePageAsync(nextLink, acceptLanguage, context)); + nextLink -> listAreaCodesNextSinglePageAsync(nextLink, context)); } /** * Gets the list of available area codes. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. + * @param phoneNumberType Represents the number type of the offering. * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param assignmentType Represents the assignment type of the offering. * @param locality The name of locality or town in which to search for the area code. This is required if the number * type is Geographic. * @param administrativeDivision The name of the state or province in which to search for the area code. @@ -506,7 +456,7 @@ public PagedFlux listAreaCodesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available area codes as paginated response with {@link PagedIterable}. + * @return the list of available area codes. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAreaCodes( @@ -534,11 +484,11 @@ public PagedIterable listAreaCodes( * Gets the list of available area codes. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. + * @param phoneNumberType Represents the number type of the offering. * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param assignmentType Represents the assignment type of the offering. * @param locality The name of locality or town in which to search for the area code. This is required if the number * type is Geographic. * @param administrativeDivision The name of the state or province in which to search for the area code. @@ -547,7 +497,7 @@ public PagedIterable listAreaCodes( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available area codes as paginated response with {@link PagedIterable}. + * @return the list of available area codes. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAreaCodes( @@ -583,13 +533,11 @@ public PagedIterable listAreaCodes( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of supported countries along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of supported countries. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAvailableCountriesSinglePageAsync( Integer skip, Integer maxPageSize, String acceptLanguage) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.listAvailableCountries( @@ -598,7 +546,6 @@ public Mono> listAvailableCountriesSinglePageA maxPageSize, this.client.getApiVersion(), acceptLanguage, - accept, context)) .map( res -> @@ -622,20 +569,17 @@ public Mono> listAvailableCountriesSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of supported countries along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of supported countries. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAvailableCountriesSinglePageAsync( Integer skip, Integer maxPageSize, String acceptLanguage, Context context) { - final String accept = "application/json"; return service.listAvailableCountries( this.client.getEndpoint(), skip, maxPageSize, this.client.getApiVersion(), acceptLanguage, - accept, context) .map( res -> @@ -658,14 +602,14 @@ public Mono> listAvailableCountriesSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of supported countries as paginated response with {@link PagedFlux}. + * @return the list of supported countries. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAvailableCountriesAsync( Integer skip, Integer maxPageSize, String acceptLanguage) { return new PagedFlux<>( () -> listAvailableCountriesSinglePageAsync(skip, maxPageSize, acceptLanguage), - nextLink -> listAvailableCountriesNextSinglePageAsync(nextLink, acceptLanguage)); + nextLink -> listAvailableCountriesNextSinglePageAsync(nextLink)); } /** @@ -679,14 +623,14 @@ public PagedFlux listAvailableCountriesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of supported countries as paginated response with {@link PagedFlux}. + * @return the list of supported countries. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAvailableCountriesAsync( Integer skip, Integer maxPageSize, String acceptLanguage, Context context) { return new PagedFlux<>( () -> listAvailableCountriesSinglePageAsync(skip, maxPageSize, acceptLanguage, context), - nextLink -> listAvailableCountriesNextSinglePageAsync(nextLink, acceptLanguage, context)); + nextLink -> listAvailableCountriesNextSinglePageAsync(nextLink, context)); } /** @@ -699,7 +643,7 @@ public PagedFlux listAvailableCountriesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of supported countries as paginated response with {@link PagedIterable}. + * @return the list of supported countries. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAvailableCountries( @@ -718,7 +662,7 @@ public PagedIterable listAvailableCountries( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of supported countries as paginated response with {@link PagedIterable}. + * @return the list of supported countries. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAvailableCountries( @@ -739,8 +683,7 @@ public PagedIterable listAvailableCountries( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cities or towns with available phone numbers along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of cities or towns with available phone numbers. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAvailableLocalitiesSinglePageAsync( @@ -749,7 +692,6 @@ public Mono> listAvailableLocalitiesSinglePag Integer maxPageSize, String administrativeDivision, String acceptLanguage) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.listAvailableLocalities( @@ -760,7 +702,6 @@ public Mono> listAvailableLocalitiesSinglePag administrativeDivision, this.client.getApiVersion(), acceptLanguage, - accept, context)) .map( res -> @@ -787,8 +728,7 @@ public Mono> listAvailableLocalitiesSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cities or towns with available phone numbers along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of cities or towns with available phone numbers. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAvailableLocalitiesSinglePageAsync( @@ -798,7 +738,6 @@ public Mono> listAvailableLocalitiesSinglePag String administrativeDivision, String acceptLanguage, Context context) { - final String accept = "application/json"; return service.listAvailableLocalities( this.client.getEndpoint(), countryCode, @@ -807,7 +746,6 @@ public Mono> listAvailableLocalitiesSinglePag administrativeDivision, this.client.getApiVersion(), acceptLanguage, - accept, context) .map( res -> @@ -833,7 +771,7 @@ public Mono> listAvailableLocalitiesSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cities or towns with available phone numbers as paginated response with {@link PagedFlux}. + * @return the list of cities or towns with available phone numbers. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAvailableLocalitiesAsync( @@ -846,7 +784,7 @@ public PagedFlux listAvailableLocalitiesAsync( () -> listAvailableLocalitiesSinglePageAsync( countryCode, skip, maxPageSize, administrativeDivision, acceptLanguage), - nextLink -> listAvailableLocalitiesNextSinglePageAsync(nextLink, acceptLanguage)); + nextLink -> listAvailableLocalitiesNextSinglePageAsync(nextLink)); } /** @@ -863,7 +801,7 @@ public PagedFlux listAvailableLocalitiesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cities or towns with available phone numbers as paginated response with {@link PagedFlux}. + * @return the list of cities or towns with available phone numbers. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAvailableLocalitiesAsync( @@ -877,7 +815,7 @@ public PagedFlux listAvailableLocalitiesAsync( () -> listAvailableLocalitiesSinglePageAsync( countryCode, skip, maxPageSize, administrativeDivision, acceptLanguage, context), - nextLink -> listAvailableLocalitiesNextSinglePageAsync(nextLink, acceptLanguage, context)); + nextLink -> listAvailableLocalitiesNextSinglePageAsync(nextLink, context)); } /** @@ -893,8 +831,7 @@ public PagedFlux listAvailableLocalitiesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cities or towns with available phone numbers as paginated response with {@link - * PagedIterable}. + * @return the list of cities or towns with available phone numbers. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAvailableLocalities( @@ -921,8 +858,7 @@ public PagedIterable listAvailableLocalities( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cities or towns with available phone numbers as paginated response with {@link - * PagedIterable}. + * @return the list of cities or towns with available phone numbers. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAvailableLocalities( @@ -944,14 +880,13 @@ public PagedIterable listAvailableLocalities( * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param phoneNumberType Represents the number type of the offering. + * @param assignmentType Represents the assignment type of the offering. * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of offerings along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return represents a wrapper around a list of offerings. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listOfferingsSinglePageAsync( @@ -961,7 +896,6 @@ public Mono> listOfferingsSinglePageAsync( PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, String acceptLanguage) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.listOfferings( @@ -973,7 +907,6 @@ public Mono> listOfferingsSinglePageAsync( assignmentType, this.client.getApiVersion(), acceptLanguage, - accept, context)) .map( res -> @@ -993,15 +926,14 @@ public Mono> listOfferingsSinglePageAsync( * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param phoneNumberType Represents the number type of the offering. + * @param assignmentType Represents the assignment type of the offering. * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of offerings along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return represents a wrapper around a list of offerings. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listOfferingsSinglePageAsync( @@ -1012,7 +944,6 @@ public Mono> listOfferingsSinglePageAsync( PhoneNumberAssignmentType assignmentType, String acceptLanguage, Context context) { - final String accept = "application/json"; return service.listOfferings( this.client.getEndpoint(), countryCode, @@ -1022,7 +953,6 @@ public Mono> listOfferingsSinglePageAsync( assignmentType, this.client.getApiVersion(), acceptLanguage, - accept, context) .map( res -> @@ -1042,13 +972,13 @@ public Mono> listOfferingsSinglePageAsync( * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param phoneNumberType Represents the number type of the offering. + * @param assignmentType Represents the assignment type of the offering. * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of offerings as paginated response with {@link PagedFlux}. + * @return represents a wrapper around a list of offerings. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listOfferingsAsync( @@ -1062,7 +992,7 @@ public PagedFlux listOfferingsAsync( () -> listOfferingsSinglePageAsync( countryCode, skip, maxPageSize, phoneNumberType, assignmentType, acceptLanguage), - nextLink -> listOfferingsNextSinglePageAsync(nextLink, acceptLanguage)); + nextLink -> listOfferingsNextSinglePageAsync(nextLink)); } /** @@ -1072,14 +1002,14 @@ public PagedFlux listOfferingsAsync( * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param phoneNumberType Represents the number type of the offering. + * @param assignmentType Represents the assignment type of the offering. * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of offerings as paginated response with {@link PagedFlux}. + * @return represents a wrapper around a list of offerings. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listOfferingsAsync( @@ -1100,7 +1030,7 @@ public PagedFlux listOfferingsAsync( assignmentType, acceptLanguage, context), - nextLink -> listOfferingsNextSinglePageAsync(nextLink, acceptLanguage, context)); + nextLink -> listOfferingsNextSinglePageAsync(nextLink, context)); } /** @@ -1110,13 +1040,13 @@ public PagedFlux listOfferingsAsync( * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param phoneNumberType Represents the number type of the offering. + * @param assignmentType Represents the assignment type of the offering. * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of offerings as paginated response with {@link PagedIterable}. + * @return represents a wrapper around a list of offerings. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listOfferings( @@ -1137,14 +1067,14 @@ public PagedIterable listOfferings( * @param skip An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. * @param maxPageSize An optional parameter for how many entries to return, for pagination purposes. The default * value is 100. - * @param phoneNumberType Filter by numberType, e.g. Geographic, TollFree. - * @param assignmentType Filter by assignmentType, e.g. Person, Application. + * @param phoneNumberType Represents the number type of the offering. + * @param assignmentType Represents the assignment type of the offering. * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of offerings as paginated response with {@link PagedIterable}. + * @return represents a wrapper around a list of offerings. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listOfferings( @@ -1164,86 +1094,98 @@ public PagedIterable listOfferings( * Search for available phone numbers to purchase. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param body The phone number search request. + * @param body Represents a phone number search request to find phone numbers. Found phone numbers are temporarily + * held for a following purchase. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a phone number search operation on successful completion of {@link Mono}. + * @return the result of a phone number search operation. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono searchAvailablePhoneNumbersWithResponseAsync( String countryCode, PhoneNumberSearchRequest body) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.searchAvailablePhoneNumbers( - this.client.getEndpoint(), - countryCode, - this.client.getApiVersion(), - body, - accept, - context)); + this.client.getEndpoint(), countryCode, this.client.getApiVersion(), body, context)); } /** * Search for available phone numbers to purchase. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param body The phone number search request. + * @param body Represents a phone number search request to find phone numbers. Found phone numbers are temporarily + * held for a following purchase. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a phone number search operation on successful completion of {@link Mono}. + * @return the result of a phone number search operation. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono searchAvailablePhoneNumbersWithResponseAsync( String countryCode, PhoneNumberSearchRequest body, Context context) { - final String accept = "application/json"; return service.searchAvailablePhoneNumbers( - this.client.getEndpoint(), countryCode, this.client.getApiVersion(), body, accept, context); + this.client.getEndpoint(), countryCode, this.client.getApiVersion(), body, context); } /** * Search for available phone numbers to purchase. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param body The phone number search request. + * @param body Represents a phone number search request to find phone numbers. Found phone numbers are temporarily + * held for a following purchase. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a phone number search operation on successful completion of {@link Mono}. + * @return the result of a phone number search operation. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono searchAvailablePhoneNumbersAsync( String countryCode, PhoneNumberSearchRequest body) { return searchAvailablePhoneNumbersWithResponseAsync(countryCode, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + .flatMap( + (PhoneNumbersSearchAvailablePhoneNumbersResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Search for available phone numbers to purchase. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param body The phone number search request. + * @param body Represents a phone number search request to find phone numbers. Found phone numbers are temporarily + * held for a following purchase. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a phone number search operation on successful completion of {@link Mono}. + * @return the result of a phone number search operation. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono searchAvailablePhoneNumbersAsync( String countryCode, PhoneNumberSearchRequest body, Context context) { return searchAvailablePhoneNumbersWithResponseAsync(countryCode, body, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + .flatMap( + (PhoneNumbersSearchAvailablePhoneNumbersResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** * Search for available phone numbers to purchase. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param body The phone number search request. + * @param body Represents a phone number search request to find phone numbers. Found phone numbers are temporarily + * held for a following purchase. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1258,7 +1200,8 @@ public PhoneNumberSearchResult searchAvailablePhoneNumbers(String countryCode, P * Search for available phone numbers to purchase. * * @param countryCode The ISO 3166-2 country code, e.g. US. - * @param body The phone number search request. + * @param body Represents a phone number search request to find phone numbers. Found phone numbers are temporarily + * held for a following purchase. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. @@ -1266,9 +1209,9 @@ public PhoneNumberSearchResult searchAvailablePhoneNumbers(String countryCode, P * @return the result of a phone number search operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PhoneNumbersSearchAvailablePhoneNumbersResponse searchAvailablePhoneNumbersWithResponse( + public PhoneNumberSearchResult searchAvailablePhoneNumbers( String countryCode, PhoneNumberSearchRequest body, Context context) { - return searchAvailablePhoneNumbersWithResponseAsync(countryCode, body, context).block(); + return searchAvailablePhoneNumbersAsync(countryCode, body, context).block(); } /** @@ -1278,16 +1221,14 @@ public PhoneNumbersSearchAvailablePhoneNumbersResponse searchAvailablePhoneNumbe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a phone number search result by search id along with {@link Response} on successful completion of {@link - * Mono}. + * @return a phone number search result by search id. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSearchResultWithResponseAsync(String searchId) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.getSearchResult( - this.client.getEndpoint(), searchId, this.client.getApiVersion(), accept, context)); + this.client.getEndpoint(), searchId, this.client.getApiVersion(), context)); } /** @@ -1298,14 +1239,11 @@ public Mono> getSearchResultWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a phone number search result by search id along with {@link Response} on successful completion of {@link - * Mono}. + * @return a phone number search result by search id. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSearchResultWithResponseAsync(String searchId, Context context) { - final String accept = "application/json"; - return service.getSearchResult( - this.client.getEndpoint(), searchId, this.client.getApiVersion(), accept, context); + return service.getSearchResult(this.client.getEndpoint(), searchId, this.client.getApiVersion(), context); } /** @@ -1315,11 +1253,19 @@ public Mono> getSearchResultWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a phone number search result by search id on successful completion of {@link Mono}. + * @return a phone number search result by search id. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getSearchResultAsync(String searchId) { - return getSearchResultWithResponseAsync(searchId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getSearchResultWithResponseAsync(searchId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** @@ -1330,11 +1276,19 @@ public Mono getSearchResultAsync(String searchId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a phone number search result by search id on successful completion of {@link Mono}. + * @return a phone number search result by search id. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getSearchResultAsync(String searchId, Context context) { - return getSearchResultWithResponseAsync(searchId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getSearchResultWithResponseAsync(searchId, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** @@ -1359,83 +1313,82 @@ public PhoneNumberSearchResult getSearchResult(String searchId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a phone number search result by search id along with {@link Response}. + * @return a phone number search result by search id. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSearchResultWithResponse(String searchId, Context context) { - return getSearchResultWithResponseAsync(searchId, context).block(); + public PhoneNumberSearchResult getSearchResult(String searchId, Context context) { + return getSearchResultAsync(searchId, context).block(); } /** * Purchases phone numbers. * - * @param body The phone number purchase request. + * @param body The phone number search purchase request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono purchasePhoneNumbersWithResponseAsync( PhoneNumberPurchaseRequest body) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.purchasePhoneNumbers( - this.client.getEndpoint(), this.client.getApiVersion(), body, accept, context)); + this.client.getEndpoint(), this.client.getApiVersion(), body, context)); } /** * Purchases phone numbers. * - * @param body The phone number purchase request. + * @param body The phone number search purchase request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono purchasePhoneNumbersWithResponseAsync( PhoneNumberPurchaseRequest body, Context context) { - final String accept = "application/json"; - return service.purchasePhoneNumbers( - this.client.getEndpoint(), this.client.getApiVersion(), body, accept, context); + return service.purchasePhoneNumbers(this.client.getEndpoint(), this.client.getApiVersion(), body, context); } /** * Purchases phone numbers. * - * @param body The phone number purchase request. + * @param body The phone number search purchase request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono purchasePhoneNumbersAsync(PhoneNumberPurchaseRequest body) { - return purchasePhoneNumbersWithResponseAsync(body).flatMap(ignored -> Mono.empty()); + return purchasePhoneNumbersWithResponseAsync(body) + .flatMap((PhoneNumbersPurchasePhoneNumbersResponse res) -> Mono.empty()); } /** * Purchases phone numbers. * - * @param body The phone number purchase request. + * @param body The phone number search purchase request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono purchasePhoneNumbersAsync(PhoneNumberPurchaseRequest body, Context context) { - return purchasePhoneNumbersWithResponseAsync(body, context).flatMap(ignored -> Mono.empty()); + return purchasePhoneNumbersWithResponseAsync(body, context) + .flatMap((PhoneNumbersPurchasePhoneNumbersResponse res) -> Mono.empty()); } /** * Purchases phone numbers. * - * @param body The phone number purchase request. + * @param body The phone number search purchase request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1448,17 +1401,15 @@ public void purchasePhoneNumbers(PhoneNumberPurchaseRequest body) { /** * Purchases phone numbers. * - * @param body The phone number purchase request. + * @param body The phone number search purchase request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PhoneNumbersPurchasePhoneNumbersResponse purchasePhoneNumbersWithResponse( - PhoneNumberPurchaseRequest body, Context context) { - return purchasePhoneNumbersWithResponseAsync(body, context).block(); + public void purchasePhoneNumbers(PhoneNumberPurchaseRequest body, Context context) { + purchasePhoneNumbersAsync(body, context).block(); } /** @@ -1468,15 +1419,14 @@ public PhoneNumbersPurchasePhoneNumbersResponse purchasePhoneNumbersWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation by its id on successful completion of {@link Mono}. + * @return an operation by its id. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getOperationWithResponseAsync(String operationId) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.getOperation( - this.client.getEndpoint(), operationId, this.client.getApiVersion(), accept, context)); + this.client.getEndpoint(), operationId, this.client.getApiVersion(), context)); } /** @@ -1487,13 +1437,11 @@ public Mono getOperationWithResponseAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation by its id on successful completion of {@link Mono}. + * @return an operation by its id. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getOperationWithResponseAsync(String operationId, Context context) { - final String accept = "application/json"; - return service.getOperation( - this.client.getEndpoint(), operationId, this.client.getApiVersion(), accept, context); + return service.getOperation(this.client.getEndpoint(), operationId, this.client.getApiVersion(), context); } /** @@ -1503,11 +1451,19 @@ public Mono getOperationWithResponseAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation by its id on successful completion of {@link Mono}. + * @return an operation by its id. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getOperationAsync(String operationId) { - return getOperationWithResponseAsync(operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getOperationWithResponseAsync(operationId) + .flatMap( + (PhoneNumbersGetOperationResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** @@ -1518,11 +1474,19 @@ public Mono getOperationAsync(String operationId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation by its id on successful completion of {@link Mono}. + * @return an operation by its id. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getOperationAsync(String operationId, Context context) { - return getOperationWithResponseAsync(operationId, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getOperationWithResponseAsync(operationId, context) + .flatMap( + (PhoneNumbersGetOperationResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** @@ -1550,8 +1514,8 @@ public PhoneNumberRawOperation getOperation(String operationId) { * @return an operation by its id. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PhoneNumbersGetOperationResponse getOperationWithResponse(String operationId, Context context) { - return getOperationWithResponseAsync(operationId, context).block(); + public PhoneNumberRawOperation getOperation(String operationId, Context context) { + return getOperationAsync(operationId, context).block(); } /** @@ -1561,15 +1525,14 @@ public PhoneNumbersGetOperationResponse getOperationWithResponse(String operatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> cancelOperationWithResponseAsync(String operationId) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.cancelOperation( - this.client.getEndpoint(), operationId, this.client.getApiVersion(), accept, context)); + this.client.getEndpoint(), operationId, this.client.getApiVersion(), context)); } /** @@ -1580,13 +1543,11 @@ public Mono> cancelOperationWithResponseAsync(String operationId) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> cancelOperationWithResponseAsync(String operationId, Context context) { - final String accept = "application/json"; - return service.cancelOperation( - this.client.getEndpoint(), operationId, this.client.getApiVersion(), accept, context); + return service.cancelOperation(this.client.getEndpoint(), operationId, this.client.getApiVersion(), context); } /** @@ -1596,11 +1557,11 @@ public Mono> cancelOperationWithResponseAsync(String operationId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelOperationAsync(String operationId) { - return cancelOperationWithResponseAsync(operationId).flatMap(ignored -> Mono.empty()); + return cancelOperationWithResponseAsync(operationId).flatMap((Response res) -> Mono.empty()); } /** @@ -1611,11 +1572,11 @@ public Mono cancelOperationAsync(String operationId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelOperationAsync(String operationId, Context context) { - return cancelOperationWithResponseAsync(operationId, context).flatMap(ignored -> Mono.empty()); + return cancelOperationWithResponseAsync(operationId, context).flatMap((Response res) -> Mono.empty()); } /** @@ -1639,11 +1600,10 @@ public void cancelOperation(String operationId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelOperationWithResponse(String operationId, Context context) { - return cancelOperationWithResponseAsync(operationId, context).block(); + public void cancelOperation(String operationId, Context context) { + cancelOperationAsync(operationId, context).block(); } /** @@ -1651,25 +1611,19 @@ public Response cancelOperationWithResponse(String operationId, Context co * * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded as %2B, e.g. * +11234567890. - * @param body Defines the update capabilities request. + * @param body Capabilities of a phone number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a purchased phone number on successful completion of {@link Mono}. + * @return represents a purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateCapabilitiesWithResponseAsync( String phoneNumber, PhoneNumberCapabilitiesRequest body) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.updateCapabilities( - this.client.getEndpoint(), - phoneNumber, - this.client.getApiVersion(), - body, - accept, - context)); + this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), body, context)); } /** @@ -1677,19 +1631,18 @@ public Mono updateCapabilitiesWithRespon * * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded as %2B, e.g. * +11234567890. - * @param body Defines the update capabilities request. + * @param body Capabilities of a phone number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a purchased phone number on successful completion of {@link Mono}. + * @return represents a purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateCapabilitiesWithResponseAsync( String phoneNumber, PhoneNumberCapabilitiesRequest body, Context context) { - final String accept = "application/json"; return service.updateCapabilities( - this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), body, accept, context); + this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), body, context); } /** @@ -1697,15 +1650,23 @@ public Mono updateCapabilitiesWithRespon * * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded as %2B, e.g. * +11234567890. - * @param body Defines the update capabilities request. + * @param body Capabilities of a phone number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a purchased phone number on successful completion of {@link Mono}. + * @return represents a purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateCapabilitiesAsync(String phoneNumber, PhoneNumberCapabilitiesRequest body) { - return updateCapabilitiesWithResponseAsync(phoneNumber, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return updateCapabilitiesWithResponseAsync(phoneNumber, body) + .flatMap( + (PhoneNumbersUpdateCapabilitiesResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** @@ -1713,18 +1674,25 @@ public Mono updateCapabilitiesAsync(String phoneNumber, Ph * * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded as %2B, e.g. * +11234567890. - * @param body Defines the update capabilities request. + * @param body Capabilities of a phone number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a purchased phone number on successful completion of {@link Mono}. + * @return represents a purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateCapabilitiesAsync( String phoneNumber, PhoneNumberCapabilitiesRequest body, Context context) { return updateCapabilitiesWithResponseAsync(phoneNumber, body, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + .flatMap( + (PhoneNumbersUpdateCapabilitiesResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** @@ -1732,7 +1700,7 @@ public Mono updateCapabilitiesAsync( * * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded as %2B, e.g. * +11234567890. - * @param body Defines the update capabilities request. + * @param body Capabilities of a phone number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1748,7 +1716,7 @@ public PurchasedPhoneNumber updateCapabilities(String phoneNumber, PhoneNumberCa * * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded as %2B, e.g. * +11234567890. - * @param body Defines the update capabilities request. + * @param body Capabilities of a phone number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. @@ -1756,9 +1724,9 @@ public PurchasedPhoneNumber updateCapabilities(String phoneNumber, PhoneNumberCa * @return represents a purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PhoneNumbersUpdateCapabilitiesResponse updateCapabilitiesWithResponse( + public PurchasedPhoneNumber updateCapabilities( String phoneNumber, PhoneNumberCapabilitiesRequest body, Context context) { - return updateCapabilitiesWithResponseAsync(phoneNumber, body, context).block(); + return updateCapabilitiesAsync(phoneNumber, body, context).block(); } /** @@ -1768,16 +1736,14 @@ public PhoneNumbersUpdateCapabilitiesResponse updateCapabilitiesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the given purchased phone number along with {@link Response} on successful completion of - * {@link Mono}. + * @return the details of the given purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByNumberWithResponseAsync(String phoneNumber) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.getByNumber( - this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), accept, context)); + this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), context)); } /** @@ -1788,14 +1754,11 @@ public Mono> getByNumberWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the given purchased phone number along with {@link Response} on successful completion of - * {@link Mono}. + * @return the details of the given purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByNumberWithResponseAsync(String phoneNumber, Context context) { - final String accept = "application/json"; - return service.getByNumber( - this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), accept, context); + return service.getByNumber(this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), context); } /** @@ -1805,11 +1768,19 @@ public Mono> getByNumberWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the given purchased phone number on successful completion of {@link Mono}. + * @return the details of the given purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getByNumberAsync(String phoneNumber) { - return getByNumberWithResponseAsync(phoneNumber).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getByNumberWithResponseAsync(phoneNumber) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** @@ -1820,11 +1791,19 @@ public Mono getByNumberAsync(String phoneNumber) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the given purchased phone number on successful completion of {@link Mono}. + * @return the details of the given purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getByNumberAsync(String phoneNumber, Context context) { - return getByNumberWithResponseAsync(phoneNumber, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getByNumberWithResponseAsync(phoneNumber, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** @@ -1849,11 +1828,11 @@ public PurchasedPhoneNumber getByNumber(String phoneNumber) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the given purchased phone number along with {@link Response}. + * @return the details of the given purchased phone number. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByNumberWithResponse(String phoneNumber, Context context) { - return getByNumberWithResponseAsync(phoneNumber, context).block(); + public PurchasedPhoneNumber getByNumber(String phoneNumber, Context context) { + return getByNumberAsync(phoneNumber, context).block(); } /** @@ -1863,15 +1842,14 @@ public Response getByNumberWithResponse(String phoneNumber * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono releasePhoneNumberWithResponseAsync(String phoneNumber) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.releasePhoneNumber( - this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), accept, context)); + this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), context)); } /** @@ -1882,14 +1860,12 @@ public Mono releasePhoneNumberWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono releasePhoneNumberWithResponseAsync( String phoneNumber, Context context) { - final String accept = "application/json"; - return service.releasePhoneNumber( - this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), accept, context); + return service.releasePhoneNumber(this.client.getEndpoint(), phoneNumber, this.client.getApiVersion(), context); } /** @@ -1899,11 +1875,12 @@ public Mono releasePhoneNumberWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono releasePhoneNumberAsync(String phoneNumber) { - return releasePhoneNumberWithResponseAsync(phoneNumber).flatMap(ignored -> Mono.empty()); + return releasePhoneNumberWithResponseAsync(phoneNumber) + .flatMap((PhoneNumbersReleasePhoneNumberResponse res) -> Mono.empty()); } /** @@ -1914,11 +1891,12 @@ public Mono releasePhoneNumberAsync(String phoneNumber) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono releasePhoneNumberAsync(String phoneNumber, Context context) { - return releasePhoneNumberWithResponseAsync(phoneNumber, context).flatMap(ignored -> Mono.empty()); + return releasePhoneNumberWithResponseAsync(phoneNumber, context) + .flatMap((PhoneNumbersReleasePhoneNumberResponse res) -> Mono.empty()); } /** @@ -1942,11 +1920,10 @@ public void releasePhoneNumber(String phoneNumber) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException 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 PhoneNumbersReleasePhoneNumberResponse releasePhoneNumberWithResponse(String phoneNumber, Context context) { - return releasePhoneNumberWithResponseAsync(phoneNumber, context).block(); + public void releasePhoneNumber(String phoneNumber, Context context) { + releasePhoneNumberAsync(phoneNumber, context).block(); } /** @@ -1958,21 +1935,14 @@ public PhoneNumbersReleasePhoneNumberResponse releasePhoneNumberWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all purchased phone numbers along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of all purchased phone numbers. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listPhoneNumbersSinglePageAsync(Integer skip, Integer top) { - final String accept = "application/json"; return FluxUtil.withContext( context -> service.listPhoneNumbers( - this.client.getEndpoint(), - skip, - top, - this.client.getApiVersion(), - accept, - context)) + this.client.getEndpoint(), skip, top, this.client.getApiVersion(), context)) .map( res -> new PagedResponseBase<>( @@ -1994,15 +1964,12 @@ public Mono> listPhoneNumbersSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all purchased phone numbers along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of all purchased phone numbers. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listPhoneNumbersSinglePageAsync( Integer skip, Integer top, Context context) { - final String accept = "application/json"; - return service.listPhoneNumbers( - this.client.getEndpoint(), skip, top, this.client.getApiVersion(), accept, context) + return service.listPhoneNumbers(this.client.getEndpoint(), skip, top, this.client.getApiVersion(), context) .map( res -> new PagedResponseBase<>( @@ -2023,7 +1990,7 @@ public Mono> listPhoneNumbersSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all purchased phone numbers as paginated response with {@link PagedFlux}. + * @return the list of all purchased phone numbers. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listPhoneNumbersAsync(Integer skip, Integer top) { @@ -2042,7 +2009,7 @@ public PagedFlux listPhoneNumbersAsync(Integer skip, Integ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all purchased phone numbers as paginated response with {@link PagedFlux}. + * @return the list of all purchased phone numbers. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listPhoneNumbersAsync(Integer skip, Integer top, Context context) { @@ -2060,7 +2027,7 @@ public PagedFlux listPhoneNumbersAsync(Integer skip, Integ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all purchased phone numbers as paginated response with {@link PagedIterable}. + * @return the list of all purchased phone numbers. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listPhoneNumbers(Integer skip, Integer top) { @@ -2077,136 +2044,25 @@ public PagedIterable listPhoneNumbers(Integer skip, Intege * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all purchased phone numbers as paginated response with {@link PagedIterable}. + * @return the list of all purchased phone numbers. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listPhoneNumbers(Integer skip, Integer top, Context context) { return new PagedIterable<>(listPhoneNumbersAsync(skip, top, context)); } - /** - * Searches for number format and operator information for a given list of phone numbers. - * - * @param body The phone number(s) whose number format and operator information should be searched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a search result containing format and operator information associated with the requested phone - * numbers along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> operatorInformationSearchWithResponseAsync( - OperatorInformationRequest body) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.operatorInformationSearch( - this.client.getEndpoint(), this.client.getApiVersion(), body, accept, context)); - } - - /** - * Searches for number format and operator information for a given list of phone numbers. - * - * @param body The phone number(s) whose number format and operator information should be searched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a search result containing format and operator information associated with the requested phone - * numbers along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> operatorInformationSearchWithResponseAsync( - OperatorInformationRequest body, Context context) { - final String accept = "application/json"; - return service.operatorInformationSearch( - this.client.getEndpoint(), this.client.getApiVersion(), body, accept, context); - } - - /** - * Searches for number format and operator information for a given list of phone numbers. - * - * @param body The phone number(s) whose number format and operator information should be searched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a search result containing format and operator information associated with the requested phone - * numbers on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono operatorInformationSearchAsync(OperatorInformationRequest body) { - return operatorInformationSearchWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Searches for number format and operator information for a given list of phone numbers. - * - * @param body The phone number(s) whose number format and operator information should be searched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a search result containing format and operator information associated with the requested phone - * numbers on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono operatorInformationSearchAsync( - OperatorInformationRequest body, Context context) { - return operatorInformationSearchWithResponseAsync(body, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Searches for number format and operator information for a given list of phone numbers. - * - * @param body The phone number(s) whose number format and operator information should be searched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a search result containing format and operator information associated with the requested phone - * numbers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperatorInformationResult operatorInformationSearch(OperatorInformationRequest body) { - return operatorInformationSearchAsync(body).block(); - } - - /** - * Searches for number format and operator information for a given list of phone numbers. - * - * @param body The phone number(s) whose number format and operator information should be searched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws CommunicationErrorResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a search result containing format and operator information associated with the requested phone - * numbers along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response operatorInformationSearchWithResponse( - OperatorInformationRequest body, Context context) { - return operatorInformationSearchWithResponseAsync(body, context).block(); - } - /** * Get the next page of items. * * @param nextLink The nextLink parameter. - * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available area codes along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of available area codes. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAreaCodesNextSinglePageAsync( - String nextLink, String acceptLanguage) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listAreaCodesNext( - nextLink, this.client.getEndpoint(), acceptLanguage, accept, context)) + public Mono> listAreaCodesNextSinglePageAsync(String nextLink) { + return FluxUtil.withContext(context -> service.listAreaCodesNext(nextLink, context)) .map( res -> new PagedResponseBase<>( @@ -2222,19 +2078,15 @@ public Mono> listAreaCodesNextSinglePageAsync * Get the next page of items. * * @param nextLink The nextLink parameter. - * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available area codes along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of available area codes. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAreaCodesNextSinglePageAsync( - String nextLink, String acceptLanguage, Context context) { - final String accept = "application/json"; - return service.listAreaCodesNext(nextLink, this.client.getEndpoint(), acceptLanguage, accept, context) + public Mono> listAreaCodesNextSinglePageAsync(String nextLink, Context context) { + return service.listAreaCodesNext(nextLink, context) .map( res -> new PagedResponseBase<>( @@ -2250,21 +2102,14 @@ public Mono> listAreaCodesNextSinglePageAsync * Get the next page of items. * * @param nextLink The nextLink parameter. - * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of countries along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return represents a wrapper around a list of countries. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableCountriesNextSinglePageAsync( - String nextLink, String acceptLanguage) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listAvailableCountriesNext( - nextLink, this.client.getEndpoint(), acceptLanguage, accept, context)) + public Mono> listAvailableCountriesNextSinglePageAsync(String nextLink) { + return FluxUtil.withContext(context -> service.listAvailableCountriesNext(nextLink, context)) .map( res -> new PagedResponseBase<>( @@ -2280,19 +2125,16 @@ public Mono> listAvailableCountriesNextSingleP * Get the next page of items. * * @param nextLink The nextLink parameter. - * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of countries along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return represents a wrapper around a list of countries. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAvailableCountriesNextSinglePageAsync( - String nextLink, String acceptLanguage, Context context) { - final String accept = "application/json"; - return service.listAvailableCountriesNext(nextLink, this.client.getEndpoint(), acceptLanguage, accept, context) + String nextLink, Context context) { + return service.listAvailableCountriesNext(nextLink, context) .map( res -> new PagedResponseBase<>( @@ -2308,21 +2150,14 @@ public Mono> listAvailableCountriesNextSingleP * Get the next page of items. * * @param nextLink The nextLink parameter. - * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of cities or towns along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return represents a wrapper around a list of cities or towns. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableLocalitiesNextSinglePageAsync( - String nextLink, String acceptLanguage) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listAvailableLocalitiesNext( - nextLink, this.client.getEndpoint(), acceptLanguage, accept, context)) + public Mono> listAvailableLocalitiesNextSinglePageAsync(String nextLink) { + return FluxUtil.withContext(context -> service.listAvailableLocalitiesNext(nextLink, context)) .map( res -> new PagedResponseBase<>( @@ -2338,19 +2173,16 @@ public Mono> listAvailableLocalitiesNextSingl * Get the next page of items. * * @param nextLink The nextLink parameter. - * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of cities or towns along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return represents a wrapper around a list of cities or towns. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAvailableLocalitiesNextSinglePageAsync( - String nextLink, String acceptLanguage, Context context) { - final String accept = "application/json"; - return service.listAvailableLocalitiesNext(nextLink, this.client.getEndpoint(), acceptLanguage, accept, context) + String nextLink, Context context) { + return service.listAvailableLocalitiesNext(nextLink, context) .map( res -> new PagedResponseBase<>( @@ -2366,21 +2198,14 @@ public Mono> listAvailableLocalitiesNextSingl * Get the next page of items. * * @param nextLink The nextLink parameter. - * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of offerings along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return represents a wrapper around a list of offerings. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOfferingsNextSinglePageAsync( - String nextLink, String acceptLanguage) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listOfferingsNext( - nextLink, this.client.getEndpoint(), acceptLanguage, accept, context)) + public Mono> listOfferingsNextSinglePageAsync(String nextLink) { + return FluxUtil.withContext(context -> service.listOfferingsNext(nextLink, context)) .map( res -> new PagedResponseBase<>( @@ -2396,19 +2221,15 @@ public Mono> listOfferingsNextSinglePageAsync * Get the next page of items. * * @param nextLink The nextLink parameter. - * @param acceptLanguage The locale to display in the localized fields in the response. e.g. 'en-US'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a wrapper around a list of offerings along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return represents a wrapper around a list of offerings. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOfferingsNextSinglePageAsync( - String nextLink, String acceptLanguage, Context context) { - final String accept = "application/json"; - return service.listOfferingsNext(nextLink, this.client.getEndpoint(), acceptLanguage, accept, context) + public Mono> listOfferingsNextSinglePageAsync(String nextLink, Context context) { + return service.listOfferingsNext(nextLink, context) .map( res -> new PagedResponseBase<>( @@ -2427,14 +2248,11 @@ public Mono> listOfferingsNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of purchased phone numbers along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of purchased phone numbers. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listPhoneNumbersNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listPhoneNumbersNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listPhoneNumbersNext(nextLink, context)) .map( res -> new PagedResponseBase<>( @@ -2454,14 +2272,12 @@ public Mono> listPhoneNumbersNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of purchased phone numbers along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of purchased phone numbers. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listPhoneNumbersNextSinglePageAsync( String nextLink, Context context) { - final String accept = "application/json"; - return service.listPhoneNumbersNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listPhoneNumbersNext(nextLink, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/CommunicationError.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/CommunicationError.java index 6faa242aeb4c..24f9ab2b7157 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/CommunicationError.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/CommunicationError.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The Communication Services error. */ +/** The CommunicationError model. */ @Fluent public final class CommunicationError { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/CommunicationErrorResponse.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/CommunicationErrorResponse.java index 43cf593dca00..0c8f43d0a4e7 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/CommunicationErrorResponse.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/CommunicationErrorResponse.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Communication Services error. */ +/** The CommunicationErrorResponse model. */ @Fluent public final class CommunicationErrorResponse { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/Error.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/Error.java deleted file mode 100644 index 8ffdcac479bf..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/Error.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Error. */ -public final class Error extends ExpandableStringEnum { - /** Static value NoError for Error. */ - public static final Error NO_ERROR = fromString("NoError"); - - /** Static value UnknownErrorCode for Error. */ - public static final Error UNKNOWN_ERROR_CODE = fromString("UnknownErrorCode"); - - /** Static value OutOfStock for Error. */ - public static final Error OUT_OF_STOCK = fromString("OutOfStock"); - - /** Static value AuthorizationDenied for Error. */ - public static final Error AUTHORIZATION_DENIED = fromString("AuthorizationDenied"); - - /** Static value MissingAddress for Error. */ - public static final Error MISSING_ADDRESS = fromString("MissingAddress"); - - /** Static value InvalidAddress for Error. */ - public static final Error INVALID_ADDRESS = fromString("InvalidAddress"); - - /** Static value InvalidOfferModel for Error. */ - public static final Error INVALID_OFFER_MODEL = fromString("InvalidOfferModel"); - - /** Static value NotEnoughLicenses for Error. */ - public static final Error NOT_ENOUGH_LICENSES = fromString("NotEnoughLicenses"); - - /** Static value NoWallet for Error. */ - public static final Error NO_WALLET = fromString("NoWallet"); - - /** Static value NotEnoughCredit for Error. */ - public static final Error NOT_ENOUGH_CREDIT = fromString("NotEnoughCredit"); - - /** Static value NumbersPartiallyAcquired for Error. */ - public static final Error NUMBERS_PARTIALLY_ACQUIRED = fromString("NumbersPartiallyAcquired"); - - /** Static value AllNumbersNotAcquired for Error. */ - public static final Error ALL_NUMBERS_NOT_ACQUIRED = fromString("AllNumbersNotAcquired"); - - /** Static value ReservationExpired for Error. */ - public static final Error RESERVATION_EXPIRED = fromString("ReservationExpired"); - - /** Static value PurchaseFailed for Error. */ - public static final Error PURCHASE_FAILED = fromString("PurchaseFailed"); - - /** Static value BillingUnavailable for Error. */ - public static final Error BILLING_UNAVAILABLE = fromString("BillingUnavailable"); - - /** Static value ProvisioningFailed for Error. */ - public static final Error PROVISIONING_FAILED = fromString("ProvisioningFailed"); - - /** Static value UnknownSearchError for Error. */ - public static final Error UNKNOWN_SEARCH_ERROR = fromString("UnknownSearchError"); - - /** - * Creates or finds a Error from its string representation. - * - * @param name a name to look for. - * @return the corresponding Error. - */ - @JsonCreator - public static Error fromString(String name) { - return fromString(name, Error.class); - } - - /** - * Gets known Error values. - * - * @return known Error values. - */ - public static Collection values() { - return values(Error.class); - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OfferingsResponse.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OfferingsResponse.java index 3d1f1d3c1cf1..4c7737e931bb 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OfferingsResponse.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OfferingsResponse.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents a wrapper around a list of offerings. */ +/** The OfferingsResponse model. */ @Immutable public final class OfferingsResponse { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationOptions.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationOptions.java deleted file mode 100644 index bb4982e04af0..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationOptions.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents options to modify a search request for operator information. */ -@Fluent -public final class OperatorInformationOptions { - /* - * Includes the fields operatorDetails, numberType, and isoCountryCode in - * the response. Please note: use of this option will result in additional - * costs - */ - @JsonProperty(value = "includeAdditionalOperatorDetails") - private Boolean includeAdditionalOperatorDetails; - - /** - * Get the includeAdditionalOperatorDetails property: Includes the fields operatorDetails, numberType, and - * isoCountryCode in the response. Please note: use of this option will result in additional costs. - * - * @return the includeAdditionalOperatorDetails value. - */ - public Boolean isIncludeAdditionalOperatorDetails() { - return this.includeAdditionalOperatorDetails; - } - - /** - * Set the includeAdditionalOperatorDetails property: Includes the fields operatorDetails, numberType, and - * isoCountryCode in the response. Please note: use of this option will result in additional costs. - * - * @param includeAdditionalOperatorDetails the includeAdditionalOperatorDetails value to set. - * @return the OperatorInformationOptions object itself. - */ - public OperatorInformationOptions setIncludeAdditionalOperatorDetails(Boolean includeAdditionalOperatorDetails) { - this.includeAdditionalOperatorDetails = includeAdditionalOperatorDetails; - return this; - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationRequest.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationRequest.java deleted file mode 100644 index e53765d39836..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationRequest.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.implementation.models; - -import com.azure.communication.phonenumbers.models.OperatorInformationOptions; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a search request for operator information for the given phone numbers. */ -@Fluent -public final class OperatorInformationRequest { - /* - * Phone number(s) whose operator information is being requested - */ - @JsonProperty(value = "phoneNumbers", required = true) - private List phoneNumbers; - - /* - * Represents options to modify a search request for operator information - */ - @JsonProperty(value = "options") - private OperatorInformationOptions options; - - /** - * Get the phoneNumbers property: Phone number(s) whose operator information is being requested. - * - * @return the phoneNumbers value. - */ - public List getPhoneNumbers() { - return this.phoneNumbers; - } - - /** - * Set the phoneNumbers property: Phone number(s) whose operator information is being requested. - * - * @param phoneNumbers the phoneNumbers value to set. - * @return the OperatorInformationRequest object itself. - */ - public OperatorInformationRequest setPhoneNumbers(List phoneNumbers) { - this.phoneNumbers = phoneNumbers; - return this; - } - - /** - * Get the options property: Represents options to modify a search request for operator information. - * - * @return the options value. - */ - public OperatorInformationOptions getOptions() { - return this.options; - } - - /** - * Set the options property: Represents options to modify a search request for operator information. - * - * @param options the options value to set. - * @return the OperatorInformationRequest object itself. - */ - public OperatorInformationRequest setOptions(OperatorInformationOptions options) { - this.options = options; - return this; - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationRequestOptions.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationRequestOptions.java deleted file mode 100644 index c9cdbcf84a98..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationRequestOptions.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents options to modify a search request for operator information. */ -@Fluent -public final class OperatorInformationRequestOptions { - /* - * Includes the fields operatorDetails, numberType, and isoCountryCode in - * the response. Please note: use of this option will result in additional - * costs - */ - @JsonProperty(value = "includeAdditionalPhoneAndOperatorDetails") - private Boolean includeAdditionalPhoneAndOperatorDetails; - - /** - * Get the includeAdditionalPhoneAndOperatorDetails property: Includes the fields operatorDetails, numberType, and - * isoCountryCode in the response. Please note: use of this option will result in additional costs. - * - * @return the includeAdditionalPhoneAndOperatorDetails value. - */ - public Boolean isIncludeAdditionalPhoneAndOperatorDetails() { - return this.includeAdditionalPhoneAndOperatorDetails; - } - - /** - * Set the includeAdditionalPhoneAndOperatorDetails property: Includes the fields operatorDetails, numberType, and - * isoCountryCode in the response. Please note: use of this option will result in additional costs. - * - * @param includeAdditionalPhoneAndOperatorDetails the includeAdditionalPhoneAndOperatorDetails value to set. - * @return the OperatorInformationRequestOptions object itself. - */ - public OperatorInformationRequestOptions setIncludeAdditionalPhoneAndOperatorDetails( - Boolean includeAdditionalPhoneAndOperatorDetails) { - this.includeAdditionalPhoneAndOperatorDetails = includeAdditionalPhoneAndOperatorDetails; - return this; - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationResult.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationResult.java deleted file mode 100644 index a59e2f9c7041..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/OperatorInformationResult.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.implementation.models; - -import com.azure.communication.phonenumbers.models.OperatorInformation; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Represents a search result containing format and operator information associated with the requested phone numbers. - */ -@Immutable -public final class OperatorInformationResult { - /* - * Results of a search. - * This array will have one entry per requested phone number which will - * contain the relevant operator information. - */ - @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) - private List values; - - /** - * Get the values property: Results of a search. This array will have one entry per requested phone number which - * will contain the relevant operator information. - * - * @return the values value. - */ - public List getValues() { - return this.values; - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberAreaCodes.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberAreaCodes.java index 6ceaebb5b9bd..0e9488f8fb4d 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberAreaCodes.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberAreaCodes.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The list of available area codes. */ +/** The PhoneNumberAreaCodes model. */ @Immutable public final class PhoneNumberAreaCodes { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberCapabilitiesRequest.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberCapabilitiesRequest.java index 97da4316da66..a652e5fe7801 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberCapabilitiesRequest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberCapabilitiesRequest.java @@ -8,7 +8,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Capabilities of a phone number. */ +/** The PhoneNumberCapabilitiesRequest model. */ @Fluent public final class PhoneNumberCapabilitiesRequest { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberCountries.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberCountries.java index 33eef7b2fbe2..3b2f4500d1f4 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberCountries.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberCountries.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents a wrapper around a list of countries. */ +/** The PhoneNumberCountries model. */ @Immutable public final class PhoneNumberCountries { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberLocalities.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberLocalities.java index eff6de721cdb..ff5701bd4b7d 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberLocalities.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberLocalities.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents a wrapper around a list of cities or towns. */ +/** The PhoneNumberLocalities model. */ @Immutable public final class PhoneNumberLocalities { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberPurchaseRequest.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberPurchaseRequest.java index f9eca676f6b4..21a53d735ecb 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberPurchaseRequest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberPurchaseRequest.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The phone number search purchase request. */ +/** The PhoneNumberPurchaseRequest model. */ @Fluent public final class PhoneNumberPurchaseRequest { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberSearchRequest.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberSearchRequest.java index b83dff58033f..5ad15ab05359 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberSearchRequest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberSearchRequest.java @@ -10,10 +10,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * Represents a phone number search request to find phone numbers. Found phone numbers are temporarily held for a - * following purchase. - */ +/** The PhoneNumberSearchRequest model. */ @Fluent public final class PhoneNumberSearchRequest { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberSearchResultError.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberSearchResultError.java deleted file mode 100644 index 9313a8bf4139..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumberSearchResultError.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PhoneNumberSearchResultError. */ -public final class PhoneNumberSearchResultError extends ExpandableStringEnum { - /** Static value NoError for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NO_ERROR = fromString("NoError"); - - /** Static value UnknownErrorCode for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError UNKNOWN_ERROR_CODE = fromString("UnknownErrorCode"); - - /** Static value OutOfStock for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError OUT_OF_STOCK = fromString("OutOfStock"); - - /** Static value AuthorizationDenied for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError AUTHORIZATION_DENIED = fromString("AuthorizationDenied"); - - /** Static value MissingAddress for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError MISSING_ADDRESS = fromString("MissingAddress"); - - /** Static value InvalidAddress for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError INVALID_ADDRESS = fromString("InvalidAddress"); - - /** Static value InvalidOfferModel for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError INVALID_OFFER_MODEL = fromString("InvalidOfferModel"); - - /** Static value NotEnoughLicenses for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NOT_ENOUGH_LICENSES = fromString("NotEnoughLicenses"); - - /** Static value NoWallet for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NO_WALLET = fromString("NoWallet"); - - /** Static value NotEnoughCredit for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NOT_ENOUGH_CREDIT = fromString("NotEnoughCredit"); - - /** Static value NumbersPartiallyAcquired for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NUMBERS_PARTIALLY_ACQUIRED = - fromString("NumbersPartiallyAcquired"); - - /** Static value AllNumbersNotAcquired for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError ALL_NUMBERS_NOT_ACQUIRED = fromString("AllNumbersNotAcquired"); - - /** Static value ReservationExpired for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError RESERVATION_EXPIRED = fromString("ReservationExpired"); - - /** Static value PurchaseFailed for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError PURCHASE_FAILED = fromString("PurchaseFailed"); - - /** Static value BillingUnavailable for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError BILLING_UNAVAILABLE = fromString("BillingUnavailable"); - - /** Static value ProvisioningFailed for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError PROVISIONING_FAILED = fromString("ProvisioningFailed"); - - /** Static value UnknownSearchError for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError UNKNOWN_SEARCH_ERROR = fromString("UnknownSearchError"); - - /** - * Creates or finds a PhoneNumberSearchResultError from its string representation. - * - * @param name a name to look for. - * @return the corresponding PhoneNumberSearchResultError. - */ - @JsonCreator - public static PhoneNumberSearchResultError fromString(String name) { - return fromString(name, PhoneNumberSearchResultError.class); - } - - /** - * Gets known PhoneNumberSearchResultError values. - * - * @return known PhoneNumberSearchResultError values. - */ - public static Collection values() { - return values(PhoneNumberSearchResultError.class); - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersGetOperationResponse.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersGetOperationResponse.java index ab10ce0b9de7..5155754aed56 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersGetOperationResponse.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersGetOperationResponse.java @@ -29,11 +29,7 @@ public PhoneNumbersGetOperationResponse( super(request, statusCode, rawHeaders, value, headers); } - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ + /** @return the deserialized response body. */ @Override public PhoneNumberRawOperation getValue() { return super.getValue(); diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersSearchAvailablePhoneNumbersResponse.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersSearchAvailablePhoneNumbersResponse.java index 41e0b46b111f..885ad0f71db4 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersSearchAvailablePhoneNumbersResponse.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersSearchAvailablePhoneNumbersResponse.java @@ -30,11 +30,7 @@ public PhoneNumbersSearchAvailablePhoneNumbersResponse( super(request, statusCode, rawHeaders, value, headers); } - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ + /** @return the deserialized response body. */ @Override public PhoneNumberSearchResult getValue() { return super.getValue(); diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersUpdateCapabilitiesResponse.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersUpdateCapabilitiesResponse.java index 4514062064b2..e8df2c4afc4e 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersUpdateCapabilitiesResponse.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PhoneNumbersUpdateCapabilitiesResponse.java @@ -30,11 +30,7 @@ public PhoneNumbersUpdateCapabilitiesResponse( super(request, statusCode, rawHeaders, value, headers); } - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ + /** @return the deserialized response body. */ @Override public PurchasedPhoneNumber getValue() { return super.getValue(); diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PurchasedPhoneNumbers.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PurchasedPhoneNumbers.java index 22b42f45753e..3d93d8bef7b3 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PurchasedPhoneNumbers.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/models/PurchasedPhoneNumbers.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The list of purchased phone numbers. */ +/** The PurchasedPhoneNumbers model. */ @Fluent public final class PurchasedPhoneNumbers { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/package-info.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/package-info.java index 407db3a212ab..ca2fb8168ac6 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/package-info.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for PhoneNumberAdminClient. The phone numbers client uses Azure Communication - * Services to purchase and manage phone numbers. + * Package containing the implementations and inner classes for PhoneNumberAdminClient. The phone numbers client uses + * Azure Communication Services to purchase and manage phone numbers. */ package com.azure.communication.phonenumbers.implementation; diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/BillingFrequency.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/BillingFrequency.java index 4a5e7ba00c62..1b4e8a5376c3 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/BillingFrequency.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/BillingFrequency.java @@ -24,11 +24,7 @@ public static BillingFrequency fromString(String name) { return fromString(name, BillingFrequency.class); } - /** - * Gets known BillingFrequency values. - * - * @return known BillingFrequency values. - */ + /** @return known BillingFrequency values. */ public static Collection values() { return values(BillingFrequency.class); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorDetails.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorDetails.java deleted file mode 100644 index d1c40ee27acc..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorDetails.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents metadata describing the operator of a phone number. */ -@Immutable -public final class OperatorDetails { - /* - * Name of the phone operator - */ - @JsonProperty(value = "name", required = true, access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Mobile Network Code - */ - @JsonProperty(value = "mobileNetworkCode", access = JsonProperty.Access.WRITE_ONLY) - private String mobileNetworkCode; - - /* - * Mobile Country Code - */ - @JsonProperty(value = "mobileCountryCode", access = JsonProperty.Access.WRITE_ONLY) - private String mobileCountryCode; - - /** - * Get the name property: Name of the phone operator. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * Get the mobileNetworkCode property: Mobile Network Code. - * - * @return the mobileNetworkCode value. - */ - public String getMobileNetworkCode() { - return this.mobileNetworkCode; - } - - /** - * Get the mobileCountryCode property: Mobile Country Code. - * - * @return the mobileCountryCode value. - */ - public String getMobileCountryCode() { - return this.mobileCountryCode; - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformation.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformation.java deleted file mode 100644 index d3bbe11c89a8..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformation.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents metadata about a phone number that is controlled/provided by that phone number's operator. */ -@Immutable -public final class OperatorInformation { - /* - * E.164 formatted string representation of the phone number - */ - @JsonProperty(value = "phoneNumber", required = true, access = JsonProperty.Access.WRITE_ONLY) - private String phoneNumber; - - /* - * National format of the phone number - */ - @JsonProperty(value = "nationalFormat", access = JsonProperty.Access.WRITE_ONLY) - private String nationalFormat; - - /* - * International format of the phone number - */ - @JsonProperty(value = "internationalFormat", access = JsonProperty.Access.WRITE_ONLY) - private String internationalFormat; - - /* - * ISO 3166-1 two character ('alpha-2') code associated with the phone - * number. - */ - @JsonProperty(value = "isoCountryCode", access = JsonProperty.Access.WRITE_ONLY) - private String isoCountryCode; - - /* - * Type of service associated with the phone number - */ - @JsonProperty(value = "numberType", access = JsonProperty.Access.WRITE_ONLY) - private OperatorNumberType numberType; - - /* - * Represents metadata describing the operator of a phone number - */ - @JsonProperty(value = "operatorDetails", access = JsonProperty.Access.WRITE_ONLY) - private OperatorDetails operatorDetails; - - /** - * Get the phoneNumber property: E.164 formatted string representation of the phone number. - * - * @return the phoneNumber value. - */ - public String getPhoneNumber() { - return this.phoneNumber; - } - - /** - * Get the nationalFormat property: National format of the phone number. - * - * @return the nationalFormat value. - */ - public String getNationalFormat() { - return this.nationalFormat; - } - - /** - * Get the internationalFormat property: International format of the phone number. - * - * @return the internationalFormat value. - */ - public String getInternationalFormat() { - return this.internationalFormat; - } - - /** - * Get the isoCountryCode property: ISO 3166-1 two character ('alpha-2') code associated with the phone number. - * - * @return the isoCountryCode value. - */ - public String getIsoCountryCode() { - return this.isoCountryCode; - } - - /** - * Get the numberType property: Type of service associated with the phone number. - * - * @return the numberType value. - */ - public OperatorNumberType getNumberType() { - return this.numberType; - } - - /** - * Get the operatorDetails property: Represents metadata describing the operator of a phone number. - * - * @return the operatorDetails value. - */ - public OperatorDetails getOperatorDetails() { - return this.operatorDetails; - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformationOptions.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformationOptions.java deleted file mode 100644 index beb3cde0cc08..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformationOptions.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents options to modify a search request for operator information. */ -@Fluent -public final class OperatorInformationOptions { - /* - * Includes the fields operatorDetails, numberType, and isoCountryCode in - * the response. Please note: use of this option will result in additional - * costs - */ - @JsonProperty(value = "includeAdditionalOperatorDetails") - private Boolean includeAdditionalOperatorDetails; - - /** - * Get the includeAdditionalOperatorDetails property: Includes the fields operatorDetails, numberType, and - * isoCountryCode in the response. Please note: use of this option will result in additional costs. - * - * @return the includeAdditionalOperatorDetails value. - */ - public Boolean isIncludeAdditionalOperatorDetails() { - return this.includeAdditionalOperatorDetails; - } - - /** - * Set the includeAdditionalOperatorDetails property: Includes the fields operatorDetails, numberType, and - * isoCountryCode in the response. Please note: use of this option will result in additional costs. - * - * @param includeAdditionalOperatorDetails the includeAdditionalOperatorDetails value to set. - * @return the OperatorInformationOptions object itself. - */ - public OperatorInformationOptions setIncludeAdditionalOperatorDetails(Boolean includeAdditionalOperatorDetails) { - this.includeAdditionalOperatorDetails = includeAdditionalOperatorDetails; - return this; - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformationResult.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformationResult.java deleted file mode 100644 index 3f8c271d5b74..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorInformationResult.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Represents a search result containing format and operator information associated with the requested phone numbers. - */ -@Immutable -public final class OperatorInformationResult { - /* - * Results of a search. - * This array will have one entry per requested phone number which will - * contain the relevant operator information. - */ - @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) - private List values; - - /** - * Get the values property: Results of a search. This array will have one entry per requested phone number which - * will contain the relevant operator information. - * - * @return the values value. - */ - public List getValues() { - return this.values; - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorNumberType.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorNumberType.java deleted file mode 100644 index 9f86c3654121..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/OperatorNumberType.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OperatorNumberType. */ -public final class OperatorNumberType extends ExpandableStringEnum { - /** Static value unknown for OperatorNumberType. */ - public static final OperatorNumberType UNKNOWN = fromString("unknown"); - - /** Static value other for OperatorNumberType. */ - public static final OperatorNumberType OTHER = fromString("other"); - - /** Static value geographic for OperatorNumberType. */ - public static final OperatorNumberType GEOGRAPHIC = fromString("geographic"); - - /** Static value mobile for OperatorNumberType. */ - public static final OperatorNumberType MOBILE = fromString("mobile"); - - /** - * Creates or finds a OperatorNumberType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperatorNumberType. - */ - @JsonCreator - public static OperatorNumberType fromString(String name) { - return fromString(name, OperatorNumberType.class); - } - - /** - * Gets known OperatorNumberType values. - * - * @return known OperatorNumberType values. - */ - public static Collection values() { - return values(OperatorNumberType.class); - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAdministrativeDivision.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAdministrativeDivision.java index d8c6f9245fe7..61dce61a3501 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAdministrativeDivision.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAdministrativeDivision.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents an administrative division. e.g. state or province. */ +/** The PhoneNumberAdministrativeDivision model. */ @Immutable public final class PhoneNumberAdministrativeDivision { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAreaCode.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAreaCode.java index c82d3211fe93..f9f465ef07d1 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAreaCode.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAreaCode.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents an Area Code. */ +/** The PhoneNumberAreaCode model. */ @Immutable public final class PhoneNumberAreaCode { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAssignmentType.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAssignmentType.java index 243e0860a2f9..5a54a579000d 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAssignmentType.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberAssignmentType.java @@ -27,11 +27,7 @@ public static PhoneNumberAssignmentType fromString(String name) { return fromString(name, PhoneNumberAssignmentType.class); } - /** - * Gets known PhoneNumberAssignmentType values. - * - * @return known PhoneNumberAssignmentType values. - */ + /** @return known PhoneNumberAssignmentType values. */ public static Collection values() { return values(PhoneNumberAssignmentType.class); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCapabilities.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCapabilities.java index c31e1683e256..c6f809cc7ac2 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCapabilities.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCapabilities.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Capabilities of a phone number. */ +/** The PhoneNumberCapabilities model. */ @Fluent public final class PhoneNumberCapabilities { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCapabilityType.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCapabilityType.java index 8e52991b3d4e..9b657ac09bd9 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCapabilityType.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCapabilityType.java @@ -33,11 +33,7 @@ public static PhoneNumberCapabilityType fromString(String name) { return fromString(name, PhoneNumberCapabilityType.class); } - /** - * Gets known PhoneNumberCapabilityType values. - * - * @return known PhoneNumberCapabilityType values. - */ + /** @return known PhoneNumberCapabilityType values. */ public static Collection values() { return values(PhoneNumberCapabilityType.class); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCost.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCost.java index cd5635b330d4..a66a2f4b552f 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCost.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCost.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The incurred cost for a single phone number. */ +/** The PhoneNumberCost model. */ @Immutable public final class PhoneNumberCost { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCountry.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCountry.java index 675f0181b7e1..525593379bc1 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCountry.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberCountry.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents a country. */ +/** The PhoneNumberCountry model. */ @Immutable public final class PhoneNumberCountry { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberLocality.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberLocality.java index 99136bca717c..470546892fb3 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberLocality.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberLocality.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents a locality. */ +/** The PhoneNumberLocality model. */ @Immutable public final class PhoneNumberLocality { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOffering.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOffering.java index 7272cb519105..59d80cc5fbeb 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOffering.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOffering.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents a phone number capability offering. */ +/** The PhoneNumberOffering model. */ @Immutable public final class PhoneNumberOffering { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOperationStatus.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOperationStatus.java index d77a8de27201..30c5feac9a03 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOperationStatus.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOperationStatus.java @@ -33,11 +33,7 @@ public static PhoneNumberOperationStatus fromString(String name) { return fromString(name, PhoneNumberOperationStatus.class); } - /** - * Gets known PhoneNumberOperationStatus values. - * - * @return known PhoneNumberOperationStatus values. - */ + /** @return known PhoneNumberOperationStatus values. */ public static Collection values() { return values(PhoneNumberOperationStatus.class); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOperationType.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOperationType.java index cb15a0b29011..cef1da493ca8 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOperationType.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberOperationType.java @@ -34,11 +34,7 @@ public static PhoneNumberOperationType fromString(String name) { return fromString(name, PhoneNumberOperationType.class); } - /** - * Gets known PhoneNumberOperationType values. - * - * @return known PhoneNumberOperationType values. - */ + /** @return known PhoneNumberOperationType values. */ public static Collection values() { return values(PhoneNumberOperationType.class); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberSearchResult.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberSearchResult.java index 81df3852bf70..5214db68b4b6 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberSearchResult.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberSearchResult.java @@ -9,7 +9,7 @@ import java.time.OffsetDateTime; import java.util.List; -/** The result of a phone number search operation. */ +/** The PhoneNumberSearchResult model. */ @Immutable public final class PhoneNumberSearchResult { /* @@ -57,18 +57,6 @@ public final class PhoneNumberSearchResult { @JsonProperty(value = "searchExpiresBy", required = true, access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime searchExpiresBy; - /* - * The error code of the search. - */ - @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) - private Integer errorCode; - - /* - * Mapping Error Messages to Codes - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private PhoneNumberSearchResultError error; - /** * Get the searchId property: The search id. * @@ -133,22 +121,4 @@ public PhoneNumberCost getCost() { public OffsetDateTime getSearchExpiresBy() { return this.searchExpiresBy; } - - /** - * Get the errorCode property: The error code of the search. - * - * @return the errorCode value. - */ - public Integer getErrorCode() { - return this.errorCode; - } - - /** - * Get the error property: Mapping Error Messages to Codes. - * - * @return the error value. - */ - public PhoneNumberSearchResultError getError() { - return this.error; - } } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberSearchResultError.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberSearchResultError.java deleted file mode 100644 index 47db8912beb9..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberSearchResultError.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.phonenumbers.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PhoneNumberSearchResultError. */ -public final class PhoneNumberSearchResultError extends ExpandableStringEnum { - /** Static value NoError for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NO_ERROR = fromString("NoError"); - - /** Static value UnknownErrorCode for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError UNKNOWN_ERROR_CODE = fromString("UnknownErrorCode"); - - /** Static value OutOfStock for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError OUT_OF_STOCK = fromString("OutOfStock"); - - /** Static value AuthorizationDenied for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError AUTHORIZATION_DENIED = fromString("AuthorizationDenied"); - - /** Static value MissingAddress for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError MISSING_ADDRESS = fromString("MissingAddress"); - - /** Static value InvalidAddress for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError INVALID_ADDRESS = fromString("InvalidAddress"); - - /** Static value InvalidOfferModel for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError INVALID_OFFER_MODEL = fromString("InvalidOfferModel"); - - /** Static value NotEnoughLicenses for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NOT_ENOUGH_LICENSES = fromString("NotEnoughLicenses"); - - /** Static value NoWallet for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NO_WALLET = fromString("NoWallet"); - - /** Static value NotEnoughCredit for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NOT_ENOUGH_CREDIT = fromString("NotEnoughCredit"); - - /** Static value NumbersPartiallyAcquired for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError NUMBERS_PARTIALLY_ACQUIRED = - fromString("NumbersPartiallyAcquired"); - - /** Static value AllNumbersNotAcquired for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError ALL_NUMBERS_NOT_ACQUIRED = fromString("AllNumbersNotAcquired"); - - /** Static value ReservationExpired for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError RESERVATION_EXPIRED = fromString("ReservationExpired"); - - /** Static value PurchaseFailed for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError PURCHASE_FAILED = fromString("PurchaseFailed"); - - /** Static value BillingUnavailable for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError BILLING_UNAVAILABLE = fromString("BillingUnavailable"); - - /** Static value ProvisioningFailed for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError PROVISIONING_FAILED = fromString("ProvisioningFailed"); - - /** Static value UnknownSearchError for PhoneNumberSearchResultError. */ - public static final PhoneNumberSearchResultError UNKNOWN_SEARCH_ERROR = fromString("UnknownSearchError"); - - /** - * Creates or finds a PhoneNumberSearchResultError from its string representation. - * - * @param name a name to look for. - * @return the corresponding PhoneNumberSearchResultError. - */ - @JsonCreator - public static PhoneNumberSearchResultError fromString(String name) { - return fromString(name, PhoneNumberSearchResultError.class); - } - - /** - * Gets known PhoneNumberSearchResultError values. - * - * @return known PhoneNumberSearchResultError values. - */ - public static Collection values() { - return values(PhoneNumberSearchResultError.class); - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberType.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberType.java index e4537fd9c691..5a2746fdf269 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberType.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PhoneNumberType.java @@ -27,11 +27,7 @@ public static PhoneNumberType fromString(String name) { return fromString(name, PhoneNumberType.class); } - /** - * Gets known PhoneNumberType values. - * - * @return known PhoneNumberType values. - */ + /** @return known PhoneNumberType values. */ public static Collection values() { return values(PhoneNumberType.class); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PurchasePhoneNumbersResult.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PurchasePhoneNumbersResult.java index b03250d39cd1..f38a57a0f9a6 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PurchasePhoneNumbersResult.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PurchasePhoneNumbersResult.java @@ -3,8 +3,7 @@ package com.azure.communication.phonenumbers.models; -/** - * The PurchasePhoneNumbersResult model. - */ + +/** The PurchasePhoneNumbersResult model. */ public final class PurchasePhoneNumbersResult { } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PurchasedPhoneNumber.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PurchasedPhoneNumber.java index b24bd52c4f29..6f05ff05fb16 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PurchasedPhoneNumber.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/PurchasedPhoneNumber.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Represents a purchased phone number. */ +/** The PurchasedPhoneNumber model. */ @Immutable public final class PurchasedPhoneNumber { /* diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/ReleasePhoneNumberResult.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/ReleasePhoneNumberResult.java index 48ee45f0491f..3d0e84aa55ac 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/ReleasePhoneNumberResult.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/ReleasePhoneNumberResult.java @@ -4,9 +4,7 @@ package com.azure.communication.phonenumbers.models; -/** - * The ReleasePhoneNumberResult model. - */ +/** The ReleasePhoneNumberResult model. */ public final class ReleasePhoneNumberResult { } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/ReservationStatus.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/ReservationStatus.java index abe185b3a66d..e37ff7eee900 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/ReservationStatus.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/models/ReservationStatus.java @@ -63,11 +63,7 @@ public static ReservationStatus fromString(String name) { return fromString(name, ReservationStatus.class); } - /** - * Gives a Collection of ReservationStatus values. - * - * @return known ReservationStatus values. - */ + /** @return known ReservationStatus values. */ public static Collection values() { return values(ReservationStatus.class); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/SipRoutingAdminClientImplBuilder.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/SipRoutingAdminClientImplBuilder.java index f42c75b71e4b..b53b8652d76c 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/SipRoutingAdminClientImplBuilder.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/SipRoutingAdminClientImplBuilder.java @@ -4,7 +4,6 @@ package com.azure.communication.phonenumbers.siprouting.implementation; -import com.azure.communication.phonenumbers.CodeCoverageAnnotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -72,7 +71,6 @@ public SipRoutingAdminClientImplBuilder endpoint(String endpoint) { * @param apiVersion the apiVersion value. * @return the SipRoutingAdminClientImplBuilder. */ - @Generated public SipRoutingAdminClientImplBuilder apiVersion(String apiVersion) { this.apiVersion = apiVersion; return this; @@ -105,7 +103,6 @@ public SipRoutingAdminClientImplBuilder pipeline(HttpPipeline pipeline) { * @param serializerAdapter the serializerAdapter value. * @return the SipRoutingAdminClientImplBuilder. */ - @Generated public SipRoutingAdminClientImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; @@ -122,7 +119,6 @@ public SipRoutingAdminClientImplBuilder serializerAdapter(SerializerAdapter seri * @param httpClient the httpClient value. * @return the SipRoutingAdminClientImplBuilder. */ - @Generated public SipRoutingAdminClientImplBuilder httpClient(HttpClient httpClient) { this.httpClient = httpClient; return this; @@ -140,7 +136,6 @@ public SipRoutingAdminClientImplBuilder httpClient(HttpClient httpClient) { * @param configuration the configuration value. * @return the SipRoutingAdminClientImplBuilder. */ - @Generated public SipRoutingAdminClientImplBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; @@ -157,7 +152,6 @@ public SipRoutingAdminClientImplBuilder configuration(Configuration configuratio * @param httpLogOptions the httpLogOptions value. * @return the SipRoutingAdminClientImplBuilder. */ - @Generated public SipRoutingAdminClientImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { this.httpLogOptions = httpLogOptions; return this; @@ -175,7 +169,6 @@ public SipRoutingAdminClientImplBuilder httpLogOptions(HttpLogOptions httpLogOpt * @param retryPolicy the retryPolicy value. * @return the SipRoutingAdminClientImplBuilder. */ - @Generated public SipRoutingAdminClientImplBuilder retryPolicy(RetryPolicy retryPolicy) { this.retryPolicy = retryPolicy; return this; @@ -198,7 +191,6 @@ public SipRoutingAdminClientImplBuilder retryPolicy(RetryPolicy retryPolicy) { * @param clientOptions the clientOptions value. * @return the SipRoutingAdminClientImplBuilder. */ - @Generated public SipRoutingAdminClientImplBuilder clientOptions(ClientOptions clientOptions) { this.clientOptions = clientOptions; return this; @@ -210,7 +202,6 @@ public SipRoutingAdminClientImplBuilder clientOptions(ClientOptions clientOption * @param customPolicy The custom Http pipeline policy to add. * @return the SipRoutingAdminClientImplBuilder. */ - @Generated public SipRoutingAdminClientImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { pipelinePolicies.add(customPolicy); return this; @@ -236,7 +227,6 @@ public SipRoutingAdminClientImpl buildClient() { return client; } - @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/CommunicationError.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/CommunicationError.java index a03eed097793..ea9afdd3f634 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/CommunicationError.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/CommunicationError.java @@ -4,14 +4,12 @@ package com.azure.communication.phonenumbers.siprouting.implementation.models; -import com.azure.communication.phonenumbers.CodeCoverageAnnotation.Generated; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The Communication Services error. */ @Fluent -@Generated public final class CommunicationError { /* * The error code. diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/CommunicationErrorResponse.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/CommunicationErrorResponse.java index e3336dfd9c45..77cc8079721f 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/CommunicationErrorResponse.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/CommunicationErrorResponse.java @@ -4,13 +4,11 @@ package com.azure.communication.phonenumbers.siprouting.implementation.models; -import com.azure.communication.phonenumbers.CodeCoverageAnnotation.Generated; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** The Communication Services error. */ @Fluent -@Generated public final class CommunicationErrorResponse { /* * The Communication Services error. diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/SipConfigurationUpdate.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/SipConfigurationUpdate.java index 5fc2f2bbf3fb..be7206995894 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/SipConfigurationUpdate.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/SipConfigurationUpdate.java @@ -4,7 +4,6 @@ package com.azure.communication.phonenumbers.siprouting.implementation.models; -import com.azure.communication.phonenumbers.CodeCoverageAnnotation.Generated; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -12,7 +11,6 @@ /** Represents a SIP configuration update. */ @Fluent -@Generated public final class SipConfigurationUpdate { /* * SIP trunks for routing calls. diff --git a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/TrunkUpdate.java b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/TrunkUpdate.java index d30dfe83d8b4..b91009a85538 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/TrunkUpdate.java +++ b/sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/siprouting/implementation/models/TrunkUpdate.java @@ -4,13 +4,11 @@ package com.azure.communication.phonenumbers.siprouting.implementation.models; -import com.azure.communication.phonenumbers.CodeCoverageAnnotation.Generated; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Represents a SIP trunk update. */ @Fluent -@Generated public final class TrunkUpdate { /* * Gets or sets SIP signaling port of the trunk. diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClientIntegrationTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClientIntegrationTest.java index ddf3ea567afb..b555dbe0a6da 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClientIntegrationTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClientIntegrationTest.java @@ -2,43 +2,33 @@ // Licensed under the MIT License. package com.azure.communication.phonenumbers; -import com.azure.communication.phonenumbers.implementation.converters.PhoneNumberErrorConverter; -import com.azure.communication.phonenumbers.implementation.models.CommunicationError; -import com.azure.communication.phonenumbers.models.BillingFrequency; -import com.azure.communication.phonenumbers.models.PhoneNumberAdministrativeDivision; -import com.azure.communication.phonenumbers.models.OperatorInformationResult; -import com.azure.communication.phonenumbers.models.OperatorInformationOptions; import com.azure.communication.phonenumbers.models.PhoneNumberAreaCode; import com.azure.communication.phonenumbers.models.PhoneNumberAssignmentType; import com.azure.communication.phonenumbers.models.PhoneNumberCapabilities; import com.azure.communication.phonenumbers.models.PhoneNumberCapabilityType; import com.azure.communication.phonenumbers.models.PhoneNumberCountry; -import com.azure.communication.phonenumbers.models.PhoneNumberError; import com.azure.communication.phonenumbers.models.PhoneNumberLocality; -import com.azure.communication.phonenumbers.models.PhoneNumberOffering; import com.azure.communication.phonenumbers.models.PhoneNumberOperation; -import com.azure.communication.phonenumbers.models.PhoneNumberOperationStatus; +import com.azure.communication.phonenumbers.models.PhoneNumberOffering; import com.azure.communication.phonenumbers.models.PhoneNumberSearchOptions; import com.azure.communication.phonenumbers.models.PhoneNumberSearchResult; import com.azure.communication.phonenumbers.models.PhoneNumberType; import com.azure.communication.phonenumbers.models.PurchasePhoneNumbersResult; import com.azure.communication.phonenumbers.models.PurchasedPhoneNumber; import com.azure.communication.phonenumbers.models.ReleasePhoneNumberResult; +import com.azure.communication.phonenumbers.models.PhoneNumberOperationStatus; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; +import com.azure.core.test.TestMode; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import reactor.test.StepVerifier; +import reactor.test.StepVerifier; import java.time.Duration; -import java.util.ArrayList; -import java.util.List; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -104,66 +94,62 @@ public void listPurchasedPhoneNumbers(HttpClient httpClient) { @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable(named = "COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", matches = "(?i)(true)") public void beginSearchAvailablePhoneNumbers(HttpClient httpClient) { - PhoneNumbersAsyncClient client = - this.getClientWithConnectionString(httpClient, "beginSearchAvailablePhoneNumbers"); StepVerifier.create( - beginSearchAvailablePhoneNumbersHelper(client, true).last() - .flatMap((AsyncPollResponse result) -> { - return result.getFinalResult(); - })) - .assertNext((PhoneNumberSearchResult searchResult) -> { - assertEquals(searchResult.getPhoneNumbers().size(), 1); - assertNotNull(searchResult.getSearchId()); - }) - .verifyComplete(); + beginSearchAvailablePhoneNumbersHelper(httpClient, "beginSearchAvailablePhoneNumbers", true).last() + .flatMap((AsyncPollResponse result) -> { + return result.getFinalResult(); + })) + .assertNext((PhoneNumberSearchResult searchResult) -> { + assertEquals(searchResult.getPhoneNumbers().size(), 1); + assertNotNull(searchResult.getSearchId()); + }) + .verifyComplete(); } @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable(named = "COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", matches = "(?i)(true)") public void beginSearchAvailablePhoneNumbersWithoutOptions(HttpClient httpClient) { - PhoneNumbersAsyncClient client = - this.getClientWithConnectionString(httpClient, "getPurchasedPhoneNumberForCapabilities"); StepVerifier.create( - beginSearchAvailablePhoneNumbersHelper(client, false).last() - .flatMap((AsyncPollResponse result) -> { - return result.getFinalResult(); - })) - .assertNext((PhoneNumberSearchResult searchResult) -> { - assertEquals(searchResult.getPhoneNumbers().size(), 1); - assertNotNull(searchResult.getSearchId()); - }) - .verifyComplete(); + beginSearchAvailablePhoneNumbersHelper(httpClient, "beginSearchAvailablePhoneNumbersWithoutOptions", + false).last() + .flatMap((AsyncPollResponse result) -> { + return result.getFinalResult(); + })) + .assertNext((PhoneNumberSearchResult searchResult) -> { + assertEquals(searchResult.getPhoneNumbers().size(), 1); + assertNotNull(searchResult.getSearchId()); + }) + .verifyComplete(); } @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable(named = "SKIP_LIVE_TEST", matches = "(?i)(true)") public void beginPurchaseandReleasePhoneNumbers(HttpClient httpClient) { - PhoneNumbersAsyncClient client = - this.getClientWithConnectionString(httpClient, "getPurchasedPhoneNumberForCapabilities"); StepVerifier.create( - beginSearchAvailablePhoneNumbersHelper(client, true).last() - .flatMap((AsyncPollResponse result) -> { - return result.getFinalResult() - .flatMap((PhoneNumberSearchResult searchResult) -> { - String phoneNumber = searchResult.getPhoneNumbers().get(0); - return beginPurchasePhoneNumbersHelper(client, searchResult.getSearchId() - ).last() - .flatMap(( - AsyncPollResponse purchaseResult) -> { - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - purchaseResult.getStatus()); - return beginReleasePhoneNumberHelper(client, phoneNumber - ).last(); - }); - }); - })) - .assertNext((AsyncPollResponse releaseResult) -> { - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, releaseResult.getStatus()); - - }) - .verifyComplete(); + beginSearchAvailablePhoneNumbersHelper(httpClient, "beginSearchAvailablePhoneNumbers", true).last() + .flatMap((AsyncPollResponse result) -> { + return result.getFinalResult() + .flatMap((PhoneNumberSearchResult searchResult) -> { + String phoneNumber = redactIfPlaybackMode( + searchResult.getPhoneNumbers().get(0)); + return beginPurchasePhoneNumbersHelper(httpClient, searchResult.getSearchId(), + "beginPurchasePhoneNumbers").last() + .flatMap(( + AsyncPollResponse purchaseResult) -> { + assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + purchaseResult.getStatus()); + return beginReleasePhoneNumberHelper(httpClient, phoneNumber, + "beginReleasePhoneNumber").last(); + }); + }); + })) + .assertNext((AsyncPollResponse releaseResult) -> { + assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, releaseResult.getStatus()); + + }) + .verifyComplete(); } @ParameterizedTest @@ -171,33 +157,37 @@ public void beginPurchaseandReleasePhoneNumbers(HttpClient httpClient) { @DisabledIfEnvironmentVariable(named = "COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", matches = "(?i)(true)") @DisabledIfEnvironmentVariable(named = "SKIP_UPDATE_CAPABILITIES_LIVE_TESTS", matches = "(?i)(true)") public void beginUpdatePhoneNumberCapabilities(HttpClient httpClient) { - String phoneNumber = getTestPhoneNumber(); - PhoneNumbersAsyncClient client = - this.getClientWithConnectionString(httpClient, "getPurchasedPhoneNumberForCapabilities"); + String phoneNumber = redactIfPlaybackMode(getTestPhoneNumber()); + StepVerifier.create( - client.getPurchasedPhoneNumberWithResponse(phoneNumber) - .flatMap(responseAcquiredPhone -> { - PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities(); - capabilities.setCalling(responseAcquiredPhone.getValue().getCapabilities() - .getCalling() == PhoneNumberCapabilityType.INBOUND - ? PhoneNumberCapabilityType.OUTBOUND - : PhoneNumberCapabilityType.INBOUND); - capabilities.setSms(responseAcquiredPhone.getValue().getCapabilities() - .getSms() == PhoneNumberCapabilityType.INBOUND_OUTBOUND - ? PhoneNumberCapabilityType.OUTBOUND - : PhoneNumberCapabilityType.INBOUND_OUTBOUND); - return beginUpdatePhoneNumberCapabilitiesHelper(client, phoneNumber, capabilities) - .last() - .flatMap((AsyncPollResponse result) -> { - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - result.getStatus()); - assertEquals(PhoneNumberOperationStatus.SUCCEEDED, - result.getValue().getStatus()); - return result.getFinalResult(); - }); - })) - .assertNext(Assertions::assertNotNull) - .verifyComplete(); + this.getClientWithConnectionString(httpClient, "getPurchasedPhoneNumberForCapabilities") + .getPurchasedPhoneNumberWithResponse(phoneNumber) + .flatMap(responseAcquiredPhone -> { + PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities(); + capabilities.setCalling(responseAcquiredPhone.getValue().getCapabilities() + .getCalling() == PhoneNumberCapabilityType.INBOUND + ? PhoneNumberCapabilityType.OUTBOUND + : PhoneNumberCapabilityType.INBOUND); + capabilities.setSms(responseAcquiredPhone.getValue().getCapabilities() + .getSms() == PhoneNumberCapabilityType.INBOUND_OUTBOUND + ? PhoneNumberCapabilityType.OUTBOUND + : PhoneNumberCapabilityType.INBOUND_OUTBOUND); + return beginUpdatePhoneNumberCapabilitiesHelper(httpClient, phoneNumber, + "beginUpdatePhoneNumberCapabilities", capabilities) + .last() + .flatMap((AsyncPollResponse result) -> { + assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + result.getStatus()); + assertEquals(PhoneNumberOperationStatus.SUCCEEDED, + result.getValue().getStatus()); + return result.getFinalResult(); + }); + + })) + .assertNext((PurchasedPhoneNumber acquiredPhoneNumber) -> { + assertNotNull(acquiredPhoneNumber); + }) + .verifyComplete(); } @ParameterizedTest @@ -267,7 +257,10 @@ public void getTollFreeAreaCodesWithAAD(HttpClient httpClient) { StepVerifier.create( this.getClientWithManagedIdentity(httpClient, "listAvailableTollFreeAreaCodes") .listAvailableTollFreeAreaCodes("US", PhoneNumberAssignmentType.APPLICATION).next()) - .expectAccessibleContext(); + .assertNext((PhoneNumberAreaCode areaCodes) -> { + assertNotNull(areaCodes.getAreaCode()); + }) + .verifyComplete(); } @ParameterizedTest @@ -282,7 +275,6 @@ public void getGeographicAreaCodesWithAAD(HttpClient httpClient) { .next()) .assertNext((PhoneNumberAreaCode areaCodes) -> { assertNotNull(areaCodes); - assertNotNull(areaCodes.getAreaCode()); }) .verifyComplete(); } @@ -321,7 +313,6 @@ public void getLocalitiesAdministrativeDivisionWithAAD(HttpClient httpClient) { .assertNext((PhoneNumberLocality localityWithAD) -> { assertNotNull(localityWithAD); assertEquals(localityWithAD.getAdministrativeDivision().getAbbreviatedName(), locality.getAdministrativeDivision().getAbbreviatedName()); - assertEquals(localityWithAD.getAdministrativeDivision().getLocalizedName(), locality.getAdministrativeDivision().getLocalizedName()); }) .verifyComplete(); } @@ -334,10 +325,6 @@ public void getOfferingsWithAAD(HttpClient httpClient) { .listAvailableOfferings("US", null, null).next()) .assertNext((PhoneNumberOffering offering) -> { assertNotNull(offering); - offering.getCost().getBillingFrequency(); - assertNotNull(BillingFrequency.values()); - assertNotNull(offering.getCost().getCurrencyCode()); - assertNotNull(offering.getCost().getAmount()); }) .verifyComplete(); } @@ -348,16 +335,10 @@ public void getTollFreeAreaCodes(HttpClient httpClient) { StepVerifier.create( this.getClientWithConnectionString(httpClient, "listAvailableTollFreeAreaCodes") .listAvailableTollFreeAreaCodes("US", PhoneNumberAssignmentType.APPLICATION).next()) - .expectAccessibleContext(); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getTollFreeAreaCodesWrongCountryCode(HttpClient httpClient) { - StepVerifier.create( - this.getClientWithConnectionString(httpClient, "listAvailableTollFreeAreaCodes") - .listAvailableTollFreeAreaCodes("XX", PhoneNumberAssignmentType.APPLICATION).next()) - .expectError(); + .assertNext((PhoneNumberAreaCode areaCodes) -> { + assertNotNull(areaCodes.getAreaCode()); + }) + .verifyComplete(); } @ParameterizedTest @@ -372,22 +353,10 @@ public void getGeographicAreaCodes(HttpClient httpClient) { .next()) .assertNext((PhoneNumberAreaCode areaCodes) -> { assertNotNull(areaCodes); - assertNotNull(areaCodes.getAreaCode()); }) .verifyComplete(); } - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getGeographicAreaCodesWronglocality(HttpClient httpClient) { - StepVerifier.create( - this.getClientWithConnectionString(httpClient, "listAvailableGeographicAreaCodes") - .listAvailableGeographicAreaCodes("US", PhoneNumberAssignmentType.PERSON, - "XX", "XX") - .next()) - .expectError(); - } - @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void getCountries(HttpClient httpClient) { @@ -415,30 +384,19 @@ public void getLocalities(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void getLocalitiesAdministrativeDivision(HttpClient httpClient) { - PhoneNumberAdministrativeDivision localityAdministraiveDivision = this.getClientWithConnectionString(httpClient, "listAvailableLocalities") - .listAvailableLocalities("US", null).blockFirst().getAdministrativeDivision(); + String localityAdministraiveDivision = this.getClientWithConnectionString(httpClient, "listAvailableLocalities") + .listAvailableLocalities("US", null).blockFirst().getAdministrativeDivision().getAbbreviatedName(); StepVerifier.create( this.getClientWithConnectionString(httpClient, "listAvailableLocalities") - .listAvailableLocalities("US", localityAdministraiveDivision.getAbbreviatedName()).next()) + .listAvailableLocalities("US", localityAdministraiveDivision).next()) .assertNext((PhoneNumberLocality locality) -> { assertNotNull(locality); assertEquals(locality.getAdministrativeDivision().getAbbreviatedName(), - localityAdministraiveDivision.getAbbreviatedName()); - assertEquals(locality.getAdministrativeDivision().getLocalizedName(), - localityAdministraiveDivision.getLocalizedName()); + localityAdministraiveDivision); }) .verifyComplete(); } - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getLocalitiesInvalidAdministrativeDivision(HttpClient httpClient) { - StepVerifier.create( - this.getClientWithConnectionString(httpClient, "listAvailableLocalities") - .listAvailableLocalities("US", "null").next()) - .expectError(); - } - @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void getOfferings(HttpClient httpClient) { @@ -447,111 +405,19 @@ public void getOfferings(HttpClient httpClient) { .listAvailableOfferings("US", null, null).next()) .assertNext((PhoneNumberOffering offering) -> { assertNotNull(offering); - offering.getCost().getBillingFrequency(); - assertNotNull(BillingFrequency.values()); - assertNotNull(offering.getCost().getCurrencyCode()); - assertNotNull(offering.getCost().getAmount()); - }) - .verifyComplete(); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void convertCommunicationError(HttpClient httpClient) { - List details = new ArrayList(); - CommunicationError communicationError = new CommunicationError(); - communicationError.setCode("500"); - communicationError.setMessage("Communication Error"); - - PhoneNumberError phoneNumberError = new PhoneNumberError( - communicationError.getMessage(), - communicationError.getCode(), - communicationError.getTarget(), - details - ); - PhoneNumberError error = PhoneNumberErrorConverter.convert(communicationError); - assertEquals(phoneNumberError.getCode(), error.getCode()); - assertEquals(phoneNumberError.getMessage(), error.getMessage()); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void convertCommunicationErrorWithNull(HttpClient httpClient) { - CommunicationError communicationError = null; - PhoneNumberError error = PhoneNumberErrorConverter.convert(communicationError); - assertEquals(null, error); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void searchOperatorInformationSucceeds(HttpClient httpClient) { - List phoneNumbers = new ArrayList(); - phoneNumbers.add(redactIfPlaybackMode(getTestPhoneNumber())); - StepVerifier.create( - this.getClientWithConnectionString(httpClient, "searchOperatorInformation") - .searchOperatorInformation(phoneNumbers)) - .assertNext((OperatorInformationResult result) -> { - assertEquals(phoneNumbers.get(0), result.getValues().get(0).getPhoneNumber()); - }) - .verifyComplete(); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void searchOperatorInformationOnlyAcceptsOnePhoneNumber(HttpClient httpClient) { - List phoneNumbers = new ArrayList(); - phoneNumbers.add(redactIfPlaybackMode(getTestPhoneNumber())); - phoneNumbers.add(redactIfPlaybackMode(getTestPhoneNumber())); - StepVerifier.create( - this.getClientWithConnectionString(httpClient, "searchOperatorInformationOnlyAcceptsOnePhoneNumber") - .searchOperatorInformation(phoneNumbers)) - .verifyError(); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void searchOperatorInformationRespectsSearchOptions(HttpClient httpClient) { - List phoneNumbers = new ArrayList(); - phoneNumbers.add(redactIfPlaybackMode(getTestPhoneNumber())); - OperatorInformationOptions requestOptions = new OperatorInformationOptions(); - requestOptions.setIncludeAdditionalOperatorDetails(false); - StepVerifier.create( - this.getClientWithConnectionString(httpClient, "searchOperatorInformation") - .searchOperatorInformationWithResponse(phoneNumbers, requestOptions)) - .assertNext((Response result) -> { - assertEquals(phoneNumbers.get(0), result.getValue().getValues().get(0).getPhoneNumber()); - assertNotNull(result.getValue().getValues().get(0).getNationalFormat()); - assertNotNull(result.getValue().getValues().get(0).getInternationalFormat()); - assertEquals(null, result.getValue().getValues().get(0).getNumberType()); - assertEquals(null, result.getValue().getValues().get(0).getIsoCountryCode()); - assertEquals(null, result.getValue().getValues().get(0).getOperatorDetails()); - }) - .verifyComplete(); - - requestOptions.setIncludeAdditionalOperatorDetails(true); - StepVerifier.create( - this.getClientWithConnectionString(httpClient, "searchOperatorInformation") - .searchOperatorInformationWithResponse(phoneNumbers, requestOptions)) - .assertNext((Response result) -> { - assertEquals(phoneNumbers.get(0), result.getValue().getValues().get(0).getPhoneNumber()); - assertNotNull(result.getValue().getValues().get(0).getNationalFormat()); - assertNotNull(result.getValue().getValues().get(0).getInternationalFormat()); - assertNotNull(result.getValue().getValues().get(0).getNumberType()); - assertNotNull(result.getValue().getValues().get(0).getIsoCountryCode()); - assertNotNull(result.getValue().getValues().get(0).getOperatorDetails()); }) .verifyComplete(); } private PollerFlux beginSearchAvailablePhoneNumbersHelper( - PhoneNumbersAsyncClient client, boolean withOptions) { + HttpClient httpClient, String testName, boolean withOptions) { PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities(); capabilities.setCalling(PhoneNumberCapabilityType.INBOUND); capabilities.setSms(PhoneNumberCapabilityType.INBOUND_OUTBOUND); PhoneNumberSearchOptions searchOptions = new PhoneNumberSearchOptions().setQuantity(1); if (withOptions) { - return setPollInterval(client + return setPollInterval(this.getClientWithConnectionString(httpClient, testName) .beginSearchAvailablePhoneNumbers( COUNTRY_CODE, PhoneNumberType.TOLL_FREE, @@ -559,7 +425,7 @@ private PollerFlux beginSearchAva capabilities, searchOptions)); } - return setPollInterval(client + return setPollInterval(this.getClientWithConnectionString(httpClient, testName) .beginSearchAvailablePhoneNumbers( COUNTRY_CODE, PhoneNumberType.TOLL_FREE, @@ -568,21 +434,24 @@ private PollerFlux beginSearchAva } private PollerFlux beginPurchasePhoneNumbersHelper( - PhoneNumbersAsyncClient client, String searchId) { - return setPollInterval(client + HttpClient httpClient, String searchId, String testName) { + return setPollInterval(this.getClientWithConnectionString(httpClient, testName) .beginPurchasePhoneNumbers(searchId)); } private PollerFlux beginReleasePhoneNumberHelper( - PhoneNumbersAsyncClient client, String phoneNumber) { - return setPollInterval(client + HttpClient httpClient, String phoneNumber, String testName) { + if (getTestMode() == TestMode.PLAYBACK) { + phoneNumber = "+REDACTED"; + } + return setPollInterval(this.getClientWithConnectionString(httpClient, testName) .beginReleasePhoneNumber(phoneNumber)); } private PollerFlux beginUpdatePhoneNumberCapabilitiesHelper( - PhoneNumbersAsyncClient client, String phoneNumber, PhoneNumberCapabilities capabilities) { + HttpClient httpClient, String phoneNumber, String testName, PhoneNumberCapabilities capabilities) { - return setPollInterval(client + return setPollInterval(this.getClientWithConnectionString(httpClient, testName) .beginUpdatePhoneNumberCapabilities(phoneNumber, capabilities)); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientBuilderTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientBuilderTest.java index be3f6be43f76..6a05ee7a5ea5 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientBuilderTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientBuilderTest.java @@ -110,7 +110,7 @@ public void buildClientWithConfiguration() { public void buildClientWithServiceVersion() { // Build client with required settings and mock configuration PhoneNumbersClient phoneNumberClient = this.setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .serviceVersion(PhoneNumbersServiceVersion.V2024_03_01_PREVIEW) + .serviceVersion(PhoneNumbersServiceVersion.V2021_03_07) .buildClient(); // Validate client created with expected settings @@ -227,7 +227,7 @@ public void buildAsyncClientWithServiceVersion() { // Build client with required settings and mock configuration PhoneNumbersAsyncClient phoneNumberAsyncClient = this .setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .serviceVersion(PhoneNumbersServiceVersion.V2024_03_01_PREVIEW) + .serviceVersion(PhoneNumbersServiceVersion.V2021_03_07) .buildAsyncClient(); // Validate client created with expected settings diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientIntegrationTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientIntegrationTest.java index 230c107c8488..85b52d961ca8 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientIntegrationTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientIntegrationTest.java @@ -2,27 +2,21 @@ // Licensed under the MIT License. package com.azure.communication.phonenumbers; -import com.azure.communication.phonenumbers.implementation.converters.PhoneNumberErrorConverter; -import com.azure.communication.phonenumbers.implementation.models.CommunicationError; -import com.azure.communication.phonenumbers.implementation.models.CommunicationErrorResponseException; -import com.azure.communication.phonenumbers.models.PhoneNumberAdministrativeDivision; -import com.azure.communication.phonenumbers.models.OperatorInformationResult; import com.azure.communication.phonenumbers.models.PhoneNumberAreaCode; import com.azure.communication.phonenumbers.models.PhoneNumberAssignmentType; import com.azure.communication.phonenumbers.models.PhoneNumberCapabilities; import com.azure.communication.phonenumbers.models.PhoneNumberCapabilityType; import com.azure.communication.phonenumbers.models.PhoneNumberCountry; -import com.azure.communication.phonenumbers.models.PhoneNumberError; import com.azure.communication.phonenumbers.models.PhoneNumberLocality; import com.azure.communication.phonenumbers.models.PhoneNumberOffering; import com.azure.communication.phonenumbers.models.PhoneNumberOperation; -import com.azure.communication.phonenumbers.models.PhoneNumberOperationStatus; import com.azure.communication.phonenumbers.models.PhoneNumberSearchOptions; import com.azure.communication.phonenumbers.models.PhoneNumberSearchResult; import com.azure.communication.phonenumbers.models.PhoneNumberType; import com.azure.communication.phonenumbers.models.PurchasePhoneNumbersResult; import com.azure.communication.phonenumbers.models.PurchasedPhoneNumber; import com.azure.communication.phonenumbers.models.ReleasePhoneNumberResult; +import com.azure.communication.phonenumbers.models.PhoneNumberOperationStatus; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; @@ -36,14 +30,9 @@ import org.junit.jupiter.params.provider.MethodSource; import java.time.Duration; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; public class PhoneNumbersClientIntegrationTest extends PhoneNumbersIntegrationTestBase { @@ -129,7 +118,7 @@ public void beginPurchaseandReleasePhoneNumbersWithoutContext(HttpClient httpCli PollResponse response = poller.waitForCompletion(); if (LongRunningOperationStatus.SUCCESSFULLY_COMPLETED == response.getStatus()) { PhoneNumberSearchResult searchResult = poller.getFinalResult(); - String phoneNumber = searchResult.getPhoneNumbers().get(0); + String phoneNumber = redactIfPlaybackMode(searchResult.getPhoneNumbers().get(0)); PollResponse purchaseOperationResponse = beginPurchasePhoneNumbersHelper(httpClient, searchResult.getSearchId(), "beginPurchasePhoneNumbersWithoutContextSync", false) .waitForCompletion(); @@ -151,7 +140,7 @@ public void beginPurchaseandReleasePhoneNumbers(HttpClient httpClient) { PollResponse response = poller.waitForCompletion(); if (LongRunningOperationStatus.SUCCESSFULLY_COMPLETED == response.getStatus()) { PhoneNumberSearchResult searchResult = poller.getFinalResult(); - String phoneNumber = searchResult.getPhoneNumbers().get(0); + String phoneNumber = redactIfPlaybackMode(searchResult.getPhoneNumbers().get(0)); PollResponse purchaseOperationResponse = beginPurchasePhoneNumbersHelper(httpClient, searchResult.getSearchId(), "beginPurchasePhoneNumbersSync", true).waitForCompletion(); assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, purchaseOperationResponse.getStatus()); @@ -167,7 +156,7 @@ public void beginPurchaseandReleasePhoneNumbers(HttpClient httpClient) { @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable(named = "COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", matches = "(?i)(true)") public void beginUpdatePhoneNumberCapabilitiesWithoutContext(HttpClient httpClient) { - String phoneNumber = getTestPhoneNumber(); + String phoneNumber = redactIfPlaybackMode(getTestPhoneNumber()); PollResponse result = beginUpdatePhoneNumberCapabilitiesHelper(httpClient, phoneNumber, "beginUpdatePhoneNumberCapabilitiesWithoutContextSync", false).waitForCompletion(); assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, result.getStatus()); @@ -179,61 +168,21 @@ public void beginUpdatePhoneNumberCapabilitiesWithoutContext(HttpClient httpClie @DisabledIfEnvironmentVariable(named = "COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", matches = "(?i)(true)") @DisabledIfEnvironmentVariable(named = "SKIP_UPDATE_CAPABILITIES_LIVE_TESTS", matches = "(?i)(true)") public void beginUpdatePhoneNumberCapabilities(HttpClient httpClient) { - String phoneNumber = getTestPhoneNumber(); + String phoneNumber = redactIfPlaybackMode(getTestPhoneNumber()); PollResponse result = beginUpdatePhoneNumberCapabilitiesHelper(httpClient, phoneNumber, "beginUpdatePhoneNumberCapabilities", true).waitForCompletion(); assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, result.getStatus()); assertEquals(PhoneNumberOperationStatus.SUCCEEDED, result.getValue().getStatus()); } - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getTollFreeAreaCodesWithoutContext(HttpClient httpClient) { - PagedIterable areaCodesResult = this - .getClientWithConnectionString(httpClient, "listAvailableTollFreeAreaCodes") - .listAvailableTollFreeAreaCodes("US"); - List expectedAreaCodes = Arrays.asList("888", "877", "866", "855", "844", "800", "833", "88"); - for (PhoneNumberAreaCode areaCode : areaCodesResult) { - assertTrue(expectedAreaCodes.contains(areaCode.getAreaCode())); - } - assertNotNull(areaCodesResult); - } - @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void getTollFreeAreaCodes(HttpClient httpClient) { PagedIterable areaCodesResult = this .getClientWithConnectionString(httpClient, "listAvailableTollFreeAreaCodes") - .listAvailableTollFreeAreaCodes("US", Context.NONE); - List expectedAreaCodes = Arrays.asList("888", "877", "866", "855", "844", "800", "833", "88"); - for (PhoneNumberAreaCode areaCode : areaCodesResult) { - assertTrue(expectedAreaCodes.contains(areaCode.getAreaCode())); - } - assertNotNull(areaCodesResult); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getTollFreeAreaCodesWrongCountryCode(HttpClient httpClient) { - PhoneNumbersClient client = this.getClientWithConnectionString(httpClient, "listAvailableAreaCodes"); - - assertThrows(RuntimeException.class, - () -> client.listAvailableTollFreeAreaCodes("XX", null).iterator().next(), - "Unable to parse country code."); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getGeographicAreaCodesWithoutContext(HttpClient httpClient) { - PhoneNumberLocality locality = this.getClientWithConnectionString(httpClient, "listAvailableLocalities") - .listAvailableLocalities("US", null).iterator().next(); - PagedIterable areaCodesResult = this - .getClientWithConnectionString(httpClient, "listAvailableGeographicAreaCodes") - .listAvailableGeographicAreaCodes("US", PhoneNumberAssignmentType.PERSON, locality.getLocalizedName(), - locality.getAdministrativeDivision().getAbbreviatedName()); + .listAvailableTollFreeAreaCodes("US"); PhoneNumberAreaCode areaCodes = areaCodesResult.iterator().next(); assertNotNull(areaCodes); - assertNotNull(areaCodes.getAreaCode()); } @ParameterizedTest @@ -244,54 +193,18 @@ public void getGeographicAreaCodes(HttpClient httpClient) { PagedIterable areaCodesResult = this .getClientWithConnectionString(httpClient, "listAvailableGeographicAreaCodes") .listAvailableGeographicAreaCodes("US", PhoneNumberAssignmentType.PERSON, locality.getLocalizedName(), - locality.getAdministrativeDivision().getAbbreviatedName(), Context.NONE); + locality.getAdministrativeDivision().getAbbreviatedName()); PhoneNumberAreaCode areaCodes = areaCodesResult.iterator().next(); assertNotNull(areaCodes); - assertNotNull(areaCodes.getAreaCode()); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getGeographicAreaCodesWrongLocality(HttpClient httpClient) { - PhoneNumbersClient client = this.getClientWithConnectionString(httpClient, "listAvailableAreaCodes"); - - assertThrows(RuntimeException.class, - () -> client.listAvailableGeographicAreaCodes("US", PhoneNumberAssignmentType.PERSON, "XX", - "XX").iterator().next(), - "No area codes were found for the given parameters"); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getCountriesWithoutContext(HttpClient httpClient) { - PagedIterable countriesResult = this - .getClientWithConnectionString(httpClient, "listAvailableCountries").listAvailableCountries(); - PhoneNumberCountry country = countriesResult.iterator().next(); - assertNotNull(country); - assertNotNull(country.getCountryCode()); - assertNotNull(country.getLocalizedName()); } @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void getCountries(HttpClient httpClient) { PagedIterable countriesResult = this - .getClientWithConnectionString(httpClient, "listAvailableCountries") - .listAvailableCountries(Context.NONE); + .getClientWithConnectionString(httpClient, "listAvailableCountries").listAvailableCountries(); PhoneNumberCountry country = countriesResult.iterator().next(); assertNotNull(country); - assertNotNull(country.getCountryCode()); - assertNotNull(country.getLocalizedName()); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getLocalitiesWithoutContext(HttpClient httpClient) { - PagedIterable localitiesResult = this - .getClientWithConnectionString(httpClient, "listAvailableLocalities") - .listAvailableLocalities("US", null); - PhoneNumberLocality locality = localitiesResult.iterator().next(); - assertNotNull(locality); } @ParameterizedTest @@ -299,43 +212,22 @@ public void getLocalitiesWithoutContext(HttpClient httpClient) { public void getLocalities(HttpClient httpClient) { PagedIterable localitiesResult = this .getClientWithConnectionString(httpClient, "listAvailableLocalities") - .listAvailableLocalities("US", null, Context.NONE); + .listAvailableLocalities("US", null); PhoneNumberLocality locality = localitiesResult.iterator().next(); assertNotNull(locality); } - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getLocalitiesWithInvalidAdministrativeDivision(HttpClient httpClient) { - PhoneNumbersClient client = this.getClientWithConnectionString(httpClient, "listAvailableLocalities"); - - assertThrows(CommunicationErrorResponseException.class, - () -> client.listAvailableLocalities("US", "null").iterator().next(), - "No localities were found for the given parameters"); - } - @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void getLocalitiesWithAdministrativeDivision(HttpClient httpClient) { - PhoneNumberAdministrativeDivision localityAdministraiveDivision = this.getClientWithConnectionString(httpClient, "listAvailableLocalities") - .listAvailableLocalities("US", null).iterator().next().getAdministrativeDivision(); + String localityAdministraiveDivision = this.getClientWithConnectionString(httpClient, "listAvailableLocalities") + .listAvailableLocalities("US", null).iterator().next().getAdministrativeDivision().getAbbreviatedName(); PagedIterable localitiesResult = this .getClientWithConnectionString(httpClient, "listAvailableLocalities") - .listAvailableLocalities("US", localityAdministraiveDivision.getAbbreviatedName()); + .listAvailableLocalities("US", localityAdministraiveDivision); PhoneNumberLocality locality = localitiesResult.iterator().next(); assertNotNull(locality); - assertEquals(locality.getAdministrativeDivision().getAbbreviatedName(), localityAdministraiveDivision.getAbbreviatedName()); - assertEquals(locality.getAdministrativeDivision().getLocalizedName(), localityAdministraiveDivision.getLocalizedName()); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void getOfferingsWithoutContext(HttpClient httpClient) { - PagedIterable offeringsResult = this - .getClientWithConnectionString(httpClient, "listAvailableOfferings") - .listAvailableOfferings("US", null, null); - PhoneNumberOffering offering = offeringsResult.iterator().next(); - assertNotNull(offering); + assertEquals(locality.getAdministrativeDivision().getAbbreviatedName(), localityAdministraiveDivision); } @ParameterizedTest @@ -343,7 +235,7 @@ public void getOfferingsWithoutContext(HttpClient httpClient) { public void getOfferings(HttpClient httpClient) { PagedIterable offeringsResult = this .getClientWithConnectionString(httpClient, "listAvailableOfferings") - .listAvailableOfferings("US", null, null, Context.NONE); + .listAvailableOfferings("US", null, null); PhoneNumberOffering offering = offeringsResult.iterator().next(); assertNotNull(offering); } @@ -354,11 +246,8 @@ public void getTollFreeAreaCodesWithAAD(HttpClient httpClient) { PagedIterable areaCodesResult = this .getClientWithManagedIdentity(httpClient, "listAvailableTollFreeAreaCodes") .listAvailableTollFreeAreaCodes("US"); - List expectedAreaCodes = Arrays.asList("888", "877", "866", "855", "844", "800", "833", "88"); - for (PhoneNumberAreaCode areaCode : areaCodesResult) { - assertTrue(expectedAreaCodes.contains(areaCode.getAreaCode())); - } - assertNotNull(areaCodesResult); + PhoneNumberAreaCode areaCodes = areaCodesResult.iterator().next(); + assertNotNull(areaCodes); } @ParameterizedTest @@ -372,7 +261,6 @@ public void getGeographicAreaCodesWithAAD(HttpClient httpClient) { locality.getAdministrativeDivision().getAbbreviatedName()); PhoneNumberAreaCode areaCodes = areaCodesResult.iterator().next(); assertNotNull(areaCodes); - assertNotNull(areaCodes.getAreaCode()); } @ParameterizedTest @@ -382,8 +270,6 @@ public void getCountriesWithAAD(HttpClient httpClient) { .getClientWithManagedIdentity(httpClient, "listAvailableCountries").listAvailableCountries(); PhoneNumberCountry country = countriesResult.iterator().next(); assertNotNull(country); - assertNotNull(country.getCountryCode()); - assertNotNull(country.getLocalizedName()); } @ParameterizedTest @@ -410,7 +296,6 @@ public void getLocalitiesWithAdministrativeDivisionWithAAD(HttpClient httpClient PhoneNumberLocality locality = localitiesResult.iterator().next(); assertNotNull(locality); assertEquals(locality.getAdministrativeDivision().getAbbreviatedName(), localityWithAD.getAdministrativeDivision().getAbbreviatedName()); - assertEquals(locality.getAdministrativeDivision().getLocalizedName(), localityWithAD.getAdministrativeDivision().getLocalizedName()); } @ParameterizedTest @@ -423,43 +308,6 @@ public void getOfferingsWithAAD(HttpClient httpClient) { assertNotNull(offering); } - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void convertCommunicationError(HttpClient httpClient) { - List details = new ArrayList(); - CommunicationError communicationError = new CommunicationError(); - communicationError.setCode("500"); - communicationError.setMessage("Communication Error"); - - PhoneNumberError phoneNumberError = new PhoneNumberError( - communicationError.getMessage(), - communicationError.getCode(), - communicationError.getTarget(), - details - ); - PhoneNumberError error = PhoneNumberErrorConverter.convert(communicationError); - assertEquals(phoneNumberError.getCode(), error.getCode()); - assertEquals(phoneNumberError.getMessage(), error.getMessage()); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void convertCommunicationErrorWithNull(HttpClient httpClient) { - CommunicationError communicationError = null; - PhoneNumberError error = PhoneNumberErrorConverter.convert(communicationError); - assertEquals(null, error); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void searchOperatorInformationSucceeds(HttpClient httpClient) { - List phoneNumbers = new ArrayList(); - phoneNumbers.add(redactIfPlaybackMode(getTestPhoneNumber())); - OperatorInformationResult result = this.getClientWithConnectionString(httpClient, "searchOperatorInformation") - .searchOperatorInformation(phoneNumbers); - assertEquals(phoneNumbers.get(0), result.getValues().get(0).getPhoneNumber()); - } - private SyncPoller beginSearchAvailablePhoneNumbersHelper( HttpClient httpClient, String testName, boolean withContext) { PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities(); diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java index 43789327783c..9da2063872cf 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java @@ -2,70 +2,84 @@ // Licensed under the MIT License. package com.azure.communication.phonenumbers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import com.azure.communication.common.implementation.CommunicationConnectionString; +import com.azure.core.credential.AccessToken; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.credential.TokenRequestContext; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipelineNextPolicy; import com.azure.core.http.HttpResponse; import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.test.TestBase; import com.azure.core.test.TestMode; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.models.CustomMatcher; -import com.azure.core.test.models.TestProxySanitizer; -import com.azure.core.test.models.TestProxySanitizerType; -import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.test.models.NetworkCallRecord; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.identity.DefaultAzureCredentialBuilder; -import reactor.core.publisher.Mono; -import java.util.Arrays; +import reactor.core.publisher.Mono; -public class PhoneNumbersIntegrationTestBase extends TestProxyTestBase { +public class PhoneNumbersIntegrationTestBase extends TestBase { private static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); protected static final String COUNTRY_CODE = Configuration.getGlobalConfiguration().get("COUNTRY_CODE", "US"); + protected static final String AREA_CODE = Configuration.getGlobalConfiguration().get("AREA_CODE", "833"); protected static final String MS_USERAGENT_OVERRIDE = Configuration.getGlobalConfiguration() .get("AZURE_USERAGENT_OVERRIDE", ""); - protected PhoneNumbersClientBuilder getClientBuilderWithConnectionString(HttpClient httpClient) { + private static final StringJoiner JSON_PROPERTIES_TO_REDACT = new StringJoiner("\":\"|\"", "\"", "\":\"") + .add("id") + .add("phoneNumber"); + + private static final Pattern JSON_PROPERTY_VALUE_REDACTION_PATTERN = Pattern.compile( + String.format("(?:%s)(.*?)(?:\",|\"})", JSON_PROPERTIES_TO_REDACT.toString()), Pattern.CASE_INSENSITIVE); + + private static final String URI_PHONE_NUMBERS_REPLACER_REGEX = "/phoneNumbers/([\\+]?[0-9]{11,15})"; + + protected PhoneNumbersClientBuilder getClientBuilder(HttpClient httpClient) { + CommunicationConnectionString communicationConnectionString = new CommunicationConnectionString( + CONNECTION_STRING); + String communicationEndpoint = communicationConnectionString.getEndpoint(); + String communicationAccessKey = communicationConnectionString.getAccessKey(); + PhoneNumbersClientBuilder builder = new PhoneNumbersClientBuilder(); builder .httpClient(getHttpClient(httpClient)) .addPolicy(getOverrideMSUserAgentPolicy()) - .connectionString(CONNECTION_STRING); - - if (interceptorManager.isRecordMode()) { - builder.addPolicy(interceptorManager.getRecordPolicy()); - } - - if (!interceptorManager.isLiveMode()) { - addTestProxySanitizer(); - } + .endpoint(communicationEndpoint) + .credential(new AzureKeyCredential(communicationAccessKey)); - if (interceptorManager.isPlaybackMode()) { - addTestProxyMatchers(); + if (shouldRecord()) { + builder.addPolicy(getRecordPolicy()); } return builder; } - private void addTestProxyMatchers() { - interceptorManager.addMatchers(Arrays.asList( - new CustomMatcher() - .setHeadersKeyOnlyMatch(Arrays.asList("x-ms-content-sha256", "x-ms-hmac-string-to-sign-base64")))); - } + protected PhoneNumbersClientBuilder getClientBuilderWithConnectionString(HttpClient httpClient) { + PhoneNumbersClientBuilder builder = new PhoneNumbersClientBuilder(); + builder + .httpClient(getHttpClient(httpClient)) + .addPolicy(getOverrideMSUserAgentPolicy()) + .connectionString(CONNECTION_STRING); + + if (shouldRecord()) { + builder.addPolicy(getRecordPolicy()); + } - private void addTestProxySanitizer() { - // sanitize phone numbers - interceptorManager.addSanitizers(Arrays.asList( - new TestProxySanitizer("(?<=/phoneNumbers/)([^/?]+)", "REDACTED", TestProxySanitizerType.URL), - new TestProxySanitizer("$..id", null, "REDACTED", TestProxySanitizerType.BODY_KEY), - new TestProxySanitizer("$..phoneNumber", null, "REDACTED", TestProxySanitizerType.BODY_KEY), - new TestProxySanitizer("$..nationalFormat", null, "REDACTED", TestProxySanitizerType.BODY_KEY), - new TestProxySanitizer("$..internationalFormat", null, "REDACTED", TestProxySanitizerType.BODY_KEY), - new TestProxySanitizer("((?:\\\\u002B)[0-9]{11,})|((?:\\\\%2B)[0-9]{11,})|((?:[+]?)[0-9]{11,})", "REDACTED", TestProxySanitizerType.BODY_REGEX))); + return builder; } protected PhoneNumbersClientBuilder getClientBuilderUsingManagedIdentity(HttpClient httpClient) { @@ -76,29 +90,21 @@ protected PhoneNumbersClientBuilder getClientBuilderUsingManagedIdentity(HttpCli .addPolicy(getOverrideMSUserAgentPolicy()) .endpoint(new CommunicationConnectionString(CONNECTION_STRING).getEndpoint()); - if (interceptorManager.isRecordMode()) { - builder.credential(new DefaultAzureCredentialBuilder().build()); - builder.addPolicy(interceptorManager.getRecordPolicy()); - } - - if (!interceptorManager.isLiveMode()) { - addTestProxySanitizer(); - } - - if (interceptorManager.isLiveMode()) { + if (getTestMode() == TestMode.PLAYBACK) { + builder.credential(new FakeCredentials()); + } else { builder.credential(new DefaultAzureCredentialBuilder().build()); } - if (interceptorManager.isPlaybackMode()) { - builder.credential(new MockTokenCredential()); - addTestProxyMatchers(); + if (shouldRecord()) { + builder.addPolicy(getRecordPolicy()); } return builder; } private HttpClient getHttpClient(HttpClient httpClient) { - if (getTestMode() == TestMode.PLAYBACK) { + if (httpClient == null || getTestMode() == TestMode.PLAYBACK) { return interceptorManager.getPlaybackClient(); } return httpClient; @@ -121,11 +127,21 @@ protected String getTestPhoneNumber() { protected String redactIfPlaybackMode(String phoneNumber) { if (getTestMode() == TestMode.PLAYBACK) { - phoneNumber = "REDACTED"; + phoneNumber = "+REDACTED"; } return phoneNumber; } + private boolean shouldRecord() { + return getTestMode() == TestMode.RECORD; + } + + private HttpPipelinePolicy getRecordPolicy() { + List> redactors = new ArrayList<>(); + redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data), "REDACTED")); + return interceptorManager.getRecordPolicy(redactors); + } + private HttpPipelinePolicy getOverrideMSUserAgentPolicy() { HttpHeaders headers = new HttpHeaders(); if (!MS_USERAGENT_OVERRIDE.isEmpty()) { @@ -147,6 +163,24 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne }); } + static class FakeCredentials implements TokenCredential { + @Override + public Mono getToken(TokenRequestContext tokenRequestContext) { + return Mono.just(new AccessToken("someFakeToken", OffsetDateTime.MAX)); + } + } + + private String redact(String content, Matcher matcher, String replacement) { + while (matcher.find()) { + String captureGroup = matcher.group(1); + if (!CoreUtils.isNullOrEmpty(captureGroup)) { + content = content.replace(matcher.group(1), replacement); + } + } + + return content; + } + private String getDefaultPhoneNumber() { return Configuration.getGlobalConfiguration().get("AZURE_PHONE_NUMBER", "+11234567891"); } @@ -155,16 +189,51 @@ private String getPhoneNumberByTestAgent() { String testAgent = Configuration.getGlobalConfiguration().get("AZURE_TEST_AGENT"); if (testAgent == null) { throw new IllegalStateException( - "AZURE_TEST_AGENT value is required to run update capabilities live tests."); + "AZURE_TEST_AGENT value is required to run update capabilities live tests."); } String phoneNumber = Configuration.getGlobalConfiguration() - .get(String.format("AZURE_PHONE_NUMBER_%s", testAgent)); + .get(String.format("AZURE_PHONE_NUMBER_%s", testAgent)); if (phoneNumber == null) { throw new IllegalStateException( - "A phone number specific to the current test agent is required to run update capabilities live tests."); + "A phone number specific to the current test agent is required to run update capabilities live tests."); } return phoneNumber; } + + @Override + protected void afterTest() { + super.afterTest(); + if (getTestMode() == TestMode.RECORD) { + List networkCallRecords = collectNetworkCallsWithPhoneNumberUri(); + sanitizePhoneNumerInUri(networkCallRecords); + } + } + + private List collectNetworkCallsWithPhoneNumberUri() { + List networkCallRecords = new ArrayList<>(); + NetworkCallRecord networkCallRecord = interceptorManager.getRecordedData() + .findFirstAndRemoveNetworkCall(record -> { + return Pattern.compile(URI_PHONE_NUMBERS_REPLACER_REGEX).matcher(record.getUri()).find(); + }); + do { + if (networkCallRecord != null) { + networkCallRecords.add(networkCallRecord); + } + networkCallRecord = interceptorManager.getRecordedData().findFirstAndRemoveNetworkCall(record -> { + return Pattern.compile(URI_PHONE_NUMBERS_REPLACER_REGEX).matcher(record.getUri()).find(); + }); + } while (networkCallRecord != null); + return networkCallRecords; + } + + private void sanitizePhoneNumerInUri(List networkCallRecords) { + for (NetworkCallRecord networkCallRecord : networkCallRecords) { + String sanitizedUri = networkCallRecord.getUri().replaceAll(URI_PHONE_NUMBERS_REPLACER_REGEX, + "/phoneNumbers/+REDACTED"); + networkCallRecord.setUri(sanitizedUri); + interceptorManager.getRecordedData().addNetworkCall(networkCallRecord); + } + } } diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingAsyncClientIntegrationTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingAsyncClientIntegrationTest.java index 7422a4d05c1d..f392c69dd3e2 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingAsyncClientIntegrationTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingAsyncClientIntegrationTest.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.PagedFlux; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; import org.junit.jupiter.params.ParameterizedTest; @@ -30,7 +29,6 @@ public class SipRoutingAsyncClientIntegrationTest extends SipRoutingIntegrationT // get trunk @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkNotExisting(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "getTrunkNotExisting"); StepVerifier.create(client.getTrunk(NOT_EXISTING_FQDN)).verifyComplete(); @@ -38,7 +36,6 @@ public void getTrunkNotExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkNotExistingWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "getTrunkNotExistingWithResponse"); StepVerifier.create(client.getTrunkWithResponse(NOT_EXISTING_FQDN)).assertNext(response -> { @@ -50,7 +47,6 @@ public void getTrunkNotExistingWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkExisting(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "getTrunkExisting"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -63,7 +59,6 @@ public void getTrunkExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkExistingWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "getTrunkExistingWithResponse"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -79,7 +74,6 @@ public void getTrunkExistingWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkExistingWithAAD(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithManagedIdentity(httpClient, "getTrunkExistingWithAAD"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -93,7 +87,6 @@ public void getTrunkExistingWithAAD(HttpClient httpClient) { // list trunks @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listTrunksEmpty(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "listTrunksEmpty"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -105,7 +98,6 @@ public void listTrunksEmpty(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listTrunksNotEmpty(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "listTrunksNotEmpty"); StepVerifier.create(client.setTrunks(EXPECTED_TRUNKS)).verifyComplete(); @@ -116,7 +108,6 @@ public void listTrunksNotEmpty(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listTrunksNotEmptyWithAAD(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithManagedIdentity(httpClient, "listTrunksNotEmptyWithAAD"); StepVerifier.create(client.setTrunks(EXPECTED_TRUNKS)).verifyComplete(); @@ -128,7 +119,6 @@ public void listTrunksNotEmptyWithAAD(HttpClient httpClient) { //list routes @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listRoutesEmpty(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "listRoutesEmpty"); StepVerifier.create(client.setRoutes(new ArrayList<>())).verifyComplete(); @@ -140,7 +130,6 @@ public void listRoutesEmpty(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listRoutesNotEmpty(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "listRoutesNotEmpty"); StepVerifier.create(client.setRoutes(EXPECTED_ROUTES)).verifyComplete(); @@ -149,7 +138,6 @@ public void listRoutesNotEmpty(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listRoutesNotEmptyWithAAD(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithManagedIdentity(httpClient, "listRoutesNotEmptyWithAAD"); StepVerifier.create(client.setRoutes(EXPECTED_ROUTES)).verifyComplete(); @@ -160,7 +148,6 @@ public void listRoutesNotEmptyWithAAD(HttpClient httpClient) { // set trunk @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunkNotExistingEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunkNotExistingEmptyBefore"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -177,7 +164,6 @@ public void setTrunkNotExistingEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunkNotExistingNotEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunkNotExistingNotEmptyBefore"); List initialTrunks = EXPECTED_TRUNKS; @@ -200,7 +186,6 @@ public void setTrunkNotExistingNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunkExisting(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunkExisting"); List initialTrunks = new ArrayList<>(EXPECTED_TRUNKS); @@ -223,7 +208,6 @@ public void setTrunkExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunkExistingWithAAD(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithManagedIdentity(httpClient, "setTrunkExistingWithAAD"); List initialTrunks = new ArrayList<>(EXPECTED_TRUNKS); @@ -247,7 +231,6 @@ public void setTrunkExistingWithAAD(HttpClient httpClient) { // set trunks @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksEmptyBefore"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -261,7 +244,6 @@ public void setTrunksEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksEmptyBeforeWithResponse"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -278,7 +260,6 @@ public void setTrunksEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksEmptyBeforeWithAAD(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksEmptyBeforeWithAAD"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -292,7 +273,6 @@ public void setTrunksEmptyBeforeWithAAD(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksNotEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksNotEmptyBefore"); StepVerifier.create(client.setTrunks(UPDATED_TRUNKS)).verifyComplete(); @@ -307,7 +287,6 @@ public void setTrunksNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksNotEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksNotEmptyBeforeWithResponse"); StepVerifier.create(client.setTrunks(UPDATED_TRUNKS)).verifyComplete(); @@ -324,7 +303,6 @@ public void setTrunksNotEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksWithoutAffectingRoutes(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksWithoutAffectingRoutes"); StepVerifier.create(client.setRoutes(EXPECTED_ROUTES)).verifyComplete(); @@ -338,7 +316,6 @@ public void setTrunksWithoutAffectingRoutes(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksWithoutAffectingRoutesWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksWithoutAffectingRoutesWithResponse"); StepVerifier.create(client.setRoutes(EXPECTED_ROUTES)).verifyComplete(); @@ -355,7 +332,6 @@ public void setTrunksWithoutAffectingRoutesWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyTrunksNotEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setEmptyTrunksNotEmptyBefore"); StepVerifier.create(client.setTrunks(EXPECTED_TRUNKS)).verifyComplete(); @@ -369,7 +345,6 @@ public void setEmptyTrunksNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyTrunksNotEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setEmptyTrunksNotEmptyBeforeWithResponse"); StepVerifier.create(client.setTrunks(EXPECTED_TRUNKS)).verifyComplete(); @@ -386,7 +361,6 @@ public void setEmptyTrunksNotEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyTrunksEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setEmptyTrunksEmptyBefore"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -399,7 +373,6 @@ public void setEmptyTrunksEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyTrunksEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setEmptyTrunksEmptyBeforeWithResponse"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -415,7 +388,6 @@ public void setEmptyTrunksEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksInvalidFqdn(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksInvalidFqdn"); SipTrunk invalidTrunk = new SipTrunk(SET_TRUNK_INVALID_FQDN, SET_TRUNK_PORT); @@ -426,7 +398,6 @@ public void setTrunksInvalidFqdn(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksInvalidFqdnWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksInvalidFqdnWithResponse"); SipTrunk invalidTrunk = new SipTrunk(SET_TRUNK_INVALID_FQDN, SET_TRUNK_PORT); @@ -436,7 +407,6 @@ public void setTrunksInvalidFqdnWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksInvalidPort(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksInvalidPort"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -454,7 +424,6 @@ public void setTrunksInvalidPort(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksInvalidPortWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksInvalidPortWithResponse"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -471,7 +440,6 @@ public void setTrunksInvalidPortWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksRemoveRequiredTrunk(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksRemoveRequiredTrunk"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -485,7 +453,6 @@ public void setTrunksRemoveRequiredTrunk(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksRemoveRequiredTrunkWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setTrunksRemoveRequiredTrunkWithResponse"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -500,7 +467,6 @@ public void setTrunksRemoveRequiredTrunkWithResponse(HttpClient httpClient) { // set routes @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesEmptyBefore"); StepVerifier.create(client.setRoutes(new ArrayList<>())).verifyComplete(); @@ -513,7 +479,6 @@ public void setRoutesEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesEmptyBeforeWithResponse"); StepVerifier.create(client.setRoutes(new ArrayList<>())).verifyComplete(); @@ -529,7 +494,6 @@ public void setRoutesEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesEmptyBeforeWithAAD(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithManagedIdentity(httpClient, "setRoutesEmptyBeforeWithAAD"); StepVerifier.create(client.setRoutes(new ArrayList<>())).verifyComplete(); @@ -542,7 +506,6 @@ public void setRoutesEmptyBeforeWithAAD(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesNotEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesNotEmptyBefore"); StepVerifier.create(client.setRoutes(UPDATED_ROUTES)).verifyComplete(); @@ -556,7 +519,6 @@ public void setRoutesNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesNotEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesNotEmptyBeforeWithResponse"); StepVerifier.create(client.setRoutes(UPDATED_ROUTES)).verifyComplete(); @@ -573,7 +535,6 @@ public void setRoutesNotEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesWithoutAffectingTrunks(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesWithoutAffectingTrunks"); StepVerifier.create(client.setTrunks(EXPECTED_TRUNKS)).verifyComplete(); @@ -587,7 +548,6 @@ public void setRoutesWithoutAffectingTrunks(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesWithoutAffectingTrunksWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesWithoutAffectingTrunksWithResponse"); StepVerifier.create(client.setTrunks(EXPECTED_TRUNKS)).verifyComplete(); @@ -604,7 +564,6 @@ public void setRoutesWithoutAffectingTrunksWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyRoutesNotEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setEmptyRoutesNotEmptyBefore"); StepVerifier.create(client.setRoutes(EXPECTED_ROUTES)).verifyComplete(); @@ -617,7 +576,6 @@ public void setEmptyRoutesNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyRoutesNotEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setEmptyRoutesNotEmptyBeforeWithResponse"); StepVerifier.create(client.setRoutes(EXPECTED_ROUTES)).verifyComplete(); @@ -633,7 +591,6 @@ public void setEmptyRoutesNotEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyRoutesEmptyBefore(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setEmptyRoutesEmptyBefore"); StepVerifier.create(client.setRoutes(new ArrayList<>())).verifyComplete(); @@ -646,7 +603,6 @@ public void setEmptyRoutesEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyRoutesEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setEmptyRoutesEmptyBeforeWithResponse"); StepVerifier.create(client.setRoutes(new ArrayList<>())).verifyComplete(); @@ -662,7 +618,6 @@ public void setEmptyRoutesEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesInvalidName(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesInvalidName"); SipTrunkRoute invalidRoute = new SipTrunkRoute(null, SET_TRUNK_ROUTE_NUMBER_PATTERN); @@ -674,7 +629,6 @@ public void setRoutesInvalidName(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesInvalidNameWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesInvalidNameWithResponse"); SipTrunkRoute invalidRoute = new SipTrunkRoute(null, SET_TRUNK_ROUTE_NUMBER_PATTERN); @@ -686,7 +640,6 @@ public void setRoutesInvalidNameWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesInvalidNumberPattern(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesInvalidNumberPattern"); SipTrunkRoute invalidRoute = new SipTrunkRoute(SET_TRUNK_ROUTE_NAME, null); @@ -698,7 +651,6 @@ public void setRoutesInvalidNumberPattern(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesInvalidNumberPatternWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesInvalidNumberPatternWithResponse"); SipTrunkRoute invalidRoute = new SipTrunkRoute(SET_TRUNK_ROUTE_NAME, null); @@ -710,7 +662,6 @@ public void setRoutesInvalidNumberPatternWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesDuplicatedRoutes(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesDuplicatedRoutes"); List invalidRoutes = asList(SET_TRUNK_ROUTE, SET_TRUNK_ROUTE); @@ -721,7 +672,6 @@ public void setRoutesDuplicatedRoutes(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesDuplicatedRoutesWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesDuplicatedRoutesWithResponse"); List invalidRoutes = asList(SET_TRUNK_ROUTE, SET_TRUNK_ROUTE); @@ -733,7 +683,6 @@ public void setRoutesDuplicatedRoutesWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesDuplicatedRoutingTrunks(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesDuplicatedRoutingTrunks"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -746,7 +695,6 @@ public void setRoutesDuplicatedRoutingTrunks(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesDuplicatedRoutingTrunksWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesDuplicatedRoutingTrunksWithResponse"); StepVerifier.create(client.setTrunk(SET_TRUNK)).verifyComplete(); @@ -760,7 +708,6 @@ public void setRoutesDuplicatedRoutingTrunksWithResponse(HttpClient httpClient) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesMissingTrunk(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesMissingTrunk"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -772,7 +719,6 @@ public void setRoutesMissingTrunk(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesMissingTrunkWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "setRoutesMissingTrunkWithResponse"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -786,7 +732,6 @@ public void setRoutesMissingTrunkWithResponse(HttpClient httpClient) { // delete trunk @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkExisting(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "deleteTrunkExisting"); StepVerifier.create(client.setTrunk(DELETE_TRUNK)).verifyComplete(); @@ -799,7 +744,6 @@ public void deleteTrunkExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkExistingWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "deleteTrunkExistingWithResponse"); StepVerifier.create(client.setTrunk(DELETE_TRUNK)).verifyComplete(); @@ -816,7 +760,6 @@ public void deleteTrunkExistingWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkExistingWithAAD(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithManagedIdentity(httpClient, "deleteTrunkExistingWithAAD"); StepVerifier.create(client.setTrunk(DELETE_TRUNK)).verifyComplete(); @@ -829,7 +772,6 @@ public void deleteTrunkExistingWithAAD(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkNotExisting(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "deleteTrunkNotExisting"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); @@ -843,7 +785,6 @@ public void deleteTrunkNotExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkNotExistingWithResponse(HttpClient httpClient) { SipRoutingAsyncClient client = getClientWithConnectionString(httpClient, "deleteTrunkNotExistingWithResponse"); StepVerifier.create(client.setTrunks(new ArrayList<>())).verifyComplete(); diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingClientBuilderTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingClientBuilderTest.java index f1c86973377a..8a7bcb2f0d6b 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingClientBuilderTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingClientBuilderTest.java @@ -7,9 +7,7 @@ import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.*; -import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import org.junit.jupiter.api.AfterEach; @@ -19,8 +17,6 @@ import org.mockito.Mockito; import org.mockito.stubbing.Answer; -import java.time.Duration; -import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -119,69 +115,6 @@ public void buildClientWithServiceVersion() { assertNotNull(sipRoutingClient); } - @Test - public void buildClientWithRetryPolicy() { - SipRoutingClient sipRoutingClient = this.setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .retryPolicy(new RetryPolicy("1", ChronoUnit.SECONDS)) - .buildClient(); - assertNotNull(sipRoutingClient); - } - - @Test - public void buildClientWithRetryOptions() { - SipRoutingClient sipRoutingClient = this.setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .retryOptions(new RetryOptions(new FixedDelayOptions(3, Duration.ZERO))) - .buildClient(); - assertNotNull(sipRoutingClient); - } - - @Test - public void buildClientWithClientOptions() { - SipRoutingClient sipRoutingClient = this.setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .clientOptions(new ClientOptions()) - .buildClient(); - assertNotNull(sipRoutingClient); - } - - @Test - public void buildClientByReplacingHttpClient() { - SipRoutingClient sipRoutingClient = this.setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .httpClient(this.httpClient) - .httpClient(this.httpClient) - .buildClient(); - assertNotNull(sipRoutingClient); - } - - @Test - public void buildClientByReplacingPipeline() { - HttpPipeline httpPipeline = mock(HttpPipeline.class); - SipRoutingClient sipRoutingClient = this.setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .pipeline(httpPipeline) - .pipeline(httpPipeline) - .buildClient(); - assertNotNull(sipRoutingClient); - } - - @Test - public void buildClientWithPolicyPerCall() { - HttpPipelinePolicy policy = mock(HttpPipelinePolicy.class); - doAnswer(invocation -> HttpPipelinePosition.PER_CALL).when(policy).getPipelinePosition(); - SipRoutingClient sipRoutingClient = this.setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .addPolicy(policy) - .buildClient(); - assertNotNull(sipRoutingClient); - } - - @Test - public void buildClientWithPolicyPerRetry() { - HttpPipelinePolicy policy = mock(HttpPipelinePolicy.class); - doAnswer(invocation -> HttpPipelinePosition.PER_RETRY).when(policy).getPipelinePosition(); - SipRoutingClient sipRoutingClient = this.setupBuilderWithHttpClientWithCredential(this.clientBuilder) - .addPolicy(policy) - .buildClient(); - assertNotNull(sipRoutingClient); - } - @Test public void buildClientWithOneAdditionalPolicy() { ClientBuilderSpyHelper spyHelper = new ClientBuilderSpyHelper(this.clientBuilder); diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingClientIntegrationTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingClientIntegrationTest.java index 7f5e5355aa46..c8624b0b46e2 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingClientIntegrationTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingClientIntegrationTest.java @@ -9,8 +9,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; - -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; import org.junit.jupiter.params.ParameterizedTest; @@ -30,7 +28,6 @@ public class SipRoutingClientIntegrationTest extends SipRoutingIntegrationTestBa // get trunk @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkNotExisting(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "getTrunkNotExistingSync"); SipTrunk trunk = client.getTrunk(NOT_EXISTING_FQDN); @@ -40,7 +37,6 @@ public void getTrunkNotExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkNotExistingWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "getTrunkNotExistingWithResponseSync"); @@ -53,7 +49,6 @@ public void getTrunkNotExistingWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkExisting(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "getTrunkExistingSync"); client.setTrunk(SET_TRUNK); @@ -66,7 +61,6 @@ public void getTrunkExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkExistingWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "getTrunkExistingWithResponseSync"); client.setTrunk(SET_TRUNK); @@ -82,7 +76,6 @@ public void getTrunkExistingWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void getTrunkExistingWithAAD(HttpClient httpClient) { SipRoutingClient client = getClientWithManagedIdentity(httpClient, "getTrunkExistingWithAADSync"); client.setTrunk(SET_TRUNK); @@ -96,7 +89,6 @@ public void getTrunkExistingWithAAD(HttpClient httpClient) { // list trunks @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listTrunksEmpty(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "listTrunksEmptySync"); client.setTrunks(new ArrayList<>()); @@ -109,7 +101,6 @@ public void listTrunksEmpty(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listTrunksNotEmpty(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "listTrunksNotEmptySync"); client.setTrunks(EXPECTED_TRUNKS); @@ -119,7 +110,6 @@ public void listTrunksNotEmpty(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listTrunksNotEmptyWithAAD(HttpClient httpClient) { SipRoutingClient client = getClientWithManagedIdentity(httpClient, "listTrunksNotEmptyWithAADSync"); client.setTrunks(EXPECTED_TRUNKS); @@ -130,7 +120,6 @@ public void listTrunksNotEmptyWithAAD(HttpClient httpClient) { // list routes @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listRoutesEmpty(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "listRoutesEmptySync"); client.setRoutes(new ArrayList<>()); @@ -143,7 +132,6 @@ public void listRoutesEmpty(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listRoutesNotEmpty(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "listRoutesNotEmptySync"); client.setRoutes(EXPECTED_ROUTES); @@ -153,7 +141,6 @@ public void listRoutesNotEmpty(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void listRoutesNotEmptyWithAAD(HttpClient httpClient) { SipRoutingClient client = getClientWithManagedIdentity(httpClient, "listRoutesNotEmptyWithAADSync"); client.setRoutes(EXPECTED_ROUTES); @@ -164,7 +151,6 @@ public void listRoutesNotEmptyWithAAD(HttpClient httpClient) { // set trunk @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunkNotExistingEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunkNotExistingEmptyBeforeSync"); client.setTrunks(new ArrayList<>()); @@ -182,7 +168,6 @@ public void setTrunkNotExistingEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunkNotExistingNotEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunkNotExistingNotEmptyBeforeSync"); List initialTrunks = EXPECTED_TRUNKS; @@ -202,7 +187,6 @@ public void setTrunkNotExistingNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunkExisting(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunkExistingSync"); List expectedTrunks = new ArrayList<>(EXPECTED_TRUNKS); @@ -222,7 +206,6 @@ public void setTrunkExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunkExistingWithAAD(HttpClient httpClient) { SipRoutingClient client = getClientWithManagedIdentity(httpClient, "setTrunkExistingWithAADSync"); List expectedTrunks = new ArrayList<>(EXPECTED_TRUNKS); @@ -243,7 +226,6 @@ public void setTrunkExistingWithAAD(HttpClient httpClient) { // set trunks @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksEmptyBeforeSync"); client.setTrunks(new ArrayList<>()); @@ -256,7 +238,6 @@ public void setTrunksEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksEmptyBeforeWithResponseSync"); client.setTrunks(new ArrayList<>()); @@ -271,7 +252,6 @@ public void setTrunksEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksEmptyBeforeWithAAD(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksEmptyBeforeWithAADSync"); client.setTrunks(new ArrayList<>()); @@ -284,7 +264,6 @@ public void setTrunksEmptyBeforeWithAAD(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksNotEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksNotEmptyBeforeSync"); client.setTrunks(UPDATED_TRUNKS); @@ -298,7 +277,6 @@ public void setTrunksNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksNotEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksNotEmptyBeforeWithResponseSync"); client.setTrunks(UPDATED_TRUNKS); @@ -314,7 +292,6 @@ public void setTrunksNotEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksWithoutAffectingRoutes(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksWithoutAffectingRoutesSync"); client.setRoutes(EXPECTED_ROUTES); @@ -327,7 +304,6 @@ public void setTrunksWithoutAffectingRoutes(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksWithoutAffectingRoutesWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksWithoutAffectingRoutesWithResponseSync"); client.setRoutes(EXPECTED_ROUTES); @@ -342,7 +318,6 @@ public void setTrunksWithoutAffectingRoutesWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyTrunksNotEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setEmptyTrunksNotEmptyBeforeSync"); client.setTrunks(EXPECTED_TRUNKS); @@ -355,7 +330,6 @@ public void setEmptyTrunksNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyTrunksNotEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setEmptyTrunksNotEmptyBeforeWithResponseSync"); client.setTrunks(EXPECTED_TRUNKS); @@ -370,7 +344,6 @@ public void setEmptyTrunksNotEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyTrunksEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setEmptyTrunksEmptyBeforeSync"); client.setTrunks(new ArrayList<>()); @@ -383,7 +356,6 @@ public void setEmptyTrunksEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyTrunksEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setEmptyTrunksEmptyBeforeWithResponseSync"); client.setTrunks(new ArrayList<>()); @@ -398,7 +370,6 @@ public void setEmptyTrunksEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksInvalidFqdn(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksInvalidFqdnSync"); @@ -412,7 +383,6 @@ public void setTrunksInvalidFqdn(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksInvalidPort(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksInvalidPortSync"); client.setTrunk(SET_TRUNK); @@ -431,7 +401,6 @@ public void setTrunksInvalidPort(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksRemoveRequiredTrunk(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksRemoveRequiredTrunkSync"); client.setTrunk(SET_TRUNK); @@ -445,7 +414,6 @@ public void setTrunksRemoveRequiredTrunk(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setTrunksRemoveRequiredTrunkWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setTrunksRemoveRequiredTrunkWithResponseSync"); client.setTrunk(SET_TRUNK); @@ -462,7 +430,6 @@ public void setTrunksRemoveRequiredTrunkWithResponse(HttpClient httpClient) { // set routes @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesEmptyBeforeSync"); client.setRoutes(new ArrayList<>()); @@ -475,7 +442,6 @@ public void setRoutesEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesEmptyBeforeWithResponseSync"); client.setRoutes(new ArrayList<>()); @@ -490,7 +456,6 @@ public void setRoutesEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesEmptyBeforeWithAAD(HttpClient httpClient) { SipRoutingClient client = getClientWithManagedIdentity(httpClient, "setRoutesEmptyBeforeWithAADSync"); client.setRoutes(new ArrayList<>()); @@ -503,7 +468,6 @@ public void setRoutesEmptyBeforeWithAAD(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesNotEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesNotEmptyBeforeSync"); client.setRoutes(UPDATED_ROUTES); @@ -517,7 +481,6 @@ public void setRoutesNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesNotEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesNotEmptyBeforeWithResponseSync"); client.setRoutes(UPDATED_ROUTES); @@ -534,7 +497,6 @@ public void setRoutesNotEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesWithoutAffectingTrunks(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesWithoutAffectingTrunksSync"); client.setTrunks(EXPECTED_TRUNKS); @@ -547,7 +509,6 @@ public void setRoutesWithoutAffectingTrunks(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesWithoutAffectingTrunksWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesWithoutAffectingTrunksWithResponseSync"); client.setTrunks(EXPECTED_TRUNKS); @@ -562,7 +523,6 @@ public void setRoutesWithoutAffectingTrunksWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyRoutesNotEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setEmptyRoutesNotEmptyBeforeSync"); client.setRoutes(EXPECTED_ROUTES); @@ -575,7 +535,6 @@ public void setEmptyRoutesNotEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyRoutesNotEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setEmptyRoutesNotEmptyBeforeWithResponseSync"); client.setRoutes(EXPECTED_ROUTES); @@ -592,7 +551,6 @@ public void setEmptyRoutesNotEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyRoutesEmptyBefore(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setEmptyRoutesEmptyBeforeSync"); client.setRoutes(new ArrayList<>()); @@ -605,7 +563,6 @@ public void setEmptyRoutesEmptyBefore(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setEmptyRoutesEmptyBeforeWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setEmptyRoutesEmptyBeforeWithResponseSync"); client.setRoutes(new ArrayList<>()); @@ -620,7 +577,6 @@ public void setEmptyRoutesEmptyBeforeWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesInvalidName(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesInvalidNameSync"); SipTrunkRoute invalidRoute = new SipTrunkRoute(null, SET_TRUNK_ROUTE_NUMBER_PATTERN); @@ -631,7 +587,6 @@ public void setRoutesInvalidName(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesInvalidNameWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesInvalidNameWithResponseSync"); SipTrunkRoute invalidRoute = new SipTrunkRoute(null, SET_TRUNK_ROUTE_NUMBER_PATTERN); @@ -642,7 +597,6 @@ public void setRoutesInvalidNameWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesInvalidNumberPattern(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesInvalidNumberPatternSync"); SipTrunkRoute invalidRoute = new SipTrunkRoute(SET_TRUNK_ROUTE_NAME, null); @@ -653,7 +607,6 @@ public void setRoutesInvalidNumberPattern(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesInvalidNumberPatternWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesInvalidNumberPatternWithResponseSync"); SipTrunkRoute invalidRoute = new SipTrunkRoute(SET_TRUNK_ROUTE_NAME, null); @@ -664,7 +617,6 @@ public void setRoutesInvalidNumberPatternWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesDuplicatedRoutes(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesDuplicatedRoutesSync"); List invalidRoutes = asList(SET_TRUNK_ROUTE, SET_TRUNK_ROUTE); @@ -675,7 +627,6 @@ public void setRoutesDuplicatedRoutes(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesDuplicatedRoutesWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesDuplicatedRoutesWithResponseSync"); List invalidRoutes = asList(SET_TRUNK_ROUTE, SET_TRUNK_ROUTE); @@ -686,7 +637,6 @@ public void setRoutesDuplicatedRoutesWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesDuplicatedRoutingTrunks(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesDuplicatedRoutingTrunksSync"); client.setTrunk(SET_TRUNK); @@ -699,7 +649,6 @@ public void setRoutesDuplicatedRoutingTrunks(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesDuplicatedRoutingTrunksWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesDuplicatedRoutingTrunksWithResponseSync"); client.setTrunk(SET_TRUNK); @@ -713,7 +662,6 @@ public void setRoutesDuplicatedRoutingTrunksWithResponse(HttpClient httpClient) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesMissingTrunk(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesMissingTrunkSync"); client.setTrunks(new ArrayList<>()); @@ -725,7 +673,6 @@ public void setRoutesMissingTrunk(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void setRoutesMissingTrunkWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "setRoutesMissingTrunkWithResponseSync"); client.setTrunks(new ArrayList<>()); @@ -738,7 +685,6 @@ public void setRoutesMissingTrunkWithResponse(HttpClient httpClient) { // delete trunk @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkExisting(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "deleteTrunkExistingSync"); client.setTrunk(DELETE_TRUNK); @@ -751,7 +697,6 @@ public void deleteTrunkExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkExistingWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "deleteTrunkExistingWithResponseSync"); client.setTrunk(DELETE_TRUNK); @@ -767,7 +712,6 @@ public void deleteTrunkExistingWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkExistingWithAAD(HttpClient httpClient) { SipRoutingClient client = getClientWithManagedIdentity(httpClient, "deleteTrunkExistingWithAADSync"); client.setTrunk(DELETE_TRUNK); @@ -780,7 +724,6 @@ public void deleteTrunkExistingWithAAD(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkNotExisting(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "deleteTrunkNotExistingSync"); client.setTrunks(new ArrayList<>()); @@ -794,7 +737,6 @@ public void deleteTrunkNotExisting(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable(named = "SKIP_SIP_ROUTING_LIVE_TESTS", matches = "(?i)(true)") public void deleteTrunkNotExistingWithResponse(HttpClient httpClient) { SipRoutingClient client = getClientWithConnectionString(httpClient, "deleteTrunkNotExistingWithResponseSync"); client.setTrunks(new ArrayList<>()); diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java index b74c96e53805..736ec46db0de 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java @@ -5,42 +5,43 @@ import com.azure.communication.common.implementation.CommunicationConnectionString; import com.azure.communication.phonenumbers.siprouting.models.SipTrunk; import com.azure.communication.phonenumbers.siprouting.models.SipTrunkRoute; +import com.azure.core.credential.AccessToken; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.credential.TokenRequestContext; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipelineNextPolicy; import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.test.TestBase; import com.azure.core.test.TestMode; -import com.azure.core.test.TestProxyTestBase; import com.azure.core.test.implementation.TestingHelpers; -import com.azure.core.test.models.CustomMatcher; -import com.azure.core.test.models.TestProxySanitizer; -import com.azure.core.test.models.TestProxySanitizerType; -import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.identity.DefaultAzureCredentialBuilder; import reactor.core.publisher.Mono; -import java.util.Arrays; +import java.time.OffsetDateTime; +import java.util.ArrayList; import java.util.List; +import java.util.StringJoiner; import java.util.UUID; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import static java.util.Arrays.asList; -public class SipRoutingIntegrationTestBase extends TestProxyTestBase { +public class SipRoutingIntegrationTestBase extends TestBase { private static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); private static final String AZURE_TEST_DOMAIN = Configuration.getGlobalConfiguration() .get("AZURE_TEST_DOMAIN", "testdomain.com"); - protected static final String MS_USERAGENT_OVERRIDE = Configuration.getGlobalConfiguration() - .get("AZURE_USERAGENT_OVERRIDE", ""); - private static final String MS_USERAGENT_HEADER_NAME = "x-ms-useragent"; protected static final String SET_TRUNK_ROUTE_NAME = "route99"; protected static final String SET_TRUNK_ROUTE_NUMBER_PATTERN = "99.*"; protected static final SipTrunkRoute SET_TRUNK_ROUTE = new SipTrunkRoute(SET_TRUNK_ROUTE_NAME, SET_TRUNK_ROUTE_NUMBER_PATTERN); + protected static final String FIRST_FQDN = getUniqueFqdn("first"); protected static final String SECOND_FQDN = getUniqueFqdn("second"); protected static final String THIRD_FQDN = getUniqueFqdn("third"); @@ -91,9 +92,20 @@ public class SipRoutingIntegrationTestBase extends TestProxyTestBase { new SipTrunkRoute("route21", "7.*").setDescription("desc92"), new SipTrunkRoute("route24", "4.*").setDescription("desc44") ); - protected static final String MESSAGE_DUPLICATE_ROUTES = + + private static final StringJoiner JSON_PROPERTIES_TO_REDACT = + new StringJoiner("\":\"|\"", "\"", "\":\"") + .add("id") + .add("phoneNumber"); + + private static final Pattern JSON_PROPERTY_VALUE_REDACTION_PATTERN = + Pattern.compile(String.format("(?:%s)(.*?)(?:\",|\"})", JSON_PROPERTIES_TO_REDACT.toString()), Pattern.CASE_INSENSITIVE); + private static final Pattern UUID_FQDN_REDACTION_PATTERN = + Pattern.compile("-[0-9a-f]{32}\\.[0-9a-z\\.]*(\\.com|\\.net)", Pattern.CASE_INSENSITIVE); + + protected static final String MESSAGE_DUPLICATE_ROUTES = "Status code 400, \"{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"DuplicatedRoute\",\"message\":\"There is a duplicated route.\"}}}\""; - protected static final String MESSAGE_DUPLICATE_TRUNKS = + protected static final String MESSAGE_DUPLICATE_TRUNKS = "Status code 400, \"{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"RouteWithDuplicatedTrunk\",\"message\":\"There is a duplicated trunk in a route.\"}}}\""; protected static final String MESSAGE_MISSING_TRUNK = "Status code 422, \"{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}\""; @@ -102,21 +114,32 @@ public class SipRoutingIntegrationTestBase extends TestProxyTestBase { protected static final String MESSAGE_INVALID_ROUTE_NAME = "Status code 422, \"{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteName\",\"message\":\"Route with an invalid name.\"}}}\""; - protected SipRoutingClientBuilder getClientBuilderWithConnectionString(HttpClient httpClient) { + protected SipRoutingClientBuilder getClientBuilder(HttpClient httpClient) { + CommunicationConnectionString communicationConnectionString = new CommunicationConnectionString(CONNECTION_STRING); + String communicationEndpoint = communicationConnectionString.getEndpoint(); + String communicationAccessKey = communicationConnectionString.getAccessKey(); + SipRoutingClientBuilder builder = new SipRoutingClientBuilder(); builder .httpClient(getHttpClient(httpClient)) - .connectionString(CONNECTION_STRING) - .addPolicy(addMSUserAgentPolicy()); + .endpoint(communicationEndpoint) + .credential(new AzureKeyCredential(communicationAccessKey)); - if (interceptorManager.isRecordMode()) { - builder.addPolicy(interceptorManager.getRecordPolicy()); - } - if (interceptorManager.isPlaybackMode()) { - addTestProxyMatchers(); + if (shouldRecord()) { + addRedactors(builder); } - if (!interceptorManager.isLiveMode()) { - addTestProxySanitizers(); + + return builder; + } + + protected SipRoutingClientBuilder getClientBuilderWithConnectionString(HttpClient httpClient) { + SipRoutingClientBuilder builder = new SipRoutingClientBuilder(); + builder + .httpClient(getHttpClient(httpClient)) + .connectionString(CONNECTION_STRING); + + if (shouldRecord()) { + addRedactors(builder); } return builder; @@ -126,66 +149,43 @@ protected SipRoutingClientBuilder getClientBuilderUsingManagedIdentity(HttpClien SipRoutingClientBuilder builder = new SipRoutingClientBuilder(); builder .httpClient(getHttpClient(httpClient)) - .endpoint(new CommunicationConnectionString(CONNECTION_STRING).getEndpoint()) - .addPolicy(addMSUserAgentPolicy()); + .endpoint(new CommunicationConnectionString(CONNECTION_STRING).getEndpoint()); if (getTestMode() == TestMode.PLAYBACK) { - builder.credential(new MockTokenCredential()); + builder.credential(new FakeCredentials()); } else { builder.credential(new DefaultAzureCredentialBuilder().build()); } - if (interceptorManager.isRecordMode()) { - builder.addPolicy(interceptorManager.getRecordPolicy()); - } - if (interceptorManager.isPlaybackMode()) { - addTestProxyMatchers(); - } - if (!interceptorManager.isLiveMode()) { - addTestProxySanitizers(); + if (shouldRecord()) { + addRedactors(builder); } return builder; } - private void addTestProxySanitizers() { - String domain = AZURE_TEST_DOMAIN; - interceptorManager.addSanitizers(Arrays.asList(new TestProxySanitizer("(-[0-9a-fA-F]{32}" - + ".[0-9a-fA-F]{8}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{12})", - ".redacted", TestProxySanitizerType.BODY_REGEX), - new TestProxySanitizer(domain.indexOf(".") > 0 ? domain.substring(domain.indexOf(".")) : domain, - ".testdomain.com", TestProxySanitizerType.BODY_REGEX), - new TestProxySanitizer("id", null, - "REDACTED", TestProxySanitizerType.BODY_KEY), - new TestProxySanitizer("phoneNumber", null, "REDACTED", - TestProxySanitizerType.BODY_KEY))); + private void addRedactors(SipRoutingClientBuilder builder) { + List> redactors = new ArrayList<>(); + redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data), "REDACTED")); + redactors.add(data -> redact(data, UUID_FQDN_REDACTION_PATTERN.matcher(data), ".redacted.com")); + builder.addPolicy(interceptorManager.getRecordPolicy(redactors)); } - protected SipRoutingClientBuilder addLoggingPolicy(SipRoutingClientBuilder builder, String testName) { - return builder.addPolicy((context, next) -> logHeaders(testName, next)); - } - - private HttpPipelinePolicy addMSUserAgentPolicy() { - HttpHeaders headers = new HttpHeaders(); - if (!MS_USERAGENT_OVERRIDE.isEmpty()) { - headers.add(MS_USERAGENT_HEADER_NAME, MS_USERAGENT_OVERRIDE); - } - - return new AddHeadersPolicy(headers); - } - - private void addTestProxyMatchers() { - interceptorManager.addMatchers(Arrays.asList( - new CustomMatcher().setHeadersKeyOnlyMatch(Arrays.asList("x-ms-hmac-string-to-sign-base64", "x-ms-content-sha256")))); + private boolean shouldRecord() { + return getTestMode() == TestMode.RECORD; } private HttpClient getHttpClient(HttpClient httpClient) { - if (getTestMode() == TestMode.PLAYBACK) { + if (httpClient == null || getTestMode() == TestMode.PLAYBACK) { return interceptorManager.getPlaybackClient(); } return httpClient; } + protected SipRoutingClientBuilder addLoggingPolicy(SipRoutingClientBuilder builder, String testName) { + return builder.addPolicy((context, next) -> logHeaders(testName, next)); + } + private Mono logHeaders(String testName, HttpPipelineNextPolicy next) { return next.process() .flatMap(httpResponse -> { @@ -198,11 +198,28 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne }); } + static class FakeCredentials implements TokenCredential { + @Override + public Mono getToken(TokenRequestContext tokenRequestContext) { + return Mono.just(new AccessToken("someFakeToken", OffsetDateTime.MAX)); + } + } + + private String redact(String content, Matcher matcher, String replacement) { + while (matcher.find()) { + String captureGroup = matcher.group(); + if (!CoreUtils.isNullOrEmpty(captureGroup)) { + content = content.replace(matcher.group(), replacement); + } + } + + return content; + } + private static String getUniqueFqdn(String order) { if (TestingHelpers.getTestMode() == TestMode.PLAYBACK) { - return order + ".redacted" + "." + AZURE_TEST_DOMAIN; + return order + ".redacted.com"; } - String unique = UUID.randomUUID().toString().replace("-", ""); return order + "-" + unique + "." + AZURE_TEST_DOMAIN; } diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginPurchaseandReleasePhoneNumbers[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginPurchaseandReleasePhoneNumbers[1].json new file mode 100644 index 000000000000..053821021e33 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginPurchaseandReleasePhoneNumbers[1].json @@ -0,0 +1,657 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "fa03e888-04a5-4060-bac8-4190468a965d", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "search_d411e379-c8f0-45a5-b580-2b01436dbdfe", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:34:57 GMT", + "Access-Control-Expose-Headers" : "Location,Operation-Location,operation-id,search-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1858ms", + "MS-CV" : "WKoe4vj0YE2IqSbX3xeGBg.0", + "search-id" : "d411e379-c8f0-45a5-b580-2b01436dbdfe", + "X-Azure-Ref" : "0UKOkYwAAAADmilX1m1dgQ7ZutNaVPdvWTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/search_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Location" : "/availablePhoneNumbers/searchResults/d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e9fd3b94-71e0-4b6b-8fb0-d9c6568158b5" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:34:57 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "259ms", + "MS-CV" : "X1Gk7S61m0i2KRcv3QZchg.0", + "X-Azure-Ref" : "0UqOkYwAAAABuZ198TYYKT5MzL8XE+cGrTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"notStarted\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b50f85ee-907c-4125-98d4-64c072a7ecdf" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:34:59 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "451ms", + "MS-CV" : "PrSFNoZQPk6GYfUfbzvc7Q.0", + "X-Azure-Ref" : "0U6OkYwAAAADTODop4IvnSrZYwII360W+TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"running\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "941ba9fd-2603-4dde-9939-5b1177d1f521" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:35:00 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "259ms", + "MS-CV" : "+AgeZQ/vxk6+HhOB/hhtiw.0", + "X-Azure-Ref" : "0VaOkYwAAAAB/9T47uRQeTY3g+LkVp+xzTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"succeeded\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/searchResults/d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b787ff16-b3c7-41fd-9a08-02f13eaf2121" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "852ms", + "MS-CV" : "oJrsPjG4dE+RQp1McQQEWQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VaOkYwAAAAAWgWqXlptsQKIFv32heAGhTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"searchId\":\"d411e379-c8f0-45a5-b580-2b01436dbdfe\",\"phoneNumbers\":[\"+18662357936\"],\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"},\"searchExpiresBy\":\"2022-12-22T18:51:00.3019261+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4888bdf1-421b-4196-b43a-39d92f3273e3", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:35:03 GMT", + "Access-Control-Expose-Headers" : "Operation-Location,operation-id,purchase-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1419ms", + "MS-CV" : "HyePULTeCkKBrY/u6w5+iw.0", + "purchase-id" : "d411e379-c8f0-45a5-b580-2b01436dbdfe", + "X-Azure-Ref" : "0VqOkYwAAAAAOAr44OStTRb79qhcVj589TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "460ce9b9-6105-49c6-a84e-b07709a77eae" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "449ms", + "MS-CV" : "lumJBCBthUakx5npChhnlA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0V6OkYwAAAADbCYc7Jl7RRJNwH3Q2tuACTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b7f9a653-b8c5-427e-875e-9d40f0ac5d82" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "244ms", + "MS-CV" : "Cy+8m3HsxUGmu7r7ft0g5A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WaOkYwAAAAAY/rPXzjMiQr50FN+uoyqhTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:04 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "74c2b339-d59d-4b80-9593-380448199a81" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "453ms", + "MS-CV" : "wQ1P8oGXX0mnSbwmTJz2jw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WqOkYwAAAAAR/+Cul/M5RKX0Mp8lg0YvTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:06 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "6f61de94-e476-4781-8804-b699523ef0d0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "243ms", + "MS-CV" : "FouFlN4zwkidw9uAPK6xSA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XKOkYwAAAABLPJ9BPUamSot/vdDRWfSuTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:07 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b1698171-6efb-4317-bceb-1b90f0b29f17" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "450ms", + "MS-CV" : "CExFvpgn0E2DCAdGvmJi9g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XaOkYwAAAACKFRhL3MDbTY3wwlHkS2/ZTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e9246b87-afb2-492d-8fa7-0c6436c0feed" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "236ms", + "MS-CV" : "HnU9CGNnUEyjpoNTrqhFXQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0X6OkYwAAAAC6bBL/RfZuS4PqB9vSGmUbTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e4638d48-b942-4338-8289-ae81da75b839" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "479ms", + "MS-CV" : "bhAqO2WSw0uDIoyBcQL/1Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YKOkYwAAAABZuPHtHcIGQrB3qUnxWM4xTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "45ca108d-246d-4031-b67a-9b57aa8143be" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "248ms", + "MS-CV" : "S0pRUPYF0UWZNxFhtB2Ezw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YqOkYwAAAABkujJeFl/hS6GB5yVa0qwXTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "78007746-238a-43d8-afe3-0bdf3277486f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "458ms", + "MS-CV" : "TPgZ25MRmU2lwLw0SNTZLQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Y6OkYwAAAACSoU23OAPDT7l9Jq76Ig1XTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:14 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "8c693775-0245-47bd-b12a-1aa703ffbc36" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "243ms", + "MS-CV" : "fD373K4Iv0OK4AJnr8eUQg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZKOkYwAAAAB5RYqur8GlTruU7IDKKdYiTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "0691058c-045a-4438-86df-6e43c0b77bb4" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "467ms", + "MS-CV" : "n/8QZbbJwEm7Rz0QY9yzvg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZqOkYwAAAABcJAwbdd2BTL3uRN5dATmjTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "1dec58ac-2411-421f-9f67-16e088dbd6bf" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "278ms", + "MS-CV" : "XoFRcGysvkm9XQEDmnY1ZQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Z6OkYwAAAADP43fGrrsWQr6zAyX4rmU3TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "3986e993-d5cd-4848-aec3-72715910730e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "452ms", + "MS-CV" : "pqTihZJEx02J2s56Sw2AVQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aaOkYwAAAACwjhr8Y38ZTYwBQpsnQPHgTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b1ebc807-0bd7-49d2-99e0-5e0da9c87c34" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "237ms", + "MS-CV" : "MHuyrFwo7EyPJiU/ol+8VA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aqOkYwAAAAANKyfWZfc0SIYLorj/2DToTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_d411e379-c8f0-45a5-b580-2b01436dbdfe?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e598e8ea-2c8b-4b34-a04b-12d58c73147a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "462ms", + "MS-CV" : "wdaXD41WOUqDiIDmJwCvuQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bKOkYwAAAABJ7+VEhwveQYIu40OvgFcRTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"succeeded\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:34:57.6760421+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_7d7126a8-fb27-4f7d-9f33-367067718aea?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "af716998-2fd1-4f3b-8938-728f046a6df7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "422ms", + "MS-CV" : "HUNsgr7tBkiqlE2VwprSVA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0baOkYwAAAAATQf6PTn8/RJ+n3sky4y3gTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:35:25.0048877+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_7d7126a8-fb27-4f7d-9f33-367067718aea?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e0bfed1e-0f69-4318-9759-033bd53bd704" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "207ms", + "MS-CV" : "icZzZGVCgESavSXbCgXcUw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0b6OkYwAAAADPmlOeHJONSYqSgM04lzsuTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:35:25.0048877+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_7d7126a8-fb27-4f7d-9f33-367067718aea?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "652baefa-84a4-4999-9b76-059b184ca5bf" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "424ms", + "MS-CV" : "e9Pdu/qD8EyomjmDN+QNTg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cKOkYwAAAAA7oj19mIcGSauF69S/xq+bTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:35:25.0048877+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_7d7126a8-fb27-4f7d-9f33-367067718aea?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "36506e43-51f0-4a17-bd26-a16327fbdd4d" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "207ms", + "MS-CV" : "RcMgJq8vN0me5OkiIdTpRw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cqOkYwAAAAAnonrfWM0ZQ7AT2XCqjR6PTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:35:25.0048877+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_7d7126a8-fb27-4f7d-9f33-367067718aea?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "2ce181cd-06a3-4ce0-b7db-eba45e41fe71" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "431ms", + "MS-CV" : "hl/eKe+5JUaG4ybXhVMkaA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0c6OkYwAAAACCRHZYvCi3Q7aAaVKOhwM1TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:35:25.0048877+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_7d7126a8-fb27-4f7d-9f33-367067718aea?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "c8379ba0-3347-46b7-b331-40572a600db9" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "202ms", + "MS-CV" : "+mBIZhEsa0yH0wfskUFz3Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dKOkYwAAAAC++dEl2NJFR4hsZKrxo8MPTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:35:25.0048877+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_7d7126a8-fb27-4f7d-9f33-367067718aea?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "c0029607-db10-4e4f-b88d-7cba88b775d7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "418ms", + "MS-CV" : "Zcx8q0RIzEC1SceThi2azw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dqOkYwAAAACq7U9VVckAQJ/dKjy+zmF3TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"succeeded\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:35:25.0048877+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "2576cf67-d4ad-41eb-9a19-b13a74cafcac" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "release_7d7126a8-fb27-4f7d-9f33-367067718aea", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:35:24 GMT", + "release-id" : "7d7126a8-fb27-4f7d-9f33-367067718aea", + "Access-Control-Expose-Headers" : "Operation-Location,operation-id,release-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1162ms", + "MS-CV" : "m6SExKHx5UCbB4F3fH0m2A.0", + "X-Azure-Ref" : "0bKOkYwAAAAAe5tjcpKDGRZdh1pDnqvECTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/release_7d7126a8-fb27-4f7d-9f33-367067718aea?api-version=2022-12-01" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbersNullCountryCode[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbersNullCountryCode[1].json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbersNullCountryCode[1].json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbersWithoutOptions[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbersWithoutOptions[1].json new file mode 100644 index 000000000000..030e3c2b1ec1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbersWithoutOptions[1].json @@ -0,0 +1,124 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "a6cfe9e5-fbde-4615-be06-737e1edee978", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "search_f45e5820-cce5-43d3-ac01-a29b87ca9f92", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:34:44 GMT", + "Access-Control-Expose-Headers" : "Location,Operation-Location,operation-id,search-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1997ms", + "MS-CV" : "xiqYKOncN0y9WwBLi4+JYQ.0", + "search-id" : "f45e5820-cce5-43d3-ac01-a29b87ca9f92", + "X-Azure-Ref" : "0Q6OkYwAAAABQx6lwRp2CQ585FJouEPT1TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/search_f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01", + "Location" : "/availablePhoneNumbers/searchResults/f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "8f2f32be-db8a-4f37-b3dc-9aacbd921fb3" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:34:45 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "352ms", + "MS-CV" : "C3vk9QJO/kCxeRD5UBy4hg.0", + "X-Azure-Ref" : "0RaOkYwAAAACIjrT1zrFfQIPNOU3cwHFLTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"notStarted\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:34:44.6057551+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "1625e5ac-7faf-4547-835e-f2a6eec2afb9" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:34:46 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "454ms", + "MS-CV" : "GFBYQg0U30+6WbmRBC4+og.0", + "X-Azure-Ref" : "0RqOkYwAAAAAgtpSUPQjfQqYbCnrTeHL2TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"running\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:34:44.6057551+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4d7c0d3e-d3e0-46ce-a81f-9f503f11ce6b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:34:47 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "240ms", + "MS-CV" : "zlv5qX5U/Uy3B3armZGn5Q.0", + "X-Azure-Ref" : "0SKOkYwAAAABLpBM1zdiRTYRQ96IQHYHaTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"succeeded\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:34:44.6057551+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/searchResults/f45e5820-cce5-43d3-ac01-a29b87ca9f92?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "d65f1add-c78a-48f7-a8ec-0a362baa6f8a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1038ms", + "MS-CV" : "JS3SZYq2A0Wn2ZIJ3kypeQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SKOkYwAAAABiYlx9tKU/Q7Rj6Vdzr4nNTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"searchId\":\"f45e5820-cce5-43d3-ac01-a29b87ca9f92\",\"phoneNumbers\":[\"+18336823089\"],\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"},\"searchExpiresBy\":\"2022-12-22T18:50:47.8351597+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:34:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbers[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbers[1].json new file mode 100644 index 000000000000..5c403a9211c3 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginSearchAvailablePhoneNumbers[1].json @@ -0,0 +1,100 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "a8b1ede6-5f04-456d-aa22-618c4214924d", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "search_dffa5967-5741-4e2d-be05-e59228056990", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:35:39 GMT", + "Access-Control-Expose-Headers" : "Location,Operation-Location,operation-id,search-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1580ms", + "MS-CV" : "tJjLGL8dyEe1tz/rxZzL/w.0", + "search-id" : "dffa5967-5741-4e2d-be05-e59228056990", + "X-Azure-Ref" : "0eaOkYwAAAABYngOPSRvSSbsevGor8eBgTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/search_dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01", + "Location" : "/availablePhoneNumbers/searchResults/dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "6f5e9131-3455-4ab8-9ab6-fadb8d68520d" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:35:39 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "584ms", + "MS-CV" : "SBSzl9fkUEGXGwbcypln3w.0", + "X-Azure-Ref" : "0e6OkYwAAAADnjIwKXm5KR4+qwDFJktpVTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"running\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:35:38.7662702+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b1957326-4b12-4b49-b5c9-6f9d1b1f0c48" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:35:41 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "232ms", + "MS-CV" : "OPKs4BOwek+qDTO8vvII1w.0", + "X-Azure-Ref" : "0fKOkYwAAAADVcrBkrgXNSYww3CA2Yu3zTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"succeeded\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:35:38.7662702+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/searchResults/dffa5967-5741-4e2d-be05-e59228056990?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "cc8edd19-0f12-4e9e-ab43-c7c36c4862c2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "893ms", + "MS-CV" : "U84abOEH5ke46VuRlNFUDg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0faOkYwAAAAABZ+bO6Mm/QYTLyeP3HkwATUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"searchId\":\"dffa5967-5741-4e2d-be05-e59228056990\",\"phoneNumbers\":[\"+18662358015\"],\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"},\"searchExpiresBy\":\"2022-12-22T18:51:40.0992773+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:35:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesInvalidPhoneNumber[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesInvalidPhoneNumber[1].json new file mode 100644 index 000000000000..716fef078fcb --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesInvalidPhoneNumber[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/invalid-phone-number/capabilities?api-version=2022-01-11-preview2", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "aa5584a3-62e9-4133-a8d7-343117f7fbf8", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "267ms", + "MS-CV" : "mSLGbh5nJ0uDckDfWq42BQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "05zC3YwAAAADS56k9qb/MQain7/VaNVhyU0FPMzFFREdFMTEwOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "404", + "Body" : "{\"error\":{\"code\":\"InternalError\",\"message\":\"The server encountered an internal error.\"}}", + "Date" : "Thu, 05 Jan 2023 20:19:51 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesNullPhoneNumber[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesNullPhoneNumber[1].json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesNullPhoneNumber[1].json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesUnauthorizedPhoneNumber[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesUnauthorizedPhoneNumber[1].json new file mode 100644 index 000000000000..036b54b8741e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesUnauthorizedPhoneNumber[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+14255555111/capabilities?api-version=2022-01-11-preview2", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4dee44b5-ae96-40d7-96e0-9c2d8ef36860", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "268ms", + "MS-CV" : "QKyUgQT59EqQWbHVumi3QA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0rDC3YwAAAAAj65+p76k8QqHPFrjteiajU0FPMzFFREdFMTIxMQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "404", + "Body" : "{\"error\":{\"code\":\"InternalError\",\"message\":\"The server encountered an internal error.\"}}", + "Date" : "Thu, 05 Jan 2023 20:18:53 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilities[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilities[1].json new file mode 100644 index 000000000000..3cb363f92ef4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.beginUpdatePhoneNumberCapabilities[1].json @@ -0,0 +1,172 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_c6f3e670-f114-4d4e-abe2-9a5d78f15613?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "8e6b5803-fb10-4ab3-9937-fc18fe6b9b21" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:35:47 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "429ms", + "MS-CV" : "rskpGu4HHEOBluzLT8K2cg.0", + "X-Azure-Ref" : "0g6OkYwAAAACUA8Rg5wuuQ5jp8ofD4aKZTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"running\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:35:47.0623142+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_c6f3e670-f114-4d4e-abe2-9a5d78f15613?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "81e3030d-f037-42e6-9b9e-79cc16463102" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:35:49 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "213ms", + "MS-CV" : "SJNF2HNQUEeehbB1wogPbA.0", + "X-Azure-Ref" : "0haOkYwAAAAAfuLzMQSjCRK6PJVtf5q+nTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"running\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:35:47.0623142+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_c6f3e670-f114-4d4e-abe2-9a5d78f15613?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "152293d8-3919-432f-a35c-c624ce0af948" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:35:50 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "427ms", + "MS-CV" : "oOamUhZ9okqg9sPh8b2IjQ.0", + "X-Azure-Ref" : "0hqOkYwAAAABtVU5lBpXhQYFvj1QfjuwITUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"running\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:35:47.0623142+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_c6f3e670-f114-4d4e-abe2-9a5d78f15613?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "c5f195aa-d0fa-42f2-82fe-c06d8c5bf6a0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:35:51 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "224ms", + "MS-CV" : "6cjwyzVWQ0aujI0I7Pit9A.0", + "X-Azure-Ref" : "0h6OkYwAAAAAD1P16bgc7S45D9Dn/IkdVTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"succeeded\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:35:47.0623142+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4c10f17b-2f1c-4d75-a1df-8657557fb47a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1621ms", + "MS-CV" : "BQ/XjzM1iEer6RDZhfIfMg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0gKOkYwAAAABzGI5kz/D5SrbTCR2lCUa6TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:35:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED/capabilities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "c2afe177-b26c-4f12-bfac-da9e51736458", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "capabilities-id" : "c6f3e670-f114-4d4e-abe2-9a5d78f15613", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "capabilities_c6f3e670-f114-4d4e-abe2-9a5d78f15613", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:35:47 GMT", + "Access-Control-Expose-Headers" : "Operation-Location,Location,operation-id,capabilities-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1100ms", + "MS-CV" : "rd13oPIs70+04uwFhy+LDw.0", + "X-Azure-Ref" : "0gqOkYwAAAABTeMVaX6RMQofAPvTk2cyoTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/capabilities_c6f3e670-f114-4d4e-abe2-9a5d78f15613?api-version=2022-12-01", + "Body" : "{\"capabilitiesUpdateId\":\"c6f3e670-f114-4d4e-abe2-9a5d78f15613\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "9e657131-ff3e-457d-b455-715bc566c642" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1750ms", + "MS-CV" : "D8qz9wHbjESgcttiqG47ZA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0iKOkYwAAAAA2H46WbggCS7K0z4vks3TJTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:35:53 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getCountriesWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getCountriesWithAAD[1].json new file mode 100644 index 000000000000..8be98240a45b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getCountriesWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "db27b157-9f89-44d3-8e52-35c1bf25b6ad" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "2018ms", + "MS-CV" : "6EVTOJV25kCDUDzY/6WmJw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0jKOkYwAAAAA8/DMpG8nLTIVvXRx9TwELTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"countries\":[{\"localizedName\":\"Canada\",\"countryCode\":\"CA\"},{\"localizedName\":\"Denmark\",\"countryCode\":\"DK\"},{\"localizedName\":\"Ireland\",\"countryCode\":\"IE\"},{\"localizedName\":\"Italy\",\"countryCode\":\"IT\"},{\"localizedName\":\"Puerto Rico\",\"countryCode\":\"PR\"},{\"localizedName\":\"Sweden\",\"countryCode\":\"SE\"},{\"localizedName\":\"United Kingdom\",\"countryCode\":\"GB\"},{\"localizedName\":\"United States\",\"countryCode\":\"US\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:35:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getCountries[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getCountries[1].json new file mode 100644 index 000000000000..f94149af1913 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getCountries[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "28fce975-8e34-4e45-8f5f-aebb0136b83c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "2275ms", + "MS-CV" : "SBd8wxeYyUanCwIbNOYhuQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0fqOkYwAAAABKoe8noWTsT4y8Zh0ddStuTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"countries\":[{\"localizedName\":\"Canada\",\"countryCode\":\"CA\"},{\"localizedName\":\"Denmark\",\"countryCode\":\"DK\"},{\"localizedName\":\"Ireland\",\"countryCode\":\"IE\"},{\"localizedName\":\"Italy\",\"countryCode\":\"IT\"},{\"localizedName\":\"Puerto Rico\",\"countryCode\":\"PR\"},{\"localizedName\":\"Sweden\",\"countryCode\":\"SE\"},{\"localizedName\":\"United Kingdom\",\"countryCode\":\"GB\"},{\"localizedName\":\"United States\",\"countryCode\":\"US\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:35:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getGeographicAreaCodesWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getGeographicAreaCodesWithAAD[1].json new file mode 100644 index 000000000000..e2afa96b5d8a --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getGeographicAreaCodesWithAAD[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "65385296-6c21-4408-9cea-4e2240d74f2e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "355ms", + "MS-CV" : "9XZUCqKTO0uObRfJkOqGxw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0iaOkYwAAAAA9dvSi27j4TrezIGm3u/WdTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Montgomery\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Port St Lucie\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"St. Petersburg\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Tallahassee\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Iowa City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Boston\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Otsego\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Pontiac\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Thu, 22 Dec 2022 18:35:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/areaCodes?phoneNumberType=geographic&assignmentType=person&locality=Anchorage&administrativeDivision=AK&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "33f10517-4f27-4855-8519-c3e0e3a2e9a9" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "2207ms", + "MS-CV" : "zVO8X3w01UCf2Ar+M1e79Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0iqOkYwAAAABS6wCSxJLBRbfrQWlYy+fGTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"areaCodes\":[{\"areaCode\":\"907\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:35:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getGeographicAreaCodes[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getGeographicAreaCodes[1].json new file mode 100644 index 000000000000..3ea5e1fee778 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getGeographicAreaCodes[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "8cdd8c57-d2a0-4cc3-90be-06e3be5e0d39" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "639ms", + "MS-CV" : "aa1US2pceUGz2D2Tvpn22w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0j6OkYwAAAADL6yFUeB5wQZjV7eFCpLlgTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Montgomery\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Port St Lucie\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"St. Petersburg\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Tallahassee\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Iowa City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Boston\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Otsego\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Pontiac\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Thu, 22 Dec 2022 18:35:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/areaCodes?phoneNumberType=geographic&assignmentType=person&locality=Anchorage&administrativeDivision=AK&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "7415db6b-0634-43c2-ab0f-72ad4e9ee1ac" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "1105ms", + "MS-CV" : "93H9IMZOIU2d3BpWWZy8Gw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0j6OkYwAAAAAw77/GsFYKTpCbHusQvhe8TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"areaCodes\":[{\"areaCode\":\"907\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:36:00 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesAdministrativeDivisionWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesAdministrativeDivisionWithAAD[1].json new file mode 100644 index 000000000000..553d2fd5a46d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesAdministrativeDivisionWithAAD[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "368180a6-00dc-4d6e-bf19-65976c124a99" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "304ms", + "MS-CV" : "JFHO8BrbqkCjUNCcGMuRoQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "00cC9YwAAAAAdycdq5WHZRrZ/Nt0y9dz2TUVYMzFFREdFMDQyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Wilmington\",\"administrativeDivision\":{\"localizedName\":\"DE\",\"abbreviatedName\":\"DE\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lynn\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Bloomington\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Duluth\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Mankato\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Minneapolis\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Plymouth\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"St. Paul\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Tue, 10 Jan 2023 19:47:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?administrativeDivision=AK&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "f674bde0-a9c9-4538-b04a-35ee3f3b46fb" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "871ms", + "MS-CV" : "ISNKtuh6QUK1nYGBfSCASw.0", + "retry-after" : "0", + "X-Azure-Ref" : "00cC9YwAAAADbuwLXDJCeQoBS7PLGqTugTUVYMzFFREdFMDMxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}}],\"nextLink\":null}", + "Date" : "Tue, 10 Jan 2023 19:47:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesAdministrativeDivision[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesAdministrativeDivision[1].json new file mode 100644 index 000000000000..0291bde7d43b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesAdministrativeDivision[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "a9bdb156-b691-405f-aeaa-2199e2a820ae" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "265ms", + "MS-CV" : "Dxbe078+UEOGRpMtBb5zag.0", + "retry-after" : "0", + "X-Azure-Ref" : "00sC9YwAAAAAuSeKx31hxRY0frYYFx9hMTUVYMzFFREdFMDQyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Wilmington\",\"administrativeDivision\":{\"localizedName\":\"DE\",\"abbreviatedName\":\"DE\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lynn\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Bloomington\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Duluth\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Mankato\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Minneapolis\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Plymouth\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"St. Paul\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Tue, 10 Jan 2023 19:47:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?administrativeDivision=AK&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e7ec6704-1c23-45d3-a32d-565bb10dbc16" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "596ms", + "MS-CV" : "ySpW6wkQiUWNW9bvc45EGw.0", + "retry-after" : "0", + "X-Azure-Ref" : "008C9YwAAAACQ27LcjOceRbLc9/KF6rUqTUVYMzFFREdFMDMxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}}],\"nextLink\":null}", + "Date" : "Tue, 10 Jan 2023 19:47:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesWithAAD[1].json new file mode 100644 index 000000000000..0ae7c37b7f0b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalitiesWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "6c5e890e-4cfb-4381-9c3d-b93aa90aa61e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "838ms", + "MS-CV" : "gpuB/LiLhkOMkLX0nVhw8w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PqOkYwAAAACvwzBcuy8sRbieoSFAmsW7TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Montgomery\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Port St Lucie\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"St. Petersburg\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Tallahassee\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Iowa City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Boston\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Otsego\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Pontiac\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Thu, 22 Dec 2022 18:34:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalities[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalities[1].json new file mode 100644 index 000000000000..5325fc5dbe0a --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getLocalities[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "3c33a9d2-eb3b-4874-9ec7-5027b49a9bc0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "640ms", + "MS-CV" : "T+I2IEV8OUOgSag2yo/IUA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eKOkYwAAAADtHefqIIVlT5X8om8xbY1yTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Montgomery\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Port St Lucie\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"St. Petersburg\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Tallahassee\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Iowa City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Boston\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Otsego\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Pontiac\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Thu, 22 Dec 2022 18:35:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getOfferingsWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getOfferingsWithAAD[1].json new file mode 100644 index 000000000000..9d42823153ef --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getOfferingsWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/offerings?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "041d10d8-1127-4a74-82de-b88e63c7294e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "1276ms", + "MS-CV" : "3nq/7AHpDk2fMWw2YhOE+A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QKOkYwAAAACI5t52f0FpRKaM2PPPiWHtTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberOfferings\":[{\"phoneNumberType\":\"geographic\",\"assignmentType\":\"person\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"phoneNumberType\":\"geographic\",\"assignmentType\":\"application\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:34:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getOfferings[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getOfferings[1].json new file mode 100644 index 000000000000..08672f55f904 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getOfferings[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/offerings?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b72ed61c-29c7-4c4b-a69f-4e59aa96e3c0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "1176ms", + "MS-CV" : "8yfOhGMzXkuxeZzaQ1gWnQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0kKOkYwAAAABHmE2o85zBRIwRtehaFJoFTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberOfferings\":[{\"phoneNumberType\":\"geographic\",\"assignmentType\":\"person\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"phoneNumberType\":\"geographic\",\"assignmentType\":\"application\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:36:02 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberNullNumber[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberNullNumber[1].json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberNullNumber[1].json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithAAD[1].json new file mode 100644 index 000000000000..e7b707f357bb --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "46db5f32-1c9f-4679-9681-9cdd3678b117" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "3042ms", + "MS-CV" : "Q3zEf+F56ESlAEAufNlE6Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NKOkYwAAAACqBWV+ZUr5SKnRUU2z9wtzTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:34:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithResponseNullNumber[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithResponseNullNumber[1].json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithResponseNullNumber[1].json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithResponse[1].json new file mode 100644 index 000000000000..bcd02d4a07de --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumberWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "5c254e6e-895a-4857-9c23-b9a41b9ef676" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1563ms", + "MS-CV" : "uIKF3hSQsECdTlyshBjsfA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QaOkYwAAAAB+Anh9gZnZQrqjbAXZ5+XwTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:34:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumber[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumber[1].json new file mode 100644 index 000000000000..855f6c8b5d38 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getPurchasedPhoneNumber[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "3c397c73-4240-4fa9-8c8a-f6afc7931306" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1576ms", + "MS-CV" : "0p+Rcpi/tEOCaBWtFG09hw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TKOkYwAAAAAJIJOWZ50pS7nOlGuF8xnSTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:34:53 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getTollFreeAreaCodesWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getTollFreeAreaCodesWithAAD[1].json new file mode 100644 index 000000000000..dce753bd81a3 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getTollFreeAreaCodesWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/areaCodes?phoneNumberType=tollFree&assignmentType=application&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "370e9bab-4f5b-4f20-abfa-fb06703fce25" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "6368ms", + "MS-CV" : "hFI2PxxvFEG9Br/vwrCjcA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OKOkYwAAAAB36QR/K7dqT63l6ys55V8zTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"areaCodes\":[{\"areaCode\":\"888\"},{\"areaCode\":\"877\"},{\"areaCode\":\"866\"},{\"areaCode\":\"855\"},{\"areaCode\":\"844\"},{\"areaCode\":\"800\"},{\"areaCode\":\"833\"},{\"areaCode\":\"88\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:34:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getTollFreeAreaCodes[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getTollFreeAreaCodes[1].json new file mode 100644 index 000000000000..efdd3c30a8a0 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.getTollFreeAreaCodes[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/areaCodes?phoneNumberType=tollFree&assignmentType=application&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "818c4085-171f-427e-87a7-6dfebf2f9061" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "2953ms", + "MS-CV" : "8oGNfZtBMEKQqHyczrCicQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SaOkYwAAAADRiVYeFuCfQ6BjQuAsmL6CTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"areaCodes\":[{\"areaCode\":\"888\"},{\"areaCode\":\"877\"},{\"areaCode\":\"866\"},{\"areaCode\":\"855\"},{\"areaCode\":\"844\"},{\"areaCode\":\"800\"},{\"areaCode\":\"833\"},{\"areaCode\":\"88\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:34:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.listPurchasedPhoneNumbers[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.listPurchasedPhoneNumbers[1].json new file mode 100644 index 000000000000..d5c128c3e949 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersAsyncClientIntegrationTest.listPurchasedPhoneNumbers[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b6d2f2fc-ec40-493d-a601-2445f178d91e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1539ms", + "MS-CV" : "ZiAm/wt2tUeWoWvPXOXzDg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TqOkYwAAAAD0ncYHEJuPTK1qrkAu3bA1TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumbers\":[{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T15:18:14.7689633+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:36:43.2477114+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:36:13.5514009+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:09:18.7391177+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:11:43.8093725+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:09:44.856727+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:10:43.0470316+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:11:13.2871013+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:43.3598754+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:14.2925013+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:17.7642032+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:37:57.7589612+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:38:01.2490062+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:38:10.7033129+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T15:41:42.6103267+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:30:51.9182995+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:30:17.6614122+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:47.0550566+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:32:08.7055072+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:32:20.4489554+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:27.7725472+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:28:06.2941982+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:27:58.4564095+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:35:55.6362141+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:35:38.2751041+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:12.122407+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:52.6849802+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:21.3246132+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:52.844006+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:26.0949019+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:16.7736485+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:07.5114194+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:24.9591048+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:31.4083206+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:24.2533723+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:16.2862265+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:37.7662022+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:46.6018872+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:50.4679082+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:44.6881974+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:55.8644165+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:55.9240487+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:20.5570756+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:22.1720088+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:41.0997634+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:44.9865457+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:11:13.6760492+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:13:14.7544127+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:51.5548845+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:22:13.6608168+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:23:13.802374+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:56.1826813+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:23:43.4526026+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:24:12.4592203+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:17.7235497+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:32:43.9547602+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:10.859962+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:30.851053+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"none\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2022-01-11T22:26:05.2198645+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"none\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2022-01-11T17:06:02.0097082+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:08:43.2976318+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:09:13.3731647+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:33:13.7739402+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:25:13.6206509+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:25:44.3664664+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:29:43.2087273+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:37:14.4369365+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:27:13.4604535+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:27:47.6058406+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:26:43.3088723+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:42:44.4416133+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:28:13.2155644+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:41:58.7312966+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:39:14.5759855+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:40:28.2331315+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:28:43.2865444+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:43:44.3267753+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:43:14.5582972+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:30:42.3622994+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:35:58.515204+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:30:13.3981412+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:36:12.1300788+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:36:43.3727213+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:31:43.1246125+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:58.3886965+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:44:13.795794+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:33:42.3770211+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:34:13.0593291+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:44:43.2825566+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:43.3853897+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:13.8368509+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:48:14.4930555+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:47:29.3763702+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:37:12.9376761+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:37:43.0423694+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T03:18:13.4190469+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T01:01:13.3943797+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T01:02:13.0024309+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T03:18:42.3038608+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}],\"nextLink\":\"/phoneNumbers?api-version=2022-12-01&skip=100&top=100\"}", + "Date" : "Thu, 22 Dec 2022 18:34:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginPurchaseandReleasePhoneNumbersWithoutContext[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginPurchaseandReleasePhoneNumbersWithoutContext[1].json new file mode 100644 index 000000000000..5301c99051d9 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginPurchaseandReleasePhoneNumbersWithoutContext[1].json @@ -0,0 +1,523 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "d4375e26-885f-473f-9851-6b8b42fdab32", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "search_ae153215-f309-4afb-91bd-8a42b3984609", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:38:12 GMT", + "Access-Control-Expose-Headers" : "Location,Operation-Location,operation-id,search-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1837ms", + "MS-CV" : "EeoM/uW8Q0KhaMR0fpFRJg.0", + "search-id" : "ae153215-f309-4afb-91bd-8a42b3984609", + "X-Azure-Ref" : "0E6SkYwAAAAC44PKdbvvURZ0Dz7IdQ1ZETUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/search_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Location" : "/availablePhoneNumbers/searchResults/ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "cc4a7802-207d-498a-be32-f3cb7933df32" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:38:12 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "239ms", + "MS-CV" : "VSzD8F7G+Umuk1x06ckGpA.0", + "X-Azure-Ref" : "0FaSkYwAAAACvo6w+i5owSaQMrNYhpl4cTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"notStarted\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "fec7c232-5723-450e-aa48-d230d47711f8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:38:14 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "453ms", + "MS-CV" : "bwnFjDct9EmvIMxywTzXvg.0", + "X-Azure-Ref" : "0FqSkYwAAAACWGIAB/1MUQ5BUMJnYN3APTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"succeeded\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/searchResults/ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "c4cd1f11-8763-48f2-b3a0-601ccd12727f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "615ms", + "MS-CV" : "ZgZbFkUPG0G1EfCd8WDZrQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0F6SkYwAAAAA/C6QOEhidRYMPqm8d7L8pTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"searchId\":\"ae153215-f309-4afb-91bd-8a42b3984609\",\"phoneNumbers\":[\"+18662358004\"],\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"},\"searchExpiresBy\":\"2022-12-22T18:54:14.1812671+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "c731e47f-15ec-4efe-a96b-72511fc50553", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "purchase_ae153215-f309-4afb-91bd-8a42b3984609", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:38:17 GMT", + "Access-Control-Expose-Headers" : "Operation-Location,operation-id,purchase-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1990ms", + "MS-CV" : "ggh8UmyVTU2QhInjlbVNZA.0", + "purchase-id" : "ae153215-f309-4afb-91bd-8a42b3984609", + "X-Azure-Ref" : "0F6SkYwAAAABIW2uiTt19TpTy+5GwDN/YTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "079d8529-3fa5-40f4-bc6d-b85c952753be" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "240ms", + "MS-CV" : "YQbG7os42kSRpTx1VbSf/Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GaSkYwAAAAAUHuQphhmaQ4ion6McNBsVTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "ae814ce5-a056-4aac-ab5a-44e602ff6f91" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "448ms", + "MS-CV" : "l+sYu+RB0USDRKSD50PJ/Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0G6SkYwAAAADzbt6SI+sDT4PbJYfVR8n1TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "1cc5346a-7fba-4084-9275-8c3157919932" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "269ms", + "MS-CV" : "S88UZ1Z6LUyQ9QNfYDl3Vw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HKSkYwAAAABXv207s/RLQ4GAQ5VGYVp6TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:20 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "dc467f88-dee0-4e33-a402-bd9caf9d88bb" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "452ms", + "MS-CV" : "KdVZ24WRbEWD4maTKrb/Gw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HqSkYwAAAADJMfydYrQmQqNIze13Hzc3TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b96a2cff-af5e-41d8-b987-01bcf4450582" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "252ms", + "MS-CV" : "KCi5rJWaRkS3FxnoPby73g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0H6SkYwAAAAADGdDMXS7YQLQtEp23YWiQTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "dd81453e-303c-4d71-b6f1-6f7fbc009a12" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "446ms", + "MS-CV" : "VwiOZg0zWE+UdjzjyXJZjw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IKSkYwAAAADvLxz4VyQ6TosTc0f4hmMSTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "8c2ff2af-d1e2-4f25-9262-84f449732e70" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "240ms", + "MS-CV" : "CpQC3EIqoE+XxnW2gXDVRg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IqSkYwAAAADv+4TqPjwhQ6dFhpbvDbX+TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "f551f0ea-619e-43c1-928a-ad7ec9eed12e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "454ms", + "MS-CV" : "BR/hde9d2Eqc5Ajh0xtFeQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0I6SkYwAAAAA1Y90LgCmtT4Msk8TreF9MTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "ca52c691-e977-4b93-95aa-694de178709a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "323ms", + "MS-CV" : "d4PRc1x9lUy4emCXsvQr3Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JaSkYwAAAABkyEkbUdVIS4unt/WnwF6tTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:28 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "7fad2ee0-8778-4bc6-873f-8a490f1430fe" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "490ms", + "MS-CV" : "yn2H+h+Nfk2ATcSFR3YoFQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JqSkYwAAAADGi3oO4VfeSKABsUbzyiRtTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "01003721-7701-4c98-b300-80eaaffd4d5a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "237ms", + "MS-CV" : "Kio0l0JWUk+j4Qf/v1HHdw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KKSkYwAAAADit22imfedQ52D/17abHScTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_ae153215-f309-4afb-91bd-8a42b3984609?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "40102afb-ec4a-4d8e-bf45-20808e16d0e4" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "453ms", + "MS-CV" : "X0Qt/t2M1k+01xAL6LS8Cw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KaSkYwAAAAComSiBV5DhSoJmZwguUS//TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"succeeded\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:12.6709362+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_8af8c6aa-0c13-4704-bfe1-e57eb6c031e7?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "7f9bfa5f-cf27-4619-86dd-51ed34de208d" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "411ms", + "MS-CV" : "5wk8WMaBTkeoKIGwzdQAZQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0K6SkYwAAAAARU+1pdRqOSYq2doB6TFIqTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:34.4933122+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:35 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_8af8c6aa-0c13-4704-bfe1-e57eb6c031e7?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "733c7f8b-534f-4629-abb3-9bc32426926b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "235ms", + "MS-CV" : "WzFU3vQ2/EyYAw8sFLWfPQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LaSkYwAAAAC5ru75QFGISbEwS3epTbdYTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:34.4933122+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:36 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_8af8c6aa-0c13-4704-bfe1-e57eb6c031e7?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "ed778b0f-7cd3-4bf1-8d4c-d4609def1553" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "413ms", + "MS-CV" : "aWCKfhLnoU+nc/t8nHHbKw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LqSkYwAAAABsAOpGw7WKS4Gcb7ricTdzTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:34.4933122+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_8af8c6aa-0c13-4704-bfe1-e57eb6c031e7?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "3fa9cbd2-7cf9-47ae-b09d-49d2d5c85e2b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "213ms", + "MS-CV" : "Q9UiwYZZUE+TaHYE++o3RA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0L6SkYwAAAABMXzLu4xvNRa16DgTusP5eTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:34.4933122+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:39 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_8af8c6aa-0c13-4704-bfe1-e57eb6c031e7?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e75a3810-ba87-433e-be65-9bb84a640549" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "417ms", + "MS-CV" : "or1Uj0cm1EyI9cq2wPFnAg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MaSkYwAAAABEFpDNrkdHRauCu+hTXHFMTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"succeeded\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:34.4933122+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "f64f6b84-7dbd-4ecb-979c-c951e5e66558" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "release_8af8c6aa-0c13-4704-bfe1-e57eb6c031e7", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:38:34 GMT", + "release-id" : "8af8c6aa-0c13-4704-bfe1-e57eb6c031e7", + "Access-Control-Expose-Headers" : "Operation-Location,operation-id,release-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1221ms", + "MS-CV" : "GLOH6jl6GUCqqIuSWN9d2w.0", + "X-Azure-Ref" : "0KqSkYwAAAACaGJ7qDDumTKI5PhgT945ETUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/release_8af8c6aa-0c13-4704-bfe1-e57eb6c031e7?api-version=2022-12-01" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginPurchaseandReleasePhoneNumbers[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginPurchaseandReleasePhoneNumbers[1].json new file mode 100644 index 000000000000..a733aee5c5d1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginPurchaseandReleasePhoneNumbers[1].json @@ -0,0 +1,655 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e552e01d-42b4-4205-85d2-12e9fd6325eb", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "search_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:38:49 GMT", + "Access-Control-Expose-Headers" : "Location,Operation-Location,operation-id,search-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1904ms", + "MS-CV" : "LK1eeDJjvUmy2D4pTgZTCA.0", + "search-id" : "98085f0d-aff2-4f83-8a7d-460d8c6cb9f3", + "X-Azure-Ref" : "0N6SkYwAAAAD4MOtXFLLSQ57Nz2HoXz1GTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/search_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Location" : "/availablePhoneNumbers/searchResults/98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "cc1d89a2-e143-4e1b-ae55-c5b433c01bce" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:38:50 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "277ms", + "MS-CV" : "mETrMcF5zkKQqUQe9g2vdg.0", + "X-Azure-Ref" : "0OaSkYwAAAADEhMn1HuKFTIl337Xx/YwgTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"notStarted\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "ae9174fe-1f68-4d56-984b-01eb1a6b2c56" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:38:51 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "477ms", + "MS-CV" : "FIq4wZbOaEC1N8n7Fp8t9A.0", + "X-Azure-Ref" : "0O6SkYwAAAAA7409Ou6e0TZJ9NRDttfQ8TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"succeeded\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/searchResults/98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4ffbb2c2-739a-438f-b6f8-6ebdce537021" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "910ms", + "MS-CV" : "J2CcfMP06EiHfYmfEZm45A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0O6SkYwAAAADOp9ZYp/BXQoutC2N97z5eTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"searchId\":\"98085f0d-aff2-4f83-8a7d-460d8c6cb9f3\",\"phoneNumbers\":[\"+18442276313\"],\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"},\"searchExpiresBy\":\"2022-12-22T18:54:50.9688605+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "41c0475e-ace0-4259-92e2-e6a5bf33401c", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:38:54 GMT", + "Access-Control-Expose-Headers" : "Operation-Location,operation-id,purchase-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "2063ms", + "MS-CV" : "f+qy/GpbrE+m4LYL6An7Pw.0", + "purchase-id" : "98085f0d-aff2-4f83-8a7d-460d8c6cb9f3", + "X-Azure-Ref" : "0PKSkYwAAAAD07PwVC/fyRIB9dQsVrvoATUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "f5ad0a51-636c-4845-9ee9-b7b6d958457f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "267ms", + "MS-CV" : "aGHul9Uu5Ei0PadDOSpL4w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0P6SkYwAAAADVOEJIjARSS7ayQuuf6SXSTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "6dba5c37-161e-4eaf-8e77-81bb5cf682a5" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "484ms", + "MS-CV" : "lPG50/EO5E+c56KWblvl1Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QKSkYwAAAABMwTQIFQqaTZAu+zAFm9KjTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "55ba9a99-925b-40f6-899b-778ae00776ef" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "302ms", + "MS-CV" : "uyoVNKQ7Y0ytv9000R8kRg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QaSkYwAAAABEscG2fvWHR7k0jc3b0LOeTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4887cb31-9024-4ed8-a696-83bce588e35a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "458ms", + "MS-CV" : "eoJ/uch/2Ey0qvJIcnpj2Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Q6SkYwAAAADeAbztndtGQpHzZ5EIqtSmTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:38:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "c8d90ba7-0ad2-43b8-a84f-bcde7c169cb6" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "380ms", + "MS-CV" : "BBAndKqqfkGqKQmlL63TDQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0RKSkYwAAAACZisIdAIQ0S5LgWV7Mcv6dTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "cf0313c0-d0dd-4b71-9a10-0abc8ed2e134" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "452ms", + "MS-CV" : "yROzQRWyWUO7K8Grf3iezQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0RqSkYwAAAABlwDbylzpLRKV3u3IRol4YTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "08090adc-bb8e-4c1b-a902-a58a623f0c7a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "237ms", + "MS-CV" : "PbACp3NCBUuHRb4qRuCGEQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0R6SkYwAAAADhFZnS3TrmTKCGehTLH1WQTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:04 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "3b8f3d84-a6fb-450f-b41d-d72194825ce7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "456ms", + "MS-CV" : "wELpymcMHUqEwJhLrvs3NA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SaSkYwAAAAA8H0ea58xbQ4Ufdo2k+McqTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:04 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "323a3de0-85d3-4f62-aff3-6a821ea92d00" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "238ms", + "MS-CV" : "FVgQXeUwH0StdM7ijG/x0A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SqSkYwAAAAB2YcpmswtqR6S4fQCHsz7MTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:06 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e5f92f51-3654-47d0-87fa-5e6e65424901" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "454ms", + "MS-CV" : "16mGbDlRPkKIDAx8RrYUXg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0S6SkYwAAAAClm9BhCNJMS61KEzvoWmBUTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:07 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "f2e4362c-8267-45ae-aa27-757cec80e46c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "241ms", + "MS-CV" : "zeDWKeIB60C5kjF3uSPQMw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TaSkYwAAAAC1/G0FHtobS7w8MYIDbQ/wTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "60126cb0-2a81-439c-a955-b79b9398b814" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "466ms", + "MS-CV" : "b4GkSY03oE+mp7fcWffJKw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TqSkYwAAAADzpmg1NqE/QbAAnYz4QhACTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "74614523-b7e1-4c6f-b743-eaed1e85602c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "259ms", + "MS-CV" : "TTEwr7cDhkKa7N8i0TF5nw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UKSkYwAAAACLQBUlD1efQ7MQ9ai/QYBITUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "f6d47f33-4a72-4ad9-93d8-089f0e75298f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "452ms", + "MS-CV" : "AwcmvZX2GE29fAk3aO+rAg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UaSkYwAAAAA/GTCifg7kRJShbf0YmaB9TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "a55b0f81-7be7-4b79-9077-0b83d15685f1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "233ms", + "MS-CV" : "KG69d/rH6EmHIVUENh3DbA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0U6SkYwAAAABScJZtgV5FRaTQufQiB+cfTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "35b9a334-bb49-4b3f-8ac4-86708f9d35f2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "456ms", + "MS-CV" : "eVdjpVc7Dk6r5v3/0n3NWw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VKSkYwAAAADil7nXqOwFTYyJ1Z9fdRvyTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/purchase_98085f0d-aff2-4f83-8a7d-460d8c6cb9f3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e39e029f-c0c5-4ccf-870b-e2ee52ece3b2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "261ms", + "MS-CV" : "sPqLhi2kuEuBlAEKKgY78g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VqSkYwAAAAAIkNT3UZACRqjPFfrGJiS5TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"purchase\",\"status\":\"succeeded\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:38:49.3263162+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_6a83e9c0-ffd6-4627-b0b3-a50948923563?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "85dc1e11-4f7d-4cae-8e51-2d61d17bccbe" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "205ms", + "MS-CV" : "S2aKOJJQ20ec/nDAzbtiJQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WKSkYwAAAADyYWms26dZTJrn5juO9IUCTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"notStarted\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:39:18.9020371+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:20 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_6a83e9c0-ffd6-4627-b0b3-a50948923563?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4cb7e87e-ea6b-4344-b049-e324466541df" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "403ms", + "MS-CV" : "JmTet8qkiECBv3MAUB44jw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WaSkYwAAAAD+Rhixx4N2TY7eSSJFmZKrTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:39:18.9020371+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_6a83e9c0-ffd6-4627-b0b3-a50948923563?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "baeab41d-e6e4-41f0-9a72-7d44a04a1ab1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "219ms", + "MS-CV" : "97yirGB3hkCM2J+1C+KIAQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WqSkYwAAAABfi38HCVgvR4drMW1U7mB8TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:39:18.9020371+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_6a83e9c0-ffd6-4627-b0b3-a50948923563?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "dd5545cc-0b88-4ef0-9a96-fbe642c91ea2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "539ms", + "MS-CV" : "ulsjzJAd20S848cXn1S1tA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XKSkYwAAAACBFvJs9E81QLGckvr1NT6oTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:39:18.9020371+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_6a83e9c0-ffd6-4627-b0b3-a50948923563?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "86c8a7fd-9648-48f6-b313-d99e18def726" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "214ms", + "MS-CV" : "OD79Rf3L8kWoQvTAv/+B6A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XaSkYwAAAADrzN9wcC2KRYGb4Rj9eRoeTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"running\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:39:18.9020371+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/release_6a83e9c0-ffd6-4627-b0b3-a50948923563?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "a0c33cf3-d7c8-4a8d-b6fa-076498d891b0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "X-Processing-Time" : "408ms", + "MS-CV" : "qCl6h4xBTEC95BdZp+fHxw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0X6SkYwAAAABZWIczgI7pTaVrTdqc4MF3TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"operationType\":\"releasePhoneNumber\",\"status\":\"succeeded\",\"resourceLocation\":null,\"createdDateTime\":\"2022-12-22T18:39:18.9020371+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "6c009147-3ffa-41a3-b6d6-59652836559f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "release_6a83e9c0-ffd6-4627-b0b3-a50948923563", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:39:19 GMT", + "release-id" : "6a83e9c0-ffd6-4627-b0b3-a50948923563", + "Access-Control-Expose-Headers" : "Operation-Location,operation-id,release-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1794ms", + "MS-CV" : "HslKg8IRLU+hpvEOIkvTWQ.0", + "X-Azure-Ref" : "0VqSkYwAAAAANMnNoTp9vQpbyewLGWFFQTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/release_6a83e9c0-ffd6-4627-b0b3-a50948923563?api-version=2022-12-01" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginSearchAvailablePhoneNumbers[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginSearchAvailablePhoneNumbers[1].json new file mode 100644 index 000000000000..a1ab466f66bc --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginSearchAvailablePhoneNumbers[1].json @@ -0,0 +1,148 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "ebafe845-078c-439f-a745-28fc801b83e7", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "search_5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:39:31 GMT", + "Access-Control-Expose-Headers" : "Location,Operation-Location,operation-id,search-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "1349ms", + "MS-CV" : "J0rVNZdtNEi00HeLr4rs3A.0", + "search-id" : "5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3", + "X-Azure-Ref" : "0YqSkYwAAAAC7IAfdj+YjTotRUK1ZRWDdTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/search_5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01", + "Location" : "/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "300933a2-88bc-47d3-9050-989746febad5" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:39:31 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "455ms", + "MS-CV" : "6mab04cz9kyR5QP3FEOPvg.0", + "X-Azure-Ref" : "0Y6SkYwAAAABAfWQzUm8zT6RIGdgR05voTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"notStarted\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:39:31.1928561+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "f789d7b8-e8f8-45fc-a35e-e96a685d8d28" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:39:33 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "236ms", + "MS-CV" : "OrBMFVPcFEuxdNRXwR1m2g.0", + "X-Azure-Ref" : "0ZaSkYwAAAADFbcVYw9YvQKc+FMULAbfsTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"running\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:39:31.1928561+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e6089019-52df-4bf1-8f76-bc6270af99c1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:39:33 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "257ms", + "MS-CV" : "Yq4ejp0EyUGAjWj+QmcqBg.0", + "X-Azure-Ref" : "0ZqSkYwAAAADY2MiYmEdFSKSgH41ZOijWTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"notStarted\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:39:31.1928561+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/search_5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "1a7c620b-7057-45fb-93b0-af69f2b9c6d7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:39:35 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "270ms", + "MS-CV" : "NEqSBDhwtEK4lbRzrgNaxQ.0", + "X-Azure-Ref" : "0Z6SkYwAAAAD/4wjv6ha/TIiikuKG5+3gTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"search\",\"status\":\"succeeded\",\"resourceLocation\":\"/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:39:31.1928561+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/searchResults/5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "732d7226-4242-43be-815a-0f373031095b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "609ms", + "MS-CV" : "nAaDbd3NDESfUcknJv5hbA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aKSkYwAAAAC9K/60Az6fQp+TVdxQzVftTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"searchId\":\"5f9d2ac2-b84d-46dd-b182-5391b8ef5eb3\",\"phoneNumbers\":[\"+18442276950\"],\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"},\"searchExpiresBy\":\"2022-12-22T18:55:34.3864513+00:00\"}", + "Date" : "Thu, 22 Dec 2022 18:39:35 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesWithoutContext[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesWithoutContext[1].json new file mode 100644 index 000000000000..719488431547 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginUpdatePhoneNumberCapabilitiesWithoutContext[1].json @@ -0,0 +1,150 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_f7cf2d48-7de8-40ad-a519-826943ed17c3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "653db712-daa5-4860-ad9e-c15e5db74bfb" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:38:02 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "213ms", + "MS-CV" : "7HqGWUXpjU6eBTgXjHwvQw.0", + "X-Azure-Ref" : "0CqSkYwAAAAAvLe2/hEypQ7anw5SRkziSTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"running\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:38:02.293766+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_f7cf2d48-7de8-40ad-a519-826943ed17c3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "b68b8862-6413-468d-8a8f-30d988c63f23" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:38:04 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "418ms", + "MS-CV" : "AFWOmkDezkCkW3i8wbZwJQ.0", + "X-Azure-Ref" : "0DKSkYwAAAAAY3spjhLPtSJaOSVMOrFKbTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"running\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:38:02.293766+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_f7cf2d48-7de8-40ad-a519-826943ed17c3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "95f02c5b-8542-4e76-aa47-9873e89f473a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:38:05 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "210ms", + "MS-CV" : "OoMSxbEKVEqbA67HPHj4vA.0", + "X-Azure-Ref" : "0DaSkYwAAAAATGxAjIg/+RrNXWS89qW3FTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"running\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:38:02.293766+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_f7cf2d48-7de8-40ad-a519-826943ed17c3?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "2d8ccb45-4377-4456-8398-b052ba0e65fe" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:38:06 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "432ms", + "MS-CV" : "cBNo5ev4OU6FBvsEbwu5hQ.0", + "X-Azure-Ref" : "0D6SkYwAAAAA2Uv7RD/CfQ6RXtE1pUpVxTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"succeeded\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:38:02.293766+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "8c87c319-1c8d-40e5-8cfe-1e28583f0a03" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "910ms", + "MS-CV" : "QQowdx7qREuA+bqHXzTMjg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0B6SkYwAAAADi7+UrIgbrQajNwpZ71fWYTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:37:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED/capabilities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "15e8d005-4306-4264-bce4-06c72d0221b5", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "capabilities-id" : "f7cf2d48-7de8-40ad-a519-826943ed17c3", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "capabilities_f7cf2d48-7de8-40ad-a519-826943ed17c3", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:38:02 GMT", + "Access-Control-Expose-Headers" : "Operation-Location,Location,operation-id,capabilities-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "2307ms", + "MS-CV" : "xZ96pxMwNkym+Ya8EAZEww.0", + "X-Azure-Ref" : "0CKSkYwAAAAD+NRItfw4SS4U5B59y8LQGTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/capabilities_f7cf2d48-7de8-40ad-a519-826943ed17c3?api-version=2022-12-01", + "Body" : "{\"capabilitiesUpdateId\":\"f7cf2d48-7de8-40ad-a519-826943ed17c3\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginUpdatePhoneNumberCapabilities[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginUpdatePhoneNumberCapabilities[1].json new file mode 100644 index 000000000000..ded7db910242 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.beginUpdatePhoneNumberCapabilities[1].json @@ -0,0 +1,126 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_5cc373c2-8282-4caa-8320-9f641386fa0d?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "96e31082-80b7-4623-beea-ed340dd8fc6d" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:39:44 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "224ms", + "MS-CV" : "yA3ik3+L5U2YUG4FDmmaaw.0", + "X-Azure-Ref" : "0cKSkYwAAAAChzoRDSOCqQbLLmx+fcfpvTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"running\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:39:43.7163143+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_5cc373c2-8282-4caa-8320-9f641386fa0d?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "dac0cd9e-4e33-4e01-9046-7758d60711ca" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:39:44 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "194ms", + "MS-CV" : "PWCWBcb4REGIFvWCLcx5NQ.0", + "X-Azure-Ref" : "0caSkYwAAAAADC8iTIUeLS6+FBtJGFt1sTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"running\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:39:43.7163143+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/operations/capabilities_5cc373c2-8282-4caa-8320-9f641386fa0d?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4c1d6a13-dd3e-41d4-ad48-a9c77a3dd8e4" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-11-15-preview, 2022-12-01", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 22 Dec 2022 18:39:46 GMT", + "Access-Control-Expose-Headers" : "Location", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "212ms", + "MS-CV" : "pjUw2+a3QkGis+U4T7Tyjw.0", + "X-Azure-Ref" : "0cqSkYwAAAABkMoCzpa9lSIxCzk3u0BDKTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Body" : "{\"operationType\":\"updatePhoneNumberCapabilities\",\"status\":\"succeeded\",\"resourceLocation\":\"/phoneNumbers/+18332019939?api-version=2022-12-01\",\"createdDateTime\":\"2022-12-22T18:39:43.7163143+00:00\",\"id\":\"REDACTED\",\"lastActionDateTime\":\"0001-01-01T00:00:00+00:00\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "eac11858-3cde-4304-8dd4-098e8c22015b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "926ms", + "MS-CV" : "qo/q6wmg5UC+E6513ueILg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bqSkYwAAAAAh41ygf867R7/dMWqAINo8TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:39:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED/capabilities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "d7818717-29c9-4c95-9738-d17c6818657c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "capabilities-id" : "5cc373c2-8282-4caa-8320-9f641386fa0d", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "operation-id" : "capabilities_5cc373c2-8282-4caa-8320-9f641386fa0d", + "retry-after" : "0", + "StatusCode" : "202", + "Date" : "Thu, 22 Dec 2022 18:39:43 GMT", + "Access-Control-Expose-Headers" : "Operation-Location,Location,operation-id,capabilities-id", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "839ms", + "MS-CV" : "/dOji7BFPUef70CtXqOJPA.0", + "X-Azure-Ref" : "0b6SkYwAAAAAOOn/HC9vDR4j0hX/kkuMkTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "Operation-Location" : "/phoneNumbers/operations/capabilities_5cc373c2-8282-4caa-8320-9f641386fa0d?api-version=2022-12-01", + "Body" : "{\"capabilitiesUpdateId\":\"5cc373c2-8282-4caa-8320-9f641386fa0d\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "/phoneNumbers/+18332019939?api-version=2022-12-01" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getCountriesWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getCountriesWithAAD[1].json new file mode 100644 index 000000000000..7ea3f0ae22a8 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getCountriesWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "1b33df74-9b71-400d-a0da-bf2f37deb94a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "2793ms", + "MS-CV" : "GFqfU3CReE283tmlX/DTgw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0daSkYwAAAAAwLGiiMQjnQoHtjdnVyEghTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"countries\":[{\"localizedName\":\"Canada\",\"countryCode\":\"CA\"},{\"localizedName\":\"Denmark\",\"countryCode\":\"DK\"},{\"localizedName\":\"Ireland\",\"countryCode\":\"IE\"},{\"localizedName\":\"Italy\",\"countryCode\":\"IT\"},{\"localizedName\":\"Puerto Rico\",\"countryCode\":\"PR\"},{\"localizedName\":\"Sweden\",\"countryCode\":\"SE\"},{\"localizedName\":\"United Kingdom\",\"countryCode\":\"GB\"},{\"localizedName\":\"United States\",\"countryCode\":\"US\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:39:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getCountries[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getCountries[1].json new file mode 100644 index 000000000000..b945f70e4a5e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getCountries[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "6fedad49-447a-434c-8cdf-c01e20cc3b39" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "3715ms", + "MS-CV" : "FudZMzo6ZkihR1pDms885Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aqSkYwAAAADGhN6AGD//RK19fgQ9aeUSTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"countries\":[{\"localizedName\":\"Canada\",\"countryCode\":\"CA\"},{\"localizedName\":\"Denmark\",\"countryCode\":\"DK\"},{\"localizedName\":\"Ireland\",\"countryCode\":\"IE\"},{\"localizedName\":\"Italy\",\"countryCode\":\"IT\"},{\"localizedName\":\"Puerto Rico\",\"countryCode\":\"PR\"},{\"localizedName\":\"Sweden\",\"countryCode\":\"SE\"},{\"localizedName\":\"United Kingdom\",\"countryCode\":\"GB\"},{\"localizedName\":\"United States\",\"countryCode\":\"US\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:39:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getGeographicAreaCodesWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getGeographicAreaCodesWithAAD[1].json new file mode 100644 index 000000000000..e69f7b00a309 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getGeographicAreaCodesWithAAD[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e70b4f60-4dbf-46a7-a304-0a3a54981a7b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "649ms", + "MS-CV" : "MRmJ38N/vUisfrpzOQs09w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cqSkYwAAAABuWMzWA6TUR4efnnzQxQBVTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Montgomery\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Port St Lucie\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"St. Petersburg\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Tallahassee\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Iowa City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Boston\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Otsego\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Pontiac\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Thu, 22 Dec 2022 18:39:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/areaCodes?phoneNumberType=geographic&assignmentType=person&locality=Anchorage&administrativeDivision=AK&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "bfd6b859-48c0-4403-9b0a-042e855b1e85" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "1459ms", + "MS-CV" : "SloZRsrzwUqZ3kWB7UHvKg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0c6SkYwAAAABgmaw3/6oIQLYCcCxUAmyTTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"areaCodes\":[{\"areaCode\":\"907\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:39:49 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getGeographicAreaCodes[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getGeographicAreaCodes[1].json new file mode 100644 index 000000000000..84192252cf3a --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getGeographicAreaCodes[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "ab1137b9-c4c2-4543-bc05-6021cc4e6421" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "366ms", + "MS-CV" : "RJuJRkfi7UuBLvYl3tab5g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eKSkYwAAAAAT7f0CKO1VS6srq0FlGj9wTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Montgomery\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Port St Lucie\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"St. Petersburg\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Tallahassee\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Iowa City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Boston\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Otsego\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Pontiac\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Thu, 22 Dec 2022 18:39:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/areaCodes?phoneNumberType=geographic&assignmentType=person&locality=Anchorage&administrativeDivision=AK&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "a28ae072-2c85-4106-8770-03b60f0a6782" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "2175ms", + "MS-CV" : "PskFUIEsikOY+wNhxmUDpA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eKSkYwAAAACjL1yeztIVRLTpu9bGPCpSTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"areaCodes\":[{\"areaCode\":\"907\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:39:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAAD[1].json new file mode 100644 index 000000000000..ef512e39c456 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "76627276-fb16-4275-ad62-427a433fbc3b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "362ms", + "MS-CV" : "vbiVC71QW0eAPkvZOXclyg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0D6SkYwAAAABDzXhhM/qnSpa1kt8rFgANTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Montgomery\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Port St Lucie\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"St. Petersburg\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Tallahassee\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Iowa City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Boston\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Otsego\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Pontiac\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Thu, 22 Dec 2022 18:38:07 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAdministrativeDivisionWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAdministrativeDivisionWithAAD[1].json new file mode 100644 index 000000000000..35d71c727ae1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAdministrativeDivisionWithAAD[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "e374af3f-0a54-472d-be96-237da4b40186" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "355ms", + "MS-CV" : "R1p1dbGel0WEkYR+IPpP/Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0csC9YwAAAADdPb4jk9VzSK+TIa6C/qewTUVYMzFFREdFMDQyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Wilmington\",\"administrativeDivision\":{\"localizedName\":\"DE\",\"abbreviatedName\":\"DE\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lynn\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Bloomington\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Duluth\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Mankato\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Minneapolis\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Plymouth\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"St. Paul\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Tue, 10 Jan 2023 19:45:53 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?administrativeDivision=AK&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "43ef920d-f2a5-42c0-8ba2-37f3c55c7f48" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "616ms", + "MS-CV" : "55M26Nx/GkSadnYXOUoQcg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0c8C9YwAAAABMcxHclezqR4XOSl4EwL5NTUVYMzFFREdFMDMxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}}],\"nextLink\":null}", + "Date" : "Tue, 10 Jan 2023 19:45:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAdministrativeDivision[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAdministrativeDivision[1].json new file mode 100644 index 000000000000..acc7c4b6be4d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalitiesWithAdministrativeDivision[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "32fad2ef-928c-432f-88b6-59adf12c2112" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "317ms", + "MS-CV" : "Llx5sjt3vUGeFPZ+WM7LSA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0c8C9YwAAAADVQ1HJ8xcuS7O/VWAcPV1LTUVYMzFFREdFMDQyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Wilmington\",\"administrativeDivision\":{\"localizedName\":\"DE\",\"abbreviatedName\":\"DE\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lynn\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Bloomington\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Duluth\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Mankato\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Minneapolis\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"Plymouth\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}},{\"localizedName\":\"St. Paul\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Tue, 10 Jan 2023 19:45:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?administrativeDivision=AK&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "ae986510-4538-43f1-9dfe-02a187bf2310" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "594ms", + "MS-CV" : "K1A4/JRN7EiwbuTw1hUzTw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dMC9YwAAAAB4RqE3aA2AQq/Zno8WkQNQTUVYMzFFREdFMDMxMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}}],\"nextLink\":null}", + "Date" : "Tue, 10 Jan 2023 19:45:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalities[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalities[1].json new file mode 100644 index 000000000000..f74769ad3d2b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getLocalities[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "939c7d90-6eea-459b-9bf2-d7eba6976196" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2022-12-01", + "X-Processing-Time" : "655ms", + "MS-CV" : "FArPVmwmvkyHvLAURsr+2g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YaSkYwAAAAAF3RjlwxzmRI34roJLKcb5TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberLocalities\":[{\"localizedName\":\"Anchorage\",\"administrativeDivision\":{\"localizedName\":\"AK\",\"abbreviatedName\":\"AK\"}},{\"localizedName\":\"Birmingham\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Huntsville\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Mobile\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Montgomery\",\"administrativeDivision\":{\"localizedName\":\"AL\",\"abbreviatedName\":\"AL\"}},{\"localizedName\":\"Fort Smith\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Jonesboro\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Little Rock\",\"administrativeDivision\":{\"localizedName\":\"AR\",\"abbreviatedName\":\"AR\"}},{\"localizedName\":\"Phoenix\",\"administrativeDivision\":{\"localizedName\":\"AZ\",\"abbreviatedName\":\"AZ\"}},{\"localizedName\":\"Anaheim\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Burbank\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Concord\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Fresno\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Irvine\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Los Angeles\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Riverside\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Sacramento\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Salinas\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Diego\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Francisco\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"San Jose\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Clarita\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Santa Rosa\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Stockton\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Truckee\",\"administrativeDivision\":{\"localizedName\":\"CA\",\"abbreviatedName\":\"CA\"}},{\"localizedName\":\"Washington DC\",\"administrativeDivision\":{\"localizedName\":\"CL\",\"abbreviatedName\":\"CL\"}},{\"localizedName\":\"Grand Junction\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Pueblo\",\"administrativeDivision\":{\"localizedName\":\"CO\",\"abbreviatedName\":\"CO\"}},{\"localizedName\":\"Bridgeport\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Hartford\",\"administrativeDivision\":{\"localizedName\":\"CT\",\"abbreviatedName\":\"CT\"}},{\"localizedName\":\"Cape Coral\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Daytona Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Fort Lauderdale\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Gainesville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Jacksonville\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Lakeland\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Miami\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Orlando\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Port St Lucie\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Sarasota\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"St. Petersburg\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Tallahassee\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"West Palm Beach\",\"administrativeDivision\":{\"localizedName\":\"FL\",\"abbreviatedName\":\"FL\"}},{\"localizedName\":\"Albany\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Atlanta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Augusta\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Macon\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Savannah\",\"administrativeDivision\":{\"localizedName\":\"GA\",\"abbreviatedName\":\"GA\"}},{\"localizedName\":\"Honolulu\",\"administrativeDivision\":{\"localizedName\":\"HI\",\"abbreviatedName\":\"HI\"}},{\"localizedName\":\"Cedar Rapids\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Davenport\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Iowa City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Mason City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Sioux City\",\"administrativeDivision\":{\"localizedName\":\"IA\",\"abbreviatedName\":\"IA\"}},{\"localizedName\":\"Boise\",\"administrativeDivision\":{\"localizedName\":\"ID\",\"abbreviatedName\":\"ID\"}},{\"localizedName\":\"Alton\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Aurora\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Champaign\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Chicago\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Cicero\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rock Island\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Rockford\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Waukegan\",\"administrativeDivision\":{\"localizedName\":\"IL\",\"abbreviatedName\":\"IL\"}},{\"localizedName\":\"Evansville\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Fort Wayne\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Gary\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Indianapolis\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"South Bend\",\"administrativeDivision\":{\"localizedName\":\"IN\",\"abbreviatedName\":\"IN\"}},{\"localizedName\":\"Dodge City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Kansas City\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Topeka\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Wichita\",\"administrativeDivision\":{\"localizedName\":\"KS\",\"abbreviatedName\":\"KS\"}},{\"localizedName\":\"Ashland\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Lexington\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Louisville\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Owensboro\",\"administrativeDivision\":{\"localizedName\":\"KY\",\"abbreviatedName\":\"KY\"}},{\"localizedName\":\"Baton Rouge\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Lafayette\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"New Orleans\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Shreveport\",\"administrativeDivision\":{\"localizedName\":\"LA\",\"abbreviatedName\":\"LA\"}},{\"localizedName\":\"Boston\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Chicopee\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Lowell\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Worcester\",\"administrativeDivision\":{\"localizedName\":\"MA\",\"abbreviatedName\":\"MA\"}},{\"localizedName\":\"Baltimore\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Bethesda\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Silver Spring\",\"administrativeDivision\":{\"localizedName\":\"MD\",\"abbreviatedName\":\"MD\"}},{\"localizedName\":\"Portland\",\"administrativeDivision\":{\"localizedName\":\"ME\",\"abbreviatedName\":\"ME\"}},{\"localizedName\":\"Ann Arbor\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Detroit\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Flint\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grand Rapids\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Grant\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Lansing\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Otsego\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Pontiac\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Saginaw\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Sault Ste Marie\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Troy\",\"administrativeDivision\":{\"localizedName\":\"MI\",\"abbreviatedName\":\"MI\"}},{\"localizedName\":\"Alexandria\",\"administrativeDivision\":{\"localizedName\":\"MN\",\"abbreviatedName\":\"MN\"}}],\"nextLink\":\"/availablePhoneNumbers/countries/US/localities?api-version=2022-12-01&skip=100&maxPageSize=100\"}", + "Date" : "Thu, 22 Dec 2022 18:39:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getOfferingsWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getOfferingsWithAAD[1].json new file mode 100644 index 000000000000..c4e8cb8a2216 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getOfferingsWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/offerings?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "ea11e59a-d3c6-4256-8ff4-6008d069add5" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "1966ms", + "MS-CV" : "o7B4ejlInE2efZVxGRPVfg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EKSkYwAAAACPaPRkBfnNTqDQYrQLPNBFTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberOfferings\":[{\"phoneNumberType\":\"geographic\",\"assignmentType\":\"person\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"phoneNumberType\":\"geographic\",\"assignmentType\":\"application\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:38:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getOfferings[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getOfferings[1].json new file mode 100644 index 000000000000..179a3e95e222 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getOfferings[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/offerings?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "459579de-74e2-46e0-bf05-b47fbad77da0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "1014ms", + "MS-CV" : "q+myZu0Zb0a+R65rBdiZ4g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eqSkYwAAAAC7+j5gs5hsTpi3tZZIfVG6TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumberOfferings\":[{\"phoneNumberType\":\"geographic\",\"assignmentType\":\"person\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"phoneNumberType\":\"geographic\",\"assignmentType\":\"application\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"phoneNumberType\":\"tollFree\",\"assignmentType\":\"application\",\"availableCapabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:39:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumberWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumberWithAAD[1].json new file mode 100644 index 000000000000..d75a6a87e4b5 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumberWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "f4ebd1fc-eac1-44db-b2ca-040f68e4ea1e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1809ms", + "MS-CV" : "RWPlFL4EhkqGHn09VaMaMA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/6OkYwAAAADMncIn45LuQpy+WvlGLMBmTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:37:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumberWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumberWithResponse[1].json new file mode 100644 index 000000000000..41d137f016df --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumberWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "eae1cda9-e939-4b44-8d6c-f1f0fd13c3d0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "954ms", + "MS-CV" : "DLBZNLu5wEOIGNe0M8sxpw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EqSkYwAAAABu7JtySlF+T6Fc8vDEislhTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:38:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumber[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumber[1].json new file mode 100644 index 000000000000..f099f1ac87e4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getPurchasedPhoneNumber[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers/+REDACTED?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "9796f7e2-3df1-4ab0-825e-e626f0989889" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1669ms", + "MS-CV" : "7B3+Qxv7mEyuiuASncZVTw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NKSkYwAAAAB7zmmBtr9OTa84DLTb3tz4TUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}", + "Date" : "Thu, 22 Dec 2022 18:38:45 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getTollFreeAreaCodesWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getTollFreeAreaCodesWithAAD[1].json new file mode 100644 index 000000000000..2f55d4cc7b7f --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getTollFreeAreaCodesWithAAD[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/areaCodes?phoneNumberType=tollFree&assignmentType=application&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "c706cede-afd2-4b2e-9510-47e3741a8db8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "5781ms", + "MS-CV" : "vt4zD12KF0iaxU2eWipanw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0AaSkYwAAAAAyEY1cFQ3eRqF/8vGtgxMBTUVYMzFFREdFMDMyMgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"areaCodes\":[{\"areaCode\":\"888\"},{\"areaCode\":\"877\"},{\"areaCode\":\"866\"},{\"areaCode\":\"855\"},{\"areaCode\":\"844\"},{\"areaCode\":\"800\"},{\"areaCode\":\"833\"},{\"areaCode\":\"88\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:37:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getTollFreeAreaCodes[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getTollFreeAreaCodes[1].json new file mode 100644 index 000000000000..47c227c95bcc --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.getTollFreeAreaCodes[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/availablePhoneNumbers/countries/US/areaCodes?phoneNumberType=tollFree&assignmentType=application&api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "db0939de-ec60-4dbb-96e4-435fb7e7bc1c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-12-01", + "X-Processing-Time" : "2881ms", + "MS-CV" : "kXhgiK9rlU+6dGJOEfJ8MA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MaSkYwAAAACABorCic+kQboMOEXc3T8RTUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"areaCodes\":[{\"areaCode\":\"888\"},{\"areaCode\":\"877\"},{\"areaCode\":\"866\"},{\"areaCode\":\"855\"},{\"areaCode\":\"844\"},{\"areaCode\":\"800\"},{\"areaCode\":\"833\"},{\"areaCode\":\"88\"}],\"nextLink\":null}", + "Date" : "Thu, 22 Dec 2022 18:38:43 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.listPurchasedPhoneNumbersWithoutContext[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.listPurchasedPhoneNumbersWithoutContext[1].json new file mode 100644 index 000000000000..f53a5320dfe4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.listPurchasedPhoneNumbersWithoutContext[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "8e4af56a-5696-490a-87ab-1f20841e5e30" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1421ms", + "MS-CV" : "w31owkHe+UKi+Pr6D1gBYA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aKSkYwAAAAB84dAIQYarQK7kTZBiNox6TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumbers\":[{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T15:18:14.7689633+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:36:43.2477114+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:36:13.5514009+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:09:18.7391177+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:11:43.8093725+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:09:44.856727+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:10:43.0470316+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:11:13.2871013+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:43.3598754+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:14.2925013+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:17.7642032+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:37:57.7589612+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:38:01.2490062+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:38:10.7033129+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T15:41:42.6103267+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:30:51.9182995+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:30:17.6614122+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:47.0550566+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:32:08.7055072+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:32:20.4489554+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:27.7725472+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:28:06.2941982+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:27:58.4564095+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:35:55.6362141+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:35:38.2751041+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:12.122407+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:52.6849802+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:21.3246132+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:52.844006+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:26.0949019+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:16.7736485+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:07.5114194+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:24.9591048+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:31.4083206+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:24.2533723+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:16.2862265+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:37.7662022+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:46.6018872+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:50.4679082+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:44.6881974+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:55.8644165+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:55.9240487+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:20.5570756+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:22.1720088+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:41.0997634+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:44.9865457+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:11:13.6760492+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:13:14.7544127+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:51.5548845+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:22:13.6608168+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:23:13.802374+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:56.1826813+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:23:43.4526026+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:24:12.4592203+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:17.7235497+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:32:43.9547602+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:10.859962+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:30.851053+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"none\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2022-01-11T22:26:05.2198645+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"none\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2022-01-11T17:06:02.0097082+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:08:43.2976318+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:09:13.3731647+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:33:13.7739402+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:25:13.6206509+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:25:44.3664664+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:29:43.2087273+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:37:14.4369365+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:27:13.4604535+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:27:47.6058406+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:26:43.3088723+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:42:44.4416133+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:28:13.2155644+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:41:58.7312966+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:39:14.5759855+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:40:28.2331315+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:28:43.2865444+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:43:44.3267753+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:43:14.5582972+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:30:42.3622994+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:35:58.515204+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:30:13.3981412+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:36:12.1300788+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:36:43.3727213+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:31:43.1246125+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:58.3886965+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:44:13.795794+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:33:42.3770211+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:34:13.0593291+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:44:43.2825566+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:43.3853897+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:13.8368509+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:48:14.4930555+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:47:29.3763702+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:37:12.9376761+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:37:43.0423694+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T03:18:13.4190469+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T01:01:13.3943797+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T01:02:13.0024309+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T03:18:42.3038608+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}],\"nextLink\":\"/phoneNumbers?api-version=2022-12-01&skip=100&top=100\"}", + "Date" : "Thu, 22 Dec 2022 18:39:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.listPurchasedPhoneNumbers[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.listPurchasedPhoneNumbers[1].json new file mode 100644 index 000000000000..7c7309af832b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/PhoneNumbersClientIntegrationTest.listPurchasedPhoneNumbers[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/phoneNumbers?api-version=2022-12-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.13 (17.0.5; Windows 11; 10.0)", + "x-ms-client-request-id" : "4234c8e5-fd49-4fe1-8423-2d670f43de08" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-03-07, 2022-01-11-preview2, 2022-06-01-preview, 2022-12-01", + "X-Processing-Time" : "1568ms", + "MS-CV" : "MEVfGidF2UuKEBOfTuFkuw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NqSkYwAAAADiTH1sDXIQT4MnZkA1H8n9TUVYMzFFREdFMDMxMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"phoneNumbers\":[{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T15:18:14.7689633+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:36:43.2477114+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:36:13.5514009+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:09:18.7391177+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:11:43.8093725+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:09:44.856727+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:10:43.0470316+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T05:11:13.2871013+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:43.3598754+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:14.2925013+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:35:17.7642032+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:37:57.7589612+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:38:01.2490062+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"person\",\"purchaseDate\":\"2021-06-24T06:38:10.7033129+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"geographic\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"none\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T15:41:42.6103267+00:00\",\"cost\":{\"amount\":1.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:30:51.9182995+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:30:17.6614122+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:47.0550566+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:32:08.7055072+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:32:20.4489554+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:24.7610118+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:31:27.7725472+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:28:06.2941982+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:27:58.4564095+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:35:55.6362141+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:35:38.2751041+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:12.122407+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:52.6849802+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:21.3246132+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:52.844006+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:26.0949019+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:16.7736485+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:07.5114194+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:24.9591048+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:31.4083206+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:24.2533723+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:16.2862265+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:37.7662022+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:46.6018872+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:50.4679082+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:44.6881974+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:37:55.8644165+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:39:55.9240487+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:20.5570756+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:22.1720088+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"outbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:41.0997634+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:44.9865457+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:11:13.6760492+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:13:14.7544127+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:38:51.5548845+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:22:13.6608168+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:23:13.802374+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:40:56.1826813+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:23:43.4526026+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:24:12.4592203+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:17.7235497+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:32:43.9547602+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:10.859962+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-23T23:41:30.851053+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"none\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2022-01-11T22:26:05.2198645+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"none\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2022-01-11T17:06:02.0097082+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:08:43.2976318+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound\",\"sms\":\"outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:09:13.3731647+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:33:13.7739402+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:25:13.6206509+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:25:44.3664664+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:29:43.2087273+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:37:14.4369365+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:27:13.4604535+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:27:47.6058406+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:26:43.3088723+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:42:44.4416133+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:28:13.2155644+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:41:58.7312966+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:39:14.5759855+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:40:28.2331315+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:28:43.2865444+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:43:44.3267753+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:43:14.5582972+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:30:42.3622994+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:35:58.515204+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:30:13.3981412+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:36:12.1300788+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:36:43.3727213+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:31:43.1246125+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:58.3886965+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:44:13.795794+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:33:42.3770211+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:34:13.0593291+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:44:43.2825566+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:43.3853897+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:45:13.8368509+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:48:14.4930555+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T02:47:29.3763702+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:37:12.9376761+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T00:37:43.0423694+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T03:18:13.4190469+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T01:01:13.3943797+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T01:02:13.0024309+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}},{\"id\":\"REDACTED\",\"phoneNumber\":\"+REDACTED\",\"countryCode\":\"US\",\"phoneNumberType\":\"tollFree\",\"capabilities\":{\"calling\":\"inbound+outbound\",\"sms\":\"inbound+outbound\"},\"assignmentType\":\"application\",\"purchaseDate\":\"2021-06-24T03:18:42.3038608+00:00\",\"cost\":{\"amount\":2.0,\"currencyCode\":\"USD\",\"billingFrequency\":\"monthly\"}}],\"nextLink\":\"/phoneNumbers?api-version=2022-12-01&skip=100&top=100\"}", + "Date" : "Thu, 22 Dec 2022 18:38:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExistingWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExistingWithAAD[1].json new file mode 100644 index 000000000000..d50b52e62394 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExistingWithAAD[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a8738c77-99b6-4ac6-bc13-cc06f9622f49", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1094ms", + "MS-CV" : "RGd54v61Hku8uuytk2KVTg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MpsIZAAAAABrHDuwcSZHTKDD7ytO6RMmUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "623", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7da2a9f2-3da5-427c-9fb3-35fd378e676c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "E648LgXuJkC5zhVZppfEqQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0M5sIZAAAAADZ/V2HxOSfS5bQrQXyaavIUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "623", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "cce69cfa-967a-418e-825c-76dd89c72678" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "agX8LkwZlkiZcp5rlWYLCQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NJsIZAAAAACXKFP/aV/GQp/SpeonX0EkUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "623", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:00 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8c4a6af9-ba28-4b0e-ba7b-66bcd2530eda", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "366ms", + "MS-CV" : "hScnmvGd0kS1QeHbi3nd/Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NJsIZAAAAACu2xaUCz6bS5LMfCGHksxDUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:00 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3be8b9a0-acc1-4fab-bb98-e8f976637c1c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "191ms", + "MS-CV" : "K2KY39MG002lC47CwTsg0g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NZsIZAAAAACMn3w4cHV0SoRF4SYGm8F6UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:00 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExistingWithResponse[1].json new file mode 100644 index 000000000000..bc9ffbc45a44 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExistingWithResponse[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9a0c79e7-7776-4846-86b5-9d8c1aacec0a", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1025ms", + "MS-CV" : "R0uC47a2Y0Gpa/IFTNmeFw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dJsIZAAAAADVcUKwaYSQQ70oWQFxB8YUUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "494", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:04 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b3b7cf44-0e4f-4418-99a2-f39f7c631e8c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "cP/ocwH3A0yQb9yIQ/iB7Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dZsIZAAAAAAuZ1MBYy99QZUVEaqAacYkUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "494", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "cb0420b9-0f98-423e-818e-5f0208ef8579" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "zrxJ2xGNl0aooNaxUACq0g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dZsIZAAAAADsKZI9AWEXS5ESRXKoKY0DUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "494", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b95c1290-fdb9-4d84-af5d-8da93b94e7ab", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "370ms", + "MS-CV" : "FYaF+CltC0yun24wWO5jbA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dpsIZAAAAADRez/ftmWWRY/dIPU/cGBqUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:06 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9f294b4d-2eeb-4c24-bb4d-7887a75784f9" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "9zglX4cf6E2YW221ALAydg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dpsIZAAAAABmAUAxr1HoS7nScOqTQrZbUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:06 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExisting[1].json new file mode 100644 index 000000000000..956d45ed43d7 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkExisting[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "caf37a1b-b6fd-41a5-8ba7-b2a3fac30716", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1113ms", + "MS-CV" : "ZtdOmiqTi0WM3B/lohZr9g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JZsIZAAAAADGdq/j9ghiSJAs1rhwR4ytUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "340", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3cd5213c-5233-47c2-bee5-e3a3191f1a50" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "201ms", + "MS-CV" : "4RwiWPdsZEa3oG3fcDzb6g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JpsIZAAAAACgq9jEEcNpTaSjUz1DzXV6UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "340", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6a9bc988-3387-439f-91f1-55b3fb9ec811" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "pXbjk0dhEUqaY6N2OCzckg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0J5sIZAAAAAD/bZktObqET45QugDhQEHkUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "340", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c047c67b-d973-47bc-9b65-ea69316b6ea2", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "369ms", + "MS-CV" : "gwDvrRGoF0+9uUIBPTW1YQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0J5sIZAAAAABEYLtnhDY1RKdMNqMoj8cGUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6ace5cef-9b52-4610-937a-9a4b9ec5c089" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "189ms", + "MS-CV" : "DHrMWIX6MEqpfbhFTZ+u7g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0J5sIZAAAAADYDediy0XGQbTFQQscwNx+UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkNotExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkNotExistingWithResponse[1].json new file mode 100644 index 000000000000..2742f192b2f4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkNotExistingWithResponse[1].json @@ -0,0 +1,137 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "787539c5-73bf-4d27-a372-eee34a737436" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "5tcfb5Qi702ne2ogRM5sZQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XJsIZAAAAAAyFs/mN065R6yOrujIEQiiUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9f4893df-781b-430f-beca-02dafe6a6d13", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "362ms", + "MS-CV" : "7xlaIX1x9UWokl22FgeviA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XJsIZAAAAADEppBYr5tUSLY46YdKnDGWUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c12248cb-3230-4961-91df-eab061a51fe9" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "V2lQuSZyLUa3V41eh6BHzQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XZsIZAAAAAB2zFRL4ZtISqUfpoIQNncFUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0e5c707b-6e35-4b43-a71f-25062ab854ff" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "U/IqVsFZREOjs0IwGIFZ+Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XZsIZAAAAADvan7qPN3wTox+SnQop7Q1UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2790eefa-de19-4bb0-a43c-e8e8df2cd5ff" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "190ms", + "MS-CV" : "shtNmOpinEKZ3SOAWu9M8w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XZsIZAAAAAB8aWa7bbBJTLfE1p9uJHQfUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b09697b3-ed6a-4e78-8216-8ae760c5d20f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "x1juS1ZOMUypr89OC0xHng.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XpsIZAAAAABQdgDNwd/xSLreJT7S8gFnUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkNotExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkNotExisting[1].json new file mode 100644 index 000000000000..ac5337053f73 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.deleteTrunkNotExisting[1].json @@ -0,0 +1,114 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3405d10e-4d64-41ef-a090-e4fe1abcccda" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "rBfFq58yNE+FzRq4O68CUA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UJsIZAAAAAALGlMEIsGNQZqmnFlHNZToUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:28 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "85886cef-f05d-4dad-a286-2d906d8f3101" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "HK0IrBiLRUayOPRa1Cs5oA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UZsIZAAAAACiWbyEax34SZMCASrOqpUfUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:28 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ed3ec476-ebd0-4e08-81f3-7caeedc9d472" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "DgAV8Ax+lUyLcN2zwrbNCg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UZsIZAAAAACZiUaxnia7RrApbz7t6rbLUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "475263fc-37b4-4232-9768-11b47c9a5ebf" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "3tH7F0W5BU+E4+Dpgyr+UQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UZsIZAAAAACf4mTyUyKXQrSc2WgBmbZXUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "009a5296-e374-4ba0-890f-bc309e214184" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "cCjAEhhg+EqryOZqeEJOCg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UpsIZAAAAADlAux9FAiNT5Z134H2SyPOUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExistingWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExistingWithAAD[1].json new file mode 100644 index 000000000000..009195240917 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExistingWithAAD[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e4300a3b-27e5-4a32-83f7-81960de060c4", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "395ms", + "MS-CV" : "UIEqT/vTXkiRpiQXglfmDQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VJsIZAAAAAD4AuUofISBQb/CdYe3rW97UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2e3609bf-f265-4c88-a3c1-d22510df2207" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1002ms", + "MS-CV" : "YISPgObrj0WGNNZ0A04fcw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VJsIZAAAAAA4XnyhaOC8Qr0EB7rFtxrEUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExistingWithResponse[1].json new file mode 100644 index 000000000000..0f8159ea3bad --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExistingWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "44d66622-9fb8-436b-8008-0e98ecf2db09", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "947ms", + "MS-CV" : "T11pjjjNokq/CSPo3M5ZJw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UpsIZAAAAAAeZjlTOPivRZDwHYTMw43oUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1aeab127-8659-47e4-8a77-8e0bd9eb9269" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "utNiDixU/0uggA9Zgp+bhg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0U5sIZAAAAADyGuJbQqxpSZ4O4JdpKagJUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExisting[1].json new file mode 100644 index 000000000000..c428381d715d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkExisting[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f05ba7ad-9b49-4738-8bff-d32e9eb36941", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "388ms", + "MS-CV" : "rqRLJFu3rkOrEwhkxWLnnw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GJsIZAAAAABPFHbvHjmKT57JJwfCzoNSUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "42b9bf05-dd3e-4cd5-8df9-d48d024908e4" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "8fOS7hHAakWCXUvS4KjUgw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GZsIZAAAAAAWWJpLBttXQKtypA0S4Zj3UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkNotExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkNotExistingWithResponse[1].json new file mode 100644 index 000000000000..cfa47a144437 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkNotExistingWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8e2754d8-f440-41c7-ab9e-52924214a5ee" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "BLC7JBCQGU6BOU3e2egC7A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IJsIZAAAAABfnRsNvUUzSaUel2siPV+XUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkNotExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkNotExisting[1].json new file mode 100644 index 000000000000..3f0366b3169f --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.getTrunkNotExisting[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8051c8ad-4078-4177-8cc5-ad19e8f8b1e5" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "DgDBRl3z/0K67les3Zb5rw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HZsIZAAAAADOrofsmP9UTJQv2iOrRfkKUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesEmptyWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesEmptyWithResponse[1].json new file mode 100644 index 000000000000..aef9bc6b4618 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesEmptyWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4184ab19-4c3b-4b27-8d41-e9f8614a6b9e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "585ms", + "MS-CV" : "L9HBfNt0IUmg0UoNh/+bqQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0d5sIZAAAAABViSzxsVQTQrxgL2Ktwfy9UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:07 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a31e0001-f5d3-4091-bd9e-5922580c0bb3" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "cpBWHTn+ak6ldDP9paD31g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eJsIZAAAAAB3bwg7hQIMQLq2Db1s7pSdUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:08 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesEmpty[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesEmpty[1].json new file mode 100644 index 000000000000..a47f59f12a95 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesEmpty[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c4f5979a-37cd-4977-aef3-b064da3ab4f0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "287ms", + "MS-CV" : "XxDPnkX8AUyeYnWk56vrPw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VpsIZAAAAAC5d4elFF12TJMqBQuDvYFUUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "46905b9b-ba3d-4ab8-8541-d800bbee4563" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "WXEZhMT9f0SSTe9MQ+VoTw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0V5sIZAAAAACqdJ5DHjE2T6f+fsDogCqBUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmptyWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmptyWithAAD[1].json new file mode 100644 index 000000000000..aae5defff300 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmptyWithAAD[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "bf347515-50bf-4625-8343-3b4692f4e824", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "290ms", + "MS-CV" : "yFWOtW1EnE6hKwJYBN/tNw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0H5sIZAAAAAA1EgnBQBQVTKqeSK7ruedKUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:39 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "81cd789e-25ab-402a-8f1d-994bcd8bddd6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "294ms", + "MS-CV" : "AloTGEBQAk+dliWijNF7Lg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IJsIZAAAAABqx6/8UiXIQpwfP8ykZBb2UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmptyWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmptyWithResponse[1].json new file mode 100644 index 000000000000..387cda0551af --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmptyWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9788e052-a841-4f7d-a2da-63a5734609c6", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "291ms", + "MS-CV" : "t6j8rANQ9kWvOYfF2iGx6A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZZsIZAAAAAC1rPdigweyS5dl4lFguodXUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:49 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "26fdb03e-3a7c-4671-904a-f47a20a04419" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "nN+wsQELnU+CKH4l3MZrig.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZpsIZAAAAABujqeYs01UQKSXb6FLoxcAUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:49 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmpty[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmpty[1].json new file mode 100644 index 000000000000..cd56ea252df5 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listRoutesNotEmpty[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "504a4f78-00f4-4abe-8689-f80852af3d0b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "298ms", + "MS-CV" : "n+u6I91bvEq3TYXB2KCnyQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0R5sIZAAAAAALfogwidtxSJzAz9I2XrYzUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4c38a275-8711-4f50-9361-86dcdf1ddef0" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "221ms", + "MS-CV" : "2FUoQDc8ekyM8oL3n1xsiw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SJsIZAAAAAA85G6pkfS5S5iR80VjL7BAUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:20 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksEmptyWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksEmptyWithResponse[1].json new file mode 100644 index 000000000000..91e1bb9310f4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksEmptyWithResponse[1].json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a2417bad-ecc6-46e3-8cb0-bf1d16594bda" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "KyvF3vOGLUu33cH/CoGYwA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OpsIZAAAAACLREhq7Lb/SYbmCAW3TTzBUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:06 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "71c70320-c7e4-424f-a7e3-15d2253e586b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "362ms", + "MS-CV" : "IolRIbLPrkioTv8Myeh0tQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OpsIZAAAAAAVlMGY9dz9Tpp6ax6o8nwoUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:06 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "bdaa180c-fe1e-4aa9-94ac-df771fed4320" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "vS+qxWgQ5k6364BaZfpksQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0O5sIZAAAAAA+3l0zJ050RquiQ7bb9f9kUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:07 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksEmpty[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksEmpty[1].json new file mode 100644 index 000000000000..6b27d7b9c81a --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksEmpty[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5f4ff8f7-a0a7-4791-85bc-44788ecdd910" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "195ms", + "MS-CV" : "RrCmCflK+0qt3ud/xXjFSQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QpsIZAAAAABdYmdr1JhkRougpyauxQskUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:14 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0a5da456-b36f-4a6b-9079-9b2a30ca2407" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "1IZo2PS8oE+ZSyKyh1npkg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Q5sIZAAAAAAVievlvPxCSbG8So8Llm07UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmptyWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmptyWithAAD[1].json new file mode 100644 index 000000000000..52f9ee524946 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmptyWithAAD[1].json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "21c7d5e0-e0a1-4471-8a1b-f9d7063658ca" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "213ms", + "MS-CV" : "S7ntAkEeoE+YFao+BBwyNA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IZsIZAAAAACUn6WHk+fCS6WYVKyDreKkUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4eb0ae73-87d8-40ce-b074-fcab70e469b2", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "472ms", + "MS-CV" : "mF+ItIk8sEeaoBz7XZuoqw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IZsIZAAAAABcA3AllEw3R6Pfr9eOW8W8UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5cb73004-236d-40c9-a9ea-e08fc68e5706" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "1G3ZBtCtuEOV2BwJfZFZ+g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IpsIZAAAAABXHsgABvPyRoZOoiXAIUwsUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmptyWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmptyWithResponse[1].json new file mode 100644 index 000000000000..e4e21e9d8d2b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmptyWithResponse[1].json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "173b50c9-f0fb-4bd6-afe2-4a9978833e7f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "184ms", + "MS-CV" : "GrdH+gv6hEmrh9ZjBmxwxg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YpsIZAAAAAC0hJYRSaOpR4nkn6x/vVF1UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":7651},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:45 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "aec7929c-f3c1-49d7-bc42-4e005e7934a8", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "467ms", + "MS-CV" : "m8/xeQyzsEic1Kwx4V1FPw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YpsIZAAAAAAaKwhpaxGrRIWBX7HVoEpQUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "afc2e527-1428-4ec5-88c8-3be4903029a8" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "m3684ApADEmw0bcD/wg32w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Y5sIZAAAAACOnNmHIwRBQZMx8dTpn561UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmpty[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmpty[1].json new file mode 100644 index 000000000000..f0e2ba877852 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.listTrunksNotEmpty[1].json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e2ab549b-c888-4323-a96e-d7d36ccae052" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "Hy48YWl5zEioJqk4b71KXg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0K5sIZAAAAABuANE9Qi1vQ6VQ/ZsoxPZQUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:51 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "26269544-fc92-4f79-b1bb-b6830defb638", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1195ms", + "MS-CV" : "ugsGLWcBF06xHJ92rpszvg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0K5sIZAAAAACvBxgB2H3WRJWKIy+55NqsUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5ad450dd-98c5-485e-a52a-5086e7f4ecef" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "179ms", + "MS-CV" : "7Vrzbh/fGEWVnkI6oo26Gw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LJsIZAAAAADGYUKrHWtzR57TttVVBPGVUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..e2be2e1711c6 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesEmptyBeforeWithResponse[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4c911687-3245-4f52-bc1c-2f45d7b01565", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "328ms", + "MS-CV" : "BfFLWjsqH0Kmdh6iN4jiOg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0V5sIZAAAAABx0P6sJv3ZSJjLZwH8MfJWUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:35 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a6a6d700-b922-4946-b22b-83f234b3399c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "Sp7V4DJfQkevSXuUQqrSuQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0V5sIZAAAAADHl5FLY2TxRpBKQY7FaZKdUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:35 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b7b04b9e-e0d7-407e-ad2c-f3ec0f1e8448", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "289ms", + "MS-CV" : "w43SSGOs0UWLd8cDwHCdAw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WJsIZAAAAAAtwPRO30T2SLeRB1Oy8XHvUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:36 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0f74ce34-0676-4da3-85ad-a82c0a432e47" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "4Jd2IcbWr06wGYFyZD7QVA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WJsIZAAAAACV46ovGXKpT6xgtd3/IR3qUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:36 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesEmptyBefore[1].json new file mode 100644 index 000000000000..70f86a9e9637 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesEmptyBefore[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e028bab9-5e10-4da1-83d3-e215bc481812", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "292ms", + "MS-CV" : "hlgJR0Zre0mkyxEntLCWMg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DpsIZAAAAAATRfUqqYV6T5kKLeOkxxdBUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "700df372-bf46-4276-b6d9-c5d1497fe2ea" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "LO6509wVKkyMnDwHNnIQDg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0D5sIZAAAAAAMKJtOjf6wS7QTDIhUoQ8EUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "863a9b44-1d89-4c50-aeaf-a7519f43d57d", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "287ms", + "MS-CV" : "1XnHalBmhk219rCjr1k+xA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0D5sIZAAAAADhkdZgEfcjQ7h76gdit/R3UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1a6a48b5-2776-4b84-bab6-196a20600d15" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "Cwn1d8ByxkaNnsD0RIwv/g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EJsIZAAAAADVbaXJS3LJTbLItdYxCUwMUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..cb0d5cd61f95 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "995da420-fd2b-4774-9307-d83199613e93", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "284ms", + "MS-CV" : "cKMAZbc0nkSxd0CYkPmIDw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0CZsIZAAAAABgfoj7qDoqR5tjFmPlznFEUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ada4f9ce-af6c-42d2-af25-fd3bfc4613a1" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "202ms", + "MS-CV" : "sPYcsIg/ZkOahf+5mDCSJg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0CZsIZAAAAAAeNqFoaAI0QI+XcEEGEc0cUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c7a00004-1ecd-42c7-a6d9-0d5209caf511", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "377ms", + "MS-CV" : "+27GSCG1SkS5p6jYFs0fEQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0CpsIZAAAAAB5aIw0miCmSK2O10gX8U+LUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7f5be919-98b8-46b8-abc8-660ccc06f100" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "9HLayhBacUq5EjBaHdTa0A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0CpsIZAAAAABSd6HboKpRTLEToCiYgOuvUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesNotEmptyBefore[1].json new file mode 100644 index 000000000000..fe3fe6f9d832 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyRoutesNotEmptyBefore[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ab7c18ca-68b8-44fc-856e-18a808e312bc", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "289ms", + "MS-CV" : "Im/XdjSku0icNypFOsT2Yw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WpsIZAAAAAAayFaN7mBBR6ICg910vG/gUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2a86b63c-fb87-4129-894e-57e33aab308d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "yHVKXkAP20iwYh0UsX5D9Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0W5sIZAAAAACEeazVfylXR4qHN7GFzb2xUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9d0011f8-4e2e-43ba-9859-6edd4ab09531", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "292ms", + "MS-CV" : "f/81+SY2NES0c0ZpyaKdFQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0W5sIZAAAAAA9uOVWxvEiRpXVKWhTv5G0UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:39 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "58031532-afe7-448e-bda4-470bb6c10536" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "182ms", + "MS-CV" : "cRAlqQ8JLEChK7PkpNFVIw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0W5sIZAAAAABsv/LA1mg6Sb/rizgeWeTEUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:39 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..87367a9efd1b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksEmptyBeforeWithResponse[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "06e33162-307e-41db-98cf-a711b0d87781" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "190ms", + "MS-CV" : "0QawFNawA0Gi4vZSpUY7nA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eJsIZAAAAADvDwHbXxi/Rpqmxu7IZY9QUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:08 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "871c30d7-4778-4c85-b4bb-a021cd22eadd", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "375ms", + "MS-CV" : "6DlzhpuayUy1DJtU5J+CkA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eZsIZAAAAABmmpDdDcYaQau4ZNU1BhUCUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "757a1afe-64f8-4fb8-9561-21487d32174c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "178ms", + "MS-CV" : "aABJ4vllAk6JvtTGBJXz2A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eZsIZAAAAAB1Jaqcvs7oRIgq6UqB1209UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "21dfe6b1-9e85-45fe-94d0-295661c42b40" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "194ms", + "MS-CV" : "B0eowaJXVEeg+rgkhgSgkQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eZsIZAAAAAChGlOi+zDBR4XiAe/C2LKUUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e55cb874-2370-46fa-b1e5-118ceed313c7" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "4osqSl/GF029+ACtJwRTyA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0epsIZAAAAAC7VzZun52fRb7nQcBOr8NyUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksEmptyBefore[1].json new file mode 100644 index 000000000000..67b3e3eea8e3 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksEmptyBefore[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "07f9b4f6-11f9-4d36-bdae-33d36511b035" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "178ms", + "MS-CV" : "OT4AFCnZ3UCXU9UpAn3nGA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TpsIZAAAAAC0ViuWOVs1SqW4Rf50SuTrUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c4bc47b4-3dd7-45a4-a142-675cf76aef6c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "390ms", + "MS-CV" : "VAIHU2fkD0iiQ5YuZ98i9A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0T5sIZAAAAACdLZBEui+LRp5HTyh2mDkdUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "564200f1-9b67-41ef-a3f2-48ba04576757" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "Lga0PR3kM0GyDs/VJ0sU6g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0T5sIZAAAAADAV8OaRZy+SIsVuct4ThgQUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "66f9ba7d-95b2-4477-820b-92e92b5f7e7a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "ZFQnn514b0mtfA+HXy4n0Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UJsIZAAAAAB/GHSV3b+NTYfmq00PF1rvUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c5ed8cb5-b95c-4d14-9042-3a52360ed245" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "180ms", + "MS-CV" : "9jvFsE2e3U+6V0qPOObDXw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UJsIZAAAAABkz8gPd4hZSpr/MaL33SgWUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:28 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..3f9c138a6872 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1b69b2ae-8c56-4908-a7cd-ed63a0f6d358" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "385ms", + "MS-CV" : "nUSWfvLq3EGkq46rEnqsEQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BZsIZAAAAAAz845PSOXyTJvVHY87kgHQUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ad7d774d-5005-4c13-a5e3-2eebd8b8ccda", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1410ms", + "MS-CV" : "XhUiIQ369UiyLzPViH2hWQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BZsIZAAAAAD1rNcT8EgHQ4k5MWAyVWSvUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"second.redacted.com\":{\"sipSignalingPort\":2345},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f2191d9d-ab8a-4a38-8ccf-b4ca58551be8" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "0lA15vnj7ka13YwfJZ+OkA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0B5sIZAAAAAA/2+CzuhhwQriU7rmNqftcUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"second.redacted.com\":{\"sipSignalingPort\":2345},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "49603eb6-1db5-4973-96a3-0345fe1b28f2" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "321ms", + "MS-CV" : "8wOW87BphUWHGTjXSRklIg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0B5sIZAAAAAAVUtm9g1U9QImXMV66J/4wUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"second.redacted.com\":{\"sipSignalingPort\":2345},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9f2358d6-14ff-4002-b657-9841ee13afca", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "380ms", + "MS-CV" : "qx+nvk7EM0C/Vkw5Kmr2nw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0CJsIZAAAAAAOWu9tILWjQJh79RLd3o8LUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6c975021-a1e1-4a11-bf33-ddccbccca6cc" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "uDGlWbEUwEmGnhft70AI2g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0CZsIZAAAAACuDArVKr13SIQ5lFO67HllUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksNotEmptyBefore[1].json new file mode 100644 index 000000000000..0611d42b9f5c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setEmptyTrunksNotEmptyBefore[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a54aa4d7-6666-4f0e-8f1a-75d4f6573ee8" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "189ms", + "MS-CV" : "1SEAuJtYwk+jM41/aH7sLQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IpsIZAAAAAAhOblqr3zmRoKZmdcx6PYFUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "52b567e3-fa3d-4556-9b3a-774a2e5cb5ea", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "412ms", + "MS-CV" : "Rl1Uu4m9rk2iTDhTNVCo9A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0I5sIZAAAAABMrsuw1XVQRJmVeq8rwH2aUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:43 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "34a324e2-1d90-4a2c-b866-7a5c017d9be7" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "CHMzLDiBrEio7BWcQAjeRA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0I5sIZAAAAACUoXfP25u/QYliaM53+ukBUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:43 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5af43c1d-0d30-4517-b220-68ca2218a1fb" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "GczBhbeeJUGbcApEb3O7PQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JJsIZAAAAADssadnRaWSR6fh8vL5xjlfUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a4323cb6-4103-4a14-b801-69e13e2dd76c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "380ms", + "MS-CV" : "uWfeYOyOuUy+CDdHZAY5nA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JJsIZAAAAAC1WZftdxyuRLdBE7TO+QjbUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "74861a88-11c2-4caa-836e-62c5016f1167" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "fNa/w86S6EC1dXOu3RlWpQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JJsIZAAAAAA+QHF9j685QbcXAPjYQ8bGUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutesWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutesWithResponse[1].json new file mode 100644 index 000000000000..e7a6bb37e6bd --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutesWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5f06b5ab-d96d-4c57-a792-34207657949d", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "21ms", + "MS-CV" : "+1RtKZoAm0y2/czU4F/Pjw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0E5sIZAAAAADr/R9fjdUYQ66zs7mZXxduUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "400", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"DuplicatedRoute\",\"message\":\"There is a duplicated route.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:27 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutes[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutes[1].json new file mode 100644 index 000000000000..fba1f0b5f91c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutes[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3760b815-f5a1-4964-89e1-408943188bda", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "14ms", + "MS-CV" : "UOZI6h3YZESOn75+RXbDwQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KJsIZAAAAACEiY1s4ZzMRrKT0IR2o3P+UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "400", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"DuplicatedRoute\",\"message\":\"There is a duplicated route.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:48 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutingTrunksWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutingTrunksWithResponse[1].json new file mode 100644 index 000000000000..47845638278d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutingTrunksWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0b058c12-50db-43f2-a561-b7c3bcc00d0f", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1086ms", + "MS-CV" : "n3zLga5v2021AHCnW8DNxg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LZsIZAAAAADzjSQj3CpbT5UAAvEyRdi1UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "75c8edfa-03e0-4821-a715-fad66383cd99", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "18ms", + "MS-CV" : "upqaok9Amk+X2NS9MXI2sQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LpsIZAAAAADaBqFwAKPoQYgCeoU8axwWUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "400", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"RouteWithDuplicatedTrunk\",\"message\":\"There is a duplicated trunk in a route.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:54 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutingTrunks[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutingTrunks[1].json new file mode 100644 index 000000000000..2daebb98bad2 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesDuplicatedRoutingTrunks[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "be431fe6-fa5d-4816-89a7-4a5786280b23", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "416ms", + "MS-CV" : "VbT9qU35fUWm/l7Ck2bwgg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HZsIZAAAAABcpwJP4i/KS51yF55ZQNQUUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "840d8295-ce0e-4bd5-a22e-5462c5598ea2", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "31ms", + "MS-CV" : "PaNPU/GGHEOpssENuiwItA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HpsIZAAAAAC3aVd2PQMERZH2NcRYzAVvUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "400", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"RouteWithDuplicatedTrunk\",\"message\":\"There is a duplicated trunk in a route.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:38 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBeforeWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBeforeWithAAD[1].json new file mode 100644 index 000000000000..3eaea6e4df7c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBeforeWithAAD[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "170a481d-9ad3-4d37-a0c5-05bc3f7c9b56", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "309ms", + "MS-CV" : "x4zKzYDsCkO1x124Qs6LqQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TZsIZAAAAACa23BeTzr3TqwLC7kPsfwjUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5ef0af00-42ae-4215-bbf2-df8159050858" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "191ms", + "MS-CV" : "k9zaNX5uNkOyyTWtCOM6qg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TZsIZAAAAAAr2Wv2NHfkTJv+8bmUU1aEUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "804a7f85-95ea-4990-b625-0646abf3da86", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "280ms", + "MS-CV" : "OH6vtWYLSkGJdOJz+AMMaw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TZsIZAAAAABnPxKLbNQ3SJZCeXFBxiHWUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ee97bfcf-8f61-4acb-b966-4ad4bdd3e052" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "f6pT6NA3U0O0yNVKGLdr1w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TpsIZAAAAACxWmOJQUm3QYOoUI7UZR2yUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..6c5397659ba6 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBeforeWithResponse[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0f56153f-57dd-4608-b5da-435cd92be58b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "280ms", + "MS-CV" : "cCbbRfqZ/UW7lu+ARFUQrg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WZsIZAAAAAAL6Ziu9CItQIuW9J0N4IZdUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c0c26a50-dc75-40ea-b13a-db8c3bc0a9c0" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "182ms", + "MS-CV" : "Rt1dsLT5GUSmn39d14sdxA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WZsIZAAAAABCySeyeDxYT6l3VF/Pg61yUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a567a974-0333-4c5b-92cb-40e386138962", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "286ms", + "MS-CV" : "6COrMqsc8ES79N60ourXhg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WZsIZAAAAACBeUtFh2W0SIdw141gZxOeUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "73cc8275-5997-45cf-ac49-f1eedda91a9e" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "lp8Aa823uk6Q5yMXcQsKRQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WpsIZAAAAAApqaRdVdn9R52inkwlB9IKUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBefore[1].json new file mode 100644 index 000000000000..3f6a384a84da --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesEmptyBefore[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a5a8d531-7470-457e-a30c-fdf9a774ba01", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "417ms", + "MS-CV" : "SusuFdpjIUCwXWJYSsfhzQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bpsIZAAAAACaUODvNo2OQIvEBFXHptV8UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7b136e2f-d061-4f19-9bb1-9186fbc929c6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "toqow9PGpUyPBsh4EviJqg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bpsIZAAAAAD1Px+/qLHdSbbrmkw+TpdQUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0eb50575-02cc-4e9e-87fd-d2918b6cb8a0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "287ms", + "MS-CV" : "4KiUp5BR6UibWDDEKIlHeQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0b5sIZAAAAAAW2t7lCgHhTKUywmx4IbzIUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "06aaa0df-061c-4972-9a44-ea258098a8b3" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "291ms", + "MS-CV" : "IGG+Jp0WNkqre8wCJv/9LQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0b5sIZAAAAAA4hJp07WvtQaHY/I7fqEXfUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNameWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNameWithResponse[1].json new file mode 100644 index 000000000000..6fa339b30200 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNameWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8aef5e1a-9816-4f97-8c74-af970c4923fe", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "18ms", + "MS-CV" : "0PqpmS6/f02aiJh5p6KDFg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HZsIZAAAAADA5qoDhhGJTbeQjGmMrrYjUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteName\",\"message\":\"Route with an invalid name.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:36 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidName[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidName[1].json new file mode 100644 index 000000000000..1e00f780e924 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidName[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5ff1f7a5-c5c3-4ab5-9247-20eaaca1bc1e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "16ms", + "MS-CV" : "7FCG7uSZKEmDfpxUhsxZyQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0P5sIZAAAAAD6ssRJNR7nRo5+tm60TZNZUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteName\",\"message\":\"Route with an invalid name.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:27:11 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNumberPatternWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNumberPatternWithResponse[1].json new file mode 100644 index 000000000000..a11a689d5dea --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNumberPatternWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "87b9f448-2ad8-47ad-9130-128cc414db81", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "53ms", + "MS-CV" : "HLKnj5Xgp0m8hBAqkMIj4A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BJsIZAAAAADXdXL0tM3BS7uonWLdpUGeUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteNumberPattern\",\"message\":\"Route with an invalid number pattern.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:12 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNumberPattern[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNumberPattern[1].json new file mode 100644 index 000000000000..f094e58f33e9 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesInvalidNumberPattern[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9d2a3786-17be-4e33-8a96-3fb11135ff55", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "16ms", + "MS-CV" : "P7NlE8PXUEKXBPS+pEhMrw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IJsIZAAAAAC5wqjlNJitTqCoVUAapb6EUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteNumberPattern\",\"message\":\"Route with an invalid number pattern.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:40 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesMissingTrunkWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesMissingTrunkWithResponse[1].json new file mode 100644 index 000000000000..21d86b13b8f7 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesMissingTrunkWithResponse[1].json @@ -0,0 +1,72 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "164428bc-4fdc-48f6-bbc3-d9e95cfb29ef" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "uB0PM9M//kytqLRrA2SE+g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QZsIZAAAAAAn1LUiY0NKSYR/TUwtfrQ+UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f4fccd24-d32f-4339-a561-c6ac3c5d2af2", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "376ms", + "MS-CV" : "WiegX75Fo0yOfYVKfFb9Wg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QZsIZAAAAADN/LKzBpDnRIjU2kB3fr/PUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8bad8856-f810-4eab-8be1-ef42c0344982", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "471ms", + "MS-CV" : "d8skuVNnkkqtsiAzFm/KmQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QpsIZAAAAAAIs4Aq07X3RaBO7JR9C9nBUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:27:14 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesMissingTrunk[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesMissingTrunk[1].json new file mode 100644 index 000000000000..1245c68c4c04 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesMissingTrunk[1].json @@ -0,0 +1,72 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2c4b4665-ffff-4d77-92ea-3759f32510e3" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "5nrOcL2vN0OQygLoMm8b3Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NpsIZAAAAACd6hcyEHpLRoj2QYK00OHpUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2ab3d488-f489-43ae-9544-693085c2564a", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "376ms", + "MS-CV" : "heoV8V2LOEOBLf575c8x/w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NpsIZAAAAAALJLyKrlNxQLyJnc0myD9SUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:02 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fddacb76-a01d-4c3a-b73f-a3af5fae2b98", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "361ms", + "MS-CV" : "2BOAYbD8MUyTeObB5a9U6w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NpsIZAAAAACHihZ3bvkDTrjuLUQYZetbUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:27:03 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..923692040fa4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f5f898e7-ca3b-43e2-accf-21ca0eb334c8", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "311ms", + "MS-CV" : "nYjSukZNpkeRF748usc+dg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bJsIZAAAAABY3dyZmD3IRpr7fIBaAkVUUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "608", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"des90\",\"name\":\"route10\",\"numberPattern\":\"9.*\",\"trunks\":[]},{\"description\":\"desc91\",\"name\":\"route0\",\"numberPattern\":\"8.*\",\"trunks\":[]},{\"description\":\"desc92\",\"name\":\"route21\",\"numberPattern\":\"7.*\",\"trunks\":[]},{\"description\":\"desc44\",\"name\":\"route24\",\"numberPattern\":\"4.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "25a08e1b-3aa7-46c8-92de-c7efa32e0aad" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "1sPjcq0bJ0OaO5lGUv+ZbA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bZsIZAAAAAARXiI8wghzSZBnrnn1SoWcUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "608", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"des90\",\"name\":\"route10\",\"numberPattern\":\"9.*\",\"trunks\":[]},{\"description\":\"desc91\",\"name\":\"route0\",\"numberPattern\":\"8.*\",\"trunks\":[]},{\"description\":\"desc92\",\"name\":\"route21\",\"numberPattern\":\"7.*\",\"trunks\":[]},{\"description\":\"desc44\",\"name\":\"route24\",\"numberPattern\":\"4.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9bf77a9f-ec82-49c3-8a29-e9025a434ee5", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "293ms", + "MS-CV" : "HR3DMuPhAEWRs+dfRW8iXQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bZsIZAAAAAC7DiJfA+qkQItUpwvnWweWUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:57 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3e1433c6-eed3-4508-a522-f26d3c380b54" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "vB0TGNOS7E6EqLwmyswdeg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bpsIZAAAAADuXHWfy/56R6NvNqQVDGohUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:57 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesNotEmptyBefore[1].json new file mode 100644 index 000000000000..73d48113578e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesNotEmptyBefore[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "dd1705c5-ee05-44be-958c-8554d1fbec28", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "383ms", + "MS-CV" : "ie3k6warWkSJ2aH9hItPng.0", + "retry-after" : "0", + "X-Azure-Ref" : "0fZsIZAAAAADMHgjqiTpRSKixU39g6QXKUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "608", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"des90\",\"name\":\"route10\",\"numberPattern\":\"9.*\",\"trunks\":[]},{\"description\":\"desc91\",\"name\":\"route0\",\"numberPattern\":\"8.*\",\"trunks\":[]},{\"description\":\"desc92\",\"name\":\"route21\",\"numberPattern\":\"7.*\",\"trunks\":[]},{\"description\":\"desc44\",\"name\":\"route24\",\"numberPattern\":\"4.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:28:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7af5fb27-8777-43ba-87ff-5db4241f2b07" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "mSC96DyjQkS15OR10F7yCA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0fZsIZAAAAABkX/+vQF3iQJbAgfeCHPzZUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "608", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"des90\",\"name\":\"route10\",\"numberPattern\":\"9.*\",\"trunks\":[]},{\"description\":\"desc91\",\"name\":\"route0\",\"numberPattern\":\"8.*\",\"trunks\":[]},{\"description\":\"desc92\",\"name\":\"route21\",\"numberPattern\":\"7.*\",\"trunks\":[]},{\"description\":\"desc44\",\"name\":\"route24\",\"numberPattern\":\"4.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:28:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7d5d7041-fe10-41a6-a85b-b016d7c8ed86", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "302ms", + "MS-CV" : "NPdHIeibQUqO2Zhi5949kw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0fpsIZAAAAACA0M9riAyLRLWBnAMqILY8UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:28:14 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c5c00ee1-3610-496a-b0e0-db1c1037d91a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "UR8r2s5od0+o+I3cir8r5g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0fpsIZAAAAAAZsixopVG0QJ/ebU2CZq9KUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:28:14 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesWithoutAffectingTrunksWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesWithoutAffectingTrunksWithResponse[1].json new file mode 100644 index 000000000000..425b8c8cbe1a --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesWithoutAffectingTrunksWithResponse[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5381ce07-c6e7-45bf-a559-60347c12cb7a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "0hC8AmR96kibb2OaauvrSg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EJsIZAAAAAB9/nXZB4IDQL3l+hFyM3TdUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e350c6a6-3a89-4ce8-a448-8dff3e27ed90", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1199ms", + "MS-CV" : "YLuNW6qHYkWyh0y060SBeQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EJsIZAAAAAD2UZffTrJwSLGV+T3ljlh6UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "708fe655-6121-4399-b64c-81b2fd51e293", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "292ms", + "MS-CV" : "HJNaBh/900+hcN64BeadQA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EpsIZAAAAABVcD4pRS20TJTjvtxJUGejUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0173a2c8-f59e-4979-b946-b5df1aad6e4e" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "JvVUWx0xOUqQk40VJVoJow.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EpsIZAAAAAAYGRCFYQheS6NxlO02jdgOUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a8a1e10f-a6ca-4e00-8b17-b144eff7a5dd" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "196ms", + "MS-CV" : "Es83hf/VXkyd1DBjBNUkXw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0E5sIZAAAAAAXeGDGUqh0S7u/7EXEmNdBUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesWithoutAffectingTrunks[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesWithoutAffectingTrunks[1].json new file mode 100644 index 000000000000..18e8725f8e21 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setRoutesWithoutAffectingTrunks[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2bfae27f-f734-4694-bba1-8740565be318" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "179ms", + "MS-CV" : "Tf2HV9G5dEGtasv7v2bIIw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0N5sIZAAAAADC3SxbqG0zToJtZrE5l9iLUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "61115d9b-0fc9-4ee2-88a7-0ba91b54fdef", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1107ms", + "MS-CV" : "R1qWCMJ5ZUmBFz2D7On8+w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0N5sIZAAAAABsEwUMI/DnSZrSH+cjGrjvUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:04 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "28ab18cc-84a4-4440-970a-10b55990dab2", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "309ms", + "MS-CV" : "FXhOcACTpUWtEzeqZ9afQQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OZsIZAAAAAC/r+NDkVsHQ7YWJ/BaKSjxUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e1f9848b-d5c1-40b6-bde0-b9da340cadfc" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "9zgk4hQ230KNdhEqSzpecw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OZsIZAAAAABXr08Av1d1R5uTn8VYVf0dUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "baa5a3f6-85db-4ed9-a143-ace5d51c83bf" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "o3JtAicRbUK7jQ6NkgkoYw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OpsIZAAAAAAzO3sB6npHRoOMuPXhrfIVUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkExistingWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkExistingWithAAD[1].json new file mode 100644 index 000000000000..31b5a8e5eb5b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkExistingWithAAD[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d726bc0e-b29a-439f-9275-a11fcaf88f68" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "736ms", + "MS-CV" : "W7msyjfW8UGOfS3YPDmw8A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FJsIZAAAAACCjoAQQs1gT7yOonAxt2ppUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "518a166a-a80c-431e-822b-91de7e1e92ae", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1376ms", + "MS-CV" : "0hbtwLFsxUqE/XMTwCgolw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FZsIZAAAAABsQgUste1ORa4w2lBbpX28UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "eeb3eab5-c44a-42bf-9f9c-571c5b3126ae" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "QnRhBwVpYECQyWHKcp1USQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0F5sIZAAAAACvrj7+3bzOQY6IIRSTEaEkUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "207c1897-3d98-4876-ae23-7b5e62e14d0e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "403ms", + "MS-CV" : "eXwM9H3LZUOoiZJr04kJXw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0F5sIZAAAAACO6+c74GWySJtTNBj3vsf6UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":7651}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "acdd746b-16f8-4d8f-8518-bd75371bc2ad" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "ZrGIcXzQwEuoZKWrth/zyQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GJsIZAAAAABE9VVdNmxkQYMiT5QB6Xf7UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":7651}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a66a0b9e-bd2f-4c1c-ac52-38d7c8c9526e" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "179ms", + "MS-CV" : "9b+U9t9ru0+mYTvOjLpcKQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GJsIZAAAAADqcFK/V34iSqYJnMZcvRpoUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":7651}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkExisting[1].json new file mode 100644 index 000000000000..75539a2113cd --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkExisting[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ca92eb11-d4e8-4b2d-bb61-5a7f7202f007" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "Kg3hTZ/aC0uAHVRqeCWVcg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XpsIZAAAAADKTucxqC3eT5zmnnDJLyR2UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9dd418bf-ecf4-4808-9eb2-9ab55065794e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1191ms", + "MS-CV" : "RbVz0k/qHkumpxwpjqLLGg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0X5sIZAAAAAAtbVY4Mzw4TJtONJANkWPrUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:43 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "62f03f93-ec76-42cb-b800-9b78bc9d76aa" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "0TRL91FSj0mHeBetjrNOSA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YJsIZAAAAAAw9TNBD63DQra7+SHKCvtbUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f11b01b2-a141-48f6-a87c-c7034cf016f5", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "394ms", + "MS-CV" : "c0aVsTdm6EalZGS0w67TQQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YJsIZAAAAAD+aCCMVGDgRbIvKQk/2VFNUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":7651},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "04b95136-14d1-4924-a4e9-5ba032d3c73e" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "180ms", + "MS-CV" : "KXJveXpcaUO5Z+cFdGfaAA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YZsIZAAAAAB9HhtxQ/8eT7FBILGQXGcDUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":7651},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:45 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ba2a96b9-ba1f-4692-a41f-672da5ad6876" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "Bl131kIdiUSQ/EOzs8JCQg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YZsIZAAAAABXo3V48RxuRbV8Rk7lo72jUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":7651},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:27:45 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkNotExistingEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkNotExistingEmptyBefore[1].json new file mode 100644 index 000000000000..311a9ec4760e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkNotExistingEmptyBefore[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5a7d6feb-2251-4119-b3e8-72917cc83108" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "LTg+HZ1c7U+waJwtvKrzKw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KJsIZAAAAABgX/SNF0gPQKqb9kYHwSTRUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e051d37d-11ac-4a87-be2b-3d99fb4ef6d5" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "pbGv4Wj4ZkaS/0MAH7e1mw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KJsIZAAAAACvI/FnenhgQL2kM7GvEujFUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c48da592-8527-4365-bff2-aa7fb65576b1", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1029ms", + "MS-CV" : "uRtKfVFolU2M2vqQRKdYsg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KZsIZAAAAAB8d4g4rdn6S4QzlYq3VUcpUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:49 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "142ed7d8-0e33-4c6a-9c69-235466d4b741" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "187ms", + "MS-CV" : "ipe2kBoMA02yUElqyVPJqw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KpsIZAAAAAAfI/NIxK1jRLOhf9D4JR92UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:50 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "180ddbe5-9390-4330-8b1f-ab488d7d7914" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "184ms", + "MS-CV" : "CJFeorsQXUSVBKE0y896jA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KpsIZAAAAACQo/G5q5ssT5BM9pMVEZUiUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:50 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkNotExistingNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkNotExistingNotEmptyBefore[1].json new file mode 100644 index 000000000000..96fb26f942a4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunkNotExistingNotEmptyBefore[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "cd35f24b-6d4c-463c-bb8c-59f631997c1a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "HVAvR2akGUyJU1h2Dk9Olg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0O5sIZAAAAADwcX6V2KapR7hl6TQgvvoVUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:07 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0b8b57d9-88e2-4cc9-ba89-d31b54a7d616", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1109ms", + "MS-CV" : "kG2Xw31Bv0CxQsiqO25kWw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0O5sIZAAAAAD0ghOtI/PRRpzo/VkNR/m+UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:08 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5ccf7022-0641-4852-890b-346c57293975" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "zfUhBQq/8EeN6lE1lasnng.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PZsIZAAAAACorWmmhB74R7kGhjUbXiGhUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "15656550-c5c4-46b9-bce6-d74b94bf0777", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1021ms", + "MS-CV" : "1Xd7H9pnck2TWFq370f2Wg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PZsIZAAAAAD8vozCR0EcS63MgPH/VG+aUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b7e7361f-0597-4e17-ad9e-c104ab01f0c5" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "179ms", + "MS-CV" : "tUOvRmGE5UexTtJjPvOb5g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PpsIZAAAAAAAe1eXMT1yT7VG/cv1hsbBUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "cfe989d8-2c26-47d5-8689-235ab0d5251d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "/liSMzNX90qnzieCTOVLAA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0P5sIZAAAAACtlH87UcU9QqxVx1LsigICUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:11 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBeforeWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBeforeWithAAD[1].json new file mode 100644 index 000000000000..7cb17d85df1d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBeforeWithAAD[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "37fe72d3-cfd3-48da-97f5-c7b1cfd9d411" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "aZigc/08MU2Xs5O4wp6pIQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SJsIZAAAAAAUyxXtlljqT7qhpjYVPLN7UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:20 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3a3ec08c-011c-425d-ad67-6713cd042638", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "375ms", + "MS-CV" : "y8TZqoW1gUuprKIPsmKhNQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SZsIZAAAAACysOk9I+ViRaJs/BU0fVOlUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "812aefdc-d5f9-44a6-925d-8af8ff954768" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "H0I3aCZ73UmlRLhNocHvUQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SZsIZAAAAAA9vyyIqt5TSoUqY8I2858jUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "40e3c646-6bb8-4dca-9967-39011ed2d8d9" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "191ms", + "MS-CV" : "m+xfm3VSskyq9yi+vUcNGg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SpsIZAAAAACizscsoiLdT6tZbqWS0rgzUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9380021c-c0e1-4d92-bec8-e2f89fa2a4fb", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1096ms", + "MS-CV" : "TJpQoPjMTEe+OSv1Qk77WA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SpsIZAAAAAA5b4Mt1kENTITp3g3QkzoTUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5e6100cf-f992-4c75-9ae9-90fbb285370d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "c5tNWVnp90qpT6w3+g5JDQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0S5sIZAAAAADV+rK+GfdxS704bZ7K4HA7UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..c810290244b0 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBeforeWithResponse[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5593392c-2ed7-4bb5-96f8-2af0374596a6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "O/kkj0REPESqGKPTqeVJ/g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0epsIZAAAAAD6dQcAlkl8RoFxPMXaUL1pUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d8b7e430-04c7-4eff-bbe0-433c3067e918" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "DDacki/nTEaP4PFysMcZyQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0e5sIZAAAAAAKholifParSLd6Z1IiKrlnUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5b6310d6-ebfc-4507-be59-d2a452622e0c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "G4hQBgNNaEmZY5ICtDPWlw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0e5sIZAAAAABRzfj1TBItSrYbORXQIvNLUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:11 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "46df0adc-a586-4f0a-a2cc-e64f85ae7336", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "981ms", + "MS-CV" : "rnvQ1B9vRUiM6cLkzUgRcg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0e5sIZAAAAADpa8knMgKjRqzMDhxe2rEsUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e287ccc9-acc8-40d5-a07d-39540937afca" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "Rks8dfnOiUKRpaIlSbcvOw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0fJsIZAAAAABYkNsCN2u0S7qXTuklGZgDUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBefore[1].json new file mode 100644 index 000000000000..204108bc023e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksEmptyBefore[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5fe70aa3-a0c5-4f18-9f25-421de3ef2e8d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "c9sFFle0l0aGkf2QPYtVqw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LpsIZAAAAAADdJ3D+HCZT5wBI6k77v6BUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1578340c-0afe-4f62-8f53-7af4d9b433fe", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "518ms", + "MS-CV" : "P0SzPDTvLUOeq1pgffLFsg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0L5sIZAAAAABWmkeU4gO6Q76zv40OOdZEUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "933626ec-2f94-4893-aeb6-99dffdb1de24" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "70zFZFaewkOTUpNl4zR1Uw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0L5sIZAAAAACHUp4+lwPfRI1n9WtkMIi8UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4efb78a6-030b-4f0b-a71b-904c552c856e" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "187ms", + "MS-CV" : "TyzfyQE59E6pkhY9wwJJEQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MJsIZAAAAAAehEpfdIuKR7gxonkXQkYlUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c4fb449c-4e7d-4589-8279-7369567eea0c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1141ms", + "MS-CV" : "dAovDHFe7k+NAAvdH+pkAQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MJsIZAAAAADZLaPZI2l1RYVFQ7/Czb9iUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:57 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "72be4d77-d514-457f-baf9-ffec1181a293" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "6HpW5z3deUq6r/KRIE306w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MZsIZAAAAABYZA9EzTKvTJ/DdCKm5Ea7UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:57 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidFqdnWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidFqdnWithResponse[1].json new file mode 100644 index 000000000000..a100da189924 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidFqdnWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2e2e16e1-04a5-4ef9-89d4-435f987742ff" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "cvtbfhYNlkCLoVdGaET/Nw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NZsIZAAAAADeAWULAufuQrPDTV5IDm9mUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c3fffa52-dd2b-4be3-8887-c4699347d49c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "15ms", + "MS-CV" : "+Bg3jO8d3UeOoGWppWLxPw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NZsIZAAAAABbodPvBpXrSY9va5MTViK9UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkFqdn\",\"message\":\"Domain '_' is not properly formatted domnain name.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:27:01 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidFqdn[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidFqdn[1].json new file mode 100644 index 000000000000..0ba0eb24970c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidFqdn[1].json @@ -0,0 +1,72 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d47ae0c4-9d06-4386-b495-c4db7141425b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "14ms", + "MS-CV" : "0z4cvA0KqkuHlQWXZne6tw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0C5sIZAAAAABfFtgCD5kpRpbkfjrYLVR3UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkFqdn\",\"message\":\"Domain '_' is not properly formatted domnain name.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:18 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "09cc0fe2-d75b-4916-a9fb-a694e25b0682" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "5kkiwuMMZU+Ac2u6+IXT3Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0C5sIZAAAAABks4ICSEnqS4uxKl9maK0qUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7da58038-c080-4f39-9526-1051592be14e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "17ms", + "MS-CV" : "0dYY4sCVOkq/uNDrbJD/zA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0C5sIZAAAAABKAH/LLcK4SL3vvfeRAq+MUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkFqdn\",\"message\":\"Domain '_' is not properly formatted domnain name.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:19 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidPortWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidPortWithResponse[1].json new file mode 100644 index 000000000000..b85cca8099a9 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidPortWithResponse[1].json @@ -0,0 +1,93 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "443a5897-0f8f-469a-9a5e-1df9c5665f8a", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "400ms", + "MS-CV" : "x/lSy8S5kE+y/Ycja7WAXw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0P5sIZAAAAAAvNVhatVkHSJ0CLOfGuxJgUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:11 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2cd13038-9d6b-4b66-ad20-304aea79d92a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "RFOUClGJtkmIJWR2sie7lw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QJsIZAAAAACNAhnjyK4sTI6fqd/AETFzUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4402294e-5158-476c-b135-fb1429b78b2c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "40ms", + "MS-CV" : "Buq1ANKE5Ui8g2RdtKgd7Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QJsIZAAAAAABP4v9wjaDQqbRbzdOL8lTUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkSipSignalingPort\",\"message\":\"Trunk with an invalid SIP signaling port.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:27:12 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "db7723f9-00f4-4726-91c6-e613af3f49dc" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "CYBCPl3gF0SpehcqMB33eg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QJsIZAAAAAB3RtylNWJeToDsbYJb7CraUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidPort[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidPort[1].json new file mode 100644 index 000000000000..7db8c26f4cbf --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksInvalidPort[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "648370fb-d76f-4a78-a81c-98a7c7dbf8fb", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1100ms", + "MS-CV" : "ZwhrR8Wz3UShOXolqrE8HQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0C5sIZAAAAAAX2XkMpzVgS4BcSIxg5dcQUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:20 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c1efb191-b47f-4bfe-83df-0a98f99983c7", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "16ms", + "MS-CV" : "RO+VUeSEIEq+JhXZSpKheA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DZsIZAAAAABSLTeeWoXrQ5zkmUiQUCz+UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkSipSignalingPort\",\"message\":\"Trunk with an invalid SIP signaling port.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:20 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f461d6d8-8204-49c5-b751-c507a6df63d6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "765ms", + "MS-CV" : "Z3rQzlN1KEWhDd1zWGHyjg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DZsIZAAAAAAdGwK8DsvATZMthFnGGS0rUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e3633fdb-b37c-40c1-825c-29e9a717becd", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "16ms", + "MS-CV" : "i3YnlP62FUC9Lndqm41IoA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DpsIZAAAAABY1vGlkktrSLJ1kvXXertqUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkSipSignalingPort\",\"message\":\"Trunk with an invalid SIP signaling port.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:22 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8ca6ac56-5845-4d62-acbe-6f60c22e72d0" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "180ms", + "MS-CV" : "Dd7BIvL3yk6xwiS7Uf7zRg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DpsIZAAAAAAifFm/R38NTZbcZYfWhl5KUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..ce2bb32cc907 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b4d09dac-a946-4314-a593-4c2888ec7c83" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "dRVq0Nvdf0mRMWWE5uMxcA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aJsIZAAAAADdhu1y08wtSasZIEklMh9cUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a59095a2-97e0-4065-b387-329854d62b5c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1146ms", + "MS-CV" : "CnUA8SjJ00SuJMZhrfBtQA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aJsIZAAAAAAJwqsdAWbWTredPWLz+qQ/UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fifth.redacted.com\":{\"sipSignalingPort\":3460},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:53 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "cffa3b41-c827-4e6c-899c-1adbb0e65fa0" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "193ms", + "MS-CV" : "6TGIPF00xUKm2oi0ac/Dxg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0apsIZAAAAAB4hBS6ZuzCT5nDhnomSwG2UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fifth.redacted.com\":{\"sipSignalingPort\":3460},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "908254fb-f420-46d1-84c4-4c2f26791b12" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "IETKmM0l2k+zTmNJFxSiAg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0apsIZAAAAACkfzz97pTIS7I21SWBkHIRUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fifth.redacted.com\":{\"sipSignalingPort\":3460},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5a3c99dc-7da4-448d-bcbf-c228253015da", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1192ms", + "MS-CV" : "B/pVVZS4MEGt8cRo65NZAw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0apsIZAAAAABfZiZ6mwLJTpI13OpxhE1dUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4f433f4b-ed20-45c3-8fc5-19eaf0ddcf60" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "tsXACiVkoE6gfSK9RnYBsQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bJsIZAAAAAAPDnlkoSBnSb59x55b4k4iUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksNotEmptyBefore[1].json new file mode 100644 index 000000000000..34e36326e73e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksNotEmptyBefore[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e8c263d2-cc14-43c3-93c2-59fbc4819221" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "184ms", + "MS-CV" : "djNL6xd46UiyBq9nO6ECVA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Q5sIZAAAAAAgsT7lKUjYQrPRlXkoVGiKUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "85944b66-046f-455e-9a38-3c3a91242716", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1098ms", + "MS-CV" : "r3ZilEgbk0mm7bN9NoFXoA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Q5sIZAAAAADqNgGkMeoWT4n3TPOelIX8UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fifth.redacted.com\":{\"sipSignalingPort\":3460},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ab30d8d6-3034-4941-9a4c-aa78a7056e67" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "203ms", + "MS-CV" : "eNjEmayyqkCUfioJ887jSQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0RZsIZAAAAABqGhLGw0+tTZ7V7UzMuTiaUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fifth.redacted.com\":{\"sipSignalingPort\":3460},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "648e004e-dc2c-46e9-b6d6-dda3eed5a133" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "186ms", + "MS-CV" : "HXaFpI7ZnESmWfp5/eGPoQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0RZsIZAAAAABK8M97i1gQTqbrvrPjAIFVUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fifth.redacted.com\":{\"sipSignalingPort\":3460},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "290a53b8-a2c2-4e86-977f-d40fda5f97b9", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1475ms", + "MS-CV" : "AzZvofKB+0edAubzCtXi8Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0RZsIZAAAAADrV3NJeUgGQpk0ri9uDKXOUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8c3403ca-0c75-4367-87e6-7868cbebd033" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "gKAUrNZmW0uaIZ8BYpafsw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0R5sIZAAAAAADjtJNz12vTJBYkX2klMiNUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksRemoveRequiredTrunkWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksRemoveRequiredTrunkWithResponse[1].json new file mode 100644 index 000000000000..e58b8820383b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksRemoveRequiredTrunkWithResponse[1].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "34a06513-16c0-4a2c-a011-26d688750827", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1160ms", + "MS-CV" : "3XwkrYDsmEWwtxuaBFayUw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cJsIZAAAAAC6qgVmLOORQ78mJ9yukyhNUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:28:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "48bb69e6-1803-4e86-a05f-fdb7c602fe96", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "285ms", + "MS-CV" : "W9aREXeGlEyHZ9c6920YJw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cZsIZAAAAAALNcm3kOReTrIfo3bYbS0xUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 14:28:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9b63651f-6b4b-425a-bcb0-23e68de70ccf" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "iZBezCCZq06SUXKhHv+QHw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cpsIZAAAAAAUHNKXmnpQS7FR9XXdtASZUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 14:28:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "09bcf8c6-70b9-4f91-886f-8d248c4723aa", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "340ms", + "MS-CV" : "esFUWUeLbU2jCuDb8AV6IQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cpsIZAAAAACLwAjO16VlQIHEdop1d4XLUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:28:02 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ad88a790-f4b2-494e-b169-5d12a20115cc" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "189ms", + "MS-CV" : "MQS0Z7kOeEqNWXj8qbk5Xg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cpsIZAAAAADd/3pfcshoRLprwS+T7kyqUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 14:28:02 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "04647e49-43f8-4411-b4b0-7b1335a4d473", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "222ms", + "MS-CV" : "//a2AJ7YBEWOGLh0PzePrA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0c5sIZAAAAAAtrSvxxh94Sb7wgKA728QKUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:28:03 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9649a6da-8210-45ef-9311-79d7daed286a", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "283ms", + "MS-CV" : "3xCEASmg9EyhCXMittWI7w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0c5sIZAAAAAAnKByHzG7WTJbAtlztFhqQUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:28:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksRemoveRequiredTrunk[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksRemoveRequiredTrunk[1].json new file mode 100644 index 000000000000..cf2a32b2411c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksRemoveRequiredTrunk[1].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "338910ea-08b5-4fa8-8767-235df5d6c558", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "430ms", + "MS-CV" : "9GQnKdeMEEmfwS7VSltGig.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GZsIZAAAAACcMXpYu7EkQa6BNYLc2PVvUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fcb4178d-38a9-4c61-bd9f-e5871a8acacb", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "388ms", + "MS-CV" : "/64w+bss9UKW2H6ukImCTA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GpsIZAAAAADep0BGpcSXQ7wxgI0ENNuNUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2a4e57d0-9808-438d-9dc3-2aae4dafd6db" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "NxlfIeIaIUKP8/Kr36ksVA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GpsIZAAAAAApbwh4v5GcTIWx+Ram1DvZUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d05992de-cffb-457c-80b8-b73f3a1da44b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "413ms", + "MS-CV" : "h4ahwG0z+EuO4AxkWv4z8w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0G5sIZAAAAABj5dUVt1zmToMvqcMhkdMPUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:35 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d39b1c00-f9d4-41fc-9dd9-7f8093e28e25" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "Ae6NiBdFgECBuv8zGStDyg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0G5sIZAAAAABlzaOCVteDQrnTbb3B7235UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 14:26:35 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "52af4cd4-a6eb-424d-b6bb-35c2ea2ec4e7", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "231ms", + "MS-CV" : "kGCiDZ4+dkS3bis6BfDu2Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HJsIZAAAAACa0ICtw2loQbP18dH4KMa+UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 14:26:36 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a214361a-220d-49d3-8d58-91d6da83775c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "311ms", + "MS-CV" : "mdGSVsbBlUaHKeJRpcIvyA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HJsIZAAAAADHpMDf/cKqQImoouQlBcmeUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 14:26:36 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksWithoutAffectingRoutesWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksWithoutAffectingRoutesWithResponse[1].json new file mode 100644 index 000000000000..7db95cec7d13 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksWithoutAffectingRoutesWithResponse[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "74802a43-9ff9-4408-9a0a-5ad490f370cb", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "395ms", + "MS-CV" : "Y4dX/Jn8i0S7icmdyQs7cQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Y5sIZAAAAADIRnAPRRj8Q4Wgws6SkFzKUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ff9fae5b-2003-4580-bdbc-6617e79b3837" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "Au02tsoZEkeJD9GtM1yqXA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Y5sIZAAAAADYmj8vw4+WR589FgApRxcZUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "58760ac5-fad5-45fa-98d7-eca409175ee8", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "399ms", + "MS-CV" : "VeUKYi4vpkWvFruc8wyBDA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZJsIZAAAAAByYVHwQ/iDQbCL9J2D88pgUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d51e3aa1-cbd5-4392-89ea-dc105c3890a4" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "179ms", + "MS-CV" : "ubferBY8F0uPGJ23O+24mw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZJsIZAAAAAB619g+PNOpRJxT6TcZMUyjUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e783417a-e0c3-45c4-8df3-2d34c722d4c0" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "190ms", + "MS-CV" : "9gg8ao4z3E+lnyX7XYr/PA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZZsIZAAAAAAAvGxVag4YTKBaWHHNR8URUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:49 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksWithoutAffectingRoutes[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksWithoutAffectingRoutes[1].json new file mode 100644 index 000000000000..dc300f1b9e23 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingAsyncClientIntegrationTest.setTrunksWithoutAffectingRoutes[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5afbdb4a-9732-4a89-8551-d8f1a3ee2d6b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "290ms", + "MS-CV" : "+0XCLPsl8Eyqnfc3eQ7LIQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZpsIZAAAAABQQLQSsrxtTYmZwLC2Utc3UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:50 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "41f76502-6acd-46eb-9d15-eab0b1bd33b7" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "iZfSjedfRkmwjt1tBB2Prg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZpsIZAAAAAAHffY9n4YESaWD2LeZNDQpUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:50 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e228d013-d767-47e9-9445-fa502c6ef01f", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "385ms", + "MS-CV" : "71Ud3Wk2b0+c4Pl4d6B08w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Z5sIZAAAAAAzTm2F1etiSZ1trPqn+5T8UFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:51 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0fa9b386-8fcf-4ce4-bc2a-b842e051b63c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "PYFZZaLqnUqJQjBDhcmERQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Z5sIZAAAAADz0IjsdqQgT6bDj2w40EmOUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:51 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fad6fa4e-f6d5-48ed-926c-7adf7f2c8313" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "bhOjAzobN0aOfwkLE/GsKg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aJsIZAAAAAB5NtEeX1bzTLT1N8KE8QlUUFJHMDFFREdFMDkyMQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 14:27:51 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExistingWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExistingWithAAD[1].json new file mode 100644 index 000000000000..7043a0a4fcef --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExistingWithAAD[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8cc8ecf3-5586-4f3d-9b58-1fb9cf4f24ea", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1362ms", + "MS-CV" : "wwIY/ORYXEC4J1fdTIBrog.0", + "retry-after" : "0", + "X-Azure-Ref" : "0J5EIZAAAAAADVzouMJOvT5iTm38e368SUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "623", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:07 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "bf92abbd-45a9-4e91-a2c1-3e7bfc8d0213" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "470ms", + "MS-CV" : "res1eJYubEi1QCInv0C9Yg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KJEIZAAAAADPnz8qdjF8S6QCLR7Fb7G8UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "623", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:08 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "54be90af-5a09-46b6-93c9-a0ed1a572f6d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "zuUmg3io7UGnJHARBtviqQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KZEIZAAAAADgwd7RHBGGRJ0uN7pHWtJAUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "623", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:08 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "85642d92-f9af-473a-8913-135e9da3647e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "400ms", + "MS-CV" : "VsRpaXze7UC9lcxUo2SwHw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KZEIZAAAAAAkqfyCVERPTrCQM0SAXL3uUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fda6d0a3-807b-465c-b00f-fbe93e34ab7e" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "ivtC7n8PCUqvGQAy3gDsUw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KpEIZAAAAAAgXGHaNkgRTLDlyc4AEqNjUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:09 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExistingWithResponse[1].json new file mode 100644 index 000000000000..58e64694f365 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExistingWithResponse[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "730e923d-61e4-404e-b741-fff464f252d2", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1148ms", + "MS-CV" : "1zZtWVopFEWg17sZlEQMlg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aJEIZAAAAACzGM8mnkucRb+PZ4ekWoDjUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "494", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5ada97fb-063f-4577-99a3-b14ca1f0de1c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "183ms", + "MS-CV" : "CUeEDMZxzECMfKBqQJ/DVQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aZEIZAAAAAC7pv7GvVgZQq8aydeQEvjqUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "494", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4ffac85a-7d70-4165-923c-62d87a2008c3" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "180ms", + "MS-CV" : "tDMZNuMY30KnTzu57thKzg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0apEIZAAAAAC6lVWb00lSSp9levuc1E+1UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "494", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567},\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ef65ace0-410e-41c9-a741-5ef4bb1855e8", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "651ms", + "MS-CV" : "y7L9BsNRMkKuj5hxJZVTcA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0apEIZAAAAABHCtLotzXqS5fKAXUuiXRMUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "48043ae6-64f3-4cef-a0e9-ca43d30e65e9" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "183ms", + "MS-CV" : "nmKMo8fbskKaM7Nwf7SXsQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0a5EIZAAAAAB4zRkPmKJaQ4BYf5fVQ6fhUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExisting[1].json new file mode 100644 index 000000000000..c233351a0950 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkExisting[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d2b90e6b-b2c5-4b26-98c5-277df1ca56e0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "984ms", + "MS-CV" : "XgdI/M1XrUKNEFw2Em2UTg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GZEIZAAAAABO2mrWg6wfRqWwM5ModH7/UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "340", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6b4dac22-f044-4930-a472-e312a65162fa" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "higFUaQujEuIXV5Uu9Iupw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GpEIZAAAAAD47jvuEcFwT7tnc2UTNw6OUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "340", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "bf01c61b-01ee-4089-a2bf-1872540808a1" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "DbQ3VCyRtkSTWgb76nwNvw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0G5EIZAAAAAARp3Jed7PxT4yX9ISpGmM2UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "340", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"delete.redacted.com\":{\"sipSignalingPort\":5678}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "eb8d5202-ae30-451e-ac0b-79dc835a0c80", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "403ms", + "MS-CV" : "E7sZ3l/+b06hsc6OG5QNkg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0G5EIZAAAAAAiRTa60haUQqSUUC7xygJcUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4219b359-cede-4497-a672-79197ae58ab4" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "hb9DtNhQUUGgPUYdIQGwDw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HJEIZAAAAAA1tI5boUWqRrNxnaSs0qkGUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkNotExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkNotExistingWithResponse[1].json new file mode 100644 index 000000000000..63fac3c728a9 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkNotExistingWithResponse[1].json @@ -0,0 +1,137 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "72ab09a4-de7b-4b1f-aef2-bd9c2d6426e5" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "d2smlXRtxkeCdZIBRlZP5g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TpEIZAAAAAAeLldnWlMuQb7tgZkvMjADUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "282bdaf8-4e4b-4f5a-9ea8-556c6bba4893", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "400ms", + "MS-CV" : "klbfUJyi2ke7LX5K3dHN7g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0T5EIZAAAAAA9otDRbd5cR6u5h/jV3OYlUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2b558b6b-dc2a-45c9-b372-3efb29873b11" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "0DWGiQpYXEuFKVDm8xsdgA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0T5EIZAAAAADxp7+5oWRURoev+icJR57QUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "27531f14-c0b1-449b-9506-a15e2caf13a5" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "uSLp8UONRkOmV7qC9jNScg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UJEIZAAAAABqVkdlXlOdRYe5Zw9WP4OwUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8c42ddb6-1f8c-4f3b-a1c0-c78a6b0e5e75" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "I8TnU9ttOkO/QAvqDboZow.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UJEIZAAAAACX6SQvaPx1Rr/ELdDP1gNCUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "81f7267c-36fc-430f-9f63-ecdcc84278a1" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "4TUWnUEiFUKnj7WlI5kS/A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UJEIZAAAAABRQ/FtBhJaSJQA0nd+aFEXUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkNotExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkNotExisting[1].json new file mode 100644 index 000000000000..00243bb0c6dd --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.deleteTrunkNotExisting[1].json @@ -0,0 +1,114 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "56d85db3-42ac-4121-8c30-8a729d5bf5ae" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "nrI9CYVkWEKWlK0Qz1XRlQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Q5EIZAAAAADSfGgPSfDkSqvA46UZ1cb9UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "85e7f959-9d20-425f-8eca-ea001101808d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "6KXCJsBETEy65khTKUfmCA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Q5EIZAAAAABEi5BPCiU/S599yWDiOVVfUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:35 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1308a6a1-4cb2-4e69-9b8d-38c99134d32f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "YzOshMKJ8EyMB/vlL5kO5A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Q5EIZAAAAABunP56D/IwTpo1dfxiQvVIUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:35 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f0532a33-c343-483f-97d5-e8a8f5dd5a14" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "167ms", + "MS-CV" : "ngJtnyGLnU+Ba3ZRNhlqYA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0RJEIZAAAAABjZ/tJczEFSpdQRGC6XRFgUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:35 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3a0a885d-0910-49ad-bb70-377f7ad41e6a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1540ms", + "MS-CV" : "J45Gg5vhUEmTGIPpTFj/vQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0RJEIZAAAAABdRadppLPkSo+UlW2AVJHMUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExistingWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExistingWithAAD[1].json new file mode 100644 index 000000000000..f943dc19b656 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExistingWithAAD[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fa3278ba-75a1-416d-8c9e-a05c09fcd1eb", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "506ms", + "MS-CV" : "6ppUTMtXBU+NS0ZMfmXHjw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SJEIZAAAAACdo5gwYMSaSaudGxvVZL7zUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "36f5b79a-49c6-4e08-99d0-cc6201ae2c63" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "yrrj4kRO8Ui6icxdKvpRnQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SJEIZAAAAACXeYDe7jYEQaL1vGQhV26mUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExistingWithResponse[1].json new file mode 100644 index 000000000000..434fd27a42a4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExistingWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9d3e0e3a-e81f-4919-95d6-f5776f23e9e8", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "947ms", + "MS-CV" : "JHKUpats2kaFTkDViLnbIQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0RpEIZAAAAADV0Txu7qIrSraYjhgvdA7YUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f6013848-48b9-4172-9e68-c5aeff86ef03" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "Q+zBaiJfIU+AAIncyFmmkw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0R5EIZAAAAAC35iJp//chT7Kv2xMqUpnbUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:39 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExisting[1].json new file mode 100644 index 000000000000..2f754e65c9ba --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkExisting[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5d0c771c-ef62-4d2f-9017-cafc75ed944d", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "518ms", + "MS-CV" : "rWBEOYRITEC8tTH9Y8wesQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DJEIZAAAAAAr2RdaybHtSYOPGzqifyGbUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "57b2432b-c151-4592-9d33-5207c5eab7db" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "iCxvCfWwnEOWM1CbObm/ow.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DZEIZAAAAABSKfVrh+zfQp1U7FlKwX0AUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkNotExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkNotExistingWithResponse[1].json new file mode 100644 index 000000000000..d201ccb73d7a --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkNotExistingWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e6307aab-fa09-4b8b-829d-034e8b818854" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "185ms", + "MS-CV" : "N+7Pa3QYKkio5d8wA4GVOQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FJEIZAAAAABzX2k1kPh2RLJShUlgoMOnUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkNotExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkNotExisting[1].json new file mode 100644 index 000000000000..c59ad099bc72 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.getTrunkNotExisting[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "cd575c91-7815-4fc8-bdc3-a2f60aeb0340" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "7XBOURHqKkSddpKaLU4ZYA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EpEIZAAAAACMx5FN9WESTKWPJgex/+B0UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:45 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesEmptyWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesEmptyWithResponse[1].json new file mode 100644 index 000000000000..7367f88d724e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesEmptyWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "01c3fc32-dba9-4722-b745-e4dfbd478bbf", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "296ms", + "MS-CV" : "VOs0iRinYkqucImj6p6cLQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bJEIZAAAAABoJZotQzPZSZ6gUHqAkDiMUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b6a08bf8-2293-4416-97a6-24f1622cdeb6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "H3nyox32E0mhZLMQ5DujYQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bJEIZAAAAABw9siGjM8dQqTAYP/itNyfUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesEmpty[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesEmpty[1].json new file mode 100644 index 000000000000..8dee6f91bc15 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesEmpty[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0ebde142-9f57-4fda-bd12-46c35585d824", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "284ms", + "MS-CV" : "01oW2+tu6UamNeFqbXn2kA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SZEIZAAAAABnQYEwYNXfQ4b/fOUIg1L+UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ee64c4bf-44fe-4900-bdd1-c04a589afe3e" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "kjdyhV1+10OK+jsNqfUbyA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SZEIZAAAAADDA7lZSZT/Rqd651n/wvwyUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmptyWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmptyWithAAD[1].json new file mode 100644 index 000000000000..e4ea5498fb84 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmptyWithAAD[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "678103a8-7acb-4e86-aca3-8dc2265c7ec5", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "284ms", + "MS-CV" : "cfyMQiO0SE2mpAwXks6qsA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0E5EIZAAAAACTddoliRvTQKcu/3uW2brdUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "509e81ae-0de4-45a0-815c-9fd503eae2dc" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "jbddZjgbSUS7HqcspbKPJg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FJEIZAAAAADY4R0ryeGhRJUFlIYhWI/1UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmptyWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmptyWithResponse[1].json new file mode 100644 index 000000000000..eb3b8f0bff5c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmptyWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "42306f1c-28a8-48a2-b3ff-33dc9bda03c4", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "296ms", + "MS-CV" : "9zQFEkXO6Em4BsKgC0oohQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WJEIZAAAAABXNHwB3NiWS4xzYYaYbmsRUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "48daefcb-1b45-446c-bdb7-66df5bab968f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "UqGXqXCd/EmKIA2lzDBmZg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WJEIZAAAAACl3cDBXvRfS44nXK1NUPkfUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmpty[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmpty[1].json new file mode 100644 index 000000000000..528ed358b1ff --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listRoutesNotEmpty[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fef2ec47-1419-45a8-a24a-95043495a890", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "289ms", + "MS-CV" : "Zv5xvpkH9k2S5c8UoSobtA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0O5EIZAAAAABhQBt+e66+QZl8kZmmZZTlUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5fcc5219-f2cb-4179-9a2d-7fa565b9a174" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "188ms", + "MS-CV" : "9RyKvTcigEK3DFGrdzCtfA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0O5EIZAAAAAByZNE6EKCQQra8jDJ/2De2UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksEmptyWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksEmptyWithResponse[1].json new file mode 100644 index 000000000000..69ae2c833507 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksEmptyWithResponse[1].json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "08fb9b30-ad5b-431d-b350-18bc569488e2" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "TZ1e9v3uY0q+Mpga+GL0PQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0L5EIZAAAAAA63GI2kvBXSZDnGjzTymQhUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6b9cb5a7-1fbc-4459-a15b-dcc2ae997d51", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "428ms", + "MS-CV" : "jGC9UieFqUOkWWT6SbR/Hg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MJEIZAAAAADB8NmfcW+uRawM5yV1uknUUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8dd5b590-3f71-4e6d-bce8-b705e4533151" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "216ms", + "MS-CV" : "E/Ceeqj6RkmwGfdiAbxKsg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MJEIZAAAAADFw47uR+EERbPmPLM4sO6SUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksEmpty[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksEmpty[1].json new file mode 100644 index 000000000000..39de37926726 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksEmpty[1].json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9f572f40-a500-43c9-ad83-68256cf46400" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "184ms", + "MS-CV" : "Cu3YTwW54kiPA3mvjafwPg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NpEIZAAAAAAUkTsg/u4AQI42hSvHnhD2UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2e5ba4f9-5b43-4abc-beca-ffb7448280ad" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "sWUlyLVSmkO7RuPfWe4XyA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NpEIZAAAAACbN72hp0PPQpzXqsaYzS8+UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmptyWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmptyWithAAD[1].json new file mode 100644 index 000000000000..aeb72138919e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmptyWithAAD[1].json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "22f8cc9b-8f3f-4e6a-a48f-e43f9dcb8da1" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "IkILt4kLPESjyLlcQUUjFQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FZEIZAAAAAAp66gjhfrvTrDZZypywY5jUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:49 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a5af8d5d-7dfa-46e0-a0ea-a33d1cba70b6", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "620ms", + "MS-CV" : "SH1cHzfTskCJdhQ+u7kbAQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FZEIZAAAAAAZRmquFY7PT7MBsCWgXNHZUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:49 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3ccebe34-9678-4747-a6b4-3b490005b85b" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "oW6MbRj/bkuPPwEL3ycIlw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FpEIZAAAAADmCtRuWvk4SagUTR6fxIYrUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:50 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmptyWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmptyWithResponse[1].json new file mode 100644 index 000000000000..53502289aba7 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmptyWithResponse[1].json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ca9e04a3-0523-49e5-b4ef-fc6e1cbffa14" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "ylhPxU5nBkCCCiwWSdp3vw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VJEIZAAAAACToHUfSbevQLWUNa5+GOlRUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":7651},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "52e3ab0b-1f94-478c-860f-5cd5c0339253", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "624ms", + "MS-CV" : "mbh7NTxOTUOLGzsgBq2FnA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VZEIZAAAAADSjBtXK0eoQof4Zl70CpgUUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:53 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e22de25a-cedd-46af-b1be-bcc6789cd177" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "184ms", + "MS-CV" : "DejyqixYOU+TLvu09aljdA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VZEIZAAAAADkSBN8j81vTJxoQbz5/km0UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:53 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmpty[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmpty[1].json new file mode 100644 index 000000000000..cc98392a1361 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.listTrunksNotEmpty[1].json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5f813f56-e26a-4ef3-8003-4d253a3db7c7" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "186ms", + "MS-CV" : "VxNEVBk5jUaqKTFmseOqDA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0H5EIZAAAAADVBTrnHvLSR6Dh3zlCeupQUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4df76510-e24f-44d1-b2f9-4f73947996a7", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1098ms", + "MS-CV" : "aAmDfzP9c0a0E7Ei4KSmfw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0H5EIZAAAAACiQz1yyY6vSJO+Lwy4UOuXUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:00 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "301d46ff-8d78-4129-a2d4-eac416e5ef8d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "197ms", + "MS-CV" : "u1wpywwbuUuhYJugFpOfoA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IZEIZAAAAAAZxDzvkba5Rp/WpqPmxU34UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:00 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..d3bc1b476099 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesEmptyBeforeWithResponse[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9bc470e9-525d-4edc-bc86-5926a046eb0e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "358ms", + "MS-CV" : "ZZwtA2k7OUKYnB7HaEJ6vA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SZEIZAAAAAB/zpJyCt1sTaNnYVoZJ1LMUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:41 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5d4d038c-0038-4cee-a99a-0bd3df174a82" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "miFB8S75sEOVq12TF69vTw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SpEIZAAAAADuMYX3UZ+PS5y7Cjp/+b3hUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c804ccdf-d179-4914-94f5-0e8b094fb16e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "277ms", + "MS-CV" : "uMtSfvR6Dk613xRJEs47Pg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0SpEIZAAAAADFDHVOMSTnS6sFpL3NaoexUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "edee1a71-b878-4687-aea7-572b7cc3ebdd" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "180ms", + "MS-CV" : "9277vWpvx0+z+wCnWpuZcA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0S5EIZAAAAAA2/tEvwuPASbQtnQOiW4ziUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesEmptyBefore[1].json new file mode 100644 index 000000000000..e14501599c5b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesEmptyBefore[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7d6969ed-a66c-4c70-b525-d27136d4672f", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "294ms", + "MS-CV" : "ATtSPv4ihEm5blh/WgjuMw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ApEIZAAAAAC57HqEV+VpTqebq9GGUuKvUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7e2cc872-0612-45bd-89f7-5bbc4b19ae0f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "abqaNunAE0i7ztOJ0gZ+LQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ApEIZAAAAAATlsHWo+R6RJAsjXNajGYkUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c693150c-4276-44d8-9918-83079f15da15", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "299ms", + "MS-CV" : "k3VhPMCn4kqkOVza/i+iWg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0A5EIZAAAAABNz9VNQVioQL2lAJPdv/rVUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "da099301-2b60-4685-aa76-6f051afc3cae" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "mdhWziserEqDi4SA0GeszQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0A5EIZAAAAADdQisXn+liQIpXtDp9JmXTUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..ef5994d46b4f --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "de55ea81-dcf0-4d20-bd82-576b97512f2c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "366ms", + "MS-CV" : "HcGzi4vfJkyPTAqmXDlsHw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/ZAIZAAAAAAH374r+irNToJp3h1dXQrdUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "24d95467-5ecd-402b-823e-b08a9364db79" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "215ms", + "MS-CV" : "a54gdAQbzkCA3vc4X+Mm/A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/ZAIZAAAAACNBxd6TebpSbVGMr2JZDl+UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "77b26864-85e8-4c21-ad55-23c70e2bc0e8", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "320ms", + "MS-CV" : "6pbrnJo/e0yL05EuzR5k0Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/pAIZAAAAACgQ41uSx97S5NvT7T0vKSBUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "264fdf08-1e8f-4632-b381-23824af76c33" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "220ms", + "MS-CV" : "NtUjnN1IiUGBGdf50d6eZQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/pAIZAAAAABjC55CvS0cRqvJCO2vnoNzUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesNotEmptyBefore[1].json new file mode 100644 index 000000000000..2e3301e0941b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyRoutesNotEmptyBefore[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "09cc2f39-cdb2-4525-ba80-64bda67cd5ed", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "289ms", + "MS-CV" : "MFJa8y9PpkSN8JCtUOJbvA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TZEIZAAAAADJ6SmLmkOCQ6jrYemcpUQQUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:45 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b33abed0-1bbe-4170-bedb-0289369c5514" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "166ms", + "MS-CV" : "eL5/BhuA8kmYwRClFMZ71A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TZEIZAAAAAAqAi2Bj/3PSZ8Faev8R2gQUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:45 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "999dadb8-718f-447b-b72d-be3f94032ed0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "294ms", + "MS-CV" : "U/QoQmC1DkGPT8gksXckiA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TpEIZAAAAACwnjzLbE4wSqjEoeREOMjGUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:45 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "521a8870-5c1c-4c6d-a6b4-ae460eb11291" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "Z3bGoZmt4EC/abN2t56iAA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TpEIZAAAAADzROsNv62uT5nVomg3v0RNUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..5a36b18f261e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksEmptyBeforeWithResponse[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "31d3ff50-50d8-405a-8182-ae4f71a202a4" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "xDaHmHkcCEi/LX1j+Jy30Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bZEIZAAAAACT46uVrKP/RZW4LGl8m09fUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a6e021f4-42de-4740-beba-ae40c26244d1", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "406ms", + "MS-CV" : "uiJPiSXEgk6o05P7xukpmw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bZEIZAAAAACl8OHCi3ixSo20pXaMz7ClUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "df6e8733-da1a-4663-81d2-a9d05176a382" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "182ms", + "MS-CV" : "gzxvlU6wMEuU39i4OGXB2A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bZEIZAAAAAD/UzySI661TrpApWw04uJsUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8e085570-8705-406d-abfc-176a3e1285a6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "arvxZMfRE0COboakKCooiA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bpEIZAAAAAAK/fHA3dTrTJsYTX8IzruGUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a469c978-2071-400d-81b3-60ea9cc85069" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "xuv5ubZjJEie1Wq1mFq9nQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0bpEIZAAAAABKoxepeDpPRowmylsDyE34UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksEmptyBefore[1].json new file mode 100644 index 000000000000..afe032b9d2a0 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksEmptyBefore[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "012f3ba6-78b6-46f2-989e-09ce8714b57d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "vXlXSQysQUq/cHZgGd6Azg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QZEIZAAAAADf9/bgP3cSQoDF0qHO10xMUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "176207ed-db4b-4d8c-aacd-e82b09954a78", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "397ms", + "MS-CV" : "f7CXyS68lk6jyrI5es68/A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QZEIZAAAAADluBcSqilASo5uRjkVyOS6UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d9b3b853-d615-4194-8e43-d21ebb28df62" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "ccLwAcE3IU6IfJo+CvtMdA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QpEIZAAAAAA1g8lcmFteQ4CsHPq7Fb1uUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c980d4bc-ccee-47dd-927d-c2b051e93cb3" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "fsbfLHVLD0aJjFV1aoq8Sg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QpEIZAAAAABidiGdldXkS7sQHq68ee+FUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e0f8bae7-8dbe-442d-9699-6851c7779238" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "SFauwFioUUCMkCEKfv37rw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QpEIZAAAAACFMFBsieASRqFwuxB+LQoSUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..5bc769611720 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c581ccd4-add1-40a5-aa66-4f74fa31a8ea" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "421ms", + "MS-CV" : "SoG8n/ZIqUSQFC2OI2baTQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0+ZAIZAAAAAA6YpJbsptQSI6aLymDoeG7UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "50462f6b-0315-4a18-b78d-8eb6a1bfb1f5", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1439ms", + "MS-CV" : "W79PYsXQ2Uaw0eaXxQfT1Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0+pAIZAAAAADm67S5tRj6RZJLtU23OhEKUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e562f989-72d8-442b-a762-b4044b6a25d8" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "GwW/H7ZH202uuJlS/7mB9A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0+5AIZAAAAACAGjY345ldTbG5zrJ/BeT+UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b80cb9c4-a5f9-4bc1-8d36-5df08a4fa759" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "200ms", + "MS-CV" : "4ZKFSaNlQEqZp1zesejwEA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/JAIZAAAAABJfhto/InpQpXQnl9Sf1W5UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:23 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "46d654bc-45f1-4280-bfbb-c0fd75ac5a17", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "401ms", + "MS-CV" : "mVXomd6syk+lUxU5BCNcUg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/JAIZAAAAAAWHlTey1OzRbgMxhb0O8zKUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0b6a1560-b679-4174-accc-0abffc924c6a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "FpIeLkHUrUWO1qYdq4UoUg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/ZAIZAAAAAB1UxvVN3yNSbnRSHhfc2vGUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksNotEmptyBefore[1].json new file mode 100644 index 000000000000..12a37312ca5d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setEmptyTrunksNotEmptyBefore[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1a2ee443-7a13-40ea-8fba-cc66cba36714" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "185ms", + "MS-CV" : "qssIZG0Xkky2+jHM+QUrfQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FpEIZAAAAAAU+zjAsnV4TYemsndP6lVaUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:50 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5e645800-aecf-4ffc-b441-54fb52f722f5", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "532ms", + "MS-CV" : "OvbZs8H0l0WsH+8OO9/EWw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0F5EIZAAAAABFS9VyKg2aQ7gs1OnDzBqbUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:51 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f0e07cbb-f2cb-48ca-b7d0-dca559da7f07" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "Q1o9M5W40UmMypTsRTMThg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GJEIZAAAAADS2EuBrUl7RJw7bTlke/UyUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:51 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f2a8e483-7f25-40ba-b893-17e4bf9f8920" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "179ms", + "MS-CV" : "F63B9F5TWUa0CsNQ14rUxg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GJEIZAAAAAAdZbPNkNZpRboyyfUbK4b0UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c4a5d051-a58d-4be4-8904-86c242b78939", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "408ms", + "MS-CV" : "YjeeL4n8K0SGYSnGGfacKw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GJEIZAAAAAC0m6zRt9rATLgwb6BNlqvxUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "93e02372-d596-437d-b02b-c5887d8331e8" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "vCSommGCBEa7E6skpK3gTg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0GZEIZAAAAACU+ghYa4rLToav9tzVG/FEUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:53 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutesWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutesWithResponse[1].json new file mode 100644 index 000000000000..85177eeae303 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutesWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6efd79b7-1778-46f9-a5aa-1546dd823f70", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "16ms", + "MS-CV" : "k9UHULW/ck+ewkMr9nCFGQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BpEIZAAAAAA3UDNbq8olQqBspUfM5llWUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "400", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"DuplicatedRoute\",\"message\":\"There is a duplicated route.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:34 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutes[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutes[1].json new file mode 100644 index 000000000000..36548f62230b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutes[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e9508a64-2e83-4134-8c45-1be59499db37", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "35ms", + "MS-CV" : "V0kd6oS3nkySbiYzWnmmog.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HJEIZAAAAACVGI2vD65HSbHGn7MXt2mlUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "400", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"DuplicatedRoute\",\"message\":\"There is a duplicated route.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:56 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutingTrunksWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutingTrunksWithResponse[1].json new file mode 100644 index 000000000000..6711e4e9264b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutingTrunksWithResponse[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "209f7d5a-3be0-43db-a41f-edc02eccace2", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "922ms", + "MS-CV" : "ShNGRvGXFkSxzVfghrYORw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IZEIZAAAAAC0buhYC458RJcsUbEaXke9UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7b47683f-c53f-4bcd-ac3c-d75bd552df43", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "14ms", + "MS-CV" : "1lReiWfGo02Sh6GkoY4ZQw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IpEIZAAAAAAtA7kS0pEJQp1xo7M1UmmgUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "400", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"RouteWithDuplicatedTrunk\",\"message\":\"There is a duplicated trunk in a route.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:44:02 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutingTrunks[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutingTrunks[1].json new file mode 100644 index 000000000000..3f5972cdb196 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesDuplicatedRoutingTrunks[1].json @@ -0,0 +1,49 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c0b9de62-bfa2-4223-a0d9-6d6fe172844a", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "541ms", + "MS-CV" : "R/hKjVdOT0iyvG2xlr/UNQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EpEIZAAAAADnjAjFiWH0SKPS6LFPOjjYUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:46 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fee6795a-b778-4137-a8b5-6125104102a8", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "14ms", + "MS-CV" : "U4zOLkRb3U6fc6EsWm5gSg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0E5EIZAAAAAAmsojLOL2IQ5Dp5R+ZeTf6UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "400", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"RouteWithDuplicatedTrunk\",\"message\":\"There is a duplicated trunk in a route.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:46 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBeforeWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBeforeWithAAD[1].json new file mode 100644 index 000000000000..31a2aa470707 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBeforeWithAAD[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2f8c6d4a-eb2f-408a-bb45-d38bf07bd9b7", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "291ms", + "MS-CV" : "0dBxApUC1UmpG4ciKLOOpw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0P5EIZAAAAADEVEt1yj83QblN5XhYnX9QUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ffc075a8-cace-4578-9512-f94360fe3123" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "aOYpPN3tkUm3tLTgdPqiqA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QJEIZAAAAABZuuV668h4Q5Ormk44qCQRUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f1d3fbb6-ecc8-4234-bc79-23199fe47b22", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "298ms", + "MS-CV" : "r9TRFGoCT0KzYTkrk9+0LA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QJEIZAAAAAAJy2jP1MhsTb5sBDyTH294UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "75f4b475-1fc0-42b2-9f34-cbe256d8b50c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "PLEC446Yx0SykHwBYFaR/A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QJEIZAAAAABiv5TXEQSxRYJzuzrUiOH3UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..ac784b3cb2ab --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBeforeWithResponse[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9cc93093-0768-4f3c-8a72-8bf1ceb90997", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "285ms", + "MS-CV" : "gD5j1WXjxE29som+5W52Uw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0S5EIZAAAAAD5SK0lLZBQR6LwbI4a0ncHUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:43 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "73a29058-b910-43cf-b2d7-6ff302da2b7d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "0GSYbcmNjUG9grAgfICFOw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TJEIZAAAAAAVyUFjaITKSImWaaqmruQjUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:43 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "772d0935-2fac-4eb6-98b5-976ec0d7ca71", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "287ms", + "MS-CV" : "gaJWsPKYqUqE7XhT18ztUQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TJEIZAAAAAD06+st+D0ERKKCUlTfWIbDUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "68c28454-34b8-4554-9ff3-247cc7e31b3d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "182ms", + "MS-CV" : "q/cXN1SYo0G1CWb/Oq+DkA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0TJEIZAAAAABD7CW4QrseR6OoEn6REXSUUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBefore[1].json new file mode 100644 index 000000000000..49f9446292cc --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesEmptyBefore[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "994b6eb4-abb0-40cc-a3aa-6c0cfe869651", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "295ms", + "MS-CV" : "BiGBX7+BQ0ijP6BNCISFYQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YZEIZAAAAACAqTgdDKTPQK3DO21DRTGPUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "808b82d4-ac51-4679-8d92-6a51f1d9c636" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "Z4ce7q3WwUudl594iN5OiQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YpEIZAAAAAC2u1BbWNHASLahw0RVgxMCUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a81478b2-4761-4661-a529-654beda6aaf1", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "276ms", + "MS-CV" : "mSp8FjrPuEmUPXvkftvxPw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YpEIZAAAAAB53XhK1CxYTIyb1wegQIrRUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:06 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f39a7f69-1831-442a-a1c5-e1d350f85512" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "189ms", + "MS-CV" : "hUppOyR8S0mN9PIQKMIavw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Y5EIZAAAAADCj0A9btkKQLvf74gP6H5uUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:06 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNameWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNameWithResponse[1].json new file mode 100644 index 000000000000..8ab194f7726a --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNameWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a3b76b0b-b2f4-4bfa-8f30-9c5cfe4109f0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "18ms", + "MS-CV" : "Vvf7M3OXPkublUvjYUxU3A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EZEIZAAAAADDWyu5uOgWQppo0hmVk+7BUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteName\",\"message\":\"Route with an invalid name.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:45 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidName[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidName[1].json new file mode 100644 index 000000000000..0d346d0b4b91 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidName[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "04cedd60-f421-4c80-8163-dac3863df9c7", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "18ms", + "MS-CV" : "TZBdHvefmkalENUwuoeYRw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NJEIZAAAAAA8PkZSzqOSR6EJLTtrOwH4UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteName\",\"message\":\"Route with an invalid name.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:44:20 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNumberPatternWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNumberPatternWithResponse[1].json new file mode 100644 index 000000000000..e9b73938a923 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNumberPatternWithResponse[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4ff1c256-c490-43f6-af9c-52040c502ad6", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "36ms", + "MS-CV" : "od20PEQjTkupHfpTAdwURg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0+JAIZAAAAACJKrD7heNVQrH75K1cf+ltUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteNumberPattern\",\"message\":\"Route with an invalid number pattern.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:20 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNumberPattern[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNumberPattern[1].json new file mode 100644 index 000000000000..b869505e8128 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesInvalidNumberPattern[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "91a9fc9e-8924-4091-bc2d-9a9bc2726b0c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "31ms", + "MS-CV" : "/4JfSINk+kClAm0E8lkKQQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0FJEIZAAAAAAcvktAi1XNS5WugGMXGxFCUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidRouteNumberPattern\",\"message\":\"Route with an invalid number pattern.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:48 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesMissingTrunkWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesMissingTrunkWithResponse[1].json new file mode 100644 index 000000000000..45991711195d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesMissingTrunkWithResponse[1].json @@ -0,0 +1,72 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "058abff3-e7bf-4309-a20f-1c88e9368dcb" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "VGzlWQLkyUSeu/763WtAMA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NZEIZAAAAAAqsTlbmIM4TLF988nngnjqUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:20 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0d508672-0663-44d1-b3a4-1ecaceb07520", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "396ms", + "MS-CV" : "Qj/YzV1+kkGKG0yBIma3JQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NZEIZAAAAAD7hOGNw9SISYRr5eR6+duRUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b0336964-5c2a-49d6-961f-f60400a3db08", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "245ms", + "MS-CV" : "ka8Nsy2OxUqS9Dt1Lzqgjg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NpEIZAAAAACxnZp2LgWtTqlrnh5riZ5XUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:44:21 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesMissingTrunk[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesMissingTrunk[1].json new file mode 100644 index 000000000000..ce6d4ff7a53b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesMissingTrunk[1].json @@ -0,0 +1,72 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "2e7624b0-f6ef-4e8b-8f0d-8365f5ec060d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "AHB5bSPev0Ci1npdHqB7Kg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KpEIZAAAAAAV2khZYdHEQZRd9JNtRqwNUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4f77621f-3b35-4999-aa15-194247993681", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "405ms", + "MS-CV" : "WRV4lMQq7kqJAOYCrkE4Ew.0", + "retry-after" : "0", + "X-Azure-Ref" : "0KpEIZAAAAADMTRpd+OUXQpaSdsrkkNilUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6a1f62c1-6c68-41d5-af70-7413ace4f9f0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "245ms", + "MS-CV" : "jOlaWFC7806rACNPwtyLEw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0K5EIZAAAAACR65CWM3+/Tp9KEDNjIVxtUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:44:11 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..e2ba7dc5ff7c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1a8228da-0a75-4ee1-9f08-94f418d6888a", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "281ms", + "MS-CV" : "E41IM5IneUiAKOZGoV319g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0X5EIZAAAAAAOJ1RVlfFcRpJbusIYJeEIUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "608", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"des90\",\"name\":\"route10\",\"numberPattern\":\"9.*\",\"trunks\":[]},{\"description\":\"desc91\",\"name\":\"route0\",\"numberPattern\":\"8.*\",\"trunks\":[]},{\"description\":\"desc92\",\"name\":\"route21\",\"numberPattern\":\"7.*\",\"trunks\":[]},{\"description\":\"desc44\",\"name\":\"route24\",\"numberPattern\":\"4.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "12ecd3d7-c155-404b-bcc6-47edf205fe68" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "180ms", + "MS-CV" : "dTMljnZYbEyabx2cUzEA3A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YJEIZAAAAAABd/h84ZrbSaUST2cWhDWKUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "608", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"des90\",\"name\":\"route10\",\"numberPattern\":\"9.*\",\"trunks\":[]},{\"description\":\"desc91\",\"name\":\"route0\",\"numberPattern\":\"8.*\",\"trunks\":[]},{\"description\":\"desc92\",\"name\":\"route21\",\"numberPattern\":\"7.*\",\"trunks\":[]},{\"description\":\"desc44\",\"name\":\"route24\",\"numberPattern\":\"4.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d44ea5e1-2cc9-4504-b98e-d9814f78e2c0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "301ms", + "MS-CV" : "W2qDpexi4EqhAPtT5EOjyQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YJEIZAAAAAC0VhbwKJasRLpoZuws2bGVUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:04 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e3916fba-047a-4845-b601-4eeec7f527a6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "KWNy74RFSE27HcGvQW//1g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0YZEIZAAAAABOs7r0v/peQI22xIEhGsd8UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesNotEmptyBefore[1].json new file mode 100644 index 000000000000..569815520941 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesNotEmptyBefore[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "576eeaff-0e87-4f05-bd19-a6dc0143995b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "297ms", + "MS-CV" : "IK9s7wTQ3UKyzueFMNX/RA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cZEIZAAAAADvLi13k7ICSZ+XmfvwGVFAUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "608", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"des90\",\"name\":\"route10\",\"numberPattern\":\"9.*\",\"trunks\":[]},{\"description\":\"desc91\",\"name\":\"route0\",\"numberPattern\":\"8.*\",\"trunks\":[]},{\"description\":\"desc92\",\"name\":\"route21\",\"numberPattern\":\"7.*\",\"trunks\":[]},{\"description\":\"desc44\",\"name\":\"route24\",\"numberPattern\":\"4.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e4e15a19-dcbc-40ea-b6c0-75f8fb7f62c1" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "nShOj0l9F0CI51oNr3nDpg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cpEIZAAAAACYoqbJJ0NhTbQ5yNIcQOEAUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "608", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"des90\",\"name\":\"route10\",\"numberPattern\":\"9.*\",\"trunks\":[]},{\"description\":\"desc91\",\"name\":\"route0\",\"numberPattern\":\"8.*\",\"trunks\":[]},{\"description\":\"desc92\",\"name\":\"route21\",\"numberPattern\":\"7.*\",\"trunks\":[]},{\"description\":\"desc44\",\"name\":\"route24\",\"numberPattern\":\"4.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "933f1e74-49ae-44a5-9c38-11f7f8e075e1", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "305ms", + "MS-CV" : "Ol1DjKB2kkCirfQMCM3ubg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cpEIZAAAAADfa3umAgmeQZXbf7PqMvo+UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "eec02f88-bf82-49e0-9e9f-b2aa89f272b5" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "191ms", + "MS-CV" : "Zy2sTKV5ckCzVX/1r4gVtA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0c5EIZAAAAAArmeTgLJorT5P0t1BtUAO4UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesWithoutAffectingTrunksWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesWithoutAffectingTrunksWithResponse[1].json new file mode 100644 index 000000000000..867a064514d8 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesWithoutAffectingTrunksWithResponse[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ff6b3acb-5dcf-47d4-b1be-698aab4fb4b4" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "+mU49yTt60iba7t4Fytdpw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BJEIZAAAAAAQZtAKveuHQJln941LS7IcUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1ae5bfae-3828-4e76-b99d-bdb8a1868493", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1191ms", + "MS-CV" : "M7mn1CGJI0aqyZjMFDF2UA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BJEIZAAAAABf2aNkMt4gQ7dI8yi8P7pbUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b9fbb3b7-1530-4147-9ab6-246e2a647a90", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "282ms", + "MS-CV" : "KOuvqY4CZ0u8Zalc6Vu8kQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BZEIZAAAAADcL9RoxCn2QrHqPJh5LxmAUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c8188f5c-d8d5-49e0-be11-ffea1aed1c48" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "FPHVypj1+EyscUFeqj2KpA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BpEIZAAAAAC04Mo9ArgCRJKGU3LdM15SUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:33 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "da69bd30-ec5a-46cb-94d7-af27250c8f74" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "0n4EckTKEU+djllc6QY4Fw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0BpEIZAAAAABK2KyHATEYQpZcna+Whrq8UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesWithoutAffectingTrunks[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesWithoutAffectingTrunks[1].json new file mode 100644 index 000000000000..a5c1796ed018 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setRoutesWithoutAffectingTrunks[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "87cd9d53-7579-4077-9220-b8bc2431fd2d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "192ms", + "MS-CV" : "pwINmkyFbUeGDOs5KMKj4Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0K5EIZAAAAABPVuUvj2yWQadoZkYxM/DCUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:11 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "87b9dd82-ce22-422d-9b93-230b8c868a04", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1176ms", + "MS-CV" : "jyZzFqheCEio/i3vD4O4RA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LJEIZAAAAABJRG4KMeQ6TrlrkwMf2yF9UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "405dd41a-655d-492b-94c0-97cc5a3b1b43", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "309ms", + "MS-CV" : "uER5K1lrdUa5shElXjom2w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LZEIZAAAAACmfjPdZqXYR63DKCtSio2SUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:13 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "92de7d1e-86b5-4833-826c-bee2a0b3a2f5" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "566ms", + "MS-CV" : "pymhU+Xaekykkf7i+oGfDw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0LpEIZAAAAADdUCtd/1a6SqVHJzFIdEYMUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:14 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0638ca40-c66a-4d52-8795-f2bcffc2a695" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "182ms", + "MS-CV" : "kHpDA92ZA0S7lHr/LQ3RKA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0L5EIZAAAAAAxYaJyKV7UTbEng42TGUHcUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:15 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExistingWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExistingWithAAD[1].json new file mode 100644 index 000000000000..c3d3c6631410 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExistingWithAAD[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "e195d36b-08b9-498a-a0d3-658f2c6d5423" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "604ms", + "MS-CV" : "EazvZeGGi0aaqgGsTpS9JQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0CJEIZAAAAAAHJrHU3inIT5CVD3iZAVDiUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fd9340df-3ba3-423d-8057-aabff54d9360", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1213ms", + "MS-CV" : "JC7jv7dPlUentJO9c4TmqQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0CZEIZAAAAAAEnHm/GKfFToG3PW52s18eUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "106e2d22-f785-4c46-a019-d550a8b06e9d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "AzdHmjqPcEWuPJzp0ikp3A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0C5EIZAAAAAC8w47dmoQXTbUG61X81zueUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:38 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7e24efdf-bce1-42bb-9e4c-1bba72e43b27", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "577ms", + "MS-CV" : "SIF2MYogXEeBNPqpaX5ZDw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0C5EIZAAAAADrpUQZvOlZS5e4A45falUNUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":7651}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:39 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "169248a8-61da-47b7-a46f-050ed4d8578d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "188ms", + "MS-CV" : "osEBvfsGKkGsW8OTbHGBhw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DJEIZAAAAABlzbjK+M2NSqv9852BgpARUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":7651}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:39 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7b0d93f5-9002-495e-9c29-bb77eddcc2ad" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "185ms", + "MS-CV" : "8NhC8vH9fEqlVy+oFHtWAQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DJEIZAAAAACo12bcaSVnSLRdV6QNehelUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":7651}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:40 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExistingWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExistingWithResponse[1].json new file mode 100644 index 000000000000..8ca95c5ac6ca --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExistingWithResponse[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "5ba9e477-8ed3-4a33-ae1c-21951910f8d7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "275ms", + "MS-CV" : "xnqgs94owU2KmdYCoUzqUQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Pm3XYgAAAACXyzq3KOIsSbZQxi7AK1YAUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 20 Jul 2022 02:49:34 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "6d44f299-bbca-4211-b6fb-704d3227c505", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "962ms", + "MS-CV" : "Zk7pj8arMEGolhELzWhsNw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0P23XYgAAAADQMCl2u5rrSa1kSR9GmOluUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"4.fqdn.com\":{\"sipSignalingPort\":4567},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234}},\"routes\":[]}", + "Date" : "Wed, 20 Jul 2022 02:49:36 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "25fd3ec4-239b-43ef-b723-7d1b950742bc" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "162ms", + "MS-CV" : "QGCdSRwV2U6p5rkBDswQPg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QG3XYgAAAABuDBGtXAHfTKOlPNXm064TUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"4.fqdn.com\":{\"sipSignalingPort\":4567},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234}},\"routes\":[]}", + "Date" : "Wed, 20 Jul 2022 02:49:36 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "dc46561a-3dc1-4405-8bae-86388374f46b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "342ms", + "MS-CV" : "QPZHhgkwcEa07KVkozZRtg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QG3XYgAAAABYMD/CKe7lQ7e3+FIkDBX9UFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"4.fqdn.com\":{\"sipSignalingPort\":7651},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234}},\"routes\":[]}", + "Date" : "Wed, 20 Jul 2022 02:49:36 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "151fb8a1-e541-4762-b00a-56763f04989b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "169ms", + "MS-CV" : "4Kh+wmK3j0yGE0+A9dpOLg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QW3XYgAAAABhGjnM8T4kT7snIO9/vcm5UFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"4.fqdn.com\":{\"sipSignalingPort\":7651},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234}},\"routes\":[]}", + "Date" : "Wed, 20 Jul 2022 02:49:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "7e7dd045-bc09-4b7e-82d1-5b957ce4ae2b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "150ms", + "MS-CV" : "y+ZPGXcBNUWE+PYf92V94A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0QW3XYgAAAACLfAe5lgzvRr1HYXOD9WC6UFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"4.fqdn.com\":{\"sipSignalingPort\":7651},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234}},\"routes\":[]}", + "Date" : "Wed, 20 Jul 2022 02:49:37 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExisting[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExisting[1].json new file mode 100644 index 000000000000..d822166c0728 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkExisting[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b57ac25e-4767-4815-8060-c96004d9a687" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "ruMOEJ0uWEqYuLWKHyTKFw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UZEIZAAAAACbVW0wP4YuS4IXnZr1FXNBUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:48 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3019935f-569d-412d-8708-b4aeeff194c2", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1174ms", + "MS-CV" : "D3xvqVXfQE+6unNd5mU9FA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0UZEIZAAAAACe8DUqcGs6Rr/7Ep+5vcjaUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:50 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6d342364-1a7b-4682-96c6-f508278cc9e0" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "OSVKHMUW6kqKMUSjBxF/Iw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0U5EIZAAAAAAMj4FePtDgR5exJu5sxhW0UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:50 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3b782f80-5ff2-4cc5-b856-420c476edc0b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "539ms", + "MS-CV" : "bn5Xnz8O+UGkePrrgYcM7g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0U5EIZAAAAABqe+g7I/eURKuASMrpc1daUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":7651},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:51 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "397a7b1e-93f5-42ac-bd59-d581e097bfc6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "179ms", + "MS-CV" : "mD0IRNzk2UiceXHva+fRlg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VJEIZAAAAAA6e0qUp34GSLn3yGTp2aZ2UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":7651},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:51 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "faf48487-4c64-4d45-85ca-70e29e1c5afe" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "178ms", + "MS-CV" : "xSgUkD9QX06Fvwvpyvy2+w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VJEIZAAAAAC+iq93/tYlQ776VkrNh9YIUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":7651},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:44:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..c4e5913d4a8b --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingEmptyBeforeWithResponse[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "25a781c0-d3b8-4612-9b2e-ab85510bab89" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "151ms", + "MS-CV" : "3tBX/SvK30KUMijLkacmhA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VG3XYgAAAACCS/l2lT8RSbvRcRKBbWvDUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"1.fqdn.com\":{\"sipSignalingPort\":1234},\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:49:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "fd1b87dd-8bef-4851-83e2-c8b9dc9453ab", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "351ms", + "MS-CV" : "vhT7xV1W/kSFdmFCtKDNLg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VG3XYgAAAABGqqf0zbxjTZd8KFPl+pmkUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:49:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "073ff734-46d2-4419-9842-2b51bf3de056" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "162ms", + "MS-CV" : "bTb7DIaVGEuz2NpB/UaNpg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VW3XYgAAAAAYBTXXNNeOSJ5nk/NHrrZGUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:49:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "7b8a71d9-69f5-4b1d-953d-5e499cd3b446", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "788ms", + "MS-CV" : "Zw3ulRCkq0mg6yIm16MTEQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VW3XYgAAAAAynhcH3eXcRrc5WUtiv1tyUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:49:57 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "2b7c0063-5fef-4e29-8af4-95acdf2cf3d7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "189ms", + "MS-CV" : "1P+wcu0ekk2JZ1MdYI8Zuw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Vm3XYgAAAABsxG1WUUNYTovmxZiJkrNiUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:49:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "c707dcad-935e-49af-9719-dafa104a535d" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "189ms", + "MS-CV" : "t/FOdZotLUu+IM7eU6DPrQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Vm3XYgAAAAAJc3eXMckiTrUrE44rcxhJUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:49:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingEmptyBefore[1].json new file mode 100644 index 000000000000..4cd191f3f17d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingEmptyBefore[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0defaf10-705a-41ea-b05f-fd06dd7c4f31" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "9YsyqPGh0E21NsgOpxOBmA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HJEIZAAAAAD6BnDk/TFzTrwWp86+TJOOUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a94dbb0b-36ed-404a-a6b4-eef4a5d90ba1" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "Um0ekq9T50yo8wIVSPv4lQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HZEIZAAAAACcM81bOJm6SLVESzE6RtdqUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:56 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c0fab43d-dd46-4e93-bb84-fa086a8fd1a7", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1030ms", + "MS-CV" : "uqm0RAM0YUG/bSa+Dn5/xQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HZEIZAAAAABqe6+PZi3lRIiQ++DC4BYiUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:57 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fe20a83b-4961-4c94-88f4-4204f5095dba" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "YqlIeiu/QU+nxMIZIbgsIA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HpEIZAAAAAAy/Z+iOEseSafh16YRMBcWUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "cc997269-4e1f-4dcf-b289-5d32ad20796c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "193ms", + "MS-CV" : "b1sL3+1aqkiW6KhwNMx9BA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0HpEIZAAAAAAUUpLfMrLFS5YYQSrXPZtzUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "337", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..3b361dc8be6e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "3c99f572-e33d-4309-bfde-6404b368118c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "119ms", + "MS-CV" : "m7u4iKwSTUCSwfQM9+zLNQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0dm3XYgAAAACmDOFl0/tES5oLsS71I7EDUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "7f710652-079e-4e48-876c-bb5eb95ecf35", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "356ms", + "MS-CV" : "XaOb/blHSkioK1jBHDDqHQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0d23XYgAAAAAPs9jf2aa3RqlEIH9462Y+UFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"1.fqdn.com\":{\"sipSignalingPort\":1234}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "8b46744e-3194-4106-9fe7-465dcf31a2e0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "158ms", + "MS-CV" : "ZWCNoDwce0aHAvJfLEr/qA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0d23XYgAAAAAQDFCu1vB2Sq05bJur1bgJUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"1.fqdn.com\":{\"sipSignalingPort\":1234}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:31 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "be13215e-61f0-4152-a4ca-164b4d9434dc", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "317ms", + "MS-CV" : "pcTrEgZ69EGRwTCUV6gWPw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0d23XYgAAAAD3HN2UfMolTKidRvFFJqxoUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"1.fqdn.com\":{\"sipSignalingPort\":1234},\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "93cde48e-0e97-49dd-9cbd-b6b4dffe9077" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "127ms", + "MS-CV" : "nBNPHyKITk+xZR+0QmmDmg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eG3XYgAAAADcEOnK/bg1SYx1jgds+HRtUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"1.fqdn.com\":{\"sipSignalingPort\":1234},\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "72c0c4c4-d5fb-4d44-a4ab-af26e60a4c1f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "142ms", + "MS-CV" : "B7ezgLZy0ESyWIU4vIXJbQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0eG3XYgAAAACRsIxPHBG8S5/caDI1OhTGUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"1.fqdn.com\":{\"sipSignalingPort\":1234},\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:32 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingNotEmptyBefore[1].json new file mode 100644 index 000000000000..9d08d4b96a89 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunkNotExistingNotEmptyBefore[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "abc43b55-6194-4c90-b504-e0cd2e30e4d2" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "r9XWvn99p0C6/I3wbmEXsQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MZEIZAAAAACSq0JSGzBNR5ahg64wOvSlUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:16 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "67a6eb93-9b51-41bd-acf2-39bc16a37868", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1009ms", + "MS-CV" : "RiyJ0fvNgE6rKwBm/RkalQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MZEIZAAAAABcZiwd57niQIYX6eTqDQSjUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:17 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d08fe64d-e7e9-4a53-a0f8-94d4de99339d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "G1XK8evQO0mzCJ8lpoQQTw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MpEIZAAAAAC3DK8xWQgzT5tdFvaBroNJUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d4914278-69a7-4ddc-ac31-aa8b2931c73d", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1012ms", + "MS-CV" : "s3WLjhxNN02M3eAqHPVaXA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0MpEIZAAAAABz2XyXx3l6RawHmTZR+MPJUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d95842a7-2253-4680-ae1e-e259b4cf729a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "WbU/Eyd2mUCNEN7o/oYZxQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NJEIZAAAAABwQdGqqLisRpvj1kY0q5O9UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "389c6e0a-19d1-4b9a-8c55-5e6067c1c5b1" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "167ms", + "MS-CV" : "XpYRZKYpWkinGtA1LGdlCw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0NJEIZAAAAAAsBgakzj+JSaAZL1uRxmZ1UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:20 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBeforeWithAAD[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBeforeWithAAD[1].json new file mode 100644 index 000000000000..f697e276ae19 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBeforeWithAAD[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "66c7c0fd-dbd0-4e5d-a4bf-fc7ae3885af3" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "/L806dD11UCluYG+bFn3RA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PJEIZAAAAAAWKjNBhqRTRYgIys/4aqcUUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c2c8636d-e931-4671-a0c7-1e989430380b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "432ms", + "MS-CV" : "XsVu/xHk50iUG/krq0iWhw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PJEIZAAAAABW9YZ6XNJnRraRYmxo3BqEUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:28 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "999d5c1c-b093-4c56-9229-c01e4420df5a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "184ms", + "MS-CV" : "f2RIJpIvKEi19CnoEKOcoQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PZEIZAAAAACBaLO1Qd2HTIoVtIV+1sU6UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:28 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f345364c-907e-4f94-911e-af0f96755c9d" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "189ms", + "MS-CV" : "BWvPU+XZ8E+00KaBDtVwWg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PZEIZAAAAABnTv3+6qhOTZqrIh6IlNLoUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d8a85b88-1245-495b-bf5d-50697b1e56e0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1003ms", + "MS-CV" : "wulQAafFNUSgsObj3R6jzA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PZEIZAAAAADoBnzd1+vlS60B1/cdS0q7UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "aacb4481-0107-4838-9893-b3eeb45cb51c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "178ms", + "MS-CV" : "Bi32IljLYUuq0eIePRy6dA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0PpEIZAAAAAAvhhfjYhL1SqL1Az6SwI/MUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:30 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..c24d4efb223e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBeforeWithResponse[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ca88e758-6ae3-4758-b0c1-45501ec45e04" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "183ms", + "MS-CV" : "PHKqV+ITcEa+3m5Xj4APHA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0b5EIZAAAAABLJN7JJyXyR6DveOg6TsDAUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a818cb73-c955-4923-bb72-760d3bbec35e" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "o6fJA3Pm4Uu0OAvo1P3ryg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0b5EIZAAAAADVwU+UJlZPQKJ+puuyGsmtUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "27c5496c-90eb-4c64-9543-42e89b927a5f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "177ms", + "MS-CV" : "TsAjwyAR6UOhecQ4BpdyTQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0b5EIZAAAAADsyrLGG1wNSaKtt3Y480cvUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "fb677b21-7893-47d2-926f-0759462c163c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1063ms", + "MS-CV" : "tItgWU/kuUy/4hCzlwBdsA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cJEIZAAAAAAitGB4pRCuTJ+AZPUml0bEUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:20 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "154a0527-6ac2-47a1-99ab-7cca4298e342" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "211ms", + "MS-CV" : "ApPApDzamE6fzgBUxRXJtw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0cZEIZAAAAAAy66bjZxe8QL7mUqcnK6avUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "307", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:21 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBefore[1].json new file mode 100644 index 000000000000..126b22586c97 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksEmptyBefore[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9947a227-5bb5-4974-beb8-fc2c5d9d3f6f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "169ms", + "MS-CV" : "+W6uaf7Dj0KB+D4btoia+g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0IpEIZAAAAADyeePtUTr0SpkSjI8oelcAUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:02 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b8e0685c-a34f-4390-9559-284173ef370e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "463ms", + "MS-CV" : "jNVslq0Z1kuclTWavMFJ2A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0I5EIZAAAAACkRZtS+mjFQYYprvYVRakCUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1740f563-6767-47bc-aa16-3b4cd29ae8b6" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "191ms", + "MS-CV" : "DjgRxeRDtU6wAuOc9r1ztw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0I5EIZAAAAACy+Wh2HFWBTo1XCSMZhI9rUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "644e2fbc-3555-4024-8647-eeb8560f6273" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "/NX1LiLTnEa0HY6M57gNrA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JJEIZAAAAABh95i9MdY4SK8BTh8Nv60NUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "75139ba2-4829-4e07-82cc-8820161edfc9", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1166ms", + "MS-CV" : "ai4QQlBvrEyhunt0YIiQxg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JJEIZAAAAABZCz1YBp0wQJfpE8FAIbuOUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "576a40c2-24ee-4d8a-bdd9-f845929d43a4" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "191ms", + "MS-CV" : "8Tv5p5lTFk+eq3RQFTawVw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0JZEIZAAAAADEUP5MKYlKRKBy9ORrRzh1UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:05 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidFqdnWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidFqdnWithResponse[1].json new file mode 100644 index 000000000000..b0c38485b74d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidFqdnWithResponse[1].json @@ -0,0 +1,72 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "f1cf3096-d3ec-4927-bbaa-562971b88f52", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "24ms", + "MS-CV" : "0fytiNKVR0uvX9DvdnNQww.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZG3XYgAAAACUTf8gR08FRLYYvJQ/Oe8fUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkFqdn\",\"message\":\"Trunk with an invalid FQDN.\"}}}", + "Date" : "Wed, 20 Jul 2022 02:50:11 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "c5d23c72-2c87-430b-933a-bb4268b1fc82" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "187ms", + "MS-CV" : "Tg5jbrDho0CNr3PpOh/hOg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZG3XYgAAAADhyDqKO6VRSIdw7Cdogu+dUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:12 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "44b30385-3fca-4fb2-9790-3172ad7ed342", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "21ms", + "MS-CV" : "pb40Z7644ku/9KX33MWU6A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZG3XYgAAAABHNjtNv83cQJXpLGjSb+ndUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkFqdn\",\"message\":\"Trunk with an invalid FQDN.\"}}}", + "Date" : "Wed, 20 Jul 2022 02:50:12 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidFqdn[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidFqdn[1].json new file mode 100644 index 000000000000..87fb59904ec4 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidFqdn[1].json @@ -0,0 +1,72 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "45af0144-dda7-43be-ab6a-5af4fe39d758", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "15ms", + "MS-CV" : "um/o9WMcqkeX26o+Rlatog.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/5AIZAAAAADyjlnxBuEjR6eUPzXCDBDhUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkFqdn\",\"message\":\"Domain '_' is not properly formatted domnain name.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:26 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "1362ed02-dcd3-4134-82e9-9ebd307a3b3f" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "bjuY/u85fU2xgLIQYz30yA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/5AIZAAAAAA8FiGT2BZSQr/qaQbA1YmhUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "25", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:27 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "479f37bb-4895-43ad-90fe-25d917827d05", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "15ms", + "MS-CV" : "xChlHu+pXkWf/0c4+Khf6w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0/5AIZAAAAACIMNoNCkRUQJMlhjUVt3TaUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkFqdn\",\"message\":\"Domain '_' is not properly formatted domnain name.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:27 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidPortWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidPortWithResponse[1].json new file mode 100644 index 000000000000..4535707aaeb7 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidPortWithResponse[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "772d0107-4e2c-4cb6-af86-2026a953f58a", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "386ms", + "MS-CV" : "6D9/p4i+l0u3iz3dYr8jtQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0am3XYgAAAABxdHRBXxZJSaQatFSqp5wwUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234},\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "dd4607dc-fd91-462d-82c4-d00986b40395", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "20ms", + "MS-CV" : "r9tX+f77ikmMRwcNQoq5VA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0a23XYgAAAABvMYmvXrm4QJFhfrbqWQ+gUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkSipSignalingPort\",\"message\":\"Trunk with an invalid SIP signaling port.\"}}}", + "Date" : "Wed, 20 Jul 2022 02:50:18 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "c6014273-a07f-4e52-bc9e-d833dfa543b0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "147ms", + "MS-CV" : "AFjS4mD0AEqDXBU3qnoAYQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0a23XYgAAAABNsrVniCXdQq8kmURS3OjmUFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234},\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:18 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "b91adb81-135a-4eb6-9562-b68a921eb4d3", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "18ms", + "MS-CV" : "lH3AdLSMlEWn1Kiwp6uPAA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0a23XYgAAAAAGjPj6Hw0aTrZNLaQfrc99UFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkSipSignalingPort\",\"message\":\"Trunk with an invalid SIP signaling port.\"}}}", + "Date" : "Wed, 20 Jul 2022 02:50:19 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.communication.azure.com/sip?api-version=2021-05-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.8 (17; Windows 10; 10.0)", + "x-ms-client-request-id" : "f3416643-03d1-4657-ac97-67c4a3a8dde5" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview", + "X-Processing-Time" : "130ms", + "MS-CV" : "THYZxsAH/UunbfnM/oxEeg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0a23XYgAAAAAj4Ggbvl+OR57RBwu1Ayu5UFJHMDFFREdFMDkxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"2.fqdn.com\":{\"sipSignalingPort\":2345},\"3.fqdn.com\":{\"sipSignalingPort\":3456},\"1.fqdn.com\":{\"sipSignalingPort\":1234},\"4.fqdn.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 20 Jul 2022 02:50:19 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidPort[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidPort[1].json new file mode 100644 index 000000000000..a757686a0165 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksInvalidPort[1].json @@ -0,0 +1,115 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0265b988-0677-4ac9-8c29-bfffcff91080", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1051ms", + "MS-CV" : "uCq+jcSUz0amNHpa23yfeg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0AJEIZAAAAABeX16Io6u7QoeM2c7TMIk+UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:28 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "bcf5689d-6408-4fcd-8b35-46fc5248573b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "16ms", + "MS-CV" : "3qu7EJppHUKzFlpbCakJ0w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0AZEIZAAAAAD0D1cK0JvWS47JJ1GkJpcZUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkSipSignalingPort\",\"message\":\"Trunk with an invalid SIP signaling port.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:28 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "7703d54c-28e1-410a-8007-a3544a1b8f61" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "181ms", + "MS-CV" : "wMa8u2ZlFkaltS8Lfyec1Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0AZEIZAAAAAA2YuCgYF6FQZxwcu8dom1bUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "67c785d9-a728-4589-ba99-6ba59b743c56", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "X-Processing-Time" : "14ms", + "MS-CV" : "gfjDbE/eUk6IhWsaT4z4Ig.0", + "retry-after" : "0", + "X-Azure-Ref" : "0AZEIZAAAAAATgr5cYozNTZbxbFLaz8+iUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"InvalidTrunkSipSignalingPort\",\"message\":\"Trunk with an invalid SIP signaling port.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:29 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "01da931f-ad98-4ed0-bee5-39477f6e1dc7" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "gPVtWozddk6zaAEzaWOvOg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ApEIZAAAAAACCuIYQJGvSYNjUIbgE0zGUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "116", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:29 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksNotEmptyBeforeWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksNotEmptyBeforeWithResponse[1].json new file mode 100644 index 000000000000..4362b2586623 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksNotEmptyBeforeWithResponse[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "ace1dd90-c83f-4f16-aae1-32a8647867f8" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "ehvnudU/Dkie8wYDDOvt+w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0W5EIZAAAAACPOgbRP7z7Sq8eaUyDmbgVUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:59 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0993c57d-9cb4-48e9-a4a1-abe1b1f942a0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1352ms", + "MS-CV" : "TbKMcMKz8EqGuzeKgmN39w.0", + "retry-after" : "0", + "X-Azure-Ref" : "0W5EIZAAAAABABIhzZtLQS5x29ZTfNxRHUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461},\"fifth.redacted.com\":{\"sipSignalingPort\":3460}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:00 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "be5fe69d-0820-4d47-95e6-142b6ebcc135" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "O0QIourZfE+7ZQvWhbcUPQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XZEIZAAAAAA/6iP5QhFrSa37Moo8tgecUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461},\"fifth.redacted.com\":{\"sipSignalingPort\":3460}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "334acbea-9aea-473c-a5f1-8aec90a68be8" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "YBNUjN4bDUOQnh7m8CLi7Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XZEIZAAAAAAVrXGn4KE6Saz+vkrc1y8MUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461},\"fifth.redacted.com\":{\"sipSignalingPort\":3460}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:01 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "68188ce3-ae01-4b73-887b-ea5039a345ef", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1245ms", + "MS-CV" : "3bDSISmDYE27JicdmJDh1A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0XpEIZAAAAAALCH5jlh4kQY2IYRySr6y4UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:02 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "211f2f21-8e7f-4e98-a66c-571a8ce60354" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "VT+ODb4oHk23lJno3/LQZg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0X5EIZAAAAABUrVw0kKwzR4Lsay/GPNc0UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:03 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksNotEmptyBefore[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksNotEmptyBefore[1].json new file mode 100644 index 000000000000..09be4b1b9468 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksNotEmptyBefore[1].json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "0b283afc-663b-4ee5-a6dd-7199df4920ab" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "X66SNHM7U06nl+rM2WOXKg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0N5EIZAAAAAC0jFGwzxUyS7AZzMToP7l1UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "246", + "StatusCode" : "200", + "Body" : "{\"trunks\":{},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:22 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d4f78144-6ce9-4aca-8f0d-aeca1d80a217", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "979ms", + "MS-CV" : "ypzj8dwDF0+kPA5rLZb74A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0N5EIZAAAAAABlB+9LcrZQqHAMEl5NykjUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461},\"fifth.redacted.com\":{\"sipSignalingPort\":3460}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "d34dc7db-4be2-4fed-86d6-9b06045d21c4" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "RaskNaTPvUycgyAzkCpZCQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OJEIZAAAAADRJtM0lDCJQo2ZEoK8YfeSUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461},\"fifth.redacted.com\":{\"sipSignalingPort\":3460}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a8f87e7d-afa5-4901-a83c-0ed7b4e3cbe1" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "173ms", + "MS-CV" : "Uzsab20OW0iBNAaVLSt+Jw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OZEIZAAAAACwaYE3c4u6Q7djvdie6sRaUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "622", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":9876},\"fourth.redacted.com\":{\"sipSignalingPort\":2340},\"sixth.redacted.com\":{\"sipSignalingPort\":4461},\"fifth.redacted.com\":{\"sipSignalingPort\":3460}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:24 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "3ec801d5-aad8-4541-8003-a28651909fef", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1034ms", + "MS-CV" : "gLQy1BhM9EKpdxeMkEcKFw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OZEIZAAAAAD9+cNCggP/SqJfk2gMcXrTUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:25 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4f56c23e-a98c-4ae5-a937-3d870434206a" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "171ms", + "MS-CV" : "cYqNTQvjrkOX+jwHBs7NXw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0OpEIZAAAAACe2/HA7Xq+SrMkLd7lqNJtUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:26 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksRemoveRequiredTrunkWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksRemoveRequiredTrunkWithResponse[1].json new file mode 100644 index 000000000000..6b0c2b3b6b73 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksRemoveRequiredTrunkWithResponse[1].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "645cffbf-9b96-404d-b07a-6ea85ca14b17", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "1043ms", + "MS-CV" : "rqnaxUhSo0Ka7ZQOp9TiKw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Y5EIZAAAAABD5ZfZUR1HRqyDq31Alr31UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:07 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "f74478c8-6162-4548-a290-8d46a2c54ddd", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "307ms", + "MS-CV" : "PfCbiBKIrk6qh081I9Xdmg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZJEIZAAAAADqD7yYXUu9RaZQavcxS7HVUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:08 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a2a4236b-4397-4482-9ceb-4e398b396653" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "178ms", + "MS-CV" : "IXc6K9+QgE2Ukzn9xJyRKQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZZEIZAAAAAA1vcvXDzr8TbS7RxPqKdnVUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:08 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "b54323ba-9fc4-4b0b-b322-6484e01c386c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "798ms", + "MS-CV" : "NRGnV0FuTUujO5fow+dUHA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ZZEIZAAAAAB/hYwik4cnSLoQ/Af4LYVkUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:45:10 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "575ccf46-d58a-453e-ba5c-88815431366c" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "ylxRLYbnLUiuV1RdH0VjcQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Z5EIZAAAAAAVj9A6t9MNT7LrGVgOmdx1UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 13:45:10 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "29a01408-c698-4610-809e-7951abb2d9d0", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "247ms", + "MS-CV" : "5EimP/rDnUypX88f7w8mvQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0Z5EIZAAAAABhTFsaW0nMRYGmKCTtzvX2UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:45:11 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "47d33386-5a2b-4d04-ba1a-f3bfd8af3a1b", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "283ms", + "MS-CV" : "1SXkvt4dOEyU/mUqfGMLPg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0aJEIZAAAAACU+kB4awe6Qp1A4MTge8PeUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"third.redacted.com\":{\"sipSignalingPort\":3456},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:45:11 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksRemoveRequiredTrunk[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksRemoveRequiredTrunk[1].json new file mode 100644 index 000000000000..708fa45feb7d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksRemoveRequiredTrunk[1].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9a9fbe2f-8af3-40e5-8bfa-fba673705eda", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "510ms", + "MS-CV" : "1jhFPrs6VEORFP1hshfqjg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DpEIZAAAAABQXvF35XTWRJgM1FdIamfmUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "620", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "a10264c1-ddc3-43a1-8f1b-61326e753f88", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "291ms", + "MS-CV" : "hMeWIcqR5U6i3TDypbdaJg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0DpEIZAAAAACCiTZBSyJnT7rHcVbZPSlvUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "26fc03e5-6b82-4130-bbf9-83dee4396cff" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "172ms", + "MS-CV" : "HXA/rbNpjk2hcMf7Wdve8A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0D5EIZAAAAABdWbi29phnRrfsw1v1hAwVUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "385723b9-11ce-4e74-9ccc-dd3be04dd359", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "466ms", + "MS-CV" : "Q7wc6KmBGkKODIErHDnv4g.0", + "retry-after" : "0", + "X-Azure-Ref" : "0D5EIZAAAAABvSjb4jM/MQK5KGO6gOOebUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:43 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "23baa0a7-4b80-437e-93f3-08e4230b9988" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "174ms", + "MS-CV" : "OVGtARl/VkyyVjclxUTffg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EJEIZAAAAADG42YXgzLMQIUXZjh6tq63UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "685", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[\"set.redacted.com\"]}]}", + "Date" : "Wed, 08 Mar 2023 13:43:43 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "70355fbc-80ad-4885-a620-331103b9b0ae", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "260ms", + "MS-CV" : "MD930LTNtESzTXiH+Tvsbw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EJEIZAAAAABaSJyv+LAQTZ/62Rzcchg/UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "StatusCode" : "422", + "Body" : "{\"error\":{\"code\":\"UnprocessableConfiguration\",\"message\":\"One or more request inputs are not valid.\",\"innererror\":{\"code\":\"MissingTrunk\",\"message\":\"Route targeting a missing trunk.\"}}}", + "Date" : "Wed, 08 Mar 2023 13:43:44 GMT", + "Content-Type" : "application/json" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "6047d1f2-7f84-4a44-a97f-91256ae5afff", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "299ms", + "MS-CV" : "gfYmf5wtUUS1/h5zbURdfA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0EZEIZAAAAAByjwb9biUyTqSK6jF35gL1UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "399", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"third.redacted.com\":{\"sipSignalingPort\":3456},\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"set.redacted.com\":{\"sipSignalingPort\":4567}},\"routes\":[]}", + "Date" : "Wed, 08 Mar 2023 13:43:44 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksWithoutAffectingRoutesWithResponse[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksWithoutAffectingRoutesWithResponse[1].json new file mode 100644 index 000000000000..19bd55d8b99d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksWithoutAffectingRoutesWithResponse[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c1aef9ec-56cb-40c0-bba1-7f002c21a53c", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "276ms", + "MS-CV" : "dWOTkd5PH0Ob1009lt6YMg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VpEIZAAAAAAzZQOYZ+SiRrPVD7wEKXw0UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:53 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "4e6474d4-a1c1-4ba7-a5b4-3f6e7c96c1db" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "vrJVMcQQ4Uq6oKgKgwmFMw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0VpEIZAAAAACQ4GeCwSJSSY9LsXeqLct/UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:54 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "46cd115a-4f69-4756-96d0-eb98dcec7c4f", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "506ms", + "MS-CV" : "V0C+ne+GtEu6ItXv7/veLA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0V5EIZAAAAADRtMFPbtpmQ55VjHZtncy2UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c0c58bbe-5c33-48c4-ae1f-7841006fdfca" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "175ms", + "MS-CV" : "YT/Ca1cHHEyag961o0kBmQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0V5EIZAAAAAAdcPHsxZ/YTJU2QBE2MZoxUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "5adc252d-7569-46df-9d03-e9bfe0cdacf0" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "168ms", + "MS-CV" : "Yl5O1cBLu0+WAKOokQEoEQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WJEIZAAAAACd5eofPQoNSZDGais17mVPUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:55 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksWithoutAffectingRoutes[1].json b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksWithoutAffectingRoutes[1].json new file mode 100644 index 000000000000..b9ebb1352813 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/src/test/resources/session-records/SipRoutingClientIntegrationTest.setTrunksWithoutAffectingRoutes[1].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "c9e738f2-9783-4e87-90b3-f6972a419d14", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "295ms", + "MS-CV" : "Kv/IweWDdUWSZ1jEHbdvUA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WZEIZAAAAAAy+a+46xHHSJjtRYo6dWikUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:57 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "46dee678-f139-4a35-86ac-086a18846b64" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "176ms", + "MS-CV" : "lSb5K0Fv9UiJbSqQ1SwHtg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WZEIZAAAAABeVJqwCHtyTJa3jFjus9wXUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:57 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "9a70c320-df43-44f6-9c29-f1b3fb8ee0a3", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "528ms", + "MS-CV" : "p460j/wX5EykWtfXNKoc8Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WpEIZAAAAACEGEXOecEjRqzb6gCLmj1pUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "8793083e-2846-430c-9258-251ef93c0eb5" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "170ms", + "MS-CV" : "idBu8fUkdUKa4WwNcYufpg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0WpEIZAAAAAD/X4RgfpaxQ7J3tj2N2vr7UFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.int.communication.azure.net/sip?api-version=2023-03-01", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-phonenumbers/1.1.0-beta.15 (19.0.1; Windows 11; 10.0)", + "x-ms-client-request-id" : "90d15bd1-b0f3-4cbb-92b0-f05bcaa8bfef" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "Strict-Transport-Security" : "max-age=2592000", + "api-supported-versions" : "2021-05-01-preview, 2022-09-01-preview, 2023-01-01-preview, 2023-03-01", + "X-Processing-Time" : "167ms", + "MS-CV" : "8BugYYAKXUqfaj/ZjkeDNw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0W5EIZAAAAADbB1ZDqgw2RLE1D2rCAMZbUFJHMDFFREdFMDkwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "Content-Length" : "528", + "StatusCode" : "200", + "Body" : "{\"trunks\":{\"first.redacted.com\":{\"sipSignalingPort\":1234},\"second.redacted.com\":{\"sipSignalingPort\":2345},\"third.redacted.com\":{\"sipSignalingPort\":3456}},\"routes\":[{\"description\":\"desc0\",\"name\":\"route0\",\"numberPattern\":\"0.*\",\"trunks\":[]},{\"description\":\"desc1\",\"name\":\"route1\",\"numberPattern\":\"1.*\",\"trunks\":[]},{\"description\":\"desc2\",\"name\":\"route2\",\"numberPattern\":\"2.*\",\"trunks\":[]}]}", + "Date" : "Wed, 08 Mar 2023 13:44:58 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/README.md b/sdk/communication/azure-communication-phonenumbers/swagger/README.md index a410cc9298a7..0f02dacaea86 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/README.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/README.md @@ -23,10 +23,10 @@ autorest README.md --java --v4 --use=@autorest/java@4.0.2 ### Code generation settings ``` yaml -tag: package-phonenumber-2024-03-01-preview -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b56afb26c5450157006a3a1d9be57bae429051a2/specification/communication/data-plane/PhoneNumbers/readme.md +tag: package-phonenumber-2022-12-01 +require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/edf1d7365a436f0b124c0cecbefd63499e049af0/specification/communication/data-plane/PhoneNumbers/readme.md override-client-name: PhoneNumberAdminClient -custom-types: PurchasedPhoneNumber,BillingFrequency,PhoneNumberOperationStatus,PhoneNumberOperationStatusCodes,PhoneNumberOperationType,PhoneNumberAssignmentType,PhoneNumberCapabilities,PhoneNumberCapabilityType,PhoneNumberCost,PhoneNumberSearchResult,PhoneNumberType,PhoneNumberCapability,PhoneNumberAdministrativeDivision,PhoneNumberCountry,PhoneNumberLocality,PhoneNumberOffering,AreaCodeResult,AreaCodes,PhoneNumberAreaCode,PhoneNumberSearchResultError,OperatorDetails,OperatorInformation,OperatorInformationResult,OperatorInformationOptions,OperatorNumberType +custom-types: PurchasedPhoneNumber,BillingFrequency,PhoneNumberOperationStatus,PhoneNumberOperationStatusCodes,PhoneNumberOperationType,PhoneNumberAssignmentType,PhoneNumberCapabilities,PhoneNumberCapabilityType,PhoneNumberCost,PhoneNumberSearchResult,PhoneNumberType,PhoneNumberCapability,PhoneNumberAdministrativeDivision,PhoneNumberCountry,PhoneNumberLocality,PhoneNumberOffering,AreaCodeResult,AreaCodes,PhoneNumberAreaCode custom-types-subpackage: models models-subpackage: implementation.models java: true @@ -80,8 +80,6 @@ directive: $["properties"]["phoneNumberType"].readOnly = true; $["properties"]["assignmentType"].readOnly = true; $["properties"]["capabilities"].readOnly = true; - $["properties"]["error"].readOnly = true; - $["properties"]["errorCode"].readOnly = true; ``` ### Rename PhoneNumberOperation to PhoneNumberRawOperation @@ -151,6 +149,7 @@ directive: $["properties"]["localizedName"].readOnly = true; ``` + ### Add readonly attribute to PhoneNumberLocalities properties ```yaml directive: @@ -191,54 +190,4 @@ directive: transform: > $["properties"]["localizedName"].readOnly = true; $["properties"]["countryCode"].readOnly = true; -``` - -### Add readonly attribute to OperatorDetails properties -```yaml -directive: - - from: swagger-document - where: $.definitions.OperatorDetails - transform: > - $["properties"]["name"].readOnly = true; - $["properties"]["mobileNetworkCode"].readOnly = true; - $["properties"]["mobileCountryCode"].readOnly = true; -``` - -### Add readonly attribute to OperatorInformation properties -```yaml -directive: - - from: swagger-document - where: $.definitions.OperatorInformation - transform: > - $["properties"]["phoneNumber"].readOnly = true; - $["properties"]["numberType"].readOnly = true; - $["properties"]["isoCountryCode"].readOnly = true; - $["properties"]["operatorDetails"].readOnly = true; - $["properties"]["nationalFormat"].readOnly = true; - $["properties"]["internationalFormat"].readOnly = true; -``` - -### Add readonly attribute to OperatorInformationResult properties -```yaml -directive: - - from: swagger-document - where: $.definitions.OperatorInformationResult - transform: > - $["properties"]["values"].readOnly = true; -``` - -``` yaml -directive: - from: swagger-document - where: $.definitions.PhoneNumberSearchResult.properties.error.x-ms-enum - transform: > - $["name"] = "PhoneNumberSearchResultError"; -``` - -``` yaml -directive: - from: swagger-document - where: $.parameters.Endpoint - transform: > - $["format"] = ""; -``` +``` \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/pom.xml b/sdk/communication/azure-communication-phonenumbers/swagger/pom.xml index f452ae228b85..d57333aa0d47 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/pom.xml +++ b/sdk/communication/azure-communication-phonenumbers/swagger/pom.xml @@ -4,15 +4,23 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - com.azure - azure-code-customization-parent - 1.0.0-beta.1 - ../../../parents/azure-code-customization-parent - - com.azure.tools azure-phonenumbers-autorest-customization 1.0.0-beta.1 jar + + + UTF-8 + UTF-8 + 1.8 + 1.8 + + + + + com.azure.tools + azure-autorest-customization + 1.0.0-beta.4 + + diff --git a/sdk/communication/azure-communication-phonenumbers/tests.yml b/sdk/communication/azure-communication-phonenumbers/tests.yml index 7e795c2399dc..80d4eb0ef5e4 100644 --- a/sdk/communication/azure-communication-phonenumbers/tests.yml +++ b/sdk/communication/azure-communication-phonenumbers/tests.yml @@ -1,41 +1,12 @@ trigger: none -parameters: - - name: runOnlyPPE - displayName: "Run only the PPE stage" - type: boolean - default: false - -extends: - template: /sdk/communication/communication-tests-template.yml - parameters: +stages: + - template: /sdk/communication/communication-tests-template.yml + parameters: PackageName: azure-communication-phonenumbers SafeName: azurecommunicationphonenumbers - ${{ if eq(parameters.runOnlyPPE, true) }}: - Clouds: 'PPE' - ${{ if eq(parameters.runOnlyPPE, false) }}: - Clouds: 'Public,PPE,Int' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) - - MatrixReplace: - - SKIP_UPDATE_CAPABILITIES_LIVE_TESTS=false/true - PPE: - SubscriptionConfigurations: - - $(sub-config-communication-ppe-test-resources-common) - - $(sub-config-communication-ppe-test-resources-java) - MatrixReplace: - - SKIP_UPDATE_CAPABILITIES_LIVE_TESTS=false/true MatrixConfigs: - - Name: PhoneNumbers_java_livetest_matrix - Path: sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json - Selection: sparse - GenerateVMJobs: true + - Name: PhoneNumbers_java_livetest_matrix + Path: sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json + Selection: sparse + GenerateVMJobs: true \ No newline at end of file diff --git a/sdk/communication/azure-communication-rooms/CHANGELOG.md b/sdk/communication/azure-communication-rooms/CHANGELOG.md index eb204aec134b..6baeaacdb2b3 100644 --- a/sdk/communication/azure-communication-rooms/CHANGELOG.md +++ b/sdk/communication/azure-communication-rooms/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +## 1.1.1 (2024-04-23) + +### Other Changes + +#### Dependency Updates + + + ## 1.1.0 (2024-04-15) - General Availability version of PSTN dial-out capability feature. diff --git a/sdk/communication/azure-communication-rooms/README.md b/sdk/communication/azure-communication-rooms/README.md index 78f02d6d2684..b6d5eee336a8 100644 --- a/sdk/communication/azure-communication-rooms/README.md +++ b/sdk/communication/azure-communication-rooms/README.md @@ -25,7 +25,7 @@ add the direct dependency to your project as follows. com.azure azure-communication-rooms - 1.1.0 + 1.1.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/communication/azure-communication-rooms/pom.xml b/sdk/communication/azure-communication-rooms/pom.xml index c55afdbab80f..87a62e0cc3b3 100644 --- a/sdk/communication/azure-communication-rooms/pom.xml +++ b/sdk/communication/azure-communication-rooms/pom.xml @@ -15,7 +15,7 @@ com.azure azure-communication-rooms jar - 1.1.0 + 1.1.1 Microsoft Azure library for ACS Room Service This package contains clients and data structures used to create, update, get, delete the Azure Communication Room Service. @@ -66,6 +66,11 @@ azure-communication-common 1.3.1 + + com.azure + azure-core-http-netty + 1.14.2 + com.azure azure-communication-identity diff --git a/sdk/communication/azure-communication-sms/CHANGELOG.md b/sdk/communication/azure-communication-sms/CHANGELOG.md index 7ee79d0da4e4..0865cfc10329 100644 --- a/sdk/communication/azure-communication-sms/CHANGELOG.md +++ b/sdk/communication/azure-communication-sms/CHANGELOG.md @@ -1,14 +1,13 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.1.23 (2024-04-23) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. +- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. ## 1.1.22 (2024-03-20) @@ -17,9 +16,7 @@ #### Dependency Updates -- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-communication-common` from `1.3.0` to version `1.3.1`. ## 1.1.21 (2024-02-20) @@ -41,6 +38,7 @@ - Upgraded `azure-communication-common` from `1.2.14` to version `1.2.15`. - Upgraded `azure-core` from `1.45.0` to version `1.45.1`. + ## 1.1.19 (2023-11-20) ### Other Changes @@ -50,6 +48,7 @@ - Upgraded `azure-core` from `1.44.1` to version `1.45.0`. - Upgraded `azure-communication-common` from `1.2.13` to version `1.2.14`. + ## 1.1.18 (2023-10-20) ### Other Changes @@ -59,6 +58,7 @@ - Upgraded `azure-core` from `1.43.0` to version `1.44.1`. - Upgraded `azure-communication-common` from `1.2.12` to version `1.2.13`. + ## 1.1.17 (2023-09-22) ### Other Changes @@ -68,6 +68,7 @@ - Upgraded `azure-core` from `1.42.0` to version `1.43.0`. - Upgraded `azure-communication-common` from `1.2.11` to version `1.2.12`. + ## 1.1.16 (2023-08-18) ### Other Changes @@ -75,6 +76,8 @@ #### Dependency Updates - Upgraded `azure-core` from `1.41.0` to version `1.42.0`. +- Upgraded `azure-communication-common` from `1.2.10` to version `1.2.11`. + ## 1.1.15 (2023-07-25) @@ -94,6 +97,7 @@ - Upgraded `azure-core` from `1.39.0` to version `1.40.0`. - Upgraded `azure-communication-common` from `1.2.8` to version `1.2.9`. + ## 1.1.13 (2023-05-23) ### Other Changes @@ -103,6 +107,7 @@ - Upgraded `azure-communication-common` from `1.2.6` to version `1.2.8`. - Upgraded `azure-core` from `1.38.0` to version `1.39.0`. + ## 1.1.12 (2023-04-21) ### Other Changes @@ -111,6 +116,7 @@ - Upgraded `azure-core` from `1.37.0` to version `1.38.0`. + ## 1.1.11 (2023-03-15) ### Other Changes diff --git a/sdk/communication/azure-communication-sms/README.md b/sdk/communication/azure-communication-sms/README.md index 4ae2bf458aae..88a47985ab2f 100644 --- a/sdk/communication/azure-communication-sms/README.md +++ b/sdk/communication/azure-communication-sms/README.md @@ -53,7 +53,7 @@ add the direct dependency to your project as follows. com.azure azure-communication-sms - 1.1.15 + 1.1.23 ``` @@ -186,7 +186,7 @@ try { [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com [product_docs]: https://docs.microsoft.com/azure/communication-services/ -[package]: https://central.sonatype.com/artifact/com.azure/azure-communication-sms +[package]: https://search.maven.org/artifact/com.azure/azure-communication-sms [api_documentation]: https://aka.ms/java-docs [source]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/communication/azure-communication-sms/src [handle_sms_events]: https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/handle-sms-events diff --git a/sdk/communication/azure-communication-sms/assets.json b/sdk/communication/azure-communication-sms/assets.json deleted file mode 100644 index 7b371cc6c197..000000000000 --- a/sdk/communication/azure-communication-sms/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "java", - "TagPrefix": "java/communication/azure-communication-sms", - "Tag": "java/communication/azure-communication-sms_b1c346933a" -} diff --git a/sdk/communication/azure-communication-sms/pom.xml b/sdk/communication/azure-communication-sms/pom.xml index 732c9787d72b..565a824eb537 100644 --- a/sdk/communication/azure-communication-sms/pom.xml +++ b/sdk/communication/azure-communication-sms/pom.xml @@ -15,7 +15,8 @@ com.azure azure-communication-sms jar - 1.2.0-beta.1 + 1.1.23 + Microsoft Azure library for sending SMS messages This package contains clients and data structures used to send SMS messages with Azure Communication SMS Service. @@ -43,12 +44,6 @@ 0.70 0.70 false - - - --add-opens com.azure.communication.common/com.azure.communication.common.implementation=ALL-UNNAMED - --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED - - false @@ -104,12 +99,6 @@ 1.11.20 test - - com.azure - azure-core-http-vertx - 1.0.0-beta.17 - test - com.azure azure-identity @@ -123,6 +112,11 @@ org.jacoco jacoco-maven-plugin 0.8.12 + + + com/azure/communication/sms/*.class + + coverage-report @@ -149,20 +143,5 @@ - - - java12plus - - [12,) - - - - com.azure - azure-core-http-jdk-httpclient - 1.0.0-beta.12 - test - - - - + diff --git a/sdk/communication/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsClientBuilder.java b/sdk/communication/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsClientBuilder.java index a8145d31ceff..fd4d2ff542c2 100644 --- a/sdk/communication/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsClientBuilder.java +++ b/sdk/communication/azure-communication-sms/src/main/java/com/azure/communication/sms/SmsClientBuilder.java @@ -65,7 +65,7 @@ public final class SmsClientBuilder implements private HttpPipeline pipeline; private Configuration configuration; private final Map properties = CoreUtils.getProperties(APP_CONFIG_PROPERTIES); - private final List customPolicies = new ArrayList<>(); + private final List customPolicies = new ArrayList(); private ClientOptions clientOptions; private RetryPolicy retryPolicy; private RetryOptions retryOptions; @@ -135,7 +135,7 @@ public SmsClientBuilder credential(AzureKeyCredential keyCredential) { /** * Set endpoint and credential to use * - * @param connectionString connection string for setting endpoint and initializing AzureKeyCredential + * @param connectionString connection string for setting endpoint and initalizing AzureKeyCredential * @return SmsClientBuilder */ @Override diff --git a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsAsyncClientTests.java b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsAsyncClientTests.java index 089ee5570c2b..b2c0e9f080b2 100644 --- a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsAsyncClientTests.java +++ b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsAsyncClientTests.java @@ -37,7 +37,9 @@ public void sendSmsUsingConnectionString(HttpClient httpClient) { asyncClient = setupAsyncClient(builder, "sendSmsUsingConnectionString"); assertNotNull(asyncClient); StepVerifier.create(asyncClient.send(FROM_PHONE_NUMBER, TO_PHONE_NUMBER, MESSAGE)) - .assertNext(this::assertHappyPath) + .assertNext(sendResult -> { + assertHappyPath(sendResult); + }) .verifyComplete(); } @@ -49,7 +51,9 @@ public void sendSmsUsingTokenCredential(HttpClient httpClient) { asyncClient = setupAsyncClient(builder, "sendSmsUsingTokenCredential"); assertNotNull(asyncClient); StepVerifier.create(asyncClient.send(FROM_PHONE_NUMBER, TO_PHONE_NUMBER, MESSAGE)) - .assertNext(this::assertHappyPath) + .assertNext(sendResult -> { + assertHappyPath(sendResult); + }) .verifyComplete(); } @@ -100,7 +104,9 @@ public void sendSmsToSingleNumber(HttpClient httpClient) { // Action & Assert Mono response = asyncClient.send(FROM_PHONE_NUMBER, TO_PHONE_NUMBER, MESSAGE); StepVerifier.create(response) - .assertNext(this::assertHappyPath) + .assertNext(sendResult -> { + assertHappyPath(sendResult); + }) .verifyComplete(); } @@ -116,22 +122,9 @@ public void sendSmsToSingleNumberWithOptions(HttpClient httpClient) { // Action & Assert StepVerifier.create(asyncClient.send(FROM_PHONE_NUMBER, TO_PHONE_NUMBER, MESSAGE, options)) - .assertNext(this::assertHappyPath) - .verifyComplete(); - } - - @ParameterizedTest - @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void sendSmsToSingleNumberWithContext(HttpClient httpClient) { - // Arrange - SmsClientBuilder builder = getSmsClientUsingConnectionString(httpClient); - asyncClient = setupAsyncClient(builder, "sendSmsToSingleNumberWithOptions"); - SmsSendOptions options = new SmsSendOptions(); - Context context = new Context("context_key", "context_value"); - - // Action & Assert - StepVerifier.create(asyncClient.send(FROM_PHONE_NUMBER, TO_PHONE_NUMBER, MESSAGE, options, context)) - .assertNext(this::assertHappyPath) + .assertNext((SmsSendResult sendResult) -> { + assertHappyPath(sendResult); + }) .verifyComplete(); } @@ -145,7 +138,7 @@ public void sendFromFakeNumber(HttpClient httpClient) { Mono response = asyncClient.send("+155512345678", TO_PHONE_NUMBER, MESSAGE); StepVerifier.create(response) .expectErrorMatches(exception -> - ((HttpResponseException) exception).getResponse().getStatusCode() == 401).verify(); + ((HttpResponseException) exception).getResponse().getStatusCode() == 400).verify(); } @ParameterizedTest @@ -162,6 +155,28 @@ public void sendFromUnauthorizedNumber(HttpClient httpClient) { ((HttpResponseException) exception).getResponse().getStatusCode() == 401).verify(); } + @ParameterizedTest + @MethodSource("com.azure.core.test.TestBase#getHttpClients") + public void sendToFakePhoneNumber(HttpClient httpClient) { + // Arrange + SmsClientBuilder builder = getSmsClientUsingConnectionString(httpClient); + asyncClient = setupAsyncClient(builder, "sendToFakePhoneNumber"); + Mono> response = asyncClient.send(FROM_PHONE_NUMBER, Arrays.asList("+15550000000"), MESSAGE); + + // Action & Assert + StepVerifier.create(response) + .assertNext(item -> { + assertNotNull(item); + }) + .verifyComplete(); + + Iterable smsSendResults = response.block(); + for (SmsSendResult result : smsSendResults) { + assertFalse(result.isSuccessful()); + assertEquals(result.getHttpStatusCode(), 400); + } + } + @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void sendTwoMessages(HttpClient httpClient) { @@ -203,7 +218,8 @@ public void sendSmsFromNullNumber(HttpClient httpClient) { asyncClient = setupAsyncClient(builder, "sendSmsFromNullNumber"); // Action & Assert - Mono response = asyncClient.send(null, TO_PHONE_NUMBER, MESSAGE); + String from = null; + Mono response = asyncClient.send(from, TO_PHONE_NUMBER, MESSAGE); StepVerifier.create(response).verifyError(); } diff --git a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsBuilderTests.java b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsBuilderTests.java index 39a00b89468f..c5f3fa0b520f 100644 --- a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsBuilderTests.java +++ b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsBuilderTests.java @@ -16,19 +16,14 @@ import com.azure.core.http.HttpResponse; import com.azure.core.http.policy.ExponentialBackoffOptions; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; public class SmsBuilderTests { static final String MOCK_URL = "https://REDACTED.communication.azure.com"; - static final String MOCK_APP_ID = "appId"; static final String MOCK_ACCESS_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaGfQSflKxwRJSMeKKF2QT4fwpMeJf36POk6yJVadQssw5c"; static final String MOCK_CONNECTION_STRING = "endpoint=https://REDACTED.communication.azure.com/;accesskey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaGfQSflKxwRJSMeKKF2QT4fwpMeJf36POk6yJVadQssw5c"; @@ -46,9 +41,10 @@ public void missingTokenCredentialTest() throws NullPointerException, MalformedURLException, InvalidKeyException, NoSuchAlgorithmException { builder .endpoint(MOCK_URL) - .configuration(Configuration.NONE) .httpClient(new NoOpHttpClient()); - assertThrows(Exception.class, builder::buildAsyncClient); + assertThrows(Exception.class, () -> { + builder.buildAsyncClient(); + }); } @Test @@ -57,7 +53,9 @@ public void missingUrlTest() builder .credential(new AzureKeyCredential(MOCK_ACCESS_KEY)) .httpClient(new NoOpHttpClient()); - assertThrows(Exception.class, builder::buildAsyncClient); + assertThrows(Exception.class, () -> { + builder.buildAsyncClient(); + }); } @Test @@ -101,38 +99,7 @@ public void nullHttpLogOptionsTest() { } @Test - public void buildPipelineWithNullClientOptions() { - SmsAsyncClient smsClient = builder - .connectionString(MOCK_CONNECTION_STRING) - .httpClient(new NoOpHttpClient()) - .httpLogOptions(new HttpLogOptions()) - .clientOptions(null) - .buildAsyncClient(); - assertNotNull(smsClient); - } - - @Test - public void buildPipelineWithClientOptionsApplicationId() { - SmsAsyncClient smsClient = builder - .connectionString(MOCK_CONNECTION_STRING) - .httpClient(new NoOpHttpClient()) - .clientOptions(new ClientOptions().setApplicationId(MOCK_APP_ID)) - .buildAsyncClient(); - assertNotNull(smsClient); - } - - @Test - public void buildPipelineWithLogOptionsApplicationId() { - SmsAsyncClient smsClient = builder - .connectionString(MOCK_CONNECTION_STRING) - .httpClient(new NoOpHttpClient()) - .httpLogOptions(new HttpLogOptions().setApplicationId(MOCK_APP_ID)) - .buildAsyncClient(); - assertNotNull(smsClient); - } - - @Test - public void buildPipelineForClient() { + public void buildPiplineForClient() { SmsAsyncClient smsClient = builder .connectionString(MOCK_CONNECTION_STRING) .httpClient(new NoOpHttpClient()) @@ -149,13 +116,4 @@ public void bothRetryOptionsAndRetryPolicySet() { .retryPolicy(new RetryPolicy()) .buildClient()); } - - @Test - public void bothAzureKeyCredentialAndTokenCredentialSet() { - assertThrows(IllegalArgumentException.class, () -> builder - .connectionString(MOCK_CONNECTION_STRING) - .credential(new AzureKeyCredential(MOCK_ACCESS_KEY)) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient()); - } } diff --git a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsClientTests.java b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsClientTests.java index 6f2348114227..d9935b3d703a 100644 --- a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsClientTests.java +++ b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsClientTests.java @@ -17,6 +17,7 @@ import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -118,7 +119,7 @@ public void sendFromFakeNumber(HttpClient httpClient) { try { client.send("+15550000000", TO_PHONE_NUMBER, MESSAGE); } catch (Exception exception) { - assertEquals(401, ((HttpResponseException) exception).getResponse().getStatusCode()); + assertEquals(400, ((HttpResponseException) exception).getResponse().getStatusCode()); } } @@ -131,12 +132,26 @@ public void sendFromUnauthorizedNumber(HttpClient httpClient) { // Action & Assert try { - client.send("+18007342577", TO_PHONE_NUMBER, MESSAGE); + SmsSendResult response = client.send("+18007342577", TO_PHONE_NUMBER, MESSAGE); } catch (Exception exception) { + assertNotNull(((HttpResponseException) exception).getResponse().getStatusCode()); assertEquals(401, ((HttpResponseException) exception).getResponse().getStatusCode()); } } + @ParameterizedTest + @MethodSource("com.azure.core.test.TestBase#getHttpClients") + public void sendToFakePhoneNumber(HttpClient httpClient) { + // Arrange + SmsClientBuilder builder = getSmsClientUsingConnectionString(httpClient); + client = setupSyncClient(builder, "sendToFakePhoneNumberSync"); + + // Action & Assert + SmsSendResult sendResult = client.send(FROM_PHONE_NUMBER, "+15550000000", MESSAGE); + assertFalse(sendResult.isSuccessful()); + assertEquals(sendResult.getHttpStatusCode(), 400); + } + @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void sendTwoMessages(HttpClient httpClient) { diff --git a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java index fdffac7a5479..81547473b298 100644 --- a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java +++ b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java @@ -4,22 +4,31 @@ package com.azure.communication.sms; import com.azure.communication.common.implementation.CommunicationConnectionString; +import com.azure.core.credential.AccessToken; +import com.azure.core.credential.AzureKeyCredential; import com.azure.core.credential.TokenCredential; +import com.azure.core.credential.TokenRequestContext; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; +import com.azure.core.test.TestBase; import com.azure.core.test.TestMode; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.models.CustomMatcher; -import com.azure.core.test.models.TestProxySanitizer; -import com.azure.core.test.models.TestProxySanitizerType; -import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.StringJoiner; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import reactor.core.publisher.Mono; +import com.azure.core.http.HttpPipelineNextPolicy; +import com.azure.core.http.HttpResponse; -import java.util.Arrays; +public class SmsTestBase extends TestBase { + protected static final TestMode TEST_MODE = initializeTestMode(); -public class SmsTestBase extends TestProxyTestBase { protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); @@ -34,21 +43,45 @@ public class SmsTestBase extends TestProxyTestBase { protected static final String MESSAGE = "Hello"; + private static final StringJoiner JSON_PROPERTIES_TO_REDACT + = new StringJoiner("\":\"|\"", "\"", "\":\"") + .add("to"); + + private static final Pattern JSON_PROPERTY_VALUE_REDACTION_PATTERN + = Pattern.compile(String.format("(?:%s)(.*?)(?:\",|\"})", JSON_PROPERTIES_TO_REDACT.toString()), + Pattern.CASE_INSENSITIVE); + + protected SmsClientBuilder getSmsClient(HttpClient httpClient) { + CommunicationConnectionString communicationConnectionString = new CommunicationConnectionString(CONNECTION_STRING); + String communicationEndpoint = communicationConnectionString.getEndpoint(); + String communicationAccessKey = communicationConnectionString.getAccessKey(); + + SmsClientBuilder builder = new SmsClientBuilder(); + builder.endpoint(communicationEndpoint) + .credential(new AzureKeyCredential(communicationAccessKey)) + .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient); + if (getTestMode() == TestMode.RECORD) { + List> redactors = new ArrayList<>(); + redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data), "REDACTED")); + builder.addPolicy(interceptorManager.getRecordPolicy(redactors)); + } + return builder; + } protected SmsClientBuilder getSmsClientWithToken(HttpClient httpClient, TokenCredential tokenCredential) { if (getTestMode() == TestMode.PLAYBACK) { - tokenCredential = new MockTokenCredential(); + tokenCredential = new FakeCredentials(); } SmsClientBuilder builder = new SmsClientBuilder(); builder.endpoint(new CommunicationConnectionString(CONNECTION_STRING).getEndpoint()) .credential(tokenCredential) - .httpClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient); + .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient); if (getTestMode() == TestMode.RECORD) { - builder.addPolicy(interceptorManager.getRecordPolicy()); + List> redactors = new ArrayList<>(); + redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data), "REDACTED")); + builder.addPolicy(interceptorManager.getRecordPolicy(redactors)); } - addTestProxySanitizer(); - addTestProxyMatcher(); return builder; } @@ -56,32 +89,30 @@ protected SmsClientBuilder getSmsClientUsingConnectionString(HttpClient httpClie SmsClientBuilder builder = new SmsClientBuilder(); builder .connectionString(CONNECTION_STRING) - .httpClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient); + .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient); if (getTestMode() == TestMode.RECORD) { - builder.addPolicy(interceptorManager.getRecordPolicy()); + List> redactors = new ArrayList<>(); + redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data), "REDACTED")); + builder.addPolicy(interceptorManager.getRecordPolicy(redactors)); } - - addTestProxySanitizer(); - addTestProxyMatcher(); return builder; } - private void addTestProxySanitizer() { - if (!interceptorManager.isLiveMode()) { - interceptorManager.addSanitizers(Arrays.asList(new TestProxySanitizer("$..to", null, - "REDACTED", - TestProxySanitizerType.BODY_KEY), new TestProxySanitizer("$..from", null, - "REDACTED", - TestProxySanitizerType.BODY_KEY))); - } - } - - private void addTestProxyMatcher() { - if (interceptorManager.isPlaybackMode()) { - interceptorManager.addMatchers(Arrays.asList(new CustomMatcher() - .setHeadersKeyOnlyMatch(Arrays.asList("x-ms-content-sha256", "x-ms-hmac-string-to-sign-base64")) - .setComparingBodies(false))); + private static TestMode initializeTestMode() { + ClientLogger logger = new ClientLogger(SmsTestBase.class); + String azureTestMode = Configuration.getGlobalConfiguration().get("AZURE_TEST_MODE"); + if (azureTestMode != null) { + System.out.println("azureTestMode: " + azureTestMode); + try { + return TestMode.valueOf(azureTestMode.toUpperCase(Locale.US)); + } catch (IllegalArgumentException var3) { + logger.error("Could not parse '{}' into TestEnum. Using 'Playback' mode.", azureTestMode); + return TestMode.PLAYBACK; + } + } else { + logger.info("Environment variable '{}' has not been set yet. Using 'Playback' mode.", "AZURE_TEST_MODE"); + return TestMode.PLAYBACK; } } @@ -100,6 +131,24 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne return Mono.just(bufferedResponse); }); } + + static class FakeCredentials implements TokenCredential { + @Override + public Mono getToken(TokenRequestContext tokenRequestContext) { + return Mono.just(new AccessToken("someFakeToken", OffsetDateTime.MAX)); + } + } + + private String redact(String content, Matcher matcher, String replacement) { + while (matcher.find()) { + String captureGroup = matcher.group(1); + if (!CoreUtils.isNullOrEmpty(captureGroup)) { + content = content.replace(matcher.group(1), replacement); + } + } + return content; + } + protected boolean shouldEnableSmsTests() { return !Boolean.parseBoolean(SKIP_INT_SMS_TEST); } diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.checkForRepeatabilityOptions[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.checkForRepeatabilityOptions[1].json new file mode 100644 index 000000000000..4a5c3e272979 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.checkForRepeatabilityOptions[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "cb254981-68d0-4e3f-be0f-81a24ec3aba3", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "542ms", + "MS-CV" : "CfZe5w46JUeef8mcmGeRRw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0gb/DYAAAAACupeebyz5TQ6h0cL3V87PnWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_202106111954427ef02e33-45a3-4ef4-a8dd-db1fbb2ed75f_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true},{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195442a7f23bdd-7bcc-478c-993d-14eafd0dec8f_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:41 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendFromFakeNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendFromFakeNumber[1].json new file mode 100644 index 000000000000..d37efc7d9257 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendFromFakeNumber[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "7ebe4d01-17a1-4dbe-9ee0-184ac2787d0b", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "X-Processing-Time" : "15ms", + "MS-CV" : "w+ORY6SE5km6rlnQtwwrZg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0gr/DYAAAAAALa9Hok3PWQrzp/Lgpb2KdWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "400", + "Body" : "{\"From\":[\"Invalid From phone number format\"]}", + "Date" : "Fri, 11 Jun 2021 19:54:42 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendFromUnauthorizedNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendFromUnauthorizedNumber[1].json new file mode 100644 index 000000000000..8e4e1da1f41b --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendFromUnauthorizedNumber[1].json @@ -0,0 +1,25 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "75b8b130-c074-4ef2-95b2-19beee5ec466", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "331ms", + "MS-CV" : "O3bqFuQDEEOXEI2FUTjm0Q.0", + "retry-after" : "0", + "X-Azure-Ref" : "0g7/DYAAAAADL3+7zJTZETKNnW82A6XT9WVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "401", + "Date" : "Fri, 11 Jun 2021 19:54:43 GMT", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsFromNullNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsFromNullNumber[1].json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsFromNullNumber[1].json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToGroupWithOptions[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToGroupWithOptions[1].json new file mode 100644 index 000000000000..5f7ccd0f42ac --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToGroupWithOptions[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "ae59f3c0-5019-4344-9c2d-2c72a075a761", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "491ms", + "MS-CV" : "BIQSukDWJ0qbSjrcRZAwsg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0g7/DYAAAAABHmkbVBJu0S6RntmURfGsNWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195443755ce74e-be2f-47df-b1a2-b97443abfb08_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true},{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_202106111954435c64c118-4f24-4c11-9264-6fb7da306bfc_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:43 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToGroup[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToGroup[1].json new file mode 100644 index 000000000000..be54ba4b3cbe --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToGroup[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "bddca24c-16a5-4078-b0e2-ad5fbd4166a7", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "537ms", + "MS-CV" : "ZlUTtF/uPkSZcA9iTkWyuQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0hL/DYAAAAADmIKVz3R67Q7IlW36zBGjpWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195444c23c3b29-f2dc-474d-b16f-5ede4137e323_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true},{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_202106111954440d1656c7-c4bc-448c-be11-650491d37564_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:44 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToNullNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToNullNumber[1].json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToNullNumber[1].json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToSingleNumberWithOptions[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToSingleNumberWithOptions[1].json new file mode 100644 index 000000000000..f596f2ff4686 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToSingleNumberWithOptions[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "fd4c682b-b3b8-44fd-be48-699df0d613a5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "577ms", + "MS-CV" : "LBvJrt6RiUqbM0ehpzfgGA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0hL/DYAAAAACDSqYWjo0rQLVMwbH1nFdqWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_202106111954452707eb90-9aa2-42be-95c0-b77a07850014_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:44 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToSingleNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToSingleNumber[1].json new file mode 100644 index 000000000000..c917bccb199b --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsToSingleNumber[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "2fab6820-62bb-47f8-9f01-d9257b601a70", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "536ms", + "MS-CV" : "KzK3aCOMDU+wVDarBAAehQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0gr/DYAAAAABooOvfWV0pQ4kOb/7cpuZoWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_202106111954423ad7f70f-a68e-4a3e-9e7e-1f1aa7b7c667_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:42 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsUsingConnectionString[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsUsingConnectionString[1].json new file mode 100644 index 000000000000..775283d6e1b2 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsUsingConnectionString[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "c4b38a1f-1c10-4edd-9d13-0fd3ff8de87a", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "475ms", + "MS-CV" : "A1xSuGgDLEW9/hoSe0GENQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0hb/DYAAAAADbrUg4jiNqR6Ihjy3l6wMZWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195445047b17e3-26c0-4524-adff-3b9736ef08c2_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:45 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsUsingTokenCredential[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsUsingTokenCredential[1].json new file mode 100644 index 000000000000..6bb44ecaa76d --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendSmsUsingTokenCredential[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "8f60907b-5e8e-436f-b5e1-ce96b4c24821", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "788ms", + "MS-CV" : "eUYf0fZbXUWE68WhBv/1Ow.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ib/DYAAAAABNKKdJihZvTLhgg40xloA6WVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_202106111954497fe74062-3228-4309-af4c-70e782dce83e_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:49 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendToFakePhoneNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendToFakePhoneNumber[1].json new file mode 100644 index 000000000000..fc62205b0fd2 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendToFakePhoneNumber[1].json @@ -0,0 +1,50 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "7550a08a-dcfc-409c-867d-42ccd36820b8", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "327ms", + "MS-CV" : "EOrRUoKHpU2EDnP+/Q6bsA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0hb/DYAAAAAAZqOB5hSNAQ6KSUTiO0lfZWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"httpStatusCode\":400,\"errorMessage\":\"Invalid To phone number format.\",\"successful\":false}]}", + "Date" : "Fri, 11 Jun 2021 19:54:45 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "dfd3eaea-6f19-472c-a9cc-2eedd61db67f", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "278ms", + "MS-CV" : "eKOOyYDaHU2fszlLAfGjOw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0hr/DYAAAAAA/qB45jlGES6ILjpCUxVWSWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"httpStatusCode\":400,\"errorMessage\":\"Invalid To phone number format.\",\"successful\":false}]}", + "Date" : "Fri, 11 Jun 2021 19:54:46 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendTwoMessages[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendTwoMessages[1].json new file mode 100644 index 000000000000..8a71178f1a31 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsAsyncClientTests.sendTwoMessages[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0ecd0e85-c203-400c-83b3-8b73d9d2f6aa", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "563ms", + "MS-CV" : "uhHY5AIbO0+hC36tgZxgmA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0gL/DYAAAAAAFqwTHs8seTZIIBmeCJHdEWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195441b65c3c94-4069-4164-95a7-4ccf1e51638a_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:41 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.checkForRepeatabilityOptions[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.checkForRepeatabilityOptions[1].json new file mode 100644 index 000000000000..b21aa8c771a3 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.checkForRepeatabilityOptions[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "3be8e776-f032-45b2-b537-65b88c420bfb", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "890ms", + "MS-CV" : "MRlwVWI8wUexyiP5skccxw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0i7/DYAAAAABFhgLMxvksTrn9xiJiHvlNWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_2021061119545237455641-e630-432f-8da0-f50760e66485_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true},{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_2021061119545225264396-2f9f-414a-b0a2-30e1a4d25b9c_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:52 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendFromFakeNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendFromFakeNumber[1].json new file mode 100644 index 000000000000..138962e84120 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendFromFakeNumber[1].json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "93c611f5-945c-4d98-a16d-5c0092193737", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "X-Processing-Time" : "16ms", + "MS-CV" : "/Z4B9LL2tECOTLDcpbc4yA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0jL/DYAAAAAApMvA7vIwJQbt3oe4iATexWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "400", + "Body" : "{\"From\":[\"Invalid From phone number format\"]}", + "Date" : "Fri, 11 Jun 2021 19:54:52 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendFromUnauthorizedNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendFromUnauthorizedNumber[1].json new file mode 100644 index 000000000000..9f1d3227f1e4 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendFromUnauthorizedNumber[1].json @@ -0,0 +1,25 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "ce1a6d6f-c788-4ae8-87d1-0beec722d8d2", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "418ms", + "MS-CV" : "z3abkGjmQ0yNquMo7EYCSA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0jr/DYAAAAAD6HFJM6FoNSJ8WiDlOx4YSWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "401", + "Date" : "Fri, 11 Jun 2021 19:54:54 GMT", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToGroupWithOptions[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToGroupWithOptions[1].json new file mode 100644 index 000000000000..529ae54049ab --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToGroupWithOptions[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "490b1f02-2e10-4caa-b942-e19fa9477b69", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "633ms", + "MS-CV" : "bjGLtdIQhESMbQ+rLgSmng.0", + "retry-after" : "0", + "X-Azure-Ref" : "0jb/DYAAAAADSf/rwoJv1SqKdTHX01f5LWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_202106111954537e35c845-233a-4eff-a362-8e651c0055f8_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true},{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195453fc2e49df-008f-49fe-8b44-ba0472332dcb_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:53 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToGroup[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToGroup[1].json new file mode 100644 index 000000000000..be809d98762e --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToGroup[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "84e4055d-5605-4b57-a5ec-27859fe6f7fc", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "634ms", + "MS-CV" : "FNrr3pKX+k2IqdH+HPrE8A.0", + "retry-after" : "0", + "X-Azure-Ref" : "0jr/DYAAAAADgh6h0ohshR5muwjZZjZy/WVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195455dc90f7f7-3c52-4173-93d2-6bed600c5080_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true},{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_2021061119545589f2e748-42b9-4b39-9068-519fc4c3239f_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:54 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToSingleNumberWithOptions[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToSingleNumberWithOptions[1].json new file mode 100644 index 000000000000..a5c0e4cc207b --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToSingleNumberWithOptions[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "efd33ab9-de2e-4c16-b6e9-8c4a36cf4db6", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "632ms", + "MS-CV" : "qHVqiATODkCOpoDtEShCcQ.0", + "retry-after" : "0", + "X-Azure-Ref" : "0j7/DYAAAAAAF7sC1K4l2T6TKyUuAUqzpWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_2021061119545500f55dea-ac56-4839-8ed5-6d88665f6b44_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:55 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToSingleNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToSingleNumber[1].json new file mode 100644 index 000000000000..48d17b8d51dd --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsToSingleNumber[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9b443ee3-99cf-40c3-b935-3546d96cfdf5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "642ms", + "MS-CV" : "fycjSKx+LEq36jLsQEA/yA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0jL/DYAAAAADo5ElcVZKUQrMznY4wZlp8WVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195453f84f7ece-54c0-41b2-915e-642d82966aa5_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:52 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsUsingConnectionString[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsUsingConnectionString[1].json new file mode 100644 index 000000000000..3e8c59829227 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsUsingConnectionString[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "62592ff8-4053-4664-9df0-41ff229eaa18", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "619ms", + "MS-CV" : "TTe9DpNDGkOH+pRUFXpqog.0", + "retry-after" : "0", + "X-Azure-Ref" : "0kL/DYAAAAAAqnilFqn9sQ5l9o5YSVILKWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195456c34b2fdb-a98e-4dbd-b0d6-9e8bb858686b_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:56 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsUsingTokenCredential[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsUsingTokenCredential[1].json new file mode 100644 index 000000000000..d9e456168504 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendSmsUsingTokenCredential[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "6df9b183-6cff-4cc0-a19e-ce747d2fe333", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "489ms", + "MS-CV" : "8xH/4pwLo0++woSiahW4kg.0", + "retry-after" : "0", + "X-Azure-Ref" : "0k7/DYAAAAADEibdhae14TZlFoeUhUdSHWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_20210611195500d61406d9-a4f6-4dd3-be98-ece92504ef79_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:59 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendToFakePhoneNumber[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendToFakePhoneNumber[1].json new file mode 100644 index 000000000000..19d59ada324e --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendToFakePhoneNumber[1].json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "db900036-f4dd-47c6-bae3-b52eec2181b4", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "405ms", + "MS-CV" : "a+IByg9SN0SO7GvEqbpKFA.0", + "retry-after" : "0", + "X-Azure-Ref" : "0kL/DYAAAAACPteVj7hU1R6b0rhGvkc/wWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"httpStatusCode\":400,\"errorMessage\":\"Invalid To phone number format.\",\"successful\":false}]}", + "Date" : "Fri, 11 Jun 2021 19:54:56 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendTwoMessages[1].json b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendTwoMessages[1].json new file mode 100644 index 000000000000..e8766601c270 --- /dev/null +++ b/sdk/communication/azure-communication-sms/src/test/resources/session-records/SmsClientTests.sendTwoMessages[1].json @@ -0,0 +1,50 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "926bfa26-ed08-4d3f-9e89-1d81852448b2", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "632ms", + "MS-CV" : "58JUL/zQlUuLtxmC3Bq9tw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ir/DYAAAAADlrFlug1ZYR7zh7hidKTV/WVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_202106111954506276ee3d-1354-4d40-abba-cbcd5da02b3d_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:50 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/sms?api-version=2021-03-07", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-sms/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "96a427b8-2223-4bc4-acaa-52ecebb13f9b", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "X-Cache" : "CONFIG_NOCACHE", + "api-supported-versions" : "2020-07-20-preview1, 2020-08-20-preview, 2021-03-07", + "X-Processing-Time" : "626ms", + "MS-CV" : "z2X+ANtrOEevpcsVHcjctw.0", + "retry-after" : "0", + "X-Azure-Ref" : "0ir/DYAAAAADl39HFTp4HTq8YM9u3iGdRWVZSMzBFREdFMDMxMwA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "Body" : "{\"value\":[{\"to\":\"REDACTED\",\"messageId\":\"Outgoing_2021061119545198b316e0-64fb-4fa2-9b87-a0561ebff26e_noam\",\"httpStatusCode\":202,\"repeatabilityResult\":\"accepted\",\"successful\":true}]}", + "Date" : "Fri, 11 Jun 2021 19:54:51 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Request-Context" : "appId=" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-sms/tests.yml b/sdk/communication/azure-communication-sms/tests.yml index 9144b1f87120..9c042bba0cb0 100644 --- a/sdk/communication/azure-communication-sms/tests.yml +++ b/sdk/communication/azure-communication-sms/tests.yml @@ -1,20 +1,7 @@ trigger: none -extends: - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-sms - SafeName: azurecommunicationsms - Clouds: 'Public,Int' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - - $(sub-config-communication-services-sms-cloud-test-resources) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) - - $(sub-config-communication-sms-int-test-resources) +stages: + - template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-sms + SafeName: azurecommunicationsms \ No newline at end of file diff --git a/sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md b/sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md index 68d2c0793947..442262962dbd 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md +++ b/sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md @@ -1,14 +1,13 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.2 (2024-04-23) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. +- Upgraded `azure-core-http-netty` from `1.14.1` to version `1.14.2`. ## 1.0.1 (2024-03-20) diff --git a/sdk/contentsafety/azure-ai-contentsafety/README.md b/sdk/contentsafety/azure-ai-contentsafety/README.md index 37f38c51524d..505e04764f40 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/README.md +++ b/sdk/contentsafety/azure-ai-contentsafety/README.md @@ -28,7 +28,7 @@ Various documentation is available to help you get started com.azure azure-ai-contentsafety - 1.0.0 + 1.0.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/contentsafety/azure-ai-contentsafety/pom.xml b/sdk/contentsafety/azure-ai-contentsafety/pom.xml index 5be92c41dc2e..2929be15dfc6 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/pom.xml +++ b/sdk/contentsafety/azure-ai-contentsafety/pom.xml @@ -14,7 +14,7 @@ com.azure azure-ai-contentsafety - 1.1.0-beta.1 + 1.0.2 jar Microsoft Azure SDK for ContentSafety @@ -69,6 +69,12 @@ 5.9.3 test + + org.mockito + mockito-core + 4.11.0 + test + com.azure azure-core-test diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistAsyncClient.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistAsyncClient.java index af6bf87964c9..58f652c3884f 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistAsyncClient.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistAsyncClient.java @@ -4,7 +4,6 @@ package com.azure.ai.contentsafety; import com.azure.ai.contentsafety.implementation.BlocklistClientImpl; -import com.azure.ai.contentsafety.implementation.JsonMergePatchHelper; import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsOptions; import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsResult; import com.azure.ai.contentsafety.models.RemoveTextBlocklistItemsOptions; @@ -53,8 +52,9 @@ public final class BlocklistAsyncClient { * * Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one * request. - *

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistItems (Required): [
@@ -66,9 +66,9 @@ public final class BlocklistAsyncClient {
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItems (Required): [
@@ -102,17 +102,18 @@ public Mono> addOrUpdateBlocklistItemsWithResponse(String n
      * Create Or Update Text Blocklist
      *
      * Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
      *     description: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -133,6 +134,8 @@ public Mono> addOrUpdateBlocklistItemsWithResponse(String n
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> createOrUpdateTextBlocklistWithResponse(String name, BinaryData options,
         RequestOptions requestOptions) {
+        // Convenience API is not generated, as operation 'createOrUpdateTextBlocklist' is
+        // 'application/merge-patch+json' and stream-style-serialization is not enabled
         return this.serviceClient.createOrUpdateTextBlocklistWithResponseAsync(name, options, requestOptions);
     }
 
@@ -159,8 +162,9 @@ public Mono> deleteTextBlocklistWithResponse(String name, Request
      * Get Text Blocklist By blocklistName
      *
      * Returns text blocklist details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -186,8 +190,9 @@ public Mono> getTextBlocklistWithResponse(String name, Requ
      * Get BlocklistItem By blocklistName And blocklistItemId
      *
      * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -217,17 +222,40 @@ public Mono> getTextBlocklistItemWithResponse(String name,
      * Get All BlocklistItems By blocklistName
      *
      * Get all blocklistItems in a text blocklist.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -254,8 +282,9 @@ public PagedFlux listTextBlocklistItems(String name, RequestOptions
      * Get All Text Blocklists
      *
      * Get all text blocklists details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -280,8 +309,9 @@ public PagedFlux listTextBlocklists(RequestOptions requestOptions) {
      * Remove BlocklistItems From Text Blocklist
      *
      * Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistItemIds (Required): [
@@ -432,13 +462,11 @@ public PagedFlux listTextBlocklistItems(String name, Integer
         }
         PagedFlux pagedFluxResponse = listTextBlocklistItems(name, requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
+                pagedResponse.getValue().stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(TextBlocklistItem.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -466,13 +494,11 @@ public PagedFlux listTextBlocklistItems(String name) {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listTextBlocklistItems(name, requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
+                pagedResponse.getValue().stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(TextBlocklistItem.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -498,13 +524,11 @@ public PagedFlux listTextBlocklists() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listTextBlocklists(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
+                pagedResponse.getValue().stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(TextBlocklist.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -534,32 +558,4 @@ public Mono removeBlocklistItems(String name, RemoveTextBlocklistItemsOpti
         return removeBlocklistItemsWithResponse(name, BinaryData.fromObject(options), requestOptions)
             .flatMap(FluxUtil::toMono);
     }
-
-    /**
-     * Create Or Update Text Blocklist
-     *
-     * Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
-     *
-     * @param name Text blocklist name.
-     * @param options The resource instance.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return text Blocklist on successful completion of {@link Mono}.
-     */
-    @Generated
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono createOrUpdateTextBlocklist(String name, TextBlocklist options) {
-        // Generated convenience method for createOrUpdateTextBlocklistWithResponse
-        RequestOptions requestOptions = new RequestOptions();
-        JsonMergePatchHelper.getTextBlocklistAccessor().prepareModelForJsonMergePatch(options, true);
-        BinaryData optionsInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(options).toBytes());
-        JsonMergePatchHelper.getTextBlocklistAccessor().prepareModelForJsonMergePatch(options, false);
-        return createOrUpdateTextBlocklistWithResponse(name, optionsInBinaryData, requestOptions)
-            .flatMap(FluxUtil::toMono)
-            .map(protocolMethodData -> protocolMethodData.toObject(TextBlocklist.class));
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClient.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClient.java
index 0436da5bf5b9..9d50db14d61a 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClient.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClient.java
@@ -4,7 +4,6 @@
 package com.azure.ai.contentsafety;
 
 import com.azure.ai.contentsafety.implementation.BlocklistClientImpl;
-import com.azure.ai.contentsafety.implementation.JsonMergePatchHelper;
 import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsOptions;
 import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsResult;
 import com.azure.ai.contentsafety.models.RemoveTextBlocklistItemsOptions;
@@ -47,8 +46,9 @@ public final class BlocklistClient {
      *
      * Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
      * request.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistItems (Required): [
@@ -60,9 +60,9 @@ public final class BlocklistClient {
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItems (Required): [
@@ -95,17 +95,18 @@ public Response addOrUpdateBlocklistItemsWithResponse(String name, B
      * Create Or Update Text Blocklist
      *
      * Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
      *     description: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -126,6 +127,8 @@ public Response addOrUpdateBlocklistItemsWithResponse(String name, B
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response createOrUpdateTextBlocklistWithResponse(String name, BinaryData options,
         RequestOptions requestOptions) {
+        // Convenience API is not generated, as operation 'createOrUpdateTextBlocklist' is
+        // 'application/merge-patch+json' and stream-style-serialization is not enabled
         return this.serviceClient.createOrUpdateTextBlocklistWithResponse(name, options, requestOptions);
     }
 
@@ -152,8 +155,9 @@ public Response deleteTextBlocklistWithResponse(String name, RequestOption
      * Get Text Blocklist By blocklistName
      *
      * Returns text blocklist details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -179,8 +183,9 @@ public Response getTextBlocklistWithResponse(String name, RequestOpt
      * Get BlocklistItem By blocklistName And blocklistItemId
      *
      * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -209,17 +214,40 @@ public Response getTextBlocklistItemWithResponse(String name, String
      * Get All BlocklistItems By blocklistName
      *
      * Get all blocklistItems in a text blocklist.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -246,8 +274,9 @@ public PagedIterable listTextBlocklistItems(String name, RequestOpti
      * Get All Text Blocklists
      *
      * Get all text blocklists details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -272,8 +301,9 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption
      * Remove BlocklistItems From Text Blocklist
      *
      * Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistItemIds (Required): [
@@ -487,31 +517,4 @@ public void removeBlocklistItems(String name, RemoveTextBlocklistItemsOptions op
         RequestOptions requestOptions = new RequestOptions();
         removeBlocklistItemsWithResponse(name, BinaryData.fromObject(options), requestOptions).getValue();
     }
-
-    /**
-     * Create Or Update Text Blocklist
-     *
-     * Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
-     *
-     * @param name Text blocklist name.
-     * @param options The resource instance.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return text Blocklist.
-     */
-    @Generated
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    public TextBlocklist createOrUpdateTextBlocklist(String name, TextBlocklist options) {
-        // Generated convenience method for createOrUpdateTextBlocklistWithResponse
-        RequestOptions requestOptions = new RequestOptions();
-        JsonMergePatchHelper.getTextBlocklistAccessor().prepareModelForJsonMergePatch(options, true);
-        BinaryData optionsInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(options).toBytes());
-        JsonMergePatchHelper.getTextBlocklistAccessor().prepareModelForJsonMergePatch(options, false);
-        return createOrUpdateTextBlocklistWithResponse(name, optionsInBinaryData, requestOptions).getValue()
-            .toObject(TextBlocklist.class);
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java
index 26c28b77525e..69a756753b58 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java
@@ -23,8 +23,8 @@
 import com.azure.core.http.policy.AddHeadersFromContextPolicy;
 import com.azure.core.http.policy.AddHeadersPolicy;
 import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
-import com.azure.core.http.policy.HttpLoggingPolicy;
 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.KeyCredentialPolicy;
@@ -87,7 +87,7 @@ public BlocklistClientBuilder() {
     @Override
     public BlocklistClientBuilder pipeline(HttpPipeline pipeline) {
         if (this.pipeline != null && pipeline == null) {
-            LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured.");
+            LOGGER.info("HttpPipeline is being set to 'null' when it was previously configured.");
         }
         this.pipeline = pipeline;
         return this;
@@ -302,8 +302,7 @@ private HttpPipeline createHttpPipeline() {
         if (headers.getSize() > 0) {
             policies.add(new AddHeadersPolicy(headers));
         }
-        this.pipelinePolicies.stream()
-            .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+        this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
             .forEach(p -> policies.add(p));
         HttpPolicyProviders.addBeforeRetryPolicies(policies);
         policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
@@ -314,15 +313,12 @@ private HttpPipeline createHttpPipeline() {
         if (tokenCredential != null) {
             policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
         }
-        this.pipelinePolicies.stream()
-            .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+        this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
             .forEach(p -> policies.add(p));
         HttpPolicyProviders.addAfterRetryPolicies(policies);
         policies.add(new HttpLoggingPolicy(localHttpLogOptions));
         HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
-            .httpClient(httpClient)
-            .clientOptions(localClientOptions)
-            .build();
+            .httpClient(httpClient).clientOptions(localClientOptions).build();
         return httpPipeline;
     }
 
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyAsyncClient.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyAsyncClient.java
index 3942fde7bc59..b689c8a0642e 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyAsyncClient.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyAsyncClient.java
@@ -47,8 +47,9 @@ public final class ContentSafetyAsyncClient {
      *
      * A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories:
      * Hate, SelfHarm, Sexual, and Violence.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     text: String (Required)
@@ -62,9 +63,9 @@ public final class ContentSafetyAsyncClient {
      *     outputType: String(FourSeverityLevels/EightSeverityLevels) (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistsMatch (Optional): [
@@ -102,8 +103,9 @@ public Mono> analyzeTextWithResponse(BinaryData options, Re
      *
      * A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories:
      * Hate, SelfHarm, Sexual, and Violence.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     image (Required): {
@@ -116,9 +118,9 @@ public Mono> analyzeTextWithResponse(BinaryData options, Re
      *     outputType: String(FourSeverityLevels) (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     categoriesAnalysis (Required): [
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClient.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClient.java
index 61a3ecc129a4..bfde1c9964b6 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClient.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClient.java
@@ -45,8 +45,9 @@ public final class ContentSafetyClient {
      *
      * A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories:
      * Hate, SelfHarm, Sexual, and Violence.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     text: String (Required)
@@ -60,9 +61,9 @@ public final class ContentSafetyClient {
      *     outputType: String(FourSeverityLevels/EightSeverityLevels) (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistsMatch (Optional): [
@@ -100,8 +101,9 @@ public Response analyzeTextWithResponse(BinaryData options, RequestO
      *
      * A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories:
      * Hate, SelfHarm, Sexual, and Violence.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     image (Required): {
@@ -114,9 +116,9 @@ public Response analyzeTextWithResponse(BinaryData options, RequestO
      *     outputType: String(FourSeverityLevels) (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     categoriesAnalysis (Required): [
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java
index 4e0803ef53b7..66d449e02fe8 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java
@@ -23,8 +23,8 @@
 import com.azure.core.http.policy.AddHeadersFromContextPolicy;
 import com.azure.core.http.policy.AddHeadersPolicy;
 import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
-import com.azure.core.http.policy.HttpLoggingPolicy;
 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.KeyCredentialPolicy;
@@ -87,7 +87,7 @@ public ContentSafetyClientBuilder() {
     @Override
     public ContentSafetyClientBuilder pipeline(HttpPipeline pipeline) {
         if (this.pipeline != null && pipeline == null) {
-            LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured.");
+            LOGGER.info("HttpPipeline is being set to 'null' when it was previously configured.");
         }
         this.pipeline = pipeline;
         return this;
@@ -302,8 +302,7 @@ private HttpPipeline createHttpPipeline() {
         if (headers.getSize() > 0) {
             policies.add(new AddHeadersPolicy(headers));
         }
-        this.pipelinePolicies.stream()
-            .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+        this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
             .forEach(p -> policies.add(p));
         HttpPolicyProviders.addBeforeRetryPolicies(policies);
         policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
@@ -314,15 +313,12 @@ private HttpPipeline createHttpPipeline() {
         if (tokenCredential != null) {
             policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
         }
-        this.pipelinePolicies.stream()
-            .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+        this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
             .forEach(p -> policies.add(p));
         HttpPolicyProviders.addAfterRetryPolicies(policies);
         policies.add(new HttpLoggingPolicy(localHttpLogOptions));
         HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
-            .httpClient(httpClient)
-            .clientOptions(localClientOptions)
-            .build();
+            .httpClient(httpClient).clientOptions(localClientOptions).build();
         return httpPipeline;
     }
 
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java
index 9e6b8118a5a4..eedb893f17d2 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java
@@ -378,8 +378,9 @@ Response listTextBlocklistsNextSync(@PathParam(value = "nextLink", e
      * 
      * Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
      * request.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistItems (Required): [
@@ -391,9 +392,9 @@ Response listTextBlocklistsNextSync(@PathParam(value = "nextLink", e
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItems (Required): [
@@ -429,8 +430,9 @@ public Mono> addOrUpdateBlocklistItemsWithResponseAsync(Str
      * 
      * Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
      * request.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistItems (Required): [
@@ -442,9 +444,9 @@ public Mono> addOrUpdateBlocklistItemsWithResponseAsync(Str
      *     ]
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItems (Required): [
@@ -478,17 +480,18 @@ public Response addOrUpdateBlocklistItemsWithResponse(String name, B
      * Create Or Update Text Blocklist
      * 
      * Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
      *     description: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -518,17 +521,18 @@ public Mono> createOrUpdateTextBlocklistWithResponseAsync(S
      * Create Or Update Text Blocklist
      * 
      * Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
      *     description: String (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -598,8 +602,9 @@ public Response deleteTextBlocklistWithResponse(String name, RequestOption
      * Get Text Blocklist By blocklistName
      * 
      * Returns text blocklist details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -626,8 +631,9 @@ public Mono> getTextBlocklistWithResponseAsync(String name,
      * Get Text Blocklist By blocklistName
      * 
      * Returns text blocklist details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -654,8 +660,9 @@ public Response getTextBlocklistWithResponse(String name, RequestOpt
      * Get BlocklistItem By blocklistName And blocklistItemId
      * 
      * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -686,8 +693,9 @@ public Mono> getTextBlocklistItemWithResponseAsync(String n
      * Get BlocklistItem By blocklistName And blocklistItemId
      * 
      * Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -717,17 +725,40 @@ public Response getTextBlocklistItemWithResponse(String name, String
      * Get All BlocklistItems By blocklistName
      * 
      * Get all blocklistItems in a text blocklist.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -760,17 +791,40 @@ private Mono> listTextBlocklistItemsSinglePageAsync(St
      * Get All BlocklistItems By blocklistName
      * 
      * Get all blocklistItems in a text blocklist.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -820,17 +874,40 @@ public PagedFlux listTextBlocklistItemsAsync(String name, RequestOpt
      * Get All BlocklistItems By blocklistName
      * 
      * Get all blocklistItems in a text blocklist.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -860,17 +937,40 @@ private PagedResponse listTextBlocklistItemsSinglePage(String name,
      * Get All BlocklistItems By blocklistName
      * 
      * Get all blocklistItems in a text blocklist.
-     * 

Query Parameters

+ *

+ * Query Parameters + *

* * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -920,8 +1020,9 @@ public PagedIterable listTextBlocklistItems(String name, RequestOpti
      * Get All Text Blocklists
      * 
      * Get all text blocklists details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -950,8 +1051,9 @@ private Mono> listTextBlocklistsSinglePageAsync(Reques
      * Get All Text Blocklists
      * 
      * Get all text blocklists details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -979,8 +1081,9 @@ public PagedFlux listTextBlocklistsAsync(RequestOptions requestOptio
      * Get All Text Blocklists
      * 
      * Get all text blocklists details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -1008,8 +1111,9 @@ private PagedResponse listTextBlocklistsSinglePage(RequestOptions re
      * Get All Text Blocklists
      * 
      * Get all text blocklists details.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -1037,8 +1141,9 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption
      * Remove BlocklistItems From Text Blocklist
      * 
      * Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistItemIds (Required): [
@@ -1068,8 +1173,9 @@ public Mono> removeBlocklistItemsWithResponseAsync(String name, B
      * Remove BlocklistItems From Text Blocklist
      * 
      * Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     blocklistItemIds (Required): [
@@ -1099,8 +1205,9 @@ public Response removeBlocklistItemsWithResponse(String name, BinaryData o
      * Get All BlocklistItems By blocklistName
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -1135,8 +1242,9 @@ private Mono> listTextBlocklistItemsNextSinglePageAsyn
      * Get All BlocklistItems By blocklistName
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistItemId: String (Required)
@@ -1169,8 +1277,9 @@ private PagedResponse listTextBlocklistItemsNextSinglePage(String ne
      * Get All Text Blocklists
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
@@ -1203,8 +1312,9 @@ private Mono> listTextBlocklistsNextSinglePageAsync(St
      * Get All Text Blocklists
      * 
      * Get the next page of items.
-     * 

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistName: String (Required)
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java
index 5c24a16c86a4..74de26118073 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java
@@ -198,8 +198,9 @@ Response analyzeImageSync(@HostParam("endpoint") String endpoint,
      * 
      * A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories:
      * Hate, SelfHarm, Sexual, and Violence.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     text: String (Required)
@@ -213,9 +214,9 @@ Response analyzeImageSync(@HostParam("endpoint") String endpoint,
      *     outputType: String(FourSeverityLevels/EightSeverityLevels) (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistsMatch (Optional): [
@@ -254,8 +255,9 @@ public Mono> analyzeTextWithResponseAsync(BinaryData option
      * 
      * A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories:
      * Hate, SelfHarm, Sexual, and Violence.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     text: String (Required)
@@ -269,9 +271,9 @@ public Mono> analyzeTextWithResponseAsync(BinaryData option
      *     outputType: String(FourSeverityLevels/EightSeverityLevels) (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     blocklistsMatch (Optional): [
@@ -310,8 +312,9 @@ public Response analyzeTextWithResponse(BinaryData options, RequestO
      * 
      * A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories:
      * Hate, SelfHarm, Sexual, and Violence.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     image (Required): {
@@ -324,9 +327,9 @@ public Response analyzeTextWithResponse(BinaryData options, RequestO
      *     outputType: String(FourSeverityLevels) (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     categoriesAnalysis (Required): [
@@ -358,8 +361,9 @@ public Mono> analyzeImageWithResponseAsync(BinaryData optio
      * 
      * A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories:
      * Hate, SelfHarm, Sexual, and Violence.
-     * 

Request Body Schema

- * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     image (Required): {
@@ -372,9 +376,9 @@ public Mono> analyzeImageWithResponseAsync(BinaryData optio
      *     outputType: String(FourSeverityLevels) (Optional)
      * }
      * }
- * - *

Response Body Schema

- * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     categoriesAnalysis (Required): [
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsOptions.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsOptions.java
index 07b171f647d9..f2fe1ed9153e 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsOptions.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsOptions.java
@@ -5,25 +5,22 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.Immutable;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.List;
 
 /**
  * The request to add blocklistItems to a text blocklist.
  */
 @Immutable
-public final class AddOrUpdateTextBlocklistItemsOptions
-    implements JsonSerializable {
+public final class AddOrUpdateTextBlocklistItemsOptions {
 
     /*
      * Array of blocklistItems to add.
      */
     @Generated
-    private final List blocklistItems;
+    @JsonProperty(value = "blocklistItems")
+    private List blocklistItems;
 
     /**
      * Creates an instance of AddOrUpdateTextBlocklistItemsOptions class.
@@ -31,7 +28,9 @@ public final class AddOrUpdateTextBlocklistItemsOptions
      * @param blocklistItems the blocklistItems value to set.
      */
     @Generated
-    public AddOrUpdateTextBlocklistItemsOptions(List blocklistItems) {
+    @JsonCreator
+    public AddOrUpdateTextBlocklistItemsOptions(
+        @JsonProperty(value = "blocklistItems") List blocklistItems) {
         this.blocklistItems = blocklistItems;
     }
 
@@ -44,42 +43,4 @@ public AddOrUpdateTextBlocklistItemsOptions(List blocklistIte
     public List getBlocklistItems() {
         return this.blocklistItems;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeArrayField("blocklistItems", this.blocklistItems,
-            (writer, element) -> writer.writeJson(element));
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of AddOrUpdateTextBlocklistItemsOptions from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of AddOrUpdateTextBlocklistItemsOptions if the JsonReader was pointing to an instance of it,
-     * or null if it was pointing to JSON null.
-     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
-     * @throws IOException If an error occurs while reading the AddOrUpdateTextBlocklistItemsOptions.
-     */
-    @Generated
-    public static AddOrUpdateTextBlocklistItemsOptions fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            List blocklistItems = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("blocklistItems".equals(fieldName)) {
-                    blocklistItems = reader.readArray(reader1 -> TextBlocklistItem.fromJson(reader1));
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            return new AddOrUpdateTextBlocklistItemsOptions(blocklistItems);
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsResult.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsResult.java
index 5f870f41d4a6..15fd4cb3e3b2 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsResult.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsResult.java
@@ -5,25 +5,22 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.Immutable;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.List;
 
 /**
  * The response of adding blocklistItems to the text blocklist.
  */
 @Immutable
-public final class AddOrUpdateTextBlocklistItemsResult
-    implements JsonSerializable {
+public final class AddOrUpdateTextBlocklistItemsResult {
 
     /*
      * Array of blocklistItems have been added.
      */
     @Generated
-    private final List blocklistItems;
+    @JsonProperty(value = "blocklistItems")
+    private List blocklistItems;
 
     /**
      * Creates an instance of AddOrUpdateTextBlocklistItemsResult class.
@@ -31,7 +28,9 @@ public final class AddOrUpdateTextBlocklistItemsResult
      * @param blocklistItems the blocklistItems value to set.
      */
     @Generated
-    private AddOrUpdateTextBlocklistItemsResult(List blocklistItems) {
+    @JsonCreator
+    private AddOrUpdateTextBlocklistItemsResult(
+        @JsonProperty(value = "blocklistItems") List blocklistItems) {
         this.blocklistItems = blocklistItems;
     }
 
@@ -44,42 +43,4 @@ private AddOrUpdateTextBlocklistItemsResult(List blocklistIte
     public List getBlocklistItems() {
         return this.blocklistItems;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeArrayField("blocklistItems", this.blocklistItems,
-            (writer, element) -> writer.writeJson(element));
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of AddOrUpdateTextBlocklistItemsResult from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of AddOrUpdateTextBlocklistItemsResult if the JsonReader was pointing to an instance of it,
-     * or null if it was pointing to JSON null.
-     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
-     * @throws IOException If an error occurs while reading the AddOrUpdateTextBlocklistItemsResult.
-     */
-    @Generated
-    public static AddOrUpdateTextBlocklistItemsResult fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            List blocklistItems = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("blocklistItems".equals(fieldName)) {
-                    blocklistItems = reader.readArray(reader1 -> TextBlocklistItem.fromJson(reader1));
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            return new AddOrUpdateTextBlocklistItemsResult(blocklistItems);
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOptions.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOptions.java
index 444a656f376a..d599b95471f7 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOptions.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOptions.java
@@ -5,35 +5,37 @@
 
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.List;
 
 /**
  * The image analysis request.
  */
 @Fluent
-public final class AnalyzeImageOptions implements JsonSerializable {
+public final class AnalyzeImageOptions {
 
     /*
      * The image needs to be analyzed.
      */
     @Generated
-    private final ContentSafetyImageData image;
+    @JsonProperty(value = "image")
+    private ContentSafetyImageData image;
 
     /*
-     * The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.
+     * The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories
+     * will be returned.
      */
     @Generated
+    @JsonProperty(value = "categories")
     private List categories;
 
     /*
-     * This refers to the type of image analysis output. If no value is assigned, the default value will be "FourSeverityLevels".
+     * This refers to the type of image analysis output. If no value is assigned, the default value will be
+     * "FourSeverityLevels".
      */
     @Generated
+    @JsonProperty(value = "outputType")
     private AnalyzeImageOutputType outputType;
 
     /**
@@ -42,7 +44,8 @@ public final class AnalyzeImageOptions implements JsonSerializable getCategories() {
     }
 
     /**
-     * Set the categories property: The categories will be analyzed. If they are not assigned, a default set of analysis
-     * results for the categories will be returned.
+     * Set the categories property: The categories will be analyzed. If they are not assigned, a default set of
+     * analysis results for the categories will be returned.
      *
      * @param categories the categories value to set.
      * @return the AnalyzeImageOptions object itself.
@@ -103,53 +106,4 @@ public AnalyzeImageOptions setOutputType(AnalyzeImageOutputType outputType) {
         this.outputType = outputType;
         return this;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeJsonField("image", this.image);
-        jsonWriter.writeArrayField("categories", this.categories,
-            (writer, element) -> writer.writeString(element == null ? null : element.toString()));
-        jsonWriter.writeStringField("outputType", this.outputType == null ? null : this.outputType.toString());
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of AnalyzeImageOptions from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of AnalyzeImageOptions if the JsonReader was pointing to an instance of it, or null if it was
-     * pointing to JSON null.
-     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
-     * @throws IOException If an error occurs while reading the AnalyzeImageOptions.
-     */
-    @Generated
-    public static AnalyzeImageOptions fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            ContentSafetyImageData image = null;
-            List categories = null;
-            AnalyzeImageOutputType outputType = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("image".equals(fieldName)) {
-                    image = ContentSafetyImageData.fromJson(reader);
-                } else if ("categories".equals(fieldName)) {
-                    categories = reader.readArray(reader1 -> ImageCategory.fromString(reader1.getString()));
-                } else if ("outputType".equals(fieldName)) {
-                    outputType = AnalyzeImageOutputType.fromString(reader.getString());
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            AnalyzeImageOptions deserializedAnalyzeImageOptions = new AnalyzeImageOptions(image);
-            deserializedAnalyzeImageOptions.categories = categories;
-            deserializedAnalyzeImageOptions.outputType = outputType;
-            return deserializedAnalyzeImageOptions;
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOutputType.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOutputType.java
index 8633e572854a..26b19f3b75a4 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOutputType.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOutputType.java
@@ -5,6 +5,7 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.util.ExpandableStringEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
 import java.util.Collection;
 
 /**
@@ -35,6 +36,7 @@ public AnalyzeImageOutputType() {
      * @return the corresponding AnalyzeImageOutputType.
      */
     @Generated
+    @JsonCreator
     public static AnalyzeImageOutputType fromString(String name) {
         return fromString(name, AnalyzeImageOutputType.class);
     }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageResult.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageResult.java
index 08105f1e3fc7..c81638c92d42 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageResult.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageResult.java
@@ -5,24 +5,22 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.Immutable;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.List;
 
 /**
  * The image analysis response.
  */
 @Immutable
-public final class AnalyzeImageResult implements JsonSerializable {
+public final class AnalyzeImageResult {
 
     /*
      * Analysis result for categories.
      */
     @Generated
-    private final List categoriesAnalysis;
+    @JsonProperty(value = "categoriesAnalysis")
+    private List categoriesAnalysis;
 
     /**
      * Creates an instance of AnalyzeImageResult class.
@@ -30,7 +28,9 @@ public final class AnalyzeImageResult implements JsonSerializable categoriesAnalysis) {
+    @JsonCreator
+    private AnalyzeImageResult(
+        @JsonProperty(value = "categoriesAnalysis") List categoriesAnalysis) {
         this.categoriesAnalysis = categoriesAnalysis;
     }
 
@@ -43,42 +43,4 @@ private AnalyzeImageResult(List categoriesAnalysis) {
     public List getCategoriesAnalysis() {
         return this.categoriesAnalysis;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeArrayField("categoriesAnalysis", this.categoriesAnalysis,
-            (writer, element) -> writer.writeJson(element));
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of AnalyzeImageResult from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of AnalyzeImageResult if the JsonReader was pointing to an instance of it, or null if it was
-     * pointing to JSON null.
-     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
-     * @throws IOException If an error occurs while reading the AnalyzeImageResult.
-     */
-    @Generated
-    public static AnalyzeImageResult fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            List categoriesAnalysis = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("categoriesAnalysis".equals(fieldName)) {
-                    categoriesAnalysis = reader.readArray(reader1 -> ImageCategoriesAnalysis.fromJson(reader1));
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            return new AnalyzeImageResult(categoriesAnalysis);
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOptions.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOptions.java
index e344fe2e60ec..21ff6f5a2dd7 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOptions.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOptions.java
@@ -5,47 +5,53 @@
 
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.List;
 
 /**
  * The text analysis request.
  */
 @Fluent
-public final class AnalyzeTextOptions implements JsonSerializable {
+public final class AnalyzeTextOptions {
 
     /*
-     * The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.
+     * The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text
+     * of one request.
      */
     @Generated
-    private final String text;
+    @JsonProperty(value = "text")
+    private String text;
 
     /*
-     * The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.
+     * The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories
+     * will be returned.
      */
     @Generated
+    @JsonProperty(value = "categories")
     private List categories;
 
     /*
      * The names of blocklists.
      */
     @Generated
+    @JsonProperty(value = "blocklistNames")
     private List blocklistNames;
 
     /*
-     * When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit.
+     * When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit.
+     * When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit.
      */
     @Generated
+    @JsonProperty(value = "haltOnBlocklistHit")
     private Boolean haltOnBlocklistHit;
 
     /*
-     * This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels".
+     * This refers to the type of text analysis output. If no value is assigned, the default value will be
+     * "FourSeverityLevels".
      */
     @Generated
+    @JsonProperty(value = "outputType")
     private AnalyzeTextOutputType outputType;
 
     /**
@@ -54,7 +60,8 @@ public final class AnalyzeTextOptions implements JsonSerializable getCategories() {
     }
 
     /**
-     * Set the categories property: The categories will be analyzed. If they are not assigned, a default set of analysis
-     * results for the categories will be returned.
+     * Set the categories property: The categories will be analyzed. If they are not assigned, a default set of
+     * analysis results for the categories will be returned.
      *
      * @param categories the categories value to set.
      * @return the AnalyzeTextOptions object itself.
@@ -164,64 +171,4 @@ public AnalyzeTextOptions setOutputType(AnalyzeTextOutputType outputType) {
         this.outputType = outputType;
         return this;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeStringField("text", this.text);
-        jsonWriter.writeArrayField("categories", this.categories,
-            (writer, element) -> writer.writeString(element == null ? null : element.toString()));
-        jsonWriter.writeArrayField("blocklistNames", this.blocklistNames,
-            (writer, element) -> writer.writeString(element));
-        jsonWriter.writeBooleanField("haltOnBlocklistHit", this.haltOnBlocklistHit);
-        jsonWriter.writeStringField("outputType", this.outputType == null ? null : this.outputType.toString());
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of AnalyzeTextOptions from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of AnalyzeTextOptions if the JsonReader was pointing to an instance of it, or null if it was
-     * pointing to JSON null.
-     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
-     * @throws IOException If an error occurs while reading the AnalyzeTextOptions.
-     */
-    @Generated
-    public static AnalyzeTextOptions fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            String text = null;
-            List categories = null;
-            List blocklistNames = null;
-            Boolean haltOnBlocklistHit = null;
-            AnalyzeTextOutputType outputType = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("text".equals(fieldName)) {
-                    text = reader.getString();
-                } else if ("categories".equals(fieldName)) {
-                    categories = reader.readArray(reader1 -> TextCategory.fromString(reader1.getString()));
-                } else if ("blocklistNames".equals(fieldName)) {
-                    blocklistNames = reader.readArray(reader1 -> reader1.getString());
-                } else if ("haltOnBlocklistHit".equals(fieldName)) {
-                    haltOnBlocklistHit = reader.getNullable(JsonReader::getBoolean);
-                } else if ("outputType".equals(fieldName)) {
-                    outputType = AnalyzeTextOutputType.fromString(reader.getString());
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            AnalyzeTextOptions deserializedAnalyzeTextOptions = new AnalyzeTextOptions(text);
-            deserializedAnalyzeTextOptions.categories = categories;
-            deserializedAnalyzeTextOptions.blocklistNames = blocklistNames;
-            deserializedAnalyzeTextOptions.haltOnBlocklistHit = haltOnBlocklistHit;
-            deserializedAnalyzeTextOptions.outputType = outputType;
-            return deserializedAnalyzeTextOptions;
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOutputType.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOutputType.java
index a091101e1cc1..25a21e33b6de 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOutputType.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOutputType.java
@@ -5,6 +5,7 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.util.ExpandableStringEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
 import java.util.Collection;
 
 /**
@@ -41,6 +42,7 @@ public AnalyzeTextOutputType() {
      * @return the corresponding AnalyzeTextOutputType.
      */
     @Generated
+    @JsonCreator
     public static AnalyzeTextOutputType fromString(String name) {
         return fromString(name, AnalyzeTextOutputType.class);
     }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextResult.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextResult.java
index d5187de9e87f..21a0a6d33936 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextResult.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextResult.java
@@ -5,30 +5,29 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.Immutable;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.List;
 
 /**
  * The text analysis response.
  */
 @Immutable
-public final class AnalyzeTextResult implements JsonSerializable {
+public final class AnalyzeTextResult {
 
     /*
      * The blocklist match details.
      */
     @Generated
+    @JsonProperty(value = "blocklistsMatch")
     private List blocklistsMatch;
 
     /*
      * Analysis result for categories.
      */
     @Generated
-    private final List categoriesAnalysis;
+    @JsonProperty(value = "categoriesAnalysis")
+    private List categoriesAnalysis;
 
     /**
      * Creates an instance of AnalyzeTextResult class.
@@ -36,7 +35,9 @@ public final class AnalyzeTextResult implements JsonSerializable categoriesAnalysis) {
+    @JsonCreator
+    private AnalyzeTextResult(
+        @JsonProperty(value = "categoriesAnalysis") List categoriesAnalysis) {
         this.categoriesAnalysis = categoriesAnalysis;
     }
 
@@ -59,49 +60,4 @@ public List getBlocklistsMatch() {
     public List getCategoriesAnalysis() {
         return this.categoriesAnalysis;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeArrayField("categoriesAnalysis", this.categoriesAnalysis,
-            (writer, element) -> writer.writeJson(element));
-        jsonWriter.writeArrayField("blocklistsMatch", this.blocklistsMatch,
-            (writer, element) -> writer.writeJson(element));
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of AnalyzeTextResult from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of AnalyzeTextResult if the JsonReader was pointing to an instance of it, or null if it was
-     * pointing to JSON null.
-     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
-     * @throws IOException If an error occurs while reading the AnalyzeTextResult.
-     */
-    @Generated
-    public static AnalyzeTextResult fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            List categoriesAnalysis = null;
-            List blocklistsMatch = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("categoriesAnalysis".equals(fieldName)) {
-                    categoriesAnalysis = reader.readArray(reader1 -> TextCategoriesAnalysis.fromJson(reader1));
-                } else if ("blocklistsMatch".equals(fieldName)) {
-                    blocklistsMatch = reader.readArray(reader1 -> TextBlocklistMatch.fromJson(reader1));
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            AnalyzeTextResult deserializedAnalyzeTextResult = new AnalyzeTextResult(categoriesAnalysis);
-            deserializedAnalyzeTextResult.blocklistsMatch = blocklistsMatch;
-            return deserializedAnalyzeTextResult;
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ContentSafetyImageData.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ContentSafetyImageData.java
index 7a79f6d7a5dc..9097a10a7d78 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ContentSafetyImageData.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ContentSafetyImageData.java
@@ -5,31 +5,29 @@
 
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
 import com.azure.core.util.BinaryData;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
  * The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are
- * provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while
- * the minimum image size is 50 x 50 pixels.
+ * provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB,
+ * while the minimum image size is 50 x 50 pixels.
  */
 @Fluent
-public final class ContentSafetyImageData implements JsonSerializable {
+public final class ContentSafetyImageData {
 
     /*
      * The Base64 encoding of the image.
      */
     @Generated
+    @JsonProperty(value = "content")
     private byte[] content;
 
     /*
      * The blob url of the image.
      */
     @Generated
+    @JsonProperty(value = "blobUrl")
     private String blobUrl;
 
     /**
@@ -80,43 +78,4 @@ public ContentSafetyImageData setBlobUrl(String blobUrl) {
         this.blobUrl = blobUrl;
         return this;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeBinaryField("content", this.content);
-        jsonWriter.writeStringField("blobUrl", this.blobUrl);
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of ContentSafetyImageData from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of ContentSafetyImageData if the JsonReader was pointing to an instance of it, or null if it
-     * was pointing to JSON null.
-     * @throws IOException If an error occurs while reading the ContentSafetyImageData.
-     */
-    @Generated
-    public static ContentSafetyImageData fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            ContentSafetyImageData deserializedContentSafetyImageData = new ContentSafetyImageData();
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("content".equals(fieldName)) {
-                    deserializedContentSafetyImageData.content = reader.getBinary();
-                } else if ("blobUrl".equals(fieldName)) {
-                    deserializedContentSafetyImageData.blobUrl = reader.getString();
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            return deserializedContentSafetyImageData;
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategoriesAnalysis.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategoriesAnalysis.java
index 134d175690d3..478642f2ee5a 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategoriesAnalysis.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategoriesAnalysis.java
@@ -5,28 +5,29 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.Immutable;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
  * Image analysis result.
  */
 @Immutable
-public final class ImageCategoriesAnalysis implements JsonSerializable {
+public final class ImageCategoriesAnalysis {
 
     /*
      * The image analysis category.
      */
     @Generated
-    private final ImageCategory category;
+    @JsonProperty(value = "category")
+    private ImageCategory category;
 
     /*
-     * The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2, 4, 6.
+     * The value increases with the severity of the input content. The value of this field is determined by the output
+     * type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2,
+     * 4, 6.
      */
     @Generated
+    @JsonProperty(value = "severity")
     private Integer severity;
 
     /**
@@ -35,7 +36,8 @@ public final class ImageCategoriesAnalysis implements JsonSerializable {
-            ImageCategory category = null;
-            Integer severity = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("category".equals(fieldName)) {
-                    category = ImageCategory.fromString(reader.getString());
-                } else if ("severity".equals(fieldName)) {
-                    severity = reader.getNullable(JsonReader::getInt);
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            ImageCategoriesAnalysis deserializedImageCategoriesAnalysis = new ImageCategoriesAnalysis(category);
-            deserializedImageCategoriesAnalysis.severity = severity;
-            return deserializedImageCategoriesAnalysis;
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategory.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategory.java
index 67ee0baa0779..36ceb6947c51 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategory.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategory.java
@@ -5,6 +5,7 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.util.ExpandableStringEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
 import java.util.Collection;
 
 /**
@@ -53,6 +54,7 @@ public ImageCategory() {
      * @return the corresponding ImageCategory.
      */
     @Generated
+    @JsonCreator
     public static ImageCategory fromString(String name) {
         return fromString(name, ImageCategory.class);
     }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/RemoveTextBlocklistItemsOptions.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/RemoveTextBlocklistItemsOptions.java
index bdd2409adca5..f98bd7536e89 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/RemoveTextBlocklistItemsOptions.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/RemoveTextBlocklistItemsOptions.java
@@ -5,24 +5,22 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.Immutable;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.List;
 
 /**
  * The request to remove blocklistItems from a text blocklist.
  */
 @Immutable
-public final class RemoveTextBlocklistItemsOptions implements JsonSerializable {
+public final class RemoveTextBlocklistItemsOptions {
 
     /*
      * Array of blocklistItemIds to remove.
      */
     @Generated
-    private final List blocklistItemIds;
+    @JsonProperty(value = "blocklistItemIds")
+    private List blocklistItemIds;
 
     /**
      * Creates an instance of RemoveTextBlocklistItemsOptions class.
@@ -30,7 +28,8 @@ public final class RemoveTextBlocklistItemsOptions implements JsonSerializable blocklistItemIds) {
+    @JsonCreator
+    public RemoveTextBlocklistItemsOptions(@JsonProperty(value = "blocklistItemIds") List blocklistItemIds) {
         this.blocklistItemIds = blocklistItemIds;
     }
 
@@ -43,42 +42,4 @@ public RemoveTextBlocklistItemsOptions(List blocklistItemIds) {
     public List getBlocklistItemIds() {
         return this.blocklistItemIds;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        jsonWriter.writeArrayField("blocklistItemIds", this.blocklistItemIds,
-            (writer, element) -> writer.writeString(element));
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of RemoveTextBlocklistItemsOptions from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of RemoveTextBlocklistItemsOptions if the JsonReader was pointing to an instance of it, or
-     * null if it was pointing to JSON null.
-     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
-     * @throws IOException If an error occurs while reading the RemoveTextBlocklistItemsOptions.
-     */
-    @Generated
-    public static RemoveTextBlocklistItemsOptions fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            List blocklistItemIds = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("blocklistItemIds".equals(fieldName)) {
-                    blocklistItemIds = reader.readArray(reader1 -> reader1.getString());
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            return new RemoveTextBlocklistItemsOptions(blocklistItemIds);
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklist.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklist.java
index 68b04ccfe07c..841d73776133 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklist.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklist.java
@@ -3,33 +3,28 @@
 // Code generated by Microsoft (R) TypeSpec Code Generator.
 package com.azure.ai.contentsafety.models;
 
-import com.azure.ai.contentsafety.implementation.JsonMergePatchHelper;
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
  * Text Blocklist.
  */
 @Fluent
-public final class TextBlocklist implements JsonSerializable {
+public final class TextBlocklist {
 
     /*
      * Text blocklist name.
      */
     @Generated
+    @JsonProperty(value = "blocklistName", access = JsonProperty.Access.WRITE_ONLY)
     private String name;
 
     /*
      * Text blocklist description.
      */
     @Generated
+    @JsonProperty(value = "description")
     private String description;
 
     /**
@@ -68,88 +63,6 @@ public String getDescription() {
     @Generated
     public TextBlocklist setDescription(String description) {
         this.description = description;
-        this.updatedProperties.add("description");
         return this;
     }
-
-    @Generated
-    private boolean jsonMergePatch;
-
-    /**
-     * Stores updated model property, the value is property name, not serialized name.
-     */
-    @Generated
-    private final Set updatedProperties = new HashSet<>();
-
-    @Generated
-    void serializeAsJsonMergePatch(boolean jsonMergePatch) {
-        this.jsonMergePatch = jsonMergePatch;
-    }
-
-    static {
-        JsonMergePatchHelper.setTextBlocklistAccessor((model, jsonMergePatchEnabled) -> {
-            model.serializeAsJsonMergePatch(jsonMergePatchEnabled);
-            return model;
-        });
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Generated
-    @Override
-    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
-        if (jsonMergePatch) {
-            return toJsonMergePatch(jsonWriter);
-        } else {
-            jsonWriter.writeStartObject();
-            jsonWriter.writeStringField("description", this.description);
-            return jsonWriter.writeEndObject();
-        }
-    }
-
-    @Generated
-    private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException {
-        jsonWriter.writeStartObject();
-        if (updatedProperties.contains("description")) {
-            if (this.description == null) {
-                jsonWriter.writeNullField("description");
-            } else {
-                jsonWriter.writeStringField("description", this.description);
-            }
-        }
-        return jsonWriter.writeEndObject();
-    }
-
-    /**
-     * Reads an instance of TextBlocklist from the JsonReader.
-     *
-     * @param jsonReader The JsonReader being read.
-     * @return An instance of TextBlocklist if the JsonReader was pointing to an instance of it, or null if it was
-     * pointing to JSON null.
-     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
-     * @throws IOException If an error occurs while reading the TextBlocklist.
-     */
-    @Generated
-    public static TextBlocklist fromJson(JsonReader jsonReader) throws IOException {
-        return jsonReader.readObject(reader -> {
-            String name = null;
-            String description = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("blocklistName".equals(fieldName)) {
-                    name = reader.getString();
-                } else if ("description".equals(fieldName)) {
-                    description = reader.getString();
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            TextBlocklist deserializedTextBlocklist = new TextBlocklist();
-            deserializedTextBlocklist.name = name;
-            deserializedTextBlocklist.description = description;
-            return deserializedTextBlocklist;
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistItem.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistItem.java
index 407283f31eec..b14a3c043d88 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistItem.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistItem.java
@@ -5,35 +5,35 @@
 
 import com.azure.core.annotation.Fluent;
 import com.azure.core.annotation.Generated;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
  * Item in a TextBlocklist.
  */
 @Fluent
-public final class TextBlocklistItem implements JsonSerializable {
+public final class TextBlocklistItem {
 
     /*
      * The service will generate a BlocklistItemId, which will be a UUID.
      */
     @Generated
+    @JsonProperty(value = "blocklistItemId", access = JsonProperty.Access.WRITE_ONLY)
     private String blocklistItemId;
 
     /*
      * BlocklistItem description.
      */
     @Generated
+    @JsonProperty(value = "description")
     private String description;
 
     /*
      * BlocklistItem content.
      */
     @Generated
-    private final String text;
+    @JsonProperty(value = "text")
+    private String text;
 
     /**
      * Creates an instance of TextBlocklistItem class.
@@ -41,7 +41,8 @@ public final class TextBlocklistItem implements JsonSerializable {
-            String blocklistItemId = null;
-            String text = null;
-            String description = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("blocklistItemId".equals(fieldName)) {
-                    blocklistItemId = reader.getString();
-                } else if ("text".equals(fieldName)) {
-                    text = reader.getString();
-                } else if ("description".equals(fieldName)) {
-                    description = reader.getString();
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            TextBlocklistItem deserializedTextBlocklistItem = new TextBlocklistItem(text);
-            deserializedTextBlocklistItem.blocklistItemId = blocklistItemId;
-            deserializedTextBlocklistItem.description = description;
-            return deserializedTextBlocklistItem;
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistMatch.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistMatch.java
index c7f7ec860f90..e12e49b2c84f 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistMatch.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistMatch.java
@@ -5,35 +5,35 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.Immutable;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
  * The result of blocklist match.
  */
 @Immutable
-public final class TextBlocklistMatch implements JsonSerializable {
+public final class TextBlocklistMatch {
 
     /*
      * The name of the matched blocklist.
      */
     @Generated
-    private final String blocklistName;
+    @JsonProperty(value = "blocklistName")
+    private String blocklistName;
 
     /*
      * The ID of the matched item.
      */
     @Generated
-    private final String blocklistItemId;
+    @JsonProperty(value = "blocklistItemId")
+    private String blocklistItemId;
 
     /*
      * The content of the matched item.
      */
     @Generated
-    private final String blocklistItemText;
+    @JsonProperty(value = "blocklistItemText")
+    private String blocklistItemText;
 
     /**
      * Creates an instance of TextBlocklistMatch class.
@@ -43,7 +43,10 @@ public final class TextBlocklistMatch implements JsonSerializable {
-            String blocklistName = null;
-            String blocklistItemId = null;
-            String blocklistItemText = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("blocklistName".equals(fieldName)) {
-                    blocklistName = reader.getString();
-                } else if ("blocklistItemId".equals(fieldName)) {
-                    blocklistItemId = reader.getString();
-                } else if ("blocklistItemText".equals(fieldName)) {
-                    blocklistItemText = reader.getString();
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            return new TextBlocklistMatch(blocklistName, blocklistItemId, blocklistItemText);
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategoriesAnalysis.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategoriesAnalysis.java
index 8a4d8987ce2d..623f87ad2535 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategoriesAnalysis.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategoriesAnalysis.java
@@ -5,28 +5,29 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.annotation.Immutable;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
  * Text analysis result.
  */
 @Immutable
-public final class TextCategoriesAnalysis implements JsonSerializable {
+public final class TextCategoriesAnalysis {
 
     /*
      * The text analysis category.
      */
     @Generated
-    private final TextCategory category;
+    @JsonProperty(value = "category")
+    private TextCategory category;
 
     /*
-     * The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7.
+     * The value increases with the severity of the input content. The value of this field is determined by the output
+     * type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the
+     * output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7.
      */
     @Generated
+    @JsonProperty(value = "severity")
     private Integer severity;
 
     /**
@@ -35,7 +36,8 @@ public final class TextCategoriesAnalysis implements JsonSerializable {
-            TextCategory category = null;
-            Integer severity = null;
-            while (reader.nextToken() != JsonToken.END_OBJECT) {
-                String fieldName = reader.getFieldName();
-                reader.nextToken();
-                if ("category".equals(fieldName)) {
-                    category = TextCategory.fromString(reader.getString());
-                } else if ("severity".equals(fieldName)) {
-                    severity = reader.getNullable(JsonReader::getInt);
-                } else {
-                    reader.skipChildren();
-                }
-            }
-            TextCategoriesAnalysis deserializedTextCategoriesAnalysis = new TextCategoriesAnalysis(category);
-            deserializedTextCategoriesAnalysis.severity = severity;
-            return deserializedTextCategoriesAnalysis;
-        });
-    }
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategory.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategory.java
index fefbff9e5cb6..fb5942c6f1dc 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategory.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategory.java
@@ -5,6 +5,7 @@
 
 import com.azure.core.annotation.Generated;
 import com.azure.core.util.ExpandableStringEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
 import java.util.Collection;
 
 /**
@@ -53,6 +54,7 @@ public TextCategory() {
      * @return the corresponding TextCategory.
      */
     @Generated
+    @JsonCreator
     public static TextCategory fromString(String name) {
         return fromString(name, TextCategory.class);
     }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/module-info.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/module-info.java
index 8dac7644d1b7..7581ba2c91b9 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/module-info.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/module-info.java
@@ -4,8 +4,7 @@
 
 module com.azure.ai.contentsafety {
     requires transitive com.azure.core;
-    requires transitive com.azure.json;
     exports com.azure.ai.contentsafety;
     exports com.azure.ai.contentsafety.models;
-    opens com.azure.ai.contentsafety.models to com.azure.core;
+    opens com.azure.ai.contentsafety.models to com.azure.core, com.fasterxml.jackson.databind;
 }
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/resources/META-INF/azure-ai-contentsafety_apiview_properties.json b/sdk/contentsafety/azure-ai-contentsafety/src/main/resources/META-INF/azure-ai-contentsafety_apiview_properties.json
deleted file mode 100644
index b6a4214d0e2a..000000000000
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/resources/META-INF/azure-ai-contentsafety_apiview_properties.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
-  "flavor": "Azure", 
-  "CrossLanguageDefinitionId": {
-    "com.azure.ai.contentsafety.BlocklistAsyncClient": "ContentSafety.BlocklistClient",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.addOrUpdateBlocklistItems": "Customizations.BlocklistClient.addOrUpdateBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.addOrUpdateBlocklistItemsWithResponse": "Customizations.BlocklistClient.addOrUpdateBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.createOrUpdateTextBlocklist": "Customizations.BlocklistClient.createOrUpdateTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.createOrUpdateTextBlocklistWithResponse": "Customizations.BlocklistClient.createOrUpdateTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.deleteTextBlocklist": "Customizations.BlocklistClient.deleteTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.deleteTextBlocklistWithResponse": "Customizations.BlocklistClient.deleteTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.getTextBlocklist": "Customizations.BlocklistClient.getTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.getTextBlocklistItem": "Customizations.BlocklistClient.getTextBlocklistItem",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.getTextBlocklistItemWithResponse": "Customizations.BlocklistClient.getTextBlocklistItem",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.getTextBlocklistWithResponse": "Customizations.BlocklistClient.getTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.listTextBlocklistItems": "Customizations.BlocklistClient.listTextBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.listTextBlocklists": "Customizations.BlocklistClient.listTextBlocklists",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.removeBlocklistItems": "Customizations.BlocklistClient.removeBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistAsyncClient.removeBlocklistItemsWithResponse": "Customizations.BlocklistClient.removeBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistClient": "ContentSafety.BlocklistClient",
-    "com.azure.ai.contentsafety.BlocklistClient.addOrUpdateBlocklistItems": "Customizations.BlocklistClient.addOrUpdateBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistClient.addOrUpdateBlocklistItemsWithResponse": "Customizations.BlocklistClient.addOrUpdateBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistClient.createOrUpdateTextBlocklist": "Customizations.BlocklistClient.createOrUpdateTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistClient.createOrUpdateTextBlocklistWithResponse": "Customizations.BlocklistClient.createOrUpdateTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistClient.deleteTextBlocklist": "Customizations.BlocklistClient.deleteTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistClient.deleteTextBlocklistWithResponse": "Customizations.BlocklistClient.deleteTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistClient.getTextBlocklist": "Customizations.BlocklistClient.getTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistClient.getTextBlocklistItem": "Customizations.BlocklistClient.getTextBlocklistItem",
-    "com.azure.ai.contentsafety.BlocklistClient.getTextBlocklistItemWithResponse": "Customizations.BlocklistClient.getTextBlocklistItem",
-    "com.azure.ai.contentsafety.BlocklistClient.getTextBlocklistWithResponse": "Customizations.BlocklistClient.getTextBlocklist",
-    "com.azure.ai.contentsafety.BlocklistClient.listTextBlocklistItems": "Customizations.BlocklistClient.listTextBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistClient.listTextBlocklists": "Customizations.BlocklistClient.listTextBlocklists",
-    "com.azure.ai.contentsafety.BlocklistClient.removeBlocklistItems": "Customizations.BlocklistClient.removeBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistClient.removeBlocklistItemsWithResponse": "Customizations.BlocklistClient.removeBlocklistItems",
-    "com.azure.ai.contentsafety.BlocklistClientBuilder": "ContentSafety.BlocklistClient",
-    "com.azure.ai.contentsafety.ContentSafetyAsyncClient": "ContentSafety.ContentSafetyClient",
-    "com.azure.ai.contentsafety.ContentSafetyAsyncClient.analyzeImage": "Customizations.ContentSafetyClient.analyzeImage",
-    "com.azure.ai.contentsafety.ContentSafetyAsyncClient.analyzeImageWithResponse": "Customizations.ContentSafetyClient.analyzeImage",
-    "com.azure.ai.contentsafety.ContentSafetyAsyncClient.analyzeText": "Customizations.ContentSafetyClient.analyzeText",
-    "com.azure.ai.contentsafety.ContentSafetyAsyncClient.analyzeTextWithResponse": "Customizations.ContentSafetyClient.analyzeText",
-    "com.azure.ai.contentsafety.ContentSafetyClient": "ContentSafety.ContentSafetyClient",
-    "com.azure.ai.contentsafety.ContentSafetyClient.analyzeImage": "Customizations.ContentSafetyClient.analyzeImage",
-    "com.azure.ai.contentsafety.ContentSafetyClient.analyzeImageWithResponse": "Customizations.ContentSafetyClient.analyzeImage",
-    "com.azure.ai.contentsafety.ContentSafetyClient.analyzeText": "Customizations.ContentSafetyClient.analyzeText",
-    "com.azure.ai.contentsafety.ContentSafetyClient.analyzeTextWithResponse": "Customizations.ContentSafetyClient.analyzeText",
-    "com.azure.ai.contentsafety.ContentSafetyClientBuilder": "ContentSafety.ContentSafetyClient",
-    "com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsOptions": "ContentSafety.AddOrUpdateTextBlocklistItemsOptions",
-    "com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsResult": "ContentSafety.AddOrUpdateTextBlocklistItemsResult",
-    "com.azure.ai.contentsafety.models.AnalyzeImageOptions": "ContentSafety.AnalyzeImageOptions",
-    "com.azure.ai.contentsafety.models.AnalyzeImageOutputType": "ContentSafety.AnalyzeImageOutputType",
-    "com.azure.ai.contentsafety.models.AnalyzeImageResult": "ContentSafety.AnalyzeImageResult",
-    "com.azure.ai.contentsafety.models.AnalyzeTextOptions": "ContentSafety.AnalyzeTextOptions",
-    "com.azure.ai.contentsafety.models.AnalyzeTextOutputType": "ContentSafety.AnalyzeTextOutputType",
-    "com.azure.ai.contentsafety.models.AnalyzeTextResult": "ContentSafety.AnalyzeTextResult",
-    "com.azure.ai.contentsafety.models.ContentSafetyImageData": "ContentSafety.ImageData",
-    "com.azure.ai.contentsafety.models.ImageCategoriesAnalysis": "ContentSafety.ImageCategoriesAnalysis",
-    "com.azure.ai.contentsafety.models.ImageCategory": "ContentSafety.ImageCategory",
-    "com.azure.ai.contentsafety.models.RemoveTextBlocklistItemsOptions": "ContentSafety.RemoveTextBlocklistItemsOptions",
-    "com.azure.ai.contentsafety.models.TextBlocklist": "ContentSafety.TextBlocklist",
-    "com.azure.ai.contentsafety.models.TextBlocklistItem": "ContentSafety.TextBlocklistItem",
-    "com.azure.ai.contentsafety.models.TextBlocklistMatch": "ContentSafety.TextBlocklistMatch",
-    "com.azure.ai.contentsafety.models.TextCategoriesAnalysis": "ContentSafety.TextCategoriesAnalysis",
-    "com.azure.ai.contentsafety.models.TextCategory": "ContentSafety.TextCategory"
-  }
-}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/ContentSafetyClientTestBase.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/ContentSafetyClientTestBase.java
new file mode 100644
index 000000000000..ba5bcb72dfbe
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/ContentSafetyClientTestBase.java
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+// The Java test files under 'generated' package are generated for your reference.
+// If you wish to modify these files, please copy them out of the 'generated' package, and modify there.
+// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test.
+
+import com.azure.ai.contentsafety.BlocklistClient;
+import com.azure.ai.contentsafety.BlocklistClientBuilder;
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.policy.HttpLogDetailLevel;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.test.TestMode;
+import com.azure.core.test.TestProxyTestBase;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+import java.time.OffsetDateTime;
+import reactor.core.publisher.Mono;
+
+class ContentSafetyClientTestBase extends TestProxyTestBase {
+    protected ContentSafetyClient contentSafetyClient;
+
+    protected BlocklistClient blocklistClient;
+
+    @Override
+    protected void beforeTest() {
+        ContentSafetyClientBuilder contentSafetyClientbuilder = new ContentSafetyClientBuilder()
+            .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
+            .httpClient(HttpClient.createDefault())
+            .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
+        if (getTestMode() == TestMode.PLAYBACK) {
+            contentSafetyClientbuilder.httpClient(interceptorManager.getPlaybackClient())
+                .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)));
+        } else if (getTestMode() == TestMode.RECORD) {
+            contentSafetyClientbuilder.addPolicy(interceptorManager.getRecordPolicy())
+                .credential(new DefaultAzureCredentialBuilder().build());
+        } else if (getTestMode() == TestMode.LIVE) {
+            contentSafetyClientbuilder.credential(new DefaultAzureCredentialBuilder().build());
+        }
+        contentSafetyClient = contentSafetyClientbuilder.buildClient();
+
+        BlocklistClientBuilder blocklistClientbuilder
+            = new BlocklistClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
+                .httpClient(HttpClient.createDefault())
+                .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
+        if (getTestMode() == TestMode.PLAYBACK) {
+            blocklistClientbuilder.httpClient(interceptorManager.getPlaybackClient())
+                .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)));
+        } else if (getTestMode() == TestMode.RECORD) {
+            blocklistClientbuilder.addPolicy(interceptorManager.getRecordPolicy())
+                .credential(new DefaultAzureCredentialBuilder().build());
+        } else if (getTestMode() == TestMode.LIVE) {
+            blocklistClientbuilder.credential(new DefaultAzureCredentialBuilder().build());
+        }
+        blocklistClient = blocklistClientbuilder.buildClient();
+
+    }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml b/sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml
deleted file mode 100644
index f08f1912274a..000000000000
--- a/sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-directory: specification/cognitiveservices/ContentSafety
-commit: 91ada2b6fbdb06456e440807e5b4706110930c49
-additionalDirectories: []
-repo: Azure/azure-rest-api-specs
-
diff --git a/sdk/storage/azure-storage-blob-stress/pom.xml b/sdk/storage/azure-storage-blob-stress/pom.xml
index 7536b2cfda86..fe67d52f5589 100644
--- a/sdk/storage/azure-storage-blob-stress/pom.xml
+++ b/sdk/storage/azure-storage-blob-stress/pom.xml
@@ -25,7 +25,7 @@
     
       ch.qos.logback
       logback-classic
-      1.3.12 
+      1.3.14 
     
     
       com.azure
@@ -57,12 +57,12 @@
     
       io.opentelemetry.instrumentation
       opentelemetry-runtime-telemetry-java8
-      1.32.0-alpha 
+      2.3.0-alpha 
     
     
       io.opentelemetry.instrumentation
       opentelemetry-logback-appender-1.0
-      1.32.0-alpha 
+      2.3.0-alpha 
     
 
     
@@ -77,7 +77,7 @@
       
         org.apache.maven.plugins
         maven-assembly-plugin
-        3.2.0 
+        3.7.1 
         
           
             package
diff --git a/sdk/storage/azure-storage-file-datalake-stress/pom.xml b/sdk/storage/azure-storage-file-datalake-stress/pom.xml
index c919d763a0fa..1210e977cba0 100644
--- a/sdk/storage/azure-storage-file-datalake-stress/pom.xml
+++ b/sdk/storage/azure-storage-file-datalake-stress/pom.xml
@@ -25,7 +25,7 @@
     
       ch.qos.logback
       logback-classic
-      1.3.12 
+      1.3.14 
     
     
       com.azure
@@ -57,12 +57,12 @@
     
       io.opentelemetry.instrumentation
       opentelemetry-runtime-telemetry-java8
-      1.32.0-alpha 
+      2.3.0-alpha 
     
     
       io.opentelemetry.instrumentation
       opentelemetry-logback-appender-1.0
-      1.32.0-alpha 
+      2.3.0-alpha 
     
 
     
@@ -77,7 +77,7 @@
       
         org.apache.maven.plugins
         maven-assembly-plugin
-        3.2.0 
+        3.7.1 
         
           
             package
diff --git a/sdk/storage/azure-storage-file-share-stress/pom.xml b/sdk/storage/azure-storage-file-share-stress/pom.xml
index 4a065a0543e0..87f919894d28 100644
--- a/sdk/storage/azure-storage-file-share-stress/pom.xml
+++ b/sdk/storage/azure-storage-file-share-stress/pom.xml
@@ -25,7 +25,7 @@
     
       ch.qos.logback
       logback-classic
-      1.3.12 
+      1.3.14 
     
     
       com.azure
@@ -57,12 +57,12 @@
     
       io.opentelemetry.instrumentation
       opentelemetry-runtime-telemetry-java8
-      1.32.0-alpha 
+      2.3.0-alpha 
     
     
       io.opentelemetry.instrumentation
       opentelemetry-logback-appender-1.0
-      1.32.0-alpha 
+      2.3.0-alpha 
     
 
     
@@ -77,7 +77,7 @@
       
         org.apache.maven.plugins
         maven-assembly-plugin
-        3.2.0 
+        3.7.1 
         
           
             package
diff --git a/sdk/storage/azure-storage-stress/pom.xml b/sdk/storage/azure-storage-stress/pom.xml
index c5d70a689c4f..64e1c784b8c7 100644
--- a/sdk/storage/azure-storage-stress/pom.xml
+++ b/sdk/storage/azure-storage-stress/pom.xml
@@ -25,7 +25,7 @@
     
       ch.qos.logback
       logback-classic
-      1.3.12 
+      1.3.14 
     
     
       com.azure
@@ -52,12 +52,12 @@
     
       io.opentelemetry.instrumentation
       opentelemetry-runtime-telemetry-java8
-      1.32.0-alpha 
+      2.3.0-alpha 
     
     
       io.opentelemetry.instrumentation
       opentelemetry-logback-appender-1.0
-      1.32.0-alpha 
+      2.3.0-alpha