diff --git a/sdk/communication/azure-communication-callingserver/README.md b/sdk/communication/azure-communication-callingserver/README.md index 55e3ca728eaaa..af6250e9353a8 100644 --- a/sdk/communication/azure-communication-callingserver/README.md +++ b/sdk/communication/azure-communication-callingserver/README.md @@ -107,7 +107,7 @@ CallConnection callConnection = callingServerClient.createCallConnection(source, ```java readme-sample-addParticipant CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier(""); String callbackUri = ""; -callConnection.addParticipant(thirdCallee, "ACS User 3", "", URI.create(callbackUri)); +callConnection.addParticipant(thirdCallee, "ACS User 3", ""); ``` #### Hangup a Call: diff --git a/sdk/communication/azure-communication-callingserver/mvn b/sdk/communication/azure-communication-callingserver/mvn new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnection.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnection.java index 0947fd14fe11d..123acb5ada541 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnection.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnection.java @@ -161,7 +161,6 @@ public Response cancelAllMediaOperationsWithResponse( * @param alternateCallerId Phone number to use when adding a phone number participant. * @param operationContext Value to identify context of the operation. This is used to co-relate other * communications related to this operation - * @param callbackUri callBackUri to get notifications. * @throws CallingServerErrorException 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 a successful add participant request. @@ -170,9 +169,8 @@ public Response cancelAllMediaOperationsWithResponse( public AddParticipantResult addParticipant( CommunicationIdentifier participant, String alternateCallerId, - String operationContext, - URI callbackUri) { - return callConnectionAsync.addParticipant(participant, alternateCallerId, operationContext, callbackUri).block(); + String operationContext) { + return callConnectionAsync.addParticipant(participant, alternateCallerId, operationContext).block(); } /** @@ -182,7 +180,6 @@ public AddParticipantResult addParticipant( * @param alternateCallerId Phone number to use when adding a phone number participant. * @param operationContext Value to identify context of the operation. This is used to co-relate other * communications related to this operation - * @param callbackUri callBackUri to get notifications. * @param context {@link Context} representing the request context. * @throws CallingServerErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -193,10 +190,9 @@ public Response addParticipantWithResponse( CommunicationIdentifier participant, String alternateCallerId, String operationContext, - URI callbackUri, Context context) { return callConnectionAsync - .addParticipantWithResponse(participant, alternateCallerId, operationContext, callbackUri, context).block(); + .addParticipantWithResponse(participant, alternateCallerId, operationContext, context).block(); } /** @@ -315,7 +311,7 @@ public Response> getParticipantsWithResponse(Context conte * @return Response for a successful get participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public List getParticipant(CommunicationIdentifier participant) { + public CallParticipant getParticipant(CommunicationIdentifier participant) { return callConnectionAsync.getParticipant(participant).block(); } @@ -329,7 +325,7 @@ public List getParticipant(CommunicationIdentifier participant) * @return Response for a successful get participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getParticipantWithResponse(CommunicationIdentifier participant, Context context) { + public Response getParticipantWithResponse(CommunicationIdentifier participant, Context context) { return callConnectionAsync.getParticipantWithResponse(participant, context).block(); } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnectionAsync.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnectionAsync.java index e7ca7369810cd..2fef56643e0f8 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnectionAsync.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnectionAsync.java @@ -8,7 +8,6 @@ import java.net.URI; import java.util.List; -import java.util.Objects; import java.util.stream.Collectors; import com.azure.communication.callingserver.implementation.CallConnectionsImpl; @@ -97,14 +96,12 @@ public Mono playAudio(URI audioFileUri, PlayAudioOptions playAu Mono playAudioInternal(URI audioFileUri, PlayAudioOptions playAudioOptions) { try { - Objects.requireNonNull(audioFileUri, "'audioFileUri' cannot be null."); PlayAudioRequest request = new PlayAudioRequest().setAudioFileUri(audioFileUri.toString()); if (playAudioOptions != null) { request .setLoop(playAudioOptions.isLoop()) .setOperationContext(playAudioOptions.getOperationContext()) - .setAudioFileId(playAudioOptions.getAudioFileId()) - .setCallbackUri(playAudioOptions.getCallbackUri().toString()); + .setAudioFileId(playAudioOptions.getAudioFileId()); } return playAudioInternal(request); } catch (RuntimeException ex) { @@ -145,14 +142,12 @@ Mono> playAudioWithResponseInternal( PlayAudioOptions playAudioOptions, Context context) { try { - Objects.requireNonNull(audioFileUri, "'audioFileUri' cannot be null."); PlayAudioRequest request = new PlayAudioRequest().setAudioFileUri(audioFileUri.toString()); if (playAudioOptions != null) { request .setLoop(playAudioOptions.isLoop()) .setOperationContext(playAudioOptions.getOperationContext()) - .setAudioFileId(playAudioOptions.getAudioFileId()) - .setCallbackUri(playAudioOptions.getCallbackUri().toString()); + .setAudioFileId(playAudioOptions.getAudioFileId()); } return playAudioWithResponseInternal(request, context); } catch (RuntimeException ex) { @@ -312,7 +307,6 @@ Mono> cancelAllMediaOperationsWithResponse( * @param alternateCallerId The phone number to use when adding a phone number participant. * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation - * @param callbackUri callBackUri to get notifications. * @throws CallingServerErrorException 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 a successful add participant request. @@ -321,13 +315,12 @@ Mono> cancelAllMediaOperationsWithResponse( public Mono addParticipant( CommunicationIdentifier participant, String alternateCallerId, - String operationContext, - URI callbackUri) { + String operationContext) { try { AddParticipantRequest request = getAddParticipantRequest(participant, alternateCallerId, - operationContext, - callbackUri); + operationContext + ); return callConnectionInternal.addParticipantAsync(callConnectionId, request) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException) .flatMap(result -> Mono.just(new AddParticipantResult(result.getParticipantId()))); @@ -343,7 +336,6 @@ public Mono addParticipant( * @param alternateCallerId The phone number to use when adding a phone number participant. * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation - * @param callbackUri callBackUri to get notifications. * @throws CallingServerErrorException 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 a successful add participant request. @@ -352,22 +344,19 @@ public Mono addParticipant( public Mono> addParticipantWithResponse( CommunicationIdentifier participant, String alternateCallerId, - String operationContext, - URI callbackUri) { - return addParticipantWithResponse(participant, alternateCallerId, operationContext, callbackUri, Context.NONE); + String operationContext) { + return addParticipantWithResponse(participant, alternateCallerId, operationContext, Context.NONE); } Mono> addParticipantWithResponse( CommunicationIdentifier participant, String alternateCallerId, String operationContext, - URI callbackUri, Context context) { try { AddParticipantRequest request = getAddParticipantRequest(participant, alternateCallerId, - operationContext, - callbackUri); + operationContext); return withContext(contextValue -> { contextValue = context == null ? contextValue : context; return callConnectionInternal @@ -585,13 +574,12 @@ Mono>> getParticipantsWithResponse(Context contex * @return Response for a successful get participant request. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public Mono> getParticipant(CommunicationIdentifier participant) { + public Mono getParticipant(CommunicationIdentifier participant) { try { GetParticipantRequest request = new GetParticipantRequest().setIdentifier(CommunicationIdentifierConverter.convert(participant)); return callConnectionInternal.getParticipantAsync(callConnectionId, request) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException) - .flatMap(result -> Mono.just( - result.stream().map(CallParticipantConverter::convert).collect(Collectors.toList()))); + .flatMap(result -> Mono.just(CallParticipantConverter.convert(result))); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -606,11 +594,11 @@ public Mono> getParticipant(CommunicationIdentifier partic * @return Response for a successful get participant request. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public Mono>> getParticipantWithResponse(CommunicationIdentifier participant) { + public Mono> getParticipantWithResponse(CommunicationIdentifier participant) { return getParticipantWithResponse(participant, Context.NONE); } - Mono>> getParticipantWithResponse(CommunicationIdentifier participant, Context context) { + Mono> getParticipantWithResponse(CommunicationIdentifier participant, Context context) { try { GetParticipantRequest request = new GetParticipantRequest().setIdentifier(CommunicationIdentifierConverter.convert(participant)); return withContext(contextValue -> { @@ -619,13 +607,7 @@ Mono>> getParticipantWithResponse(CommunicationId .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException) .map(response -> new SimpleResponse<>(response, - response.getValue() - .stream() - .map(CallParticipantConverter::convert) - .collect(Collectors.toList() - ) - ) - ); + CallParticipantConverter.convert(response.getValue()))); }); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -697,9 +679,6 @@ public Mono playAudioToParticipant( Mono playAudioToParticipantInternal(CommunicationIdentifier participant, URI audioFileUri, PlayAudioOptions playAudioOptions, Context context) { try { - Objects.requireNonNull(participant, "'participant' cannot be null."); - Objects.requireNonNull(audioFileUri, "'audioFileUri' cannot be null."); - PlayAudioToParticipantRequest playAudioToParticipantRequest = new PlayAudioToParticipantRequest() .setAudioFileUri(audioFileUri.toString()) .setIdentifier(CommunicationIdentifierConverter.convert(participant)); @@ -707,8 +686,7 @@ Mono playAudioToParticipantInternal(CommunicationIdentifier par playAudioToParticipantRequest .setLoop(playAudioOptions.isLoop()) .setOperationContext(playAudioOptions.getOperationContext()) - .setAudioFileId(playAudioOptions.getAudioFileId()) - .setCallbackUri(playAudioOptions.getCallbackUri().toString()); + .setAudioFileId(playAudioOptions.getAudioFileId()); } return callConnectionInternal.participantPlayAudioAsync(callConnectionId, playAudioToParticipantRequest, context) @@ -742,9 +720,6 @@ public Mono> playAudioToParticipantWithResponse( Mono> playAudioToParticipantWithResponseInternal(CommunicationIdentifier participant, URI audioFileUri, PlayAudioOptions playAudioOptions, Context context) { try { - Objects.requireNonNull(participant, "'participant' cannot be null."); - Objects.requireNonNull(audioFileUri, "'audioFileUri' cannot be null."); - PlayAudioToParticipantRequest playAudioToParticipantRequest = new PlayAudioToParticipantRequest() .setAudioFileUri(audioFileUri.toString()) .setIdentifier(CommunicationIdentifierConverter.convert(participant)); @@ -752,8 +727,7 @@ Mono> playAudioToParticipantWithResponseInternal(Commu playAudioToParticipantRequest .setLoop(playAudioOptions.isLoop()) .setOperationContext(playAudioOptions.getOperationContext()) - .setAudioFileId(playAudioOptions.getAudioFileId()) - .setCallbackUri(playAudioOptions.getCallbackUri().toString()); + .setAudioFileId(playAudioOptions.getAudioFileId()); } return withContext(contextValue -> { @@ -1034,7 +1008,6 @@ public Mono resumeParticipantMeetingAudio( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> resumeParticipantMeetingAudioWithResponse( CommunicationIdentifier participant) { - Objects.requireNonNull(participant, "'participant' cannot be null."); return resumeParticipantMeetingAudioWithResponseInternal(participant, Context.NONE); } @@ -1156,7 +1129,6 @@ public Mono> updateAudioRoutingGroupWithResponse( Mono> updateAudioRoutingGroupWithResponseInternal(String audioRoutingGroupId, List targets, Context context) { try { - Objects.requireNonNull(audioRoutingGroupId, "'audioRoutingGroupId' cannot be null."); UpdateAudioRoutingGroupRequest request = getUpdateAudioRoutingGroupRequest(audioRoutingGroupId, targets); return callConnectionInternal.updateAudioRoutingGroupWithResponseAsync(callConnectionId, audioRoutingGroupId, request, context) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException); @@ -1254,8 +1226,6 @@ public Mono> deleteAudioRoutingGroupWithResponse( Mono> deleteAudioRoutingGroupWithResponseInternal(String audioRoutingGroupId, Context context) { try { - Objects.requireNonNull(audioRoutingGroupId, "'audioRoutingGroupId' cannot be null."); - return callConnectionInternal.deleteAudioRoutingGroupWithResponseAsync(callConnectionId, audioRoutingGroupId, context) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException); } catch (RuntimeException ex) { @@ -1266,18 +1236,15 @@ Mono> deleteAudioRoutingGroupWithResponseInternal(String audioRou private AddParticipantRequest getAddParticipantRequest( CommunicationIdentifier participant, String alternateCallerId, - String operationContext, - URI callbackUri) { + String operationContext) { AddParticipantRequest request = new AddParticipantRequest() .setParticipant(CommunicationIdentifierConverter.convert(participant)) .setAlternateCallerId(PhoneNumberIdentifierConverter.convert(alternateCallerId)) - .setOperationContext(operationContext) - .setCallbackUri(callbackUri.toString()); + .setOperationContext(operationContext); return request; } private AudioRoutingGroupRequest getAudioRoutingGroupRequest(AudioRoutingMode audioRoutingMode, List targets) { - Objects.requireNonNull(targets, "'targets' cannot be null."); AudioRoutingGroupRequest request = new AudioRoutingGroupRequest() .setAudioRoutingMode(audioRoutingMode) .setTargets(targets @@ -1288,7 +1255,6 @@ private AudioRoutingGroupRequest getAudioRoutingGroupRequest(AudioRoutingMode au } private UpdateAudioRoutingGroupRequest getUpdateAudioRoutingGroupRequest(String audioRoutingGroupId, List targets) { - Objects.requireNonNull(targets, "'targets' cannot be null."); UpdateAudioRoutingGroupRequest request = new UpdateAudioRoutingGroupRequest() .setTargets(targets .stream() diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerAsyncClient.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerAsyncClient.java index 4b5d723ae8885..312fec42a6e2a 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerAsyncClient.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerAsyncClient.java @@ -18,7 +18,6 @@ import java.security.InvalidParameterException; import java.util.HashSet; import java.util.List; -import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @@ -193,9 +192,6 @@ Mono createCallConnectionInternal( List targets, CreateCallOptions createCallOptions) { try { - Objects.requireNonNull(source, "'source' cannot be null."); - Objects.requireNonNull(targets, "'targets' cannot be null."); - Objects.requireNonNull(createCallOptions, "'createCallOptions' cannot be null."); CreateCallRequest request = CallConnectionRequestConverter.convert(source, targets, createCallOptions); return callConnectionInternal.createCallAsync(request) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException) @@ -211,9 +207,6 @@ Mono> createCallConnectionWithResponseInternal( CreateCallOptions createCallOptions, Context context) { try { - Objects.requireNonNull(source, "'source' cannot be null."); - Objects.requireNonNull(targets, "'targets' cannot be null."); - Objects.requireNonNull(createCallOptions, "'CreateCallOptions' cannot be null."); CreateCallRequest request = CallConnectionRequestConverter.convert(source, targets, createCallOptions); return withContext(contextValue -> { contextValue = context == null ? contextValue : context; @@ -283,8 +276,6 @@ Mono joinInternal( CommunicationIdentifier source, JoinCallOptions joinCallOptions) { try { - Objects.requireNonNull(source, "'source' cannot be null."); - Objects.requireNonNull(joinCallOptions, "'joinCallOptions' cannot be null."); return serverCallInternal .joinCallAsync(JoinCallRequestConverter.convert(callLocator, source, joinCallOptions)) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException) @@ -302,9 +293,6 @@ Mono joinInternal( JoinCallOptions joinCallOptions, Context context) { try { - Objects.requireNonNull(source, "'source' cannot be null."); - Objects.requireNonNull(joinCallOptions, "'joinCallOptions' cannot be null."); - return withContext(contextValue -> { contextValue = context == null ? contextValue : context; return serverCallInternal @@ -373,7 +361,6 @@ Mono answerInternal( String incomingCallContext, AnswerCallOptions answerCallOptions) { try { - Objects.requireNonNull(incomingCallContext, "'incomingCallContext' cannot be null."); return serverCallInternal .answerCallAsync(AnswerCallRequestConverter.convert(incomingCallContext, answerCallOptions)) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException) @@ -390,8 +377,6 @@ Mono answerInternal( AnswerCallOptions answerCallOptions, Context context) { try { - Objects.requireNonNull(incomingCallContext, "'incomingCallContext' cannot be null."); - return withContext(contextValue -> { contextValue = context == null ? contextValue : context; return serverCallInternal @@ -416,12 +401,10 @@ Mono answerInternal( * @return CallConnection object. */ public CallConnectionAsync getCallConnection(String callConnectionId) { - Objects.requireNonNull(callConnectionId, "'callConnectionId' cannot be null."); return new CallConnectionAsync(callConnectionId, callConnectionInternal); } CallConnection getCallConnectionInternal(String callConnectionId) { - Objects.requireNonNull(callConnectionId, "'callConnectionId' cannot be null."); return new CallConnection(new CallConnectionAsync(callConnectionId, callConnectionInternal)); } @@ -498,8 +481,6 @@ Mono> addParticipantWithResponse( String operationContext, Context context) { try { - Objects.requireNonNull(participant, "'participant' cannot be null."); - AddParticipantWithCallLocatorRequest requestWithCallLocator = new AddParticipantWithCallLocatorRequest() .setCallLocator(CallLocatorConverter.convert(callLocator)) .setParticipant(CommunicationIdentifierConverter.convert(participant)) @@ -588,14 +569,13 @@ private RemoveParticipantWithCallLocatorRequest getRemoveParticipantWithCallLoca * @return Response for a successful get participant request. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public Mono> getParticipant(CallLocator callLocator, CommunicationIdentifier participant) { + public Mono getParticipant(CallLocator callLocator, CommunicationIdentifier participant) { try { GetParticipantWithCallLocatorRequest requestWithCallLocator = getGetParticipantWithCallLocatorRequest(callLocator, participant); return serverCallInternal.getParticipantAsync(requestWithCallLocator) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException) - .flatMap(result -> Mono.just( - result.stream().map(CallParticipantConverter::convert).collect(Collectors.toList()))); + .flatMap(result -> Mono.just(CallParticipantConverter.convert(result))); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -619,11 +599,11 @@ private GetParticipantWithCallLocatorRequest getGetParticipantWithCallLocatorReq * @return Response for a successful get participant request. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public Mono>> getParticipantWithResponse(CallLocator callLocator, CommunicationIdentifier participant) { + public Mono> getParticipantWithResponse(CallLocator callLocator, CommunicationIdentifier participant) { return getParticipantWithResponse(callLocator, participant, Context.NONE); } - Mono>> getParticipantWithResponse(CallLocator callLocator, CommunicationIdentifier participant, Context context) { + Mono> getParticipantWithResponse(CallLocator callLocator, CommunicationIdentifier participant, Context context) { try { GetParticipantWithCallLocatorRequest requestWithCallLocator = getGetParticipantWithCallLocatorRequest(callLocator, participant); @@ -632,12 +612,7 @@ Mono>> getParticipantWithResponse(CallLocator cal return serverCallInternal.getParticipantWithResponseAsync(requestWithCallLocator, contextValue) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException) .map(response -> - new SimpleResponse<>(response, - response.getValue() - .stream() - .map(CallParticipantConverter::convert) - .collect(Collectors.toList() - ) + new SimpleResponse<>(response, CallParticipantConverter.convert(response.getValue()) ) ); }); @@ -718,7 +693,6 @@ Mono>> getParticipantsWithResponse(CallLocator ca @ServiceMethod(returns = ReturnType.SINGLE) public Mono startRecording(CallLocator callLocator, URI recordingStateCallbackUri) { try { - Objects.requireNonNull(recordingStateCallbackUri, "'recordingStateCallbackUri' cannot be null."); if (!Boolean.TRUE.equals(recordingStateCallbackUri.isAbsolute())) { throw logger.logExceptionAsError(new InvalidParameterException("'recordingStateCallbackUri' has to be an absolute Uri")); } @@ -760,7 +734,6 @@ public Mono> startRecordingWithResponse( StartRecordingOptions startRecordingOptions, Context context) { try { - Objects.requireNonNull(recordingStateCallbackUri, "'recordingStateCallbackUri' cannot be null."); if (!Boolean.TRUE.equals(recordingStateCallbackUri.isAbsolute())) { throw logger.logExceptionAsError(new InvalidParameterException("'recordingStateCallbackUri' has to be an absolute Uri")); } @@ -1065,7 +1038,6 @@ Mono> downloadToWithResponse( OutputStream destinationStream, HttpRange httpRange, Context context) { - return contentDownloader.downloadToStreamWithResponse(sourceEndpoint, destinationStream, httpRange, context); } @@ -1075,9 +1047,6 @@ Mono> downloadToWithResponse( ParallelDownloadOptions parallelDownloadOptions, boolean overwrite, Context context) { - Objects.requireNonNull(sourceEndpoint, "'sourceEndpoint' cannot be null"); - Objects.requireNonNull(destinationPath, "'destinationPath' cannot be null"); - Set openOptions = new HashSet<>(); if (overwrite) { @@ -1131,9 +1100,6 @@ public Mono playAudio(CallLocator callLocator, URI audioFileUri Mono playAudioInternal(CallLocator callLocator, URI audioFileUri, PlayAudioOptions playAudioOptions, Context context) { try { - Objects.requireNonNull(callLocator, "'callLocator' cannot be null."); - Objects.requireNonNull(audioFileUri, "'audioFileUri' cannot be null."); - PlayAudioWithCallLocatorRequest requestWithCallLocator = getPlayAudioWithCallLocatorRequest(callLocator, audioFileUri, playAudioOptions); @@ -1171,9 +1137,6 @@ Mono> playAudioWithResponseInternal( PlayAudioOptions playAudioOptions, Context context) { try { - Objects.requireNonNull(callLocator, "'callLocator' cannot be null."); - Objects.requireNonNull(audioFileUri, "'audioFileUri' cannot be null."); - PlayAudioWithCallLocatorRequest requestWithCallLocator = getPlayAudioWithCallLocatorRequest(callLocator, audioFileUri, playAudioOptions); @@ -1193,7 +1156,6 @@ Mono> playAudioWithResponseInternal( private PlayAudioWithCallLocatorRequest getPlayAudioWithCallLocatorRequest(CallLocator callLocator, URI audioFileUri, PlayAudioOptions playAudioOptions) { - PlayAudioWithCallLocatorRequest requestWithCallLocator = new PlayAudioWithCallLocatorRequest() .setCallLocator(CallLocatorConverter.convert(callLocator)) .setAudioFileUri(audioFileUri.toString()); @@ -1261,9 +1223,6 @@ Mono> cancelMediaOperationWithResponseInternal( String mediaOperationId, Context context) { try { - Objects.requireNonNull(callLocator, "'callLocator' cannot be null."); - Objects.requireNonNull(mediaOperationId, "'mediaOperationId' cannot be null."); - CancelMediaOperationWithCallLocatorRequest requestWithCallLocator = new CancelMediaOperationWithCallLocatorRequest() .setCallLocator(CallLocatorConverter.convert(callLocator)) .setMediaOperationId(mediaOperationId); @@ -1324,7 +1283,6 @@ Mono> cancelParticipantMediaOperationWithResponseInternal( String mediaOperationId, Context context) { try { - CancelParticipantMediaOperationWithCallLocatorRequest requestWithCallLocator = new CancelParticipantMediaOperationWithCallLocatorRequest() .setCallLocator(CallLocatorConverter.convert(callLocator)) .setIdentifier(CommunicationIdentifierConverter.convert(participant)) @@ -1363,10 +1321,6 @@ public Mono playAudioToParticipant(CallLocator callLocator, Com Mono playAudioToParticipantInternal(CallLocator callLocator, CommunicationIdentifier participant, URI audioFileUri, PlayAudioOptions playAudioOptions, Context context) { try { - Objects.requireNonNull(callLocator, "'callLocator' cannot be null."); - Objects.requireNonNull(participant, "'participant' cannot be null."); - Objects.requireNonNull(audioFileUri, "'audioFileUri' cannot be null."); - PlayAudioToParticipantWithCallLocatorRequest requestWithCallLocator = new PlayAudioToParticipantWithCallLocatorRequest() .setCallLocator(CallLocatorConverter.convert(callLocator)) .setIdentifier(CommunicationIdentifierConverter.convert(participant)) @@ -1417,10 +1371,6 @@ Mono> playAudioToParticipantWithResponseInternal( PlayAudioOptions playAudioOptions, Context context) { try { - Objects.requireNonNull(callLocator, "'callLocator' cannot be null."); - Objects.requireNonNull(participant, "'participant' cannot be null."); - Objects.requireNonNull(audioFileUri, "'audioFileUri' cannot be null."); - PlayAudioToParticipantWithCallLocatorRequest requestWithCallLocator = new PlayAudioToParticipantWithCallLocatorRequest() .setCallLocator(CallLocatorConverter.convert(callLocator)) .setIdentifier(CommunicationIdentifierConverter.convert(participant)) @@ -1452,18 +1402,16 @@ Mono> playAudioToParticipantWithResponseInternal( * Redirect the call. * * @param incomingCallContext the incomingCallContext value to set. - * @param targets the targets value to set. - * @param callbackUri the callbackUrl value to set. - * @param timeoutInSeconds the timeout value to set. + * @param target the target value to set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException 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 redirectCall(String incomingCallContext, List targets, URI callbackUri, Integer timeoutInSeconds) { + public Mono redirectCall(String incomingCallContext, CommunicationIdentifier target) { try { - RedirectCallRequest request = getRedirectCallRequest(incomingCallContext, targets, callbackUri, timeoutInSeconds); + RedirectCallRequest request = getRedirectCallRequest(incomingCallContext, target); return serverCallInternal.redirectCallAsync(request) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException); @@ -1472,18 +1420,10 @@ public Mono redirectCall(String incomingCallContext, List targets, - URI callbackUri, Integer timeoutInSeconds) { - Objects.requireNonNull(incomingCallContext, "'redirectCallRequest' cannot be null."); - Objects.requireNonNull(targets, "'targets' cannot be null."); + private RedirectCallRequest getRedirectCallRequest(String incomingCallContext, CommunicationIdentifier target) { RedirectCallRequest request = new RedirectCallRequest() - .setCallbackUri(callbackUri.toString()) .setIncomingCallContext(incomingCallContext) - .setTimeoutInSeconds(timeoutInSeconds) - .setTargets(targets - .stream() - .map(CommunicationIdentifierConverter::convert) - .collect(Collectors.toList())); + .setTarget(CommunicationIdentifierConverter.convert(target)); return request; } @@ -1491,22 +1431,20 @@ private RedirectCallRequest getRedirectCallRequest(String incomingCallContext, L * Redirect the call. * * @param incomingCallContext the incomingCallContext value to set. - * @param targets the targets value to set. - * @param callbackUri the callbackUrl value to set. - * @param timeoutInSeconds the timeout value to set. + * @param target the target value to set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException 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> redirectCallWithResponse(String incomingCallContext, List targets, URI callbackUri, Integer timeoutInSeconds) { - return redirectCallWithResponseInternal(incomingCallContext, targets, callbackUri, timeoutInSeconds, Context.NONE); + public Mono> redirectCallWithResponse(String incomingCallContext, CommunicationIdentifier target) { + return redirectCallWithResponseInternal(incomingCallContext, target, Context.NONE); } - Mono> redirectCallWithResponseInternal(String incomingCallContext, List targets, URI callbackUri, Integer timeoutInSeconds, Context context) { + Mono> redirectCallWithResponseInternal(String incomingCallContext, CommunicationIdentifier target, Context context) { try { - RedirectCallRequest request = getRedirectCallRequest(incomingCallContext, targets, callbackUri, timeoutInSeconds); + RedirectCallRequest request = getRedirectCallRequest(incomingCallContext, target); return serverCallInternal.redirectCallWithResponseAsync(request, context) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException); } catch (RuntimeException ex) { @@ -1518,7 +1456,6 @@ Mono> redirectCallWithResponseInternal(String incomingCallContext * Reject the call. * * @param incomingCallContext the incomingCallContext value to set. - * @param callbackUri the callbackUrl value to set. * @param rejectReason the call reject reason value to set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. @@ -1526,9 +1463,9 @@ Mono> redirectCallWithResponseInternal(String incomingCallContext * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rejectCall(String incomingCallContext, URI callbackUri, CallRejectReason rejectReason) { + public Mono rejectCall(String incomingCallContext, CallRejectReason rejectReason) { try { - RejectCallRequest request = getRejectCallRequest(incomingCallContext, callbackUri, rejectReason); + RejectCallRequest request = getRejectCallRequest(incomingCallContext, rejectReason); return serverCallInternal.rejectCallAsync(request) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException); @@ -1537,10 +1474,8 @@ public Mono rejectCall(String incomingCallContext, URI callbackUri, CallRe } } - private RejectCallRequest getRejectCallRequest(String incomingCallContext, URI callbackUri, CallRejectReason rejectReason) { - Objects.requireNonNull(incomingCallContext, "'redirectCallRequest' cannot be null."); + private RejectCallRequest getRejectCallRequest(String incomingCallContext, CallRejectReason rejectReason) { RejectCallRequest request = new RejectCallRequest() - .setCallbackUri(callbackUri.toString()) .setIncomingCallContext(incomingCallContext) .setCallRejectReason(rejectReason); return request; @@ -1550,7 +1485,6 @@ private RejectCallRequest getRejectCallRequest(String incomingCallContext, URI c * Reject the call. * * @param incomingCallContext the incomingCallContext value to set. - * @param callbackUri the callbackUrl value to set. * @param rejectReason the call reject reason value to set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CommunicationErrorResponseException thrown if the request is rejected by server. @@ -1558,13 +1492,13 @@ private RejectCallRequest getRejectCallRequest(String incomingCallContext, URI c * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> rejectCallWithResponse(String incomingCallContext, URI callbackUri, CallRejectReason rejectReason) { - return rejectCallWithResponseInternal(incomingCallContext, callbackUri, rejectReason, Context.NONE); + public Mono> rejectCallWithResponse(String incomingCallContext, CallRejectReason rejectReason) { + return rejectCallWithResponseInternal(incomingCallContext, rejectReason, Context.NONE); } - Mono> rejectCallWithResponseInternal(String incomingCallContext, URI callbackUri, CallRejectReason rejectReason, Context context) { + Mono> rejectCallWithResponseInternal(String incomingCallContext, CallRejectReason rejectReason, Context context) { try { - RejectCallRequest request = getRejectCallRequest(incomingCallContext, callbackUri, rejectReason); + RejectCallRequest request = getRejectCallRequest(incomingCallContext, rejectReason); return serverCallInternal.rejectCallWithResponseAsync(request, context) .onErrorMap(CommunicationErrorResponseException.class, CallingServerErrorConverter::translateException); } catch (RuntimeException ex) { diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerClient.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerClient.java index 07e9a1f105f90..5eecb915b9d69 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerClient.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerClient.java @@ -285,7 +285,7 @@ public Response removeParticipantWithResponse(CallLocator callLocator, Com * @return Response for a successful get participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public List getParticipant(CallLocator callLocator, CommunicationIdentifier participant) { + public CallParticipant getParticipant(CallLocator callLocator, CommunicationIdentifier participant) { return callingServerAsyncClient.getParticipant(callLocator, participant).block(); } @@ -300,7 +300,7 @@ public List getParticipant(CallLocator callLocator, Communicati * @return Response for a successful get participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getParticipantWithResponse(CallLocator callLocator, CommunicationIdentifier participant, Context context) { + public Response getParticipantWithResponse(CallLocator callLocator, CommunicationIdentifier participant, Context context) { return callingServerAsyncClient.getParticipantWithResponse(callLocator, participant, context).block(); } @@ -700,25 +700,21 @@ public Response playAudioToParticipantWithResponse( * Redirect the call. * * @param incomingCallContext the incomingCallContext value to set. - * @param targets the targets value to set. - * @param callbackUri the callbackUrl value to set. - * @param timeout the timeout value to set. + * @param target the target value to set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CallingServerErrorException 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 redirectCall(String incomingCallContext, List targets, URI callbackUri, Integer timeout) { - redirectCallWithResponse(incomingCallContext, targets, callbackUri, timeout, Context.NONE); + public void redirectCall(String incomingCallContext, CommunicationIdentifier target) { + redirectCallWithResponse(incomingCallContext, target, Context.NONE); } /** * Redirect the call. * * @param incomingCallContext the incomingCallContext value to set. - * @param targets the targets value to set. - * @param callbackUri the callbackUrl value to set. - * @param timeout the timeout value to set. + * @param target the target value to set. * @param context A {@link Context} representing the request context. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CallingServerErrorException thrown if the request is rejected by server. @@ -726,30 +722,28 @@ public void redirectCall(String incomingCallContext, List redirectCallWithResponse(String incomingCallContext, List targets, URI callbackUri, Integer timeout, Context context) { - return callingServerAsyncClient.redirectCallWithResponseInternal(incomingCallContext, targets, callbackUri, timeout, context).block(); + public Response redirectCallWithResponse(String incomingCallContext, CommunicationIdentifier target, Context context) { + return callingServerAsyncClient.redirectCallWithResponseInternal(incomingCallContext, target, context).block(); } /** * Redirect the call. * * @param incomingCallContext the incomingCallContext value to set. - * @param callbackUri the callbackUrl value to set. * @param callRejectReason the call reject reason value to set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CallingServerErrorException 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 rejectCall(String incomingCallContext, URI callbackUri, CallRejectReason callRejectReason) { - rejectCallWithResponse(incomingCallContext, callbackUri, callRejectReason, Context.NONE); + public void rejectCall(String incomingCallContext, CallRejectReason callRejectReason) { + rejectCallWithResponse(incomingCallContext, callRejectReason, Context.NONE); } /** * Redirect the call. * * @param incomingCallContext the incomingCallContext value to set. - * @param callbackUri the callbackUrl value to set. * @param callRejectReason the call reject reason value to set. * @param context A {@link Context} representing the request context. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -758,8 +752,8 @@ public void rejectCall(String incomingCallContext, URI callbackUri, CallRejectRe * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response rejectCallWithResponse(String incomingCallContext, URI callbackUri, CallRejectReason callRejectReason, Context context) { - return callingServerAsyncClient.rejectCallWithResponseInternal(incomingCallContext, callbackUri, callRejectReason, context).block(); + public Response rejectCallWithResponse(String incomingCallContext, CallRejectReason callRejectReason, Context context) { + return callingServerAsyncClient.rejectCallWithResponseInternal(incomingCallContext, callRejectReason, context).block(); } /** diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerServiceVersion.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerServiceVersion.java index 4dce99bffff36..11b46e909271c 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerServiceVersion.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerServiceVersion.java @@ -10,9 +10,9 @@ */ public enum CallingServerServiceVersion implements ServiceVersion { /** - * Service version {@code 2021-08-30-preview}. + * Service version {@code 2021-11-15-preview}. */ - V2021_08_30_PREVIEW("2021-08-30-preview"); + V2021_11_15_PREVIEW("2021-11-15-preview"); private final String version; @@ -34,6 +34,6 @@ public String getVersion() { * @return The latest {@link CallingServerServiceVersion} object. */ public static CallingServerServiceVersion getLatest() { - return V2021_08_30_PREVIEW; + return V2021_11_15_PREVIEW; } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/CallConnectionsImpl.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/CallConnectionsImpl.java index be1e4cb7ecf5b..9020853d73623 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/CallConnectionsImpl.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/CallConnectionsImpl.java @@ -237,7 +237,7 @@ Mono> removeParticipant( @Post("/calling/callConnections/{callConnectionId}/participants:get") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono>> getParticipant( + Mono> getParticipant( @HostParam("endpoint") String endpoint, @PathParam("callConnectionId") String callConnectionId, @QueryParam("api-version") String apiVersion, @@ -2070,7 +2070,7 @@ public Response removeParticipantWithResponse( * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getParticipantWithResponseAsync( + public Mono> getParticipantWithResponseAsync( String callConnectionId, GetParticipantRequest getParticipantRequest) { final String accept = "application/json"; return FluxUtil.withContext( @@ -2096,7 +2096,7 @@ public Mono>> getParticipantWithResponseA * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getParticipantWithResponseAsync( + public Mono> getParticipantWithResponseAsync( String callConnectionId, GetParticipantRequest getParticipantRequest, Context context) { final String accept = "application/json"; return service.getParticipant( @@ -2119,11 +2119,11 @@ public Mono>> getParticipantWithResponseA * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getParticipantAsync( + public Mono getParticipantAsync( String callConnectionId, GetParticipantRequest getParticipantRequest) { return getParticipantWithResponseAsync(callConnectionId, getParticipantRequest) .flatMap( - (Response> res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -2144,11 +2144,11 @@ public Mono> getParticipantAsync( * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getParticipantAsync( + public Mono getParticipantAsync( String callConnectionId, GetParticipantRequest getParticipantRequest, Context context) { return getParticipantWithResponseAsync(callConnectionId, getParticipantRequest, context) .flatMap( - (Response> res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -2168,7 +2168,7 @@ public Mono> getParticipantAsync( * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public List getParticipant( + public CallParticipantInternal getParticipant( String callConnectionId, GetParticipantRequest getParticipantRequest) { return getParticipantAsync(callConnectionId, getParticipantRequest).block(); } @@ -2185,7 +2185,7 @@ public List getParticipant( * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getParticipantWithResponse( + public Response getParticipantWithResponse( String callConnectionId, GetParticipantRequest getParticipantRequest, Context context) { return getParticipantWithResponseAsync(callConnectionId, getParticipantRequest, context).block(); } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/ServerCallsImpl.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/ServerCallsImpl.java index d7637ac23bb90..a103cbe765591 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/ServerCallsImpl.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/ServerCallsImpl.java @@ -108,7 +108,7 @@ Mono> removeParticipant( @Post("/calling/participants:get") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class) - Mono>> getParticipant( + Mono> getParticipant( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") @@ -613,7 +613,7 @@ public Response removeParticipantWithResponse( * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getParticipantWithResponseAsync( + public Mono> getParticipantWithResponseAsync( GetParticipantWithCallLocatorRequest getParticipantWithCallLocatorRequest) { final String accept = "application/json"; return FluxUtil.withContext( @@ -637,7 +637,7 @@ public Mono>> getParticipantWithResponseA * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> getParticipantWithResponseAsync( + public Mono> getParticipantWithResponseAsync( GetParticipantWithCallLocatorRequest getParticipantWithCallLocatorRequest, Context context) { final String accept = "application/json"; return service.getParticipant( @@ -658,11 +658,11 @@ public Mono>> getParticipantWithResponseA * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getParticipantAsync( + public Mono getParticipantAsync( GetParticipantWithCallLocatorRequest getParticipantWithCallLocatorRequest) { return getParticipantWithResponseAsync(getParticipantWithCallLocatorRequest) .flatMap( - (Response> res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -682,11 +682,11 @@ public Mono> getParticipantAsync( * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getParticipantAsync( + public Mono getParticipantAsync( GetParticipantWithCallLocatorRequest getParticipantWithCallLocatorRequest, Context context) { return getParticipantWithResponseAsync(getParticipantWithCallLocatorRequest, context) .flatMap( - (Response> res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -705,7 +705,7 @@ public Mono> getParticipantAsync( * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public List getParticipant( + public CallParticipantInternal getParticipant( GetParticipantWithCallLocatorRequest getParticipantWithCallLocatorRequest) { return getParticipantAsync(getParticipantWithCallLocatorRequest).block(); } @@ -721,7 +721,7 @@ public List getParticipant( * @return participant from the call using identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response> getParticipantWithResponse( + public Response getParticipantWithResponse( GetParticipantWithCallLocatorRequest getParticipantWithCallLocatorRequest, Context context) { return getParticipantWithResponseAsync(getParticipantWithCallLocatorRequest, context).block(); } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/PlayAudioResultConverter.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/PlayAudioResultConverter.java index 4c75f293b6da5..fd8e68114c4bd 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/PlayAudioResultConverter.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/PlayAudioResultConverter.java @@ -23,6 +23,6 @@ public static PlayAudioResult convert(PlayAudioResultInternal playAudioResultInt playAudioResultInternal.getOperationId(), playAudioResultInternal.getStatus(), playAudioResultInternal.getOperationContext(), - ResultInfoConverter.convert(playAudioResultInternal.getResultInfo())); + ResultDetailsConverter.convert(playAudioResultInternal.getResultDetails())); } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/ResultInfoConverter.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/ResultDetailsConverter.java similarity index 96% rename from sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/ResultInfoConverter.java rename to sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/ResultDetailsConverter.java index 44d7b41465c7f..2c554d0a245bb 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/ResultInfoConverter.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/ResultDetailsConverter.java @@ -9,7 +9,7 @@ /** * A converter between {@link CallingOperationResultDetailsInternal} and {@link CallingOperationResultDetails}. */ -public final class ResultInfoConverter { +public final class ResultDetailsConverter { /** * Maps from {@link CallingOperationResultDetailsInternal} to {@link CallingOperationResultDetails}. diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/TransferCallResultConverter.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/TransferCallResultConverter.java index 9f1ae83f16457..5223352dbf63d 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/TransferCallResultConverter.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/TransferCallResultConverter.java @@ -23,6 +23,6 @@ public static TransferCallResult convert(TransferCallResultInternal transferCall transferCallResultInternal.getOperationId(), transferCallResultInternal.getStatus(), transferCallResultInternal.getOperationContext(), - ResultInfoConverter.convert(transferCallResultInternal.getResultInfo())); + ResultDetailsConverter.convert(transferCallResultInternal.getResultDetails())); } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantRequest.java index 435326f7a82e5..ed5abb3b73d51 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantRequest.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantRequest.java @@ -28,12 +28,6 @@ public final class AddParticipantRequest { @JsonProperty(value = "operationContext") private String operationContext; - /* - * The callback URI. - */ - @JsonProperty(value = "callbackUri") - private String callbackUri; - /** * Get the alternateCallerId property: The alternate identity of source participant. * @@ -93,24 +87,4 @@ public AddParticipantRequest setOperationContext(String operationContext) { this.operationContext = operationContext; return this; } - - /** - * Get the callbackUri property: The callback URI. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; - } - - /** - * Set the callbackUri property: The callback URI. - * - * @param callbackUri the callbackUri value to set. - * @return the AddParticipantRequest object itself. - */ - public AddParticipantRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; - return this; - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantResultEventInternal.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantResultEventInternal.java index d106399580b46..bfb81b9b768a6 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantResultEventInternal.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantResultEventInternal.java @@ -14,8 +14,8 @@ public final class AddParticipantResultEventInternal { /* * The result details. */ - @JsonProperty(value = "resultInfo") - private CallingOperationResultDetailsInternal resultInfo; + @JsonProperty(value = "resultDetails") + private CallingOperationResultDetailsInternal resultDetails; /* * The operation context. @@ -30,22 +30,22 @@ public final class AddParticipantResultEventInternal { private CallingOperationStatus status; /** - * Get the resultInfo property: The result details. + * Get the resultDetails property: The result details. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetailsInternal getResultInfo() { - return this.resultInfo; + public CallingOperationResultDetailsInternal getResultDetails() { + return this.resultDetails; } /** - * Set the resultInfo property: The result details. + * Set the resultDetails property: The result details. * - * @param resultInfo the resultInfo value to set. + * @param resultDetails the resultDetails value to set. * @return the AddParticipantResultEventInternal object itself. */ - public AddParticipantResultEventInternal setResultInfo(CallingOperationResultDetailsInternal resultInfo) { - this.resultInfo = resultInfo; + public AddParticipantResultEventInternal setResultDetails(CallingOperationResultDetailsInternal resultDetails) { + this.resultDetails = resultDetails; return this; } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantWithCallLocatorRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantWithCallLocatorRequest.java index c483fd8694b8c..a90ff0dd9ef72 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantWithCallLocatorRequest.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/AddParticipantWithCallLocatorRequest.java @@ -16,6 +16,12 @@ public final class AddParticipantWithCallLocatorRequest { @JsonProperty(value = "callLocator", required = true) private CallLocatorModel callLocator; + /* + * The callback URI. + */ + @JsonProperty(value = "callbackUri") + private String callbackUri; + /* * The alternate identity of source participant. */ @@ -34,12 +40,6 @@ public final class AddParticipantWithCallLocatorRequest { @JsonProperty(value = "operationContext") private String operationContext; - /* - * The callback URI. - */ - @JsonProperty(value = "callbackUri") - private String callbackUri; - /** * Get the callLocator property: The call locator. * @@ -60,6 +60,26 @@ public AddParticipantWithCallLocatorRequest setCallLocator(CallLocatorModel call return this; } + /** + * Get the callbackUri property: The callback URI. + * + * @return the callbackUri value. + */ + public String getCallbackUri() { + return this.callbackUri; + } + + /** + * Set the callbackUri property: The callback URI. + * + * @param callbackUri the callbackUri value to set. + * @return the AddParticipantWithCallLocatorRequest object itself. + */ + public AddParticipantWithCallLocatorRequest setCallbackUri(String callbackUri) { + this.callbackUri = callbackUri; + return this; + } + /** * Get the alternateCallerId property: The alternate identity of source participant. * @@ -119,24 +139,4 @@ public AddParticipantWithCallLocatorRequest setOperationContext(String operation this.operationContext = operationContext; return this; } - - /** - * Get the callbackUri property: The callback URI. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; - } - - /** - * Set the callbackUri property: The callback URI. - * - * @param callbackUri the callbackUri value to set. - * @return the AddParticipantWithCallLocatorRequest object itself. - */ - public AddParticipantWithCallLocatorRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; - return this; - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioRequest.java index 10e9947d3facf..2d8a6ef989634 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioRequest.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioRequest.java @@ -40,12 +40,6 @@ public final class PlayAudioRequest { @JsonProperty(value = "audioFileId") private String audioFileId; - /* - * The callback Uri to receive PlayAudio status notifications. - */ - @JsonProperty(value = "callbackUri") - private String callbackUri; - /** * Get the audioFileUri property: The media resource uri of the play audio request. Currently only Wave file (.wav) * format audio prompts are supported. More specifically, the audio content in the wave file must be mono @@ -129,24 +123,4 @@ public PlayAudioRequest setAudioFileId(String audioFileId) { this.audioFileId = audioFileId; return this; } - - /** - * Get the callbackUri property: The callback Uri to receive PlayAudio status notifications. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; - } - - /** - * Set the callbackUri property: The callback Uri to receive PlayAudio status notifications. - * - * @param callbackUri the callbackUri value to set. - * @return the PlayAudioRequest object itself. - */ - public PlayAudioRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; - return this; - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultEventInternal.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultEventInternal.java index a52f7a73a882f..ec018dded05f2 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultEventInternal.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultEventInternal.java @@ -14,8 +14,8 @@ public final class PlayAudioResultEventInternal { /* * The result details. */ - @JsonProperty(value = "resultInfo") - private CallingOperationResultDetailsInternal resultInfo; + @JsonProperty(value = "resultDetails") + private CallingOperationResultDetailsInternal resultDetails; /* * The operation context. @@ -30,22 +30,22 @@ public final class PlayAudioResultEventInternal { private CallingOperationStatus status; /** - * Get the resultInfo property: The result details. + * Get the resultDetails property: The result details. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetailsInternal getResultInfo() { - return this.resultInfo; + public CallingOperationResultDetailsInternal getResultDetails() { + return this.resultDetails; } /** - * Set the resultInfo property: The result details. + * Set the resultDetails property: The result details. * - * @param resultInfo the resultInfo value to set. + * @param resultDetails the resultDetails value to set. * @return the PlayAudioResultEventInternal object itself. */ - public PlayAudioResultEventInternal setResultInfo(CallingOperationResultDetailsInternal resultInfo) { - this.resultInfo = resultInfo; + public PlayAudioResultEventInternal setResultDetails(CallingOperationResultDetailsInternal resultDetails) { + this.resultDetails = resultDetails; return this; } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultInternal.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultInternal.java index 44aeb7f9bec49..6c6132303644a 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultInternal.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultInternal.java @@ -32,8 +32,8 @@ public final class PlayAudioResultInternal { /* * The result info for the operation. */ - @JsonProperty(value = "resultInfo") - private CallingOperationResultDetailsInternal resultInfo; + @JsonProperty(value = "resultDetails") + private CallingOperationResultDetailsInternal resultDetails; /** * Get the operationId property: The operation id. @@ -96,22 +96,22 @@ public PlayAudioResultInternal setOperationContext(String operationContext) { } /** - * Get the resultInfo property: The result info for the operation. + * Get the resultDetails property: The result info for the operation. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetailsInternal getResultInfo() { - return this.resultInfo; + public CallingOperationResultDetailsInternal getResultDetails() { + return this.resultDetails; } /** - * Set the resultInfo property: The result info for the operation. + * Set the resultDetails property: The result info for the operation. * - * @param resultInfo the resultInfo value to set. + * @param resultDetails the resultDetails value to set. * @return the PlayAudioResultInternal object itself. */ - public PlayAudioResultInternal setResultInfo(CallingOperationResultDetailsInternal resultInfo) { - this.resultInfo = resultInfo; + public PlayAudioResultInternal setResultDetails(CallingOperationResultDetailsInternal resultDetails) { + this.resultDetails = resultDetails; return this; } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioToParticipantRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioToParticipantRequest.java index 262febfc79616..a7439427465d3 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioToParticipantRequest.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioToParticipantRequest.java @@ -46,12 +46,6 @@ public final class PlayAudioToParticipantRequest { @JsonProperty(value = "audioFileId") private String audioFileId; - /* - * The callback Uri to receive PlayAudio status notifications. - */ - @JsonProperty(value = "callbackUri") - private String callbackUri; - /** * Get the identifier property: The identifier of the participant to play audio to. * @@ -155,24 +149,4 @@ public PlayAudioToParticipantRequest setAudioFileId(String audioFileId) { this.audioFileId = audioFileId; return this; } - - /** - * Get the callbackUri property: The callback Uri to receive PlayAudio status notifications. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; - } - - /** - * Set the callbackUri property: The callback Uri to receive PlayAudio status notifications. - * - * @param callbackUri the callbackUri value to set. - * @return the PlayAudioToParticipantRequest object itself. - */ - public PlayAudioToParticipantRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; - return this; - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioToParticipantWithCallLocatorRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioToParticipantWithCallLocatorRequest.java index c4253dac55359..6eea859b651df 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioToParticipantWithCallLocatorRequest.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioToParticipantWithCallLocatorRequest.java @@ -10,6 +10,12 @@ /** The request payload for playing audio with call locator to participant. */ @Fluent public final class PlayAudioToParticipantWithCallLocatorRequest { + /* + * The identifier of the participant to play audio to. + */ + @JsonProperty(value = "identifier", required = true) + private CommunicationIdentifierModel identifier; + /* * The call locator. */ @@ -17,10 +23,10 @@ public final class PlayAudioToParticipantWithCallLocatorRequest { private CallLocatorModel callLocator; /* - * The identifier of the participant to play audio to. + * The callback Uri to receive PlayAudio status notifications. */ - @JsonProperty(value = "identifier", required = true) - private CommunicationIdentifierModel identifier; + @JsonProperty(value = "callbackUri") + private String callbackUri; /* * The media resource uri of the play audio request. @@ -52,11 +58,25 @@ public final class PlayAudioToParticipantWithCallLocatorRequest { @JsonProperty(value = "audioFileId") private String audioFileId; - /* - * The callback Uri to receive PlayAudio status notifications. + /** + * Get the identifier property: The identifier of the participant to play audio to. + * + * @return the identifier value. */ - @JsonProperty(value = "callbackUri") - private String callbackUri; + public CommunicationIdentifierModel getIdentifier() { + return this.identifier; + } + + /** + * Set the identifier property: The identifier of the participant to play audio to. + * + * @param identifier the identifier value to set. + * @return the PlayAudioToParticipantWithCallLocatorRequest object itself. + */ + public PlayAudioToParticipantWithCallLocatorRequest setIdentifier(CommunicationIdentifierModel identifier) { + this.identifier = identifier; + return this; + } /** * Get the callLocator property: The call locator. @@ -79,22 +99,22 @@ public PlayAudioToParticipantWithCallLocatorRequest setCallLocator(CallLocatorMo } /** - * Get the identifier property: The identifier of the participant to play audio to. + * Get the callbackUri property: The callback Uri to receive PlayAudio status notifications. * - * @return the identifier value. + * @return the callbackUri value. */ - public CommunicationIdentifierModel getIdentifier() { - return this.identifier; + public String getCallbackUri() { + return this.callbackUri; } /** - * Set the identifier property: The identifier of the participant to play audio to. + * Set the callbackUri property: The callback Uri to receive PlayAudio status notifications. * - * @param identifier the identifier value to set. + * @param callbackUri the callbackUri value to set. * @return the PlayAudioToParticipantWithCallLocatorRequest object itself. */ - public PlayAudioToParticipantWithCallLocatorRequest setIdentifier(CommunicationIdentifierModel identifier) { - this.identifier = identifier; + public PlayAudioToParticipantWithCallLocatorRequest setCallbackUri(String callbackUri) { + this.callbackUri = callbackUri; return this; } @@ -181,24 +201,4 @@ public PlayAudioToParticipantWithCallLocatorRequest setAudioFileId(String audioF this.audioFileId = audioFileId; return this; } - - /** - * Get the callbackUri property: The callback Uri to receive PlayAudio status notifications. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; - } - - /** - * Set the callbackUri property: The callback Uri to receive PlayAudio status notifications. - * - * @param callbackUri the callbackUri value to set. - * @return the PlayAudioToParticipantWithCallLocatorRequest object itself. - */ - public PlayAudioToParticipantWithCallLocatorRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; - return this; - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioWithCallLocatorRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioWithCallLocatorRequest.java index 9d1dcd22efe34..7457dd575ca4a 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioWithCallLocatorRequest.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioWithCallLocatorRequest.java @@ -16,6 +16,12 @@ public final class PlayAudioWithCallLocatorRequest { @JsonProperty(value = "callLocator", required = true) private CallLocatorModel callLocator; + /* + * The callback Uri to receive PlayAudio status notifications. + */ + @JsonProperty(value = "callbackUri") + private String callbackUri; + /* * The media resource uri of the play audio request. * Currently only Wave file (.wav) format audio prompts are supported. @@ -46,12 +52,6 @@ public final class PlayAudioWithCallLocatorRequest { @JsonProperty(value = "audioFileId") private String audioFileId; - /* - * The callback Uri to receive PlayAudio status notifications. - */ - @JsonProperty(value = "callbackUri") - private String callbackUri; - /** * Get the callLocator property: The call locator. * @@ -72,6 +72,26 @@ public PlayAudioWithCallLocatorRequest setCallLocator(CallLocatorModel callLocat return this; } + /** + * Get the callbackUri property: The callback Uri to receive PlayAudio status notifications. + * + * @return the callbackUri value. + */ + public String getCallbackUri() { + return this.callbackUri; + } + + /** + * Set the callbackUri property: The callback Uri to receive PlayAudio status notifications. + * + * @param callbackUri the callbackUri value to set. + * @return the PlayAudioWithCallLocatorRequest object itself. + */ + public PlayAudioWithCallLocatorRequest setCallbackUri(String callbackUri) { + this.callbackUri = callbackUri; + return this; + } + /** * Get the audioFileUri property: The media resource uri of the play audio request. Currently only Wave file (.wav) * format audio prompts are supported. More specifically, the audio content in the wave file must be mono @@ -155,24 +175,4 @@ public PlayAudioWithCallLocatorRequest setAudioFileId(String audioFileId) { this.audioFileId = audioFileId; return this; } - - /** - * Get the callbackUri property: The callback Uri to receive PlayAudio status notifications. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; - } - - /** - * Set the callbackUri property: The callback Uri to receive PlayAudio status notifications. - * - * @param callbackUri the callbackUri value to set. - * @return the PlayAudioWithCallLocatorRequest object itself. - */ - public PlayAudioWithCallLocatorRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; - return this; - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/RedirectCallRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/RedirectCallRequest.java index 9a478cc16dc5d..bd377d379153b 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/RedirectCallRequest.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/RedirectCallRequest.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; /** The request payload for redirecting the call. */ @Fluent @@ -20,20 +19,8 @@ public final class RedirectCallRequest { /* * The target identity to redirect the call to. */ - @JsonProperty(value = "targets", required = true) - private List targets; - - /* - * The callback uri. - */ - @JsonProperty(value = "callbackUri") - private String callbackUri; - - /* - * The timeout for the redirect in seconds. - */ - @JsonProperty(value = "timeoutInSeconds") - private Integer timeoutInSeconds; + @JsonProperty(value = "target", required = true) + private CommunicationIdentifierModel target; /** * Get the incomingCallContext property: The context associated with the call. @@ -56,62 +43,22 @@ public RedirectCallRequest setIncomingCallContext(String incomingCallContext) { } /** - * Get the targets property: The target identity to redirect the call to. - * - * @return the targets value. - */ - public List getTargets() { - return this.targets; - } - - /** - * Set the targets property: The target identity to redirect the call to. - * - * @param targets the targets value to set. - * @return the RedirectCallRequest object itself. - */ - public RedirectCallRequest setTargets(List targets) { - this.targets = targets; - return this; - } - - /** - * Get the callbackUri property: The callback uri. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; - } - - /** - * Set the callbackUri property: The callback uri. - * - * @param callbackUri the callbackUri value to set. - * @return the RedirectCallRequest object itself. - */ - public RedirectCallRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; - return this; - } - - /** - * Get the timeoutInSeconds property: The timeout for the redirect in seconds. + * Get the target property: The target identity to redirect the call to. * - * @return the timeoutInSeconds value. + * @return the target value. */ - public Integer getTimeoutInSeconds() { - return this.timeoutInSeconds; + public CommunicationIdentifierModel getTarget() { + return this.target; } /** - * Set the timeoutInSeconds property: The timeout for the redirect in seconds. + * Set the target property: The target identity to redirect the call to. * - * @param timeoutInSeconds the timeoutInSeconds value to set. + * @param target the target value to set. * @return the RedirectCallRequest object itself. */ - public RedirectCallRequest setTimeoutInSeconds(Integer timeoutInSeconds) { - this.timeoutInSeconds = timeoutInSeconds; + public RedirectCallRequest setTarget(CommunicationIdentifierModel target) { + this.target = target; return this; } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/RejectCallRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/RejectCallRequest.java index 516d7c717e454..63c9208d3fd8c 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/RejectCallRequest.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/RejectCallRequest.java @@ -23,12 +23,6 @@ public final class RejectCallRequest { @JsonProperty(value = "callRejectReason") private CallRejectReason callRejectReason; - /* - * The callback uri. - */ - @JsonProperty(value = "callbackUri") - private String callbackUri; - /** * Get the incomingCallContext property: The context associated with the call. * @@ -68,24 +62,4 @@ public RejectCallRequest setCallRejectReason(CallRejectReason callRejectReason) this.callRejectReason = callRejectReason; return this; } - - /** - * Get the callbackUri property: The callback uri. - * - * @return the callbackUri value. - */ - public String getCallbackUri() { - return this.callbackUri; - } - - /** - * Set the callbackUri property: The callback uri. - * - * @param callbackUri the callbackUri value to set. - * @return the RejectCallRequest object itself. - */ - public RejectCallRequest setCallbackUri(String callbackUri) { - this.callbackUri = callbackUri; - return this; - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/TransferCallResultEventInternal.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/TransferCallResultEventInternal.java index 10af3d5727fee..8e98bce307c43 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/TransferCallResultEventInternal.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/TransferCallResultEventInternal.java @@ -14,8 +14,8 @@ public final class TransferCallResultEventInternal { /* * The result details. */ - @JsonProperty(value = "resultInfo") - private CallingOperationResultDetailsInternal resultInfo; + @JsonProperty(value = "resultDetails") + private CallingOperationResultDetailsInternal resultDetails; /* * The operation context. @@ -30,22 +30,22 @@ public final class TransferCallResultEventInternal { private CallingOperationStatus status; /** - * Get the resultInfo property: The result details. + * Get the resultDetails property: The result details. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetailsInternal getResultInfo() { - return this.resultInfo; + public CallingOperationResultDetailsInternal getResultDetails() { + return this.resultDetails; } /** - * Set the resultInfo property: The result details. + * Set the resultDetails property: The result details. * - * @param resultInfo the resultInfo value to set. + * @param resultDetails the resultDetails value to set. * @return the TransferCallResultEventInternal object itself. */ - public TransferCallResultEventInternal setResultInfo(CallingOperationResultDetailsInternal resultInfo) { - this.resultInfo = resultInfo; + public TransferCallResultEventInternal setResultDetails(CallingOperationResultDetailsInternal resultDetails) { + this.resultDetails = resultDetails; return this; } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/TransferCallResultInternal.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/TransferCallResultInternal.java index 92ee4f13c8e69..8ae5eb245d637 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/TransferCallResultInternal.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/TransferCallResultInternal.java @@ -32,8 +32,8 @@ public final class TransferCallResultInternal { /* * The result info for the operation. */ - @JsonProperty(value = "resultInfo") - private CallingOperationResultDetailsInternal resultInfo; + @JsonProperty(value = "resultDetails") + private CallingOperationResultDetailsInternal resultDetails; /** * Get the operationId property: The operation id. @@ -96,22 +96,22 @@ public TransferCallResultInternal setOperationContext(String operationContext) { } /** - * Get the resultInfo property: The result info for the operation. + * Get the resultDetails property: The result info for the operation. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetailsInternal getResultInfo() { - return this.resultInfo; + public CallingOperationResultDetailsInternal getResultDetails() { + return this.resultDetails; } /** - * Set the resultInfo property: The result info for the operation. + * Set the resultDetails property: The result info for the operation. * - * @param resultInfo the resultInfo value to set. + * @param resultDetails the resultDetails value to set. * @return the TransferCallResultInternal object itself. */ - public TransferCallResultInternal setResultInfo(CallingOperationResultDetailsInternal resultInfo) { - this.resultInfo = resultInfo; + public TransferCallResultInternal setResultDetails(CallingOperationResultDetailsInternal resultDetails) { + this.resultDetails = resultDetails; return this; } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/PlayAudioResult.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/PlayAudioResult.java index b72d66a678783..647067a9a19c5 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/PlayAudioResult.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/PlayAudioResult.java @@ -24,9 +24,9 @@ public final class PlayAudioResult { private final String operationContext; /* - * The result info + * The result details */ - private final CallingOperationResultDetails resultInfo; + private final CallingOperationResultDetails resultDetails; /** * Get the operationId property: The operation id. @@ -56,12 +56,12 @@ public String getOperationContext() { } /** - * Get the resultInfo property: Gets or sets the result info. + * Get the resultDetails property: Gets or sets the result info. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetails getResultInfo() { - return resultInfo; + public CallingOperationResultDetails getResultDetails() { + return resultDetails; } /** @@ -70,12 +70,12 @@ public CallingOperationResultDetails getResultInfo() { * @param operationId the operationId value. * @param status the status value. * @param operationContext the operationContext value. - * @param resultInfo the resultInfo value. + * @param resultDetails the resultDetails value. */ - public PlayAudioResult(String operationId, CallingOperationStatus status, String operationContext, CallingOperationResultDetails resultInfo) { + public PlayAudioResult(String operationId, CallingOperationStatus status, String operationContext, CallingOperationResultDetails resultDetails) { this.operationId = operationId; this.status = status; this.operationContext = operationContext; - this.resultInfo = resultInfo; + this.resultDetails = resultDetails; } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/TransferCallResult.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/TransferCallResult.java index 7d50a7c90b0e1..e73461c7d766e 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/TransferCallResult.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/TransferCallResult.java @@ -24,9 +24,9 @@ public final class TransferCallResult { private final String operationContext; /* - * The result info for the operation. + * The result details for the operation. */ - private final CallingOperationResultDetails resultInfo; + private final CallingOperationResultDetails resultDetails; /** * Get the operationId property: The operation id. @@ -56,12 +56,12 @@ public String getOperationContext() { } /** - * Get the resultInfo property: The result info for the operation. + * Get the resultDetails property: The result info for the operation. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetails getResultInfo() { - return this.resultInfo; + public CallingOperationResultDetails getResultDetails() { + return this.resultDetails; } /** @@ -70,12 +70,12 @@ public CallingOperationResultDetails getResultInfo() { * @param operationId the operationId value. * @param status the status value. * @param operationContext the operationContext value. - * @param resultInfo the resultInfo value. + * @param resultDetails the resultDetails value. */ - public TransferCallResult(String operationId, CallingOperationStatus status, String operationContext, CallingOperationResultDetails resultInfo) { + public TransferCallResult(String operationId, CallingOperationStatus status, String operationContext, CallingOperationResultDetails resultDetails) { this.operationId = operationId; this.status = status; this.operationContext = operationContext; - this.resultInfo = resultInfo; + this.resultDetails = resultDetails; } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/AddParticipantResultEvent.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/AddParticipantResultEvent.java index 5eb854fc58c56..18923e8c7b078 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/AddParticipantResultEvent.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/AddParticipantResultEvent.java @@ -3,7 +3,7 @@ package com.azure.communication.callingserver.models.events; -import com.azure.communication.callingserver.implementation.converters.ResultInfoConverter; +import com.azure.communication.callingserver.implementation.converters.ResultDetailsConverter; import com.azure.communication.callingserver.implementation.models.AddParticipantResultEventInternal; import com.azure.communication.callingserver.models.CallingOperationResultDetails; import com.azure.communication.callingserver.models.CallingOperationStatus; @@ -16,7 +16,7 @@ public final class AddParticipantResultEvent extends CallingServerEventBase { /* * The result details. */ - private final CallingOperationResultDetails resultInfo; + private final CallingOperationResultDetails resultDetails; /* * The operation context. @@ -29,12 +29,12 @@ public final class AddParticipantResultEvent extends CallingServerEventBase { private final CallingOperationStatus status; /** - * Get the resultInfo property: The result details. + * Get the resultDetails property: The result details. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetails getResultInfo() { - return resultInfo; + public CallingOperationResultDetails getResultDetails() { + return resultDetails; } /** @@ -58,13 +58,13 @@ public CallingOperationStatus getStatus() { /** * Initializes a new instance of AddParticipantResultEvent. * - * @param resultInfo the resultInfo value. + * @param resultDetails the resultDetails value. * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation * @param status the status value. */ - AddParticipantResultEvent(CallingOperationResultDetails resultInfo, String operationContext, CallingOperationStatus status) { - this.resultInfo = resultInfo; + AddParticipantResultEvent(CallingOperationResultDetails resultDetails, String operationContext, CallingOperationStatus status) { + this.resultDetails = resultDetails; this.operationContext = operationContext; this.status = status; } @@ -83,7 +83,7 @@ public static AddParticipantResultEvent deserialize(BinaryData eventData) { eventData.toObject(AddParticipantResultEventInternal.class); return new AddParticipantResultEvent( - ResultInfoConverter.convert(addParticipantResultEventInternal.getResultInfo()), + ResultDetailsConverter.convert(addParticipantResultEventInternal.getResultDetails()), addParticipantResultEventInternal.getOperationContext(), addParticipantResultEventInternal.getStatus()); } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/PlayAudioResultEvent.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/PlayAudioResultEvent.java index bcee843956146..5634ff235437f 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/PlayAudioResultEvent.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/PlayAudioResultEvent.java @@ -3,7 +3,7 @@ package com.azure.communication.callingserver.models.events; -import com.azure.communication.callingserver.implementation.converters.ResultInfoConverter; +import com.azure.communication.callingserver.implementation.converters.ResultDetailsConverter; import com.azure.communication.callingserver.implementation.models.PlayAudioResultEventInternal; import com.azure.communication.callingserver.models.CallingOperationResultDetails; import com.azure.communication.callingserver.models.CallingOperationStatus; @@ -16,7 +16,7 @@ public final class PlayAudioResultEvent extends CallingServerEventBase { /* * The result details. */ - private final CallingOperationResultDetails resultInfo; + private final CallingOperationResultDetails resultDetails; /* * The operation context. @@ -29,12 +29,12 @@ public final class PlayAudioResultEvent extends CallingServerEventBase { private final CallingOperationStatus status; /** - * Get the resultInfo property: The result details. + * Get the resultDetails property: The result details. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetails getResultInfo() { - return resultInfo; + public CallingOperationResultDetails getResultDetails() { + return resultDetails; } /** @@ -58,13 +58,13 @@ public CallingOperationStatus getStatus() { /** * Initializes a new instance of PlayAudioResultEvent. * - * @param resultInfo the resultInfo value. + * @param resultDetails the resultDetails value. * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation * @param status the status value. */ - PlayAudioResultEvent(CallingOperationResultDetails resultInfo, String operationContext, CallingOperationStatus status) { - this.resultInfo = resultInfo; + PlayAudioResultEvent(CallingOperationResultDetails resultDetails, String operationContext, CallingOperationStatus status) { + this.resultDetails = resultDetails; this.operationContext = operationContext; this.status = status; } @@ -83,7 +83,7 @@ public static PlayAudioResultEvent deserialize(BinaryData eventData) { eventData.toObject(PlayAudioResultEventInternal.class); return new PlayAudioResultEvent( - ResultInfoConverter.convert(playAudioResultEventInternal.getResultInfo()), + ResultDetailsConverter.convert(playAudioResultEventInternal.getResultDetails()), playAudioResultEventInternal.getOperationContext(), playAudioResultEventInternal.getStatus()); } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/TransferCallResultEvent.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/TransferCallResultEvent.java index 56b04e0d46da9..73f06ba8fee3f 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/TransferCallResultEvent.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/events/TransferCallResultEvent.java @@ -3,7 +3,7 @@ package com.azure.communication.callingserver.models.events; -import com.azure.communication.callingserver.implementation.converters.ResultInfoConverter; +import com.azure.communication.callingserver.implementation.converters.ResultDetailsConverter; import com.azure.communication.callingserver.implementation.models.TransferCallResultEventInternal; import com.azure.communication.callingserver.models.CallingOperationResultDetails; import com.azure.communication.callingserver.models.CallingOperationStatus; @@ -16,7 +16,7 @@ public final class TransferCallResultEvent { /* * The result details. */ - private final CallingOperationResultDetails resultInfo; + private final CallingOperationResultDetails resultDetails; /* * The operation context. @@ -29,12 +29,12 @@ public final class TransferCallResultEvent { private final CallingOperationStatus status; /** - * Get the resultInfo property: The result details. + * Get the resultDetails property: The result details. * - * @return the resultInfo value. + * @return the resultDetails value. */ - public CallingOperationResultDetails getResultInfo() { - return this.resultInfo; + public CallingOperationResultDetails getResultDetails() { + return this.resultDetails; } /** @@ -58,13 +58,13 @@ public CallingOperationStatus getStatus() { /** * Initializes a new instance of TransferCallResultEvent. * - * @param resultInfo the resultInfo value. + * @param resultDetails the resultDetails value. * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation * @param status the status value. */ - TransferCallResultEvent(CallingOperationResultDetails resultInfo, String operationContext, CallingOperationStatus status) { - this.resultInfo = resultInfo; + TransferCallResultEvent(CallingOperationResultDetails resultDetails, String operationContext, CallingOperationStatus status) { + this.resultDetails = resultDetails; this.operationContext = operationContext; this.status = status; } @@ -83,7 +83,7 @@ public static TransferCallResultEvent deserialize(BinaryData eventData) { eventData.toObject(TransferCallResultEventInternal.class); return new TransferCallResultEvent( - ResultInfoConverter.convert(transferCallResultEventInternal.getResultInfo()), + ResultDetailsConverter.convert(transferCallResultEventInternal.getResultDetails()), transferCallResultEventInternal.getOperationContext(), transferCallResultEventInternal.getStatus()); } diff --git a/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java b/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java index 3f302034590f9..dd71d7574b6f6 100644 --- a/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java +++ b/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java @@ -99,7 +99,7 @@ public void addParticipant() { // BEGIN: readme-sample-addParticipant CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier(""); String callbackUri = ""; - callConnection.addParticipant(thirdCallee, "ACS User 3", "", URI.create(callbackUri)); + callConnection.addParticipant(thirdCallee, "ACS User 3", ""); // END: readme-sample-addParticipant } diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncLiveTests.java index 1791bfe158c3d..f4d14a918fc2f 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncLiveTests.java @@ -159,8 +159,7 @@ public void runCreateAddRemoveHangupScenarioAsync(HttpClient httpClient) { AddParticipantResult addParticipantResult = callConnectionAsync.addParticipant( addedUser, null, - operationContext, - URI.create(CALLBACK_URI)).block(); + operationContext).block(); assert addParticipantResult != null; // Remove User @@ -210,8 +209,7 @@ public void runCreateAddRemoveHangupScenarioWithResponseAsync(HttpClient httpCli callConnectionAsync.addParticipantWithResponse( addedUser, null, - operationContext, - URI.create(CALLBACK_URI)).block(); + operationContext).block(); CallingServerTestUtils.validateAddParticipantResponse(addParticipantResponse); assert addParticipantResponse != null; diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncUnitTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncUnitTests.java index c5fcd1c3ea18e..473b3e72b21c9 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncUnitTests.java @@ -188,8 +188,7 @@ public void addParticipantAsync() { AddParticipantResult addParticipantResult = callConnectionAsync.addParticipant( user, "alternateCallerId", - OPERATION_CONTEXT, - CALLBACK_URI + OPERATION_CONTEXT ).block(); assertEquals(user.getId(), addParticipantResult.getParticipantId()); } @@ -206,8 +205,7 @@ public void addParticipantAsyncWithResponse() { Response addParticipantResultResponse = callConnectionAsync.addParticipantWithResponse( user, "alternateCallerId", - OPERATION_CONTEXT, - CALLBACK_URI + OPERATION_CONTEXT ).block(); assertEquals(202, addParticipantResultResponse.getStatusCode()); AddParticipantResult addParticipantResult = addParticipantResultResponse.getValue(); @@ -362,12 +360,11 @@ public void getParticipantAsync() { new SimpleEntry(generateGetParticipantResult(), 200) ))); - List getParticipantResult = callConnectionAsync.getParticipant(COMMUNICATION_USER).block(); + CallParticipant getParticipantResult = callConnectionAsync.getParticipant(COMMUNICATION_USER).block(); - assertEquals(1, getParticipantResult.size()); - assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.get(0).getParticipantId()); - assertEquals(COMMUNICATION_USER, getParticipantResult.get(0).getIdentifier()); - assertEquals(true, getParticipantResult.get(0).isMuted()); + assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.getParticipantId()); + assertEquals(COMMUNICATION_USER, getParticipantResult.getIdentifier()); + assertEquals(true, getParticipantResult.isMuted()); } @Test @@ -378,16 +375,15 @@ public void getParticipantAsyncWithResponse() { new SimpleEntry(generateGetParticipantResult(), 200) ))); - Response> getParticipantResultResponse = callConnectionAsync.getParticipantWithResponse( + Response getParticipantResultResponse = callConnectionAsync.getParticipantWithResponse( COMMUNICATION_USER ).block(); assertEquals(200, getParticipantResultResponse.getStatusCode()); - List getParticipantResult = getParticipantResultResponse.getValue(); - assertEquals(1, getParticipantResult.size()); - assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.get(0).getParticipantId()); - assertEquals(COMMUNICATION_USER, getParticipantResult.get(0).getIdentifier()); - assertEquals(true, getParticipantResult.get(0).isMuted()); + CallParticipant getParticipantResult = getParticipantResultResponse.getValue(); + assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.getParticipantId()); + assertEquals(COMMUNICATION_USER, getParticipantResult.getIdentifier()); + assertEquals(true, getParticipantResult.isMuted()); } @Test diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionLiveTests.java index da992fa13cbb2..afbaa0df25bac 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionLiveTests.java @@ -155,7 +155,7 @@ public void runCreateAddRemoveHangupScenario(HttpClient httpClient) { // Add User String operationContext = UUID.randomUUID().toString(); CommunicationUserIdentifier addUser = new CommunicationUserIdentifier("8:acs:" + AZURE_TENANT_ID + "_" + "0000000d-4093-ebc3-d6d4-4448220005fd"); - AddParticipantResult addParticipantResult = callConnection.addParticipant(addUser, null, operationContext, URI.create(CALLBACK_URI)); + AddParticipantResult addParticipantResult = callConnection.addParticipant(addUser, null, operationContext); assert addParticipantResult != null; // Remove User callConnection.removeParticipant(addUser); @@ -206,7 +206,6 @@ public void runCreateAddRemoveHangupScenarioWithResponse(HttpClient httpClient) addUser, null, operationContext, - URI.create(CALLBACK_URI), Context.NONE); CallingServerTestUtils.validateAddParticipantResponse(addParticipantResponse); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionUnitTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionUnitTests.java index 8e8d371b5f883..364bf823c8321 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionUnitTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionUnitTests.java @@ -187,8 +187,7 @@ public void addParticipant() { AddParticipantResult addParticipantResult = callConnection.addParticipant( user, "alternateCallerId", - OPERATION_CONTEXT, - CALLBACK_URI + OPERATION_CONTEXT ); assertEquals(user.getId(), addParticipantResult.getParticipantId()); } @@ -206,7 +205,6 @@ public void addParticipantWithResponse() { user, "alternateCallerId", OPERATION_CONTEXT, - CALLBACK_URI, Context.NONE ); assertEquals(202, addParticipantResultResponse.getStatusCode()); @@ -365,12 +363,11 @@ public void getParticipant() { new SimpleEntry(generateGetParticipantResult(), 200) ))); - List getParticipantResult = callConnection.getParticipant(COMMUNICATION_USER); + CallParticipant getParticipantResult = callConnection.getParticipant(COMMUNICATION_USER); - assertEquals(1, getParticipantResult.size()); - assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.get(0).getParticipantId()); - assertEquals(COMMUNICATION_USER, getParticipantResult.get(0).getIdentifier()); - assertEquals(true, getParticipantResult.get(0).isMuted()); + assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.getParticipantId()); + assertEquals(COMMUNICATION_USER, getParticipantResult.getIdentifier()); + assertEquals(true, getParticipantResult.isMuted()); } @Test @@ -381,17 +378,16 @@ public void getParticipantWithResponse() { new SimpleEntry(generateGetParticipantResult(), 200) ))); - Response> getParticipantResultResponse = callConnection.getParticipantWithResponse( + Response getParticipantResultResponse = callConnection.getParticipantWithResponse( COMMUNICATION_USER, Context.NONE ); assertEquals(200, getParticipantResultResponse.getStatusCode()); - List getParticipantResult = getParticipantResultResponse.getValue(); - assertEquals(1, getParticipantResult.size()); - assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.get(0).getParticipantId()); - assertEquals(COMMUNICATION_USER, getParticipantResult.get(0).getIdentifier()); - assertEquals(true, getParticipantResult.get(0).isMuted()); + CallParticipant getParticipantResult = getParticipantResultResponse.getValue(); + assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.getParticipantId()); + assertEquals(COMMUNICATION_USER, getParticipantResult.getIdentifier()); + assertEquals(true, getParticipantResult.isMuted()); } @Test diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerAsyncUnitTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerAsyncUnitTests.java index 273a5a3f23623..44b809ba28aa3 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerAsyncUnitTests.java @@ -227,15 +227,14 @@ public void getParticipantAsync() { )) ); - List getParticipantResult = callingServerAsyncClient.getParticipant( + CallParticipant getParticipantResult = callingServerAsyncClient.getParticipant( SERVERCALL_LOCATOR, COMMUNICATION_USER ).block(); - assertEquals(1, getParticipantResult.size()); - assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.get(0).getParticipantId()); - assertEquals(COMMUNICATION_USER, getParticipantResult.get(0).getIdentifier()); - assertEquals(true, getParticipantResult.get(0).isMuted()); + assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.getParticipantId()); + assertEquals(COMMUNICATION_USER, getParticipantResult.getIdentifier()); + assertEquals(true, getParticipantResult.isMuted()); } @Test @@ -248,17 +247,16 @@ public void getParticipantAsyncWithResponse() { )) ); - Response> getParticipantResultResponse = callingServerAsyncClient.getParticipantWithResponse( + Response getParticipantResultResponse = callingServerAsyncClient.getParticipantWithResponse( SERVERCALL_LOCATOR, COMMUNICATION_USER ).block(); assertEquals(200, getParticipantResultResponse.getStatusCode()); - List getParticipantResult = getParticipantResultResponse.getValue(); - assertEquals(1, getParticipantResult.size()); - assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.get(0).getParticipantId()); - assertEquals(COMMUNICATION_USER, getParticipantResult.get(0).getIdentifier()); - assertEquals(true, getParticipantResult.get(0).isMuted()); + CallParticipant getParticipantResult = getParticipantResultResponse.getValue(); + assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.getParticipantId()); + assertEquals(COMMUNICATION_USER, getParticipantResult.getIdentifier()); + assertEquals(true, getParticipantResult.isMuted()); } @Test @@ -477,9 +475,7 @@ public void redirectCallAsync() { callingServerAsyncClient.redirectCall( INCOMING_CALL_CONTEXT, - Arrays.asList(COMMUNICATION_USER), - URI.create("audioFileUri"), - TIMEOUT + COMMUNICATION_USER ).block(); } @@ -493,9 +489,7 @@ public void redirectCallAsyncWithResponse() { Response redirectCallResponse = callingServerAsyncClient.redirectCallWithResponse( INCOMING_CALL_CONTEXT, - Arrays.asList(COMMUNICATION_USER), - URI.create("audioFileUri"), - TIMEOUT + COMMUNICATION_USER ).block(); assertEquals(202, redirectCallResponse.getStatusCode()); @@ -511,7 +505,6 @@ public void rejectCallAsync() { callingServerAsyncClient.rejectCall( INCOMING_CALL_CONTEXT, - URI.create("audioFileUri"), CallRejectReason.BUSY ).block(); } @@ -526,7 +519,6 @@ public void rejectCallAsyncWithResponse() { Response rejectCallResponse = callingServerAsyncClient.rejectCallWithResponse( INCOMING_CALL_CONTEXT, - URI.create("audioFileUri"), CallRejectReason.BUSY ).block(); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerResponseMocker.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerResponseMocker.java index 5dff6c3a6c0ba..0b6de23182588 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerResponseMocker.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerResponseMocker.java @@ -70,12 +70,10 @@ public static String generateAddParticipantResult(String participantId) { } public static String generateGetParticipantResult() { - List result = new ArrayList<>(); - CallParticipantInternal participant = new CallParticipantInternal() + CallParticipantInternal result = new CallParticipantInternal() .setParticipantId(NEW_PARTICIPANT_ID) .setIdentifier(CommunicationIdentifierConverter.convert(COMMUNICATION_USER)) .setIsMuted(true); - result.add(participant); return serializeObject(result); } @@ -124,7 +122,7 @@ public static String generatePlayAudioResult() { .setOperationContext(OPERATION_CONTEXT) .setOperationId(OPERATION_ID) .setStatus(CallingOperationStatus.COMPLETED) - .setResultInfo(new CallingOperationResultDetailsInternal().setCode(202).setSubcode(0).setMessage("message")); + .setResultDetails(new CallingOperationResultDetailsInternal().setCode(202).setSubcode(0).setMessage("message")); return serializeObject(result); } @@ -148,7 +146,7 @@ public static String generateTransferCallResult() { .setOperationContext(OPERATION_CONTEXT) .setOperationId(OPERATION_ID) .setStatus(CallingOperationStatus.COMPLETED) - .setResultInfo(new CallingOperationResultDetailsInternal().setCode(202).setSubcode(0).setMessage("message")); + .setResultDetails(new CallingOperationResultDetailsInternal().setCode(202).setSubcode(0).setMessage("message")); return serializeObject(result); } diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerUnitTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerUnitTests.java index 64d0b0f9e14f5..56b3a5ce29e9d 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerUnitTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerUnitTests.java @@ -244,15 +244,14 @@ public void getParticipant() { )) ); - List getParticipantResult = callingServerClient.getParticipant( + CallParticipant getParticipantResult = callingServerClient.getParticipant( SERVERCALL_LOCATOR, COMMUNICATION_USER ); - assertEquals(1, getParticipantResult.size()); - assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.get(0).getParticipantId()); - assertEquals(COMMUNICATION_USER, getParticipantResult.get(0).getIdentifier()); - assertEquals(true, getParticipantResult.get(0).isMuted()); + assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.getParticipantId()); + assertEquals(COMMUNICATION_USER, getParticipantResult.getIdentifier()); + assertEquals(true, getParticipantResult.isMuted()); } @Test @@ -265,18 +264,17 @@ public void getParticipantWithResponse() { )) ); - Response> getParticipantResultResponse = callingServerClient.getParticipantWithResponse( + Response getParticipantResultResponse = callingServerClient.getParticipantWithResponse( SERVERCALL_LOCATOR, COMMUNICATION_USER, Context.NONE ); assertEquals(200, getParticipantResultResponse.getStatusCode()); - List getParticipantResult = getParticipantResultResponse.getValue(); - assertEquals(1, getParticipantResult.size()); - assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.get(0).getParticipantId()); - assertEquals(COMMUNICATION_USER, getParticipantResult.get(0).getIdentifier()); - assertEquals(true, getParticipantResult.get(0).isMuted()); + CallParticipant getParticipantResult = getParticipantResultResponse.getValue(); + assertEquals(NEW_PARTICIPANT_ID, getParticipantResult.getParticipantId()); + assertEquals(COMMUNICATION_USER, getParticipantResult.getIdentifier()); + assertEquals(true, getParticipantResult.isMuted()); } @Test @@ -504,9 +502,7 @@ public void redirectCall() { callingServerClient.redirectCall( INCOMING_CALL_CONTEXT, - Arrays.asList(COMMUNICATION_USER), - URI.create("audioFileUri"), - TIMEOUT + COMMUNICATION_USER ); } @@ -520,9 +516,7 @@ public void redirectCallWithResponse() { Response redirectCallResponse = callingServerClient.redirectCallWithResponse( INCOMING_CALL_CONTEXT, - Arrays.asList(COMMUNICATION_USER), - URI.create("audioFileUri"), - TIMEOUT, + COMMUNICATION_USER, Context.NONE ); @@ -539,7 +533,6 @@ public void rejectCall() { callingServerClient.rejectCall( INCOMING_CALL_CONTEXT, - URI.create("audioFileUri"), CallRejectReason.BUSY ); } @@ -554,7 +547,6 @@ public void rejectCallWithResponse() { Response rejectCallResponse = callingServerClient.rejectCallWithResponse( INCOMING_CALL_CONTEXT, - URI.create("audioFileUri"), CallRejectReason.BUSY, Context.NONE ); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/EventTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/EventTests.java index a752f4bcfb55b..c3e78ea63909f 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/EventTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/EventTests.java @@ -68,7 +68,7 @@ public void addParticipantResultEventTest() throws JsonProcessingException { new AddParticipantResultEventInternal() .setOperationContext(operationContext) .setStatus(CallingOperationStatus.COMPLETED) - .setResultInfo(new CallingOperationResultDetailsInternal().setCode(100).setSubcode(200).setMessage(message)); + .setResultDetails(new CallingOperationResultDetailsInternal().setCode(100).setSubcode(200).setMessage(message)); BinaryData binaryData = getBinaryData(internalEvent); AddParticipantResultEvent event = @@ -77,10 +77,10 @@ public void addParticipantResultEventTest() throws JsonProcessingException { assertNotNull(event); assertEquals(event.getOperationContext(), operationContext); assertEquals(event.getStatus(), CallingOperationStatus.COMPLETED); - assertNotNull(event.getResultInfo()); - assertEquals(event.getResultInfo().getCode(), 100); - assertEquals(event.getResultInfo().getSubcode(), 200); - assertEquals(event.getResultInfo().getMessage(), message); + assertNotNull(event.getResultDetails()); + assertEquals(event.getResultDetails().getCode(), 100); + assertEquals(event.getResultDetails().getSubcode(), 200); + assertEquals(event.getResultDetails().getMessage(), message); } @Test @@ -91,7 +91,7 @@ public void transferCallResultEventTest() throws JsonProcessingException { new TransferCallResultEventInternal() .setOperationContext(operationContext) .setStatus(CallingOperationStatus.COMPLETED) - .setResultInfo(new CallingOperationResultDetailsInternal().setCode(100).setSubcode(200).setMessage(message)); + .setResultDetails(new CallingOperationResultDetailsInternal().setCode(100).setSubcode(200).setMessage(message)); BinaryData binaryData = getBinaryData(internalEvent); TransferCallResultEvent event = @@ -100,10 +100,10 @@ public void transferCallResultEventTest() throws JsonProcessingException { assertNotNull(event); assertEquals(event.getOperationContext(), operationContext); assertEquals(event.getStatus(), CallingOperationStatus.COMPLETED); - assertNotNull(event.getResultInfo()); - assertEquals(event.getResultInfo().getCode(), 100); - assertEquals(event.getResultInfo().getSubcode(), 200); - assertEquals(event.getResultInfo().getMessage(), message); + assertNotNull(event.getResultDetails()); + assertEquals(event.getResultDetails().getCode(), 100); + assertEquals(event.getResultDetails().getSubcode(), 200); + assertEquals(event.getResultDetails().getMessage(), message); } @Test @@ -136,7 +136,7 @@ public void playAudioResultEventTest() throws JsonProcessingException { new PlayAudioResultEventInternal() .setOperationContext(operationContext) .setStatus(CallingOperationStatus.COMPLETED) - .setResultInfo(new CallingOperationResultDetailsInternal().setCode(100).setSubcode(200).setMessage(message)); + .setResultDetails(new CallingOperationResultDetailsInternal().setCode(100).setSubcode(200).setMessage(message)); BinaryData binaryData = getBinaryData(internalEvent); PlayAudioResultEvent event = @@ -145,10 +145,10 @@ public void playAudioResultEventTest() throws JsonProcessingException { assertNotNull(event); assertEquals(event.getOperationContext(), operationContext); assertEquals(event.getStatus(), CallingOperationStatus.COMPLETED); - assertNotNull(event.getResultInfo()); - assertEquals(event.getResultInfo().getCode(), 100); - assertEquals(event.getResultInfo().getSubcode(), 200); - assertEquals(event.getResultInfo().getMessage(), message); + assertNotNull(event.getResultDetails()); + assertEquals(event.getResultDetails().getCode(), 100); + assertEquals(event.getResultDetails().getSubcode(), 200); + assertEquals(event.getResultDetails().getMessage(), message); } @Test diff --git a/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallConnectionLiveTests.runCreatePlayCancelHangupScenarioWithResponse[1].json b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallConnectionLiveTests.runCreatePlayCancelHangupScenarioWithResponse[1].json index c092b5eafb484..84560521a28d2 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallConnectionLiveTests.runCreatePlayCancelHangupScenarioWithResponse[1].json +++ b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallConnectionLiveTests.runCreatePlayCancelHangupScenarioWithResponse[1].json @@ -35,7 +35,7 @@ "X-Azure-Ref" : "0tNZwYQAAAACg7oVRLfNhR4kepVaZ73SaV1NURURHRTA4MTYAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "StatusCode" : "202", "X-Microsoft-Skype-Chain-ID" : "f5f53191-7308-4bea-b7d6-14f34277fecb", - "Body" : "{\"operationId\":\"99460293-eba8-4a5a-88c5-c6db172cd898\",\"status\":\"running\",\"operationContext\":\"b0532558-98a2-4b10-8f80-489c552f2210\",\"resultInfo\":{\"code\":500,\"subcode\":9999,\"message\":\"FileValidationFailed\"}}", + "Body" : "{\"operationId\":\"99460293-eba8-4a5a-88c5-c6db172cd898\",\"status\":\"running\",\"operationContext\":\"b0532558-98a2-4b10-8f80-489c552f2210\",\"resultDetails\":{\"code\":500,\"subcode\":9999,\"message\":\"FileValidationFailed\"}}", "x-ms-client-request-id" : "af36e9e5-bfca-4449-aba5-79e45b19e8d8", "Date" : "Thu, 21 Oct 2021 02:55:49 GMT", "Content-Type" : "application/json; charset=utf-8" diff --git a/sdk/communication/azure-communication-callingserver/swagger/README.md b/sdk/communication/azure-communication-callingserver/swagger/README.md index 53043a2565392..d6066440e4e0a 100644 --- a/sdk/communication/azure-communication-callingserver/swagger/README.md +++ b/sdk/communication/azure-communication-callingserver/swagger/README.md @@ -33,7 +33,7 @@ To update generated files for calling service, run the following command ``` yaml tag: package-2021-11-15-preview require: - - https://raw.githubusercontent.com/navali-msft/azure-rest-api-specs/f63c517df5083d1f3d044277bac15c6b1ed2b060/specification/communication/data-plane/CallingServer/readme.md + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2a48a447a8e423a16658262b48b63335e7fadb01/specification/communication/data-plane/CallingServer/readme.md java: true output-folder: ..\ license-header: MICROSOFT_MIT_SMALL