diff --git a/sdk/communication/azure-communication-callingserver/CHANGELOG.md b/sdk/communication/azure-communication-callingserver/CHANGELOG.md index 8661754c510b..b8532b23f486 100644 --- a/sdk/communication/azure-communication-callingserver/CHANGELOG.md +++ b/sdk/communication/azure-communication-callingserver/CHANGELOG.md @@ -7,10 +7,10 @@ This is a Public Preview version, so breaking changes are possible in subsequent ### Features Added - Create outbound call to an Azure Communication Service user or a phone number. -- Hangup and delete the existing call. +- Hangup the existing call. - Play audio in the call. - Outbound APIs for call recording including start, pause, resume and stop. -- Subscribe to tone and receive tone selection via events. +- Subscribe to tone and receive tone selections via events. - Invite and remove participants from the call. 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 6b5ca86d2885..c7efc1b675e5 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 @@ -125,9 +125,9 @@ public Response playAudioWithResponse( } /** - * Disconnect the current caller in a Group-call or end a p2p-call. + * Disconnect the current caller in a group-call or end a p2p-call. * - * @return response for a successful Hangup request. + * @return response for a successful hangup request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Void hangup() { @@ -135,10 +135,10 @@ public Void hangup() { } /** - * Disconnect the current caller in a Group-call or end a p2p-call. + * Disconnect the current caller in a group-call or end a p2p-call. * * @param context A {@link Context} representing the request context. - * @return response for a successful HangupCall request. + * @return response for a successful hangup request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response hangupWithResponse(Context context) { @@ -150,7 +150,7 @@ public Response hangupWithResponse(Context context) { * * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation - * @return response for a successful CancelMediaOperations request. + * @return response for a successful cancel all media operations request. */ @ServiceMethod(returns = ReturnType.SINGLE) public CancelAllMediaOperationsResult cancelAllMediaOperations(String operationContext) { @@ -163,7 +163,7 @@ public CancelAllMediaOperationsResult cancelAllMediaOperations(String operationC * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation * @param context A {@link Context} representing the request context. - * @return response for a successful CancelMediaOperations request. + * @return response for a successful cancel all media operations request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelAllMediaOperationsWithResponse( @@ -179,7 +179,7 @@ public Response cancelAllMediaOperationsWithResp * @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 - * @return response for a successful addParticipant request. + * @return response for a successful add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Void addParticipant( @@ -197,7 +197,7 @@ public Void addParticipant( * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation * @param context A {@link Context} representing the request context. - * @return response for a successful addParticipant request. + * @return response for a successful add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response addParticipantWithResponse( @@ -213,7 +213,7 @@ public Response addParticipantWithResponse( * Remove a participant from the call. * * @param participantId Participant id. - * @return response for a successful removeParticipant request. + * @return response for a successful remove participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Void removeParticipant(String participantId) { @@ -225,7 +225,7 @@ public Void removeParticipant(String participantId) { * * @param participantId Participant id. * @param context A {@link Context} representing the request context. - * @return response for a successful removeParticipant request. + * @return response for a successful remove participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response removeParticipantWithResponse(String participantId, Context context) { 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 faa4f1cf868d..2db6c38022df 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 @@ -248,7 +248,7 @@ Mono> playAudioWithResponseInternal( /** * Hangup a call. * - * @return response for a successful Hangup request. + * @return response for a successful hangup request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono hangup() { @@ -263,7 +263,7 @@ public Mono hangup() { /** * Hangup a call. * - * @return response for a successful Hangup request. + * @return response for a successful hangup request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> hangupWithResponse() { @@ -287,7 +287,7 @@ Mono> hangupWithResponse(Context context) { * * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation - * @return the response payload of the cancel media operations. + * @return the response payload of the cancel all media operations. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAllMediaOperations(String operationContext) { @@ -307,7 +307,7 @@ public Mono cancelAllMediaOperations(String oper * * @param operationContext The value to identify context of the operation. This is used to co-relate other * communications related to this operation - * @return the response payload of the cancel media operations. + * @return the response payload of the cancel all media operations. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> cancelAllMediaOperationsWithResponse(String operationContext) { @@ -322,7 +322,8 @@ Mono> cancelAllMediaOperationsWithRespo request.setOperationContext(operationContext); return withContext(contextValue -> { contextValue = context == null ? contextValue : context; - return callConnectionInternal.cancelAllMediaOperationsWithResponseAsync(callConnectionId, request, contextValue) + return callConnectionInternal + .cancelAllMediaOperationsWithResponseAsync(callConnectionId, request, contextValue) .onErrorMap(CommunicationErrorException.class, CallingServerErrorConverter::translateException) .map(response -> new SimpleResponse<>(response, CancelAllMediaOperationsResultConverter.convert(response.getValue()))); @@ -337,8 +338,9 @@ Mono> cancelAllMediaOperationsWithRespo * * @param participant Invited participant. * @param alternateCallerId The phone number to use when adding a phone number participant. - * @param operationContext operationContext. - * @return response for a successful addParticipant request. + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation + * @return response for a successful add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono addParticipant( @@ -363,8 +365,9 @@ public Mono addParticipant( * * @param participant Invited participant. * @param alternateCallerId The phone number to use when adding a phone number participant. - * @param operationContext operationContext. - * @return response for a successful addParticipant request. + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation + * @return response for a successful add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addParticipantWithResponse( @@ -381,10 +384,13 @@ Mono> addParticipantWithResponse( Context context) { try { Objects.requireNonNull(participant, "'participant' cannot be null."); - InviteParticipantsRequest request = InviteParticipantRequestConverter.convert(participant, alternateCallerId, operationContext, null); + InviteParticipantsRequest request = + InviteParticipantRequestConverter + .convert(participant, alternateCallerId, operationContext, null); return withContext(contextValue -> { contextValue = context == null ? contextValue : context; - return callConnectionInternal.inviteParticipantsWithResponseAsync(callConnectionId, request, contextValue) + return callConnectionInternal + .inviteParticipantsWithResponseAsync(callConnectionId, request, contextValue) .onErrorMap(CommunicationErrorException.class, CallingServerErrorConverter::translateException); }); } catch (RuntimeException ex) { @@ -396,7 +402,7 @@ Mono> addParticipantWithResponse( * Remove a participant from the call. * * @param participantId Participant id. - * @return response for a successful removeParticipant request. + * @return response for a successful remove participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono removeParticipant(String participantId) { @@ -413,22 +419,20 @@ public Mono removeParticipant(String participantId) { * Remove a participant from the call. * * @param participantId Participant id. - * @return response for a successful removeParticipant request. + * @return response for a successful remove participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> removeParticipantWithResponse(String participantId) { return removeParticipantWithResponse(participantId, Context.NONE); } - /** - * Remove participant from the call. - */ Mono> removeParticipantWithResponse(String participantId, Context context) { try { Objects.requireNonNull(participantId, "'participantId' cannot be null."); return withContext(contextValue -> { contextValue = context == null ? contextValue : context; - return callConnectionInternal.removeParticipantWithResponseAsync(callConnectionId, participantId, contextValue) + return callConnectionInternal + .removeParticipantWithResponseAsync(callConnectionId, participantId, contextValue) .onErrorMap(CommunicationErrorException.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 805e908a7a11..d4cc6795e651 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 @@ -39,7 +39,7 @@ public final class CallingServerClient { } /** - * Create a Call Connection Request from source identity to targets identity. + * Create a call connection request from source identity to targets identity. * * @param source The source of the call. * @param targets The targets of the call. diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerClientBuilder.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerClientBuilder.java index f98d5a3b958c..27532e939d9b 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerClientBuilder.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallingServerClientBuilder.java @@ -111,8 +111,8 @@ public CallingServerClientBuilder credential(AzureKeyCredential keyCredential) { /** * Set connectionString to use * - * @param connectionString connection string to set endpoint and initialize AzureKeyCredential - * @return CallingServerClientBuilder + * @param connectionString connection string to set + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerClientBuilder connectionString(String connectionString) { Objects.requireNonNull(connectionString, "'connectionString' cannot be null."); @@ -124,7 +124,7 @@ public CallingServerClientBuilder connectionString(String connectionString) { * Sets the retry policy to use (using the RetryPolicy type). * * @param retryPolicy object to be applied - * @return CallingServerClientBuilder + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerClientBuilder retryPolicy(RetryPolicy retryPolicy) { this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); @@ -137,7 +137,7 @@ public CallingServerClientBuilder retryPolicy(RetryPolicy retryPolicy) { * * @param configuration Configuration store used to retrieve environment * configurations. - * @return the updated CallingServerClientBuilder object + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerClientBuilder configuration(Configuration configuration) { this.configuration = Objects.requireNonNull(configuration, "'configuration' cannot be null."); @@ -149,7 +149,7 @@ public CallingServerClientBuilder configuration(Configuration configuration) { * * @param logOptions The logging configuration to use when sending and receiving * HTTP requests/responses. - * @return the updated CallingServerClientBuilder object + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerClientBuilder httpLogOptions(HttpLogOptions logOptions) { this.httpLogOptions = Objects.requireNonNull(logOptions, "'logOptions' cannot be null."); @@ -180,7 +180,7 @@ public CallingServerClientBuilder serviceVersion(CallingServerClientBuilder vers * Set httpClient to use * * @param httpClient httpClient to use, overridden by the pipeline field. - * @return CallingServerClientBuilder + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerClientBuilder httpClient(HttpClient httpClient) { this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); @@ -191,9 +191,8 @@ public CallingServerClientBuilder httpClient(HttpClient httpClient) { * Apply additional HttpPipelinePolicy * * @param customPolicy HttpPipelinePolicy object to be applied after - * AzureKeyCredentialPolicy, UserAgentPolicy, RetryPolicy, - * and CookiePolicy - * @return CallingServerClientBuilder + * AzureKeyCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { this.customPolicies.add(Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null.")); @@ -205,7 +204,7 @@ public CallingServerClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { * UserAgentPolicy, RetryPolicy, and CookiePolicy. Additional HttpPolicies * specified by additionalPolicies will be applied after them * - * @return CallingServerAsyncClient instance + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerAsyncClient buildAsyncClient() { return new CallingServerAsyncClient(createServiceImpl()); @@ -216,7 +215,7 @@ public CallingServerAsyncClient buildAsyncClient() { * RetryPolicy, and CookiePolicy. Additional HttpPolicies specified by * additionalPolicies will be applied after them * - * @return CallingServerClient instance + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerClient buildClient() { return new CallingServerClient(buildAsyncClient()); @@ -276,7 +275,7 @@ private AzureCommunicationCallingServerServiceImpl createServiceImpl() { * user-agent string, headers, etc. * * @param clientOptions object to be applied - * @return CallingServerClientBuilder + * @return The updated {@link CallingServerClientBuilder} object. */ public CallingServerClientBuilder clientOptions(ClientOptions clientOptions) { this.clientOptions = clientOptions; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ContentDownloader.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ContentDownloader.java index e892a5c175a8..6ee8317fe7f1 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ContentDownloader.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ContentDownloader.java @@ -49,8 +49,11 @@ class ContentDownloader { this.httpPipeline = httpPipeline; } - Mono> downloadToStreamWithResponse(String sourceEndpoint, OutputStream destinationStream, - HttpRange httpRange, Context context) { + Mono> downloadToStreamWithResponse( + String sourceEndpoint, + OutputStream destinationStream, + HttpRange httpRange, + Context context) { return downloadStreamWithResponse(sourceEndpoint, httpRange, context) .flatMap(response -> response.getValue().reduce(destinationStream, (outputStream, buffer) -> { try { @@ -63,8 +66,10 @@ Mono> downloadToStreamWithResponse(String sourceEndpoint, OutputS response.getHeaders(), null))); } - Mono>> downloadStreamWithResponse(String sourceEndpoint, HttpRange httpRange, - Context context) { + Mono>> downloadStreamWithResponse( + String sourceEndpoint, + HttpRange httpRange, + Context context) { Mono httpResponse = makeDownloadRequest(sourceEndpoint, httpRange, context); return httpResponse.map(response -> { Flux result = getFluxStream(response, sourceEndpoint, httpRange, context); @@ -73,8 +78,11 @@ Mono>> downloadStreamWithResponse(String sourceEndpoin }); } - Mono> downloadToFileWithResponse(String sourceEndpoint, AsynchronousFileChannel destinationFile, - ParallelDownloadOptions parallelDownloadOptions, Context context) { + Mono> downloadToFileWithResponse( + String sourceEndpoint, + AsynchronousFileChannel destinationFile, + ParallelDownloadOptions parallelDownloadOptions, + Context context) { Lock progressLock = new ReentrantLock(); AtomicLong totalProgress = new AtomicLong(0); @@ -100,8 +108,11 @@ Mono> downloadToFileWithResponse(String sourceEndpoint, Asynchron }); } - private Flux getFluxStream(HttpResponse httpResponse, String sourceEndpoint, HttpRange httpRange, - Context context) { + private Flux getFluxStream( + HttpResponse httpResponse, + String sourceEndpoint, + HttpRange httpRange, + Context context) { return FluxUtil.createRetriableDownloadFlux( () -> getResponseBody(httpResponse), (Throwable throwable, Long aLong) -> { @@ -150,9 +161,10 @@ private String formatExceptionMessage(HttpResponse httpResponse) { return String.format("Service Request failed!%nStatus: %s", httpResponse.getStatusCode()); } - private Mono makeDownloadRequest(String sourceEndpoint, - HttpRange httpRange, - Context context) { + private Mono makeDownloadRequest( + String sourceEndpoint, + HttpRange httpRange, + Context context) { HttpRequest request = getHttpRequest(sourceEndpoint, httpRange); URL urlToSignWith = getUrlToSignRequestWith(sourceEndpoint); @@ -193,7 +205,6 @@ private HttpRequest getHttpRequest(String sourceEndpoint, HttpRange httpRange) { private Mono>>> downloadFirstChunk( ParallelDownloadOptions parallelDownloadOptions, Function>>> downloader) { - return downloader.apply(new HttpRange(0, parallelDownloadOptions.getBlockSizeLong())) .subscribeOn(Schedulers.boundedElastic()) .flatMap(response -> { @@ -220,10 +231,13 @@ private int calculateNumBlocks(long dataSize, long blockLength) { return numBlocks; } - private Flux downloadChunk(Integer chunkNum, Response> initialResponse, - ParallelDownloadOptions parallelDownloadOptions, long newCount, - Function>>> downloader, - Function>, Flux> returnTransformer) { + private Flux downloadChunk( + Integer chunkNum, + Response> initialResponse, + ParallelDownloadOptions parallelDownloadOptions, + long newCount, + Function>>> downloader, + Function>, Flux> returnTransformer) { if (chunkNum == 0) { return returnTransformer.apply(initialResponse); } @@ -240,9 +254,13 @@ private Flux downloadChunk(Integer chunkNum, Response> i .flatMapMany(returnTransformer); } - private static Mono writeBodyToFile(Response> response, AsynchronousFileChannel file, - long chunkNum, ParallelDownloadOptions parallelDownloadOptions, - Lock progressLock, AtomicLong totalProgress) { + private static Mono writeBodyToFile( + Response> response, + AsynchronousFileChannel file, + long chunkNum, + ParallelDownloadOptions parallelDownloadOptions, + Lock progressLock, + AtomicLong totalProgress) { // Extract the body. Flux data = response.getValue(); diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ServerCall.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ServerCall.java index 917d8a189a98..653db215187f 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ServerCall.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ServerCall.java @@ -38,8 +38,9 @@ public String getServerCallId() { * @param participant Invited participant. * @param callBackUri callBackUri to get notifications. * @param alternateCallerId The phone number to use when adding a phone number participant. - * @param operationContext operationContext. - * @return response for a successful addParticipant request. + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation + * @return response for a successful add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Void addParticipant( @@ -56,9 +57,10 @@ public Void addParticipant( * @param participant Invited participant. * @param callBackUri callBackUri to get notifications. * @param alternateCallerId The phone number to use when adding a phone number participant. - * @param operationContext operationContext. + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation * @param context A {@link Context} representing the request context. - * @return response for a successful addParticipant request. + * @return response for a successful add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response addParticipantWithResponse( @@ -79,7 +81,7 @@ public Response addParticipantWithResponse( * Remove a participant from the call. * * @param participantId Participant id. - * @return response for a successful removeParticipant request. + * @return response for a successful remove participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Void removeParticipant(String participantId) { @@ -91,7 +93,7 @@ public Void removeParticipant(String participantId) { * * @param participantId Participant id. * @param context A {@link Context} representing the request context. - * @return response for a successful removeParticipant request. + * @return response for a successful remove participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response removeParticipantWithResponse(String participantId, Context context) { @@ -102,7 +104,7 @@ public Response removeParticipantWithResponse(String participantId, Contex * Start recording * * @param recordingStateCallbackUri The uri to send state change callbacks. - * @return result for a successful startRecording request. + * @return result for a successful start recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public StartCallRecordingResult startRecording(String recordingStateCallbackUri) { @@ -114,7 +116,7 @@ public StartCallRecordingResult startRecording(String recordingStateCallbackUri) * * @param recordingStateCallbackUri The uri to send state change callbacks. * @param context A {@link Context} representing the request context. - * @return result for a successful startRecording request. + * @return result for a successful start recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response startRecordingWithResponse( @@ -127,7 +129,7 @@ public Response startRecordingWithResponse( * Stop recording * * @param recordingId The recording id to stop. - * @return response for a successful stopRecording request. + * @return response for a successful stop recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Void stopRecording(String recordingId) { @@ -139,7 +141,7 @@ public Void stopRecording(String recordingId) { * * @param recordingId The recording id to stop. * @param context A {@link Context} representing the request context. - * @return response for a successful stopRecording request. + * @return response for a successful stop recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response stopRecordingWithResponse(String recordingId, Context context) { @@ -150,7 +152,7 @@ public Response stopRecordingWithResponse(String recordingId, Context cont * Pause recording * * @param recordingId The recording id to stop. - * @return response for a successful pauseRecording request. + * @return response for a successful pause recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Void pauseRecording(String recordingId) { @@ -162,7 +164,7 @@ public Void pauseRecording(String recordingId) { * * @param recordingId The recording id to stop. * @param context A {@link Context} representing the request context. - * @return response for a successful pauseRecording request. + * @return response for a successful pause recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response pauseRecordingWithResponse(String recordingId, Context context) { @@ -173,7 +175,7 @@ public Response pauseRecordingWithResponse(String recordingId, Context con * Resume recording * * @param recordingId The recording id to stop. - * @return response for a successful resumeRecording request. + * @return response for a successful resume recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Void resumeRecording(String recordingId) { @@ -185,7 +187,7 @@ public Void resumeRecording(String recordingId) { * * @param recordingId The recording id to stop. * @param context A {@link Context} representing the request context. - * @return response for a successful resumeRecording request. + * @return response for a successful resume recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response resumeRecordingWithResponse(String recordingId, Context context) { @@ -196,7 +198,7 @@ public Response resumeRecordingWithResponse(String recordingId, Context co * Get recording state * * @param recordingId The recording id to stop. - * @return response for a successful getRecordingState request. + * @return response for a successful get recording state request. */ @ServiceMethod(returns = ReturnType.SINGLE) public CallRecordingStateResult getRecordingState(String recordingId) { @@ -208,7 +210,7 @@ public CallRecordingStateResult getRecordingState(String recordingId) { * * @param recordingId The recording id to stop. * @param context A {@link Context} representing the request context. - * @return response for a successful getRecordingState request. + * @return response for a successful get recording state request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRecordingStateWithResponse(String recordingId, Context context) { @@ -223,7 +225,8 @@ public Response getRecordingStateWithResponse(String r * be mono (single-channel), 16-bit samples with a 16,000 (16KHz) sampling rate. * @param audioFileId An id for the media in the AudioFileUri, using which we cache the media. * @param callbackUri The callback Uri to receive PlayAudio status notifications. - * @param operationContext The value to identify context of the operation. + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation * @return the response payload for play audio operation. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -257,7 +260,8 @@ public PlayAudioResult playAudio(String audioFileUri, PlayAudioOptions playAudio * be mono (single-channel), 16-bit samples with a 16,000 (16KHz) sampling rate. * @param audioFileId An id for the media in the AudioFileUri, using which we cache the media. * @param callbackUri The callback Uri to receive PlayAudio status notifications. - * @param operationContext The value to identify context of the operation. + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation * @param context A {@link Context} representing the request context. * @return the response payload for play audio operation. */ diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ServerCallAsync.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ServerCallAsync.java index 02862a8a928d..60b20e80b20f 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ServerCallAsync.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ServerCallAsync.java @@ -62,7 +62,7 @@ public String getServerCallId() { * @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 - * @return response for a successful addParticipant request. + * @return response for a successful add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono addParticipant( @@ -92,7 +92,7 @@ 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 - * @return response for a successful addParticipant request. + * @return response for a successful add participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addParticipantWithResponse( @@ -135,7 +135,7 @@ Mono> addParticipantWithResponse( * Remove a participant from the call. * * @param participantId Participant id. - * @return response for a successful removeParticipant request. + * @return response for a successful remove participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono removeParticipant(String participantId) { @@ -152,7 +152,7 @@ public Mono removeParticipant(String participantId) { * Remove a participant from the call. * * @param participantId Participant id. - * @return response for a successful removeParticipant request. + * @return response for a successful remove participant request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> removeParticipantWithResponse(String participantId) { @@ -178,7 +178,7 @@ Mono> removeParticipantWithResponse(String participantId, Context * * @param recordingStateCallbackUri The uri to send state change callbacks. * @throws InvalidParameterException is recordingStateCallbackUri is absolute uri. - * @return response for a successful startRecording request. + * @return response for a successful start recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startRecording(String recordingStateCallbackUri) { @@ -204,7 +204,7 @@ public Mono startRecording(String recordingStateCallba * * @param recordingStateCallbackUri The uri to send state change callbacks. * @throws InvalidParameterException is recordingStateCallbackUri is absolute uri. - * @return response for a successful startRecording request. + * @return response for a successful start recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> startRecordingWithResponse(String recordingStateCallbackUri) { @@ -240,7 +240,7 @@ Mono> startRecordingWithResponse( * Stop recording * * @param recordingId The recording id to stop. - * @return response for a successful stopRecording request. + * @return response for a successful stop recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stopRecording(String recordingId) { @@ -257,7 +257,7 @@ public Mono stopRecording(String recordingId) { * Stop recording * * @param recordingId The recording id to stop. - * @return response for a successful stopRecording request. + * @return response for a successful stop recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stopRecordingWithResponse(String recordingId) { @@ -282,7 +282,7 @@ Mono> stopRecordingWithResponse(String recordingId, Context conte * Pause recording * * @param recordingId The recording id to stop. - * @return response for a successful pauseRecording request. + * @return response for a successful pause recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono pauseRecording(String recordingId) { @@ -299,7 +299,7 @@ public Mono pauseRecording(String recordingId) { * Pause recording * * @param recordingId The recording id to stop. - * @return response for a successful pauseRecording request. + * @return response for a successful pause recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> pauseRecordingWithResponse(String recordingId) { @@ -324,7 +324,7 @@ Mono> pauseRecordingWithResponse(String recordingId, Context cont * Resume recording * * @param recordingId The recording id to stop. - * @return response for a successful resumeRecording request. + * @return response for a successful resume recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono resumeRecording(String recordingId) { @@ -341,7 +341,7 @@ public Mono resumeRecording(String recordingId) { * Resume recording * * @param recordingId The recording id to stop. - * @return response for a successful resumeRecording request. + * @return response for a successful resume recording request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> resumeRecordingWithResponse(String recordingId) { @@ -366,7 +366,7 @@ Mono> resumeRecordingWithResponse(String recordingId, Context con * Get recording state * * @param recordingId The recording id to stop. - * @return response for a successful getRecordingState request. + * @return response for a successful get recording state request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getRecordingState(String recordingId) { @@ -384,7 +384,7 @@ public Mono getRecordingState(String recordingId) { * Get recording state * * @param recordingId The recording id to stop. - * @return response for a successful getRecordingState request. + * @return response for a successful get recording state request. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getRecordingStateWithResponse(String recordingId) { @@ -525,9 +525,12 @@ public Mono> playAudioWithResponse( * @return the response payload for play audio operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> playAudioWithResponse(String audioFileUri, PlayAudioOptions playAudioOptions) { + public Mono> playAudioWithResponse( + String audioFileUri, + PlayAudioOptions playAudioOptions) { return playAudioWithResponseInternal(audioFileUri, playAudioOptions, Context.NONE); } + Mono> playAudioWithResponseInternal( String audioFileUri, String audioFileId, diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/CallConnectionRequestConverter.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/CallConnectionRequestConverter.java index 130a54a48fc7..49d5357d607b 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/CallConnectionRequestConverter.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/converters/CallConnectionRequestConverter.java @@ -32,13 +32,13 @@ public static CreateCallRequest convert( return null; } - CreateCallRequest createCallRequest - = new CreateCallRequest() - .setSource(CommunicationIdentifierConverter.convert(source)) - .setTargets(new ArrayList<>(Arrays.asList(targets)) - .stream() - .map(CommunicationIdentifierConverter::convert) - .collect(Collectors.toList())); + CreateCallRequest createCallRequest = + new CreateCallRequest() + .setSource(CommunicationIdentifierConverter.convert(source)) + .setTargets(new ArrayList<>(Arrays.asList(targets)) + .stream() + .map(CommunicationIdentifierConverter::convert) + .collect(Collectors.toList())); if (createCallOptions == null) { return createCallRequest;