diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallAsyncClient.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallAsyncClient.java index 1c720ba221908..b9192ea25eac1 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallAsyncClient.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallAsyncClient.java @@ -18,14 +18,13 @@ import com.azure.communication.callingserver.implementation.models.CallModality; import com.azure.communication.callingserver.implementation.models.CancelAllMediaOperationsRequest; import com.azure.communication.callingserver.implementation.models.CreateCallRequestInternal; -import com.azure.communication.callingserver.implementation.models.CreateCallResponse; import com.azure.communication.callingserver.implementation.models.EventSubscriptionType; import com.azure.communication.callingserver.implementation.models.InviteParticipantsRequest; import com.azure.communication.callingserver.implementation.models.PhoneNumberIdentifierModel; import com.azure.communication.callingserver.implementation.models.PlayAudioRequest; import com.azure.communication.callingserver.models.CancelAllMediaOperationsResponse; import com.azure.communication.callingserver.models.CreateCallOptions; -import com.azure.communication.callingserver.models.CreateCallResult; +import com.azure.communication.callingserver.models.CreateCallResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; @@ -59,7 +58,7 @@ public final class CallAsyncClient { * @return response for a successful CreateCall request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createCall(CommunicationIdentifier source, Iterable targets, + public Mono createCall(CommunicationIdentifier source, Iterable targets, CreateCallOptions createCallOptions) { try { Objects.requireNonNull(source, "'source' cannot be null."); @@ -68,8 +67,7 @@ public Mono createCall(CommunicationIdentifier source, Iterabl CreateCallRequestInternal request = createCreateCallRequest(source, targets, createCallOptions); return this.callClient.createCallAsync(request).flatMap((CreateCallResponse response) -> { - CreateCallResult createCallResult = convertCreateCallWithResponse(response); - return Mono.just(createCallResult); + return Mono.just(response); }); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -85,12 +83,12 @@ public Mono createCall(CommunicationIdentifier source, Iterabl * @return response for a successful CreateCall request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createCallWithResponse(CommunicationIdentifier source, + public Mono> createCallWithResponse(CommunicationIdentifier source, Iterable targets, CreateCallOptions createCallOptions) { return createCallWithResponse(source, targets, createCallOptions, null); } - Mono> createCallWithResponse(CommunicationIdentifier source, + Mono> createCallWithResponse(CommunicationIdentifier source, Iterable targets, CreateCallOptions createCallOptions, Context context) { try { Objects.requireNonNull(source, "'source' cannot be null."); @@ -105,8 +103,7 @@ Mono> createCallWithResponse(CommunicationIdentifier } return this.callClient.createCallWithResponseAsync(request) .flatMap((Response response) -> { - CreateCallResult createCallResult = convertCreateCallWithResponse(response.getValue()); - return Mono.just(new SimpleResponse<>(response, createCallResult)); + return Mono.just(new SimpleResponse<>(response, response.getValue())); }); }); } catch (RuntimeException ex) { @@ -138,7 +135,7 @@ public Mono playAudio(String callId, String audioFileUri, boo } } - public Mono playAudio(String callId, PlayAudioRequest request) { + Mono playAudio(String callId, PlayAudioRequest request) { try { Objects.requireNonNull(callId, "'callId' cannot be null."); Objects.requireNonNull(request, "'request' cannot be null."); @@ -376,7 +373,7 @@ Mono> addParticipantWithResponse( if (context != null) { contextValue = context; } - return this.callClient.inviteParticipantsWithResponseAsync(callId,request); + return this.callClient.inviteParticipantsWithResponseAsync(callId, request); }); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -459,8 +456,4 @@ private CreateCallRequestInternal createCreateCallRequest(CommunicationIdentifie return request; } - - private CreateCallResult convertCreateCallWithResponse(CreateCallResponse response) { - return new CreateCallResult().setCallLegId(response.getCallLegId()); - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallClient.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallClient.java index 1b16fda8c73e7..146d56cb85e59 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallClient.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallClient.java @@ -5,7 +5,7 @@ import com.azure.communication.callingserver.implementation.models.PlayAudioRequest; import com.azure.communication.callingserver.models.CancelAllMediaOperationsResponse; import com.azure.communication.callingserver.models.CreateCallOptions; -import com.azure.communication.callingserver.models.CreateCallResult; +import com.azure.communication.callingserver.models.CreateCallResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; @@ -34,7 +34,7 @@ public final class CallClient { * @return response for a successful CreateCall request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CreateCallResult createCall(CommunicationIdentifier source, Iterable targets, CreateCallOptions createCallOptions) { + public CreateCallResponse createCall(CommunicationIdentifier source, Iterable targets, CreateCallOptions createCallOptions) { return callAsyncClient.createCall(source, targets, createCallOptions).block(); } @@ -48,7 +48,7 @@ public CreateCallResult createCall(CommunicationIdentifier source, Iterable createCallWithResponse(CommunicationIdentifier source, Iterable targets, CreateCallOptions createCallOptions, Context context) { + public Response createCallWithResponse(CommunicationIdentifier source, Iterable targets, CreateCallOptions createCallOptions, Context context) { return callAsyncClient.createCallWithResponse(source, targets, createCallOptions, context).block(); } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ConversationAsyncClient.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ConversationAsyncClient.java index ba64d4c296619..3d9f6c777736a 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ConversationAsyncClient.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ConversationAsyncClient.java @@ -5,18 +5,16 @@ import com.azure.communication.callingserver.implementation.AzureCommunicationCallingServerServiceImpl; import com.azure.communication.callingserver.implementation.ConversationsImpl; -import com.azure.communication.callingserver.implementation.models.GetCallRecordingStateResponse; -import com.azure.communication.callingserver.implementation.models.StartCallRecordingResponse; -import com.azure.communication.callingserver.models.GetCallRecordingStateResult; import com.azure.communication.callingserver.models.PlayAudioResponse; import com.azure.communication.callingserver.implementation.converters.InviteParticipantsRequestConverter; import com.azure.communication.callingserver.implementation.converters.JoinCallRequestConverter; import com.azure.communication.callingserver.implementation.models.InviteParticipantsRequest; import com.azure.communication.callingserver.implementation.models.PlayAudioRequest; import com.azure.communication.callingserver.implementation.models.StartCallRecordingRequest; +import com.azure.communication.callingserver.models.GetCallRecordingStateResponse; import com.azure.communication.callingserver.models.JoinCallOptions; import com.azure.communication.callingserver.models.JoinCallResponse; -import com.azure.communication.callingserver.models.StartCallRecordingResult; +import com.azure.communication.callingserver.models.StartCallRecordingResponse; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -220,7 +218,7 @@ Mono> removeParticipantWithResponse(String conversationId, String * @return response for a successful startRecording request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startRecording(String conversationId, URI recordingStateCallbackUri) { + public Mono startRecording(String conversationId, URI recordingStateCallbackUri) { try { Objects.requireNonNull(conversationId, "'conversationId' cannot be null."); Objects.requireNonNull(recordingStateCallbackUri, "'recordingStateCallbackUri' cannot be null."); @@ -228,12 +226,10 @@ public Mono startRecording(String conversationId, URI throw logger.logExceptionAsError(new InvalidParameterException("'recordingStateCallbackUri' cannot be non absolute Uri")); } - StartCallRecordingRequest request = createStartCallRecordingRequest(recordingStateCallbackUri); + StartCallRecordingRequest request = new StartCallRecordingRequest().setRecordingStateCallbackUri(recordingStateCallbackUri.toString()); return this.conversationsClient.startRecordingAsync(conversationId, request) .flatMap((StartCallRecordingResponse response) -> { - StartCallRecordingResult startCallRecordingResult = convertGetCallRecordingStateResponse( - response); - return Mono.just(startCallRecordingResult); + return Mono.just(response); }); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -249,12 +245,12 @@ public Mono startRecording(String conversationId, URI * @return response for a successful startRecording request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startRecordingWithResponse(String conversationId, + public Mono> startRecordingWithResponse(String conversationId, URI recordingStateCallbackUri) { return startRecordingWithResponse(conversationId, recordingStateCallbackUri, null); } - Mono> startRecordingWithResponse(String conversationId, + Mono> startRecordingWithResponse(String conversationId, URI recordingStateCallbackUri, Context context) { try { Objects.requireNonNull(conversationId, "'conversationId' cannot be null."); @@ -266,12 +262,10 @@ Mono> startRecordingWithResponse(String conve if (context != null) { contextValue = context; } - StartCallRecordingRequest request = createStartCallRecordingRequest(recordingStateCallbackUri); + StartCallRecordingRequest request = new StartCallRecordingRequest().setRecordingStateCallbackUri(recordingStateCallbackUri.toString()); return this.conversationsClient.startRecordingWithResponseAsync(conversationId, request) .flatMap((Response response) -> { - StartCallRecordingResult startCallRecordingResult = convertGetCallRecordingStateResponse( - response.getValue()); - return Mono.just(new SimpleResponse<>(response, startCallRecordingResult)); + return Mono.just(new SimpleResponse<>(response, response.getValue())); }); }); } catch (RuntimeException ex) { @@ -422,15 +416,13 @@ Mono> resumeRecordingWithResponse(String conversationId, String r * @return response for a successful getRecordingState request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRecordingState(String conversationId, String recordingId) { + public Mono getRecordingState(String conversationId, String recordingId) { try { Objects.requireNonNull(conversationId, "'conversationId' cannot be null."); Objects.requireNonNull(recordingId, "'recordingId' cannot be null."); return this.conversationsClient.recordingStateAsync(conversationId, recordingId) .flatMap((GetCallRecordingStateResponse response) -> { - GetCallRecordingStateResult getRecordingStateResult = convertGetCallRecordingStateResponse( - response); - return Mono.just(getRecordingStateResult); + return Mono.just(response); }); } catch (RuntimeException ex) { return monoError(logger, ex); @@ -445,12 +437,12 @@ public Mono getRecordingState(String conversationId * @return response for a successful getRecordingState request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRecordingStateWithResponse(String conversationId, + public Mono> getRecordingStateWithResponse(String conversationId, String recordingId) { return getRecordingStateWithResponse(conversationId, recordingId, null); } - Mono> getRecordingStateWithResponse(String conversationId, + Mono> getRecordingStateWithResponse(String conversationId, String recordingId, Context context) { try { Objects.requireNonNull(conversationId, "'conversationId' cannot be null."); @@ -461,9 +453,7 @@ Mono> getRecordingStateWithResponse(String } return this.conversationsClient.recordingStateWithResponseAsync(conversationId, recordingId) .flatMap((Response response) -> { - GetCallRecordingStateResult getRecordingStateResult = convertGetCallRecordingStateResponse( - response.getValue()); - return Mono.just(new SimpleResponse<>(response, getRecordingStateResult)); + return Mono.just(new SimpleResponse<>(response, response.getValue())); }); }); } catch (RuntimeException ex) { @@ -497,7 +487,7 @@ public Mono playAudio(String conversationId, String audioFile } } - public Mono playAudio(String conversationId, PlayAudioRequest request) { + Mono playAudio(String conversationId, PlayAudioRequest request) { try { Objects.requireNonNull(conversationId, "'conversationId' cannot be null."); Objects.requireNonNull(request, "'request' cannot be null."); @@ -546,21 +536,4 @@ Mono> playAudioWithResponse(String conversationId, P return monoError(logger, ex); } } - - private StartCallRecordingRequest createStartCallRecordingRequest(URI recordingStateCallbackUri) { - StartCallRecordingRequest request = new StartCallRecordingRequest(); - request.setRecordingStateCallbackUri(recordingStateCallbackUri.toString()); - return request; - } - - private GetCallRecordingStateResult convertGetCallRecordingStateResponse( - com.azure.communication.callingserver.implementation.models.GetCallRecordingStateResponse response) { - return new GetCallRecordingStateResult() - .setRecordingState(com.azure.communication.callingserver.models.CallRecordingState - .fromString(response.getRecordingState().toString())); - } - - private StartCallRecordingResult convertGetCallRecordingStateResponse(StartCallRecordingResponse response) { - return new StartCallRecordingResult().setRecordingId(response.getRecordingId()); - } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ConversationClient.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ConversationClient.java index 55b4c6933f079..7cfbcda0cfa05 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ConversationClient.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/ConversationClient.java @@ -4,11 +4,11 @@ package com.azure.communication.callingserver; import com.azure.communication.callingserver.implementation.models.PlayAudioRequest; -import com.azure.communication.callingserver.models.GetCallRecordingStateResult; +import com.azure.communication.callingserver.models.GetCallRecordingStateResponse; import com.azure.communication.callingserver.models.JoinCallOptions; import com.azure.communication.callingserver.models.JoinCallResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; -import com.azure.communication.callingserver.models.StartCallRecordingResult; +import com.azure.communication.callingserver.models.StartCallRecordingResponse; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -120,7 +120,7 @@ public Response removeParticipantWithResponse(String conversationId, Strin * @return response for a successful startRecording request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StartCallRecordingResult startRecording(String conversationId, URI recordingStateCallbackUri) { + public StartCallRecordingResponse startRecording(String conversationId, URI recordingStateCallbackUri) { return conversationAsyncClient.startRecording(conversationId, recordingStateCallbackUri).block(); } @@ -133,7 +133,7 @@ public StartCallRecordingResult startRecording(String conversationId, URI record * @return response for a successful startRecording request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startRecordingWithResponse(String conversationId, + public Response startRecordingWithResponse(String conversationId, URI recordingStateCallbackUri, Context context) { return conversationAsyncClient.startRecordingWithResponse(conversationId, recordingStateCallbackUri, context).block(); } @@ -221,7 +221,7 @@ public Response resumeRecordingWithResponse(String conversationId, String * @return response for a successful getRecordingState request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GetCallRecordingStateResult getRecordingState(String conversationId, String recordingId) { + public GetCallRecordingStateResponse getRecordingState(String conversationId, String recordingId) { return conversationAsyncClient.getRecordingState(conversationId, recordingId).block(); } @@ -234,7 +234,7 @@ public GetCallRecordingStateResult getRecordingState(String conversationId, Stri * @return response for a successful getRecordingState request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRecordingStateWithResponse(String conversationId, + public Response getRecordingStateWithResponse(String conversationId, String recordingId, Context context) { return conversationAsyncClient.getRecordingStateWithResponse(conversationId, recordingId, context).block(); } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/CallsImpl.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/CallsImpl.java index 23a5e365d30f3..024af48ae3753 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/CallsImpl.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/CallsImpl.java @@ -7,10 +7,10 @@ import com.azure.communication.callingserver.implementation.models.CancelAllMediaOperationsRequest; import com.azure.communication.callingserver.implementation.models.CommunicationErrorException; import com.azure.communication.callingserver.implementation.models.CreateCallRequestInternal; -import com.azure.communication.callingserver.implementation.models.CreateCallResponse; import com.azure.communication.callingserver.implementation.models.InviteParticipantsRequest; import com.azure.communication.callingserver.implementation.models.PlayAudioRequest; import com.azure.communication.callingserver.models.CancelAllMediaOperationsResponse; +import com.azure.communication.callingserver.models.CreateCallResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/ConversationsImpl.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/ConversationsImpl.java index c6880b7dd8109..a28ba050e02f1 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/ConversationsImpl.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/ConversationsImpl.java @@ -5,14 +5,14 @@ package com.azure.communication.callingserver.implementation; import com.azure.communication.callingserver.implementation.models.CommunicationErrorException; -import com.azure.communication.callingserver.implementation.models.GetCallRecordingStateResponse; import com.azure.communication.callingserver.implementation.models.InviteParticipantsRequest; import com.azure.communication.callingserver.implementation.models.JoinCallRequest; import com.azure.communication.callingserver.implementation.models.PlayAudioRequest; import com.azure.communication.callingserver.implementation.models.StartCallRecordingRequest; -import com.azure.communication.callingserver.implementation.models.StartCallRecordingResponse; +import com.azure.communication.callingserver.models.GetCallRecordingStateResponse; import com.azure.communication.callingserver.models.JoinCallResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; +import com.azure.communication.callingserver.models.StartCallRecordingResponse; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallLegStateChangedEvent.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallLegStateChangedEvent.java index 035e9bf19e041..944e60f0fd404 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallLegStateChangedEvent.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallLegStateChangedEvent.java @@ -4,6 +4,7 @@ package com.azure.communication.callingserver.implementation.models; +import com.azure.communication.callingserver.models.CallState; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallRecordingState.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallRecordingState.java deleted file mode 100644 index 960876f07385f..0000000000000 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallRecordingState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callingserver.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CallRecordingState. */ -public final class CallRecordingState extends ExpandableStringEnum { - /** Static value active for CallRecordingState. */ - public static final CallRecordingState ACTIVE = fromString("active"); - - /** Static value inactive for CallRecordingState. */ - public static final CallRecordingState INACTIVE = fromString("inactive"); - - /** - * Creates or finds a CallRecordingState from its string representation. - * - * @param name a name to look for. - * @return the corresponding CallRecordingState. - */ - @JsonCreator - public static CallRecordingState fromString(String name) { - return fromString(name, CallRecordingState.class); - } - - /** @return known CallRecordingState values. */ - public static Collection values() { - return values(CallRecordingState.class); - } -} diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallRecordingStateChangeEvent.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallRecordingStateChangeEvent.java index 96257ec62cfad..0e19b451fec93 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallRecordingStateChangeEvent.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallRecordingStateChangeEvent.java @@ -4,6 +4,7 @@ package com.azure.communication.callingserver.implementation.models; +import com.azure.communication.callingserver.models.CallRecordingState; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallState.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallState.java deleted file mode 100644 index 69afd11848063..0000000000000 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CallState.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callingserver.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CallState. */ -public final class CallState extends ExpandableStringEnum { - /** Static value unknown for CallState. */ - public static final CallState UNKNOWN = fromString("unknown"); - - /** Static value idle for CallState. */ - public static final CallState IDLE = fromString("idle"); - - /** Static value incoming for CallState. */ - public static final CallState INCOMING = fromString("incoming"); - - /** Static value establishing for CallState. */ - public static final CallState ESTABLISHING = fromString("establishing"); - - /** Static value established for CallState. */ - public static final CallState ESTABLISHED = fromString("established"); - - /** Static value hold for CallState. */ - public static final CallState HOLD = fromString("hold"); - - /** Static value unhold for CallState. */ - public static final CallState UNHOLD = fromString("unhold"); - - /** Static value transferring for CallState. */ - public static final CallState TRANSFERRING = fromString("transferring"); - - /** Static value redirecting for CallState. */ - public static final CallState REDIRECTING = fromString("redirecting"); - - /** Static value terminating for CallState. */ - public static final CallState TERMINATING = fromString("terminating"); - - /** Static value terminated for CallState. */ - public static final CallState TERMINATED = fromString("terminated"); - - /** - * Creates or finds a CallState from its string representation. - * - * @param name a name to look for. - * @return the corresponding CallState. - */ - @JsonCreator - public static CallState fromString(String name) { - return fromString(name, CallState.class); - } - - /** @return known CallState values. */ - public static Collection values() { - return values(CallState.class); - } -} diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/InviteParticipantsResultEvent.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/InviteParticipantsResultEvent.java index 055055e52538e..bf80ddcff87e4 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/InviteParticipantsResultEvent.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/InviteParticipantsResultEvent.java @@ -4,6 +4,7 @@ package com.azure.communication.callingserver.implementation.models; +import com.azure.communication.callingserver.models.OperationStatus; import com.azure.communication.callingserver.models.ResultInfo; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/OperationStatus.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/OperationStatus.java deleted file mode 100644 index dd5d251ae0832..0000000000000 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/OperationStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.communication.callingserver.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OperationStatus. */ -public final class OperationStatus extends ExpandableStringEnum { - /** Static value notStarted for OperationStatus. */ - public static final OperationStatus NOT_STARTED = fromString("notStarted"); - - /** Static value running for OperationStatus. */ - public static final OperationStatus RUNNING = fromString("running"); - - /** Static value completed for OperationStatus. */ - public static final OperationStatus COMPLETED = fromString("completed"); - - /** Static value failed for OperationStatus. */ - public static final OperationStatus FAILED = fromString("failed"); - - /** - * Creates or finds a OperationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationStatus. - */ - @JsonCreator - public static OperationStatus fromString(String name) { - return fromString(name, OperationStatus.class); - } - - /** @return known OperationStatus values. */ - public static Collection values() { - return values(OperationStatus.class); - } -} diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultEvent.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultEvent.java index a741975d1e6ac..8a5ea2ec72bea 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultEvent.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/PlayAudioResultEvent.java @@ -4,6 +4,7 @@ package com.azure.communication.callingserver.implementation.models; +import com.azure.communication.callingserver.models.OperationStatus; import com.azure.communication.callingserver.models.ResultInfo; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CallRecordingState.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CallRecordingState.java index aba4b870e9583..9a832152d58a5 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CallRecordingState.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CallRecordingState.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.callingserver.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; - import java.util.Collection; /** Defines values for CallRecordingState. */ diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CallState.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CallState.java index 35278a49aba9c..25f9fa4fe21f8 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CallState.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CallState.java @@ -1,77 +1,61 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.callingserver.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; -/** - * Defines values for CallState. - */ -public enum CallState { - /** Unknown not recognized. */ - UNKNOWN("Unknown"), +/** Defines values for CallState. */ +public final class CallState extends ExpandableStringEnum { + /** Static value unknown for CallState. */ + public static final CallState UNKNOWN = fromString("unknown"); - /** Initial State. */ - IDLE("Idle"), + /** Static value idle for CallState. */ + public static final CallState IDLE = fromString("idle"); - /** The call has just been received. */ - INCOMING("Incoming"), + /** Static value incoming for CallState. */ + public static final CallState INCOMING = fromString("incoming"); - /** - * The call establishment is in progress after initiating or accepting the call. - */ - ESTABLISHING("Establishing"), - - /** The call is established. */ - ESTABLISHED("Established"), + /** Static value establishing for CallState. */ + public static final CallState ESTABLISHING = fromString("establishing"); - /** The call is on Hold. */ - HOLD("Hold"), + /** Static value established for CallState. */ + public static final CallState ESTABLISHED = fromString("established"); - /** The call is Unhold. */ - UNHOLD("Unhold"), + /** Static value hold for CallState. */ + public static final CallState HOLD = fromString("hold"); - /** The call has initiated a transfer. */ - TRANSFERRING("Transferring"), + /** Static value unhold for CallState. */ + public static final CallState UNHOLD = fromString("unhold"); - /** The call has initiated a redirection. */ - REDIRECTING("Redirecting"), + /** Static value transferring for CallState. */ + public static final CallState TRANSFERRING = fromString("transferring"); - /** The call is terminating. */ - TERMINATING("Terminating"), + /** Static value redirecting for CallState. */ + public static final CallState REDIRECTING = fromString("redirecting"); - /** The call has terminated. */ - TERMINATED("Terminated"); + /** Static value terminating for CallState. */ + public static final CallState TERMINATING = fromString("terminating"); - /** The actual serialized value for a CallState instance. */ - private String value; - - CallState(String value) { - this.value = value; - } + /** Static value terminated for CallState. */ + public static final CallState TERMINATED = fromString("terminated"); /** - * Parses a serialized value to a CallState instance. + * Creates or finds a CallState from its string representation. * - * @param value the serialized value to parse. - * @return the parsed CallState object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding CallState. */ @JsonCreator - public static CallState fromString(String value) { - CallState[] items = CallState.values(); - for (CallState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static CallState fromString(String name) { + return fromString(name, CallState.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known CallState values. */ + public static Collection values() { + return values(CallState.class); } } diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CancelAllMediaOperationsResponse.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CancelAllMediaOperationsResponse.java index ed64d83eb5c4e..68bf3f0be73e3 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CancelAllMediaOperationsResponse.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CancelAllMediaOperationsResponse.java @@ -4,7 +4,6 @@ package com.azure.communication.callingserver.models; -import com.azure.communication.callingserver.implementation.models.OperationStatus; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CreateCallResponse.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CreateCallResponse.java similarity index 93% rename from sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CreateCallResponse.java rename to sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CreateCallResponse.java index 984908b4c1fea..56b631b0f8019 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/CreateCallResponse.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CreateCallResponse.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.communication.callingserver.implementation.models; +package com.azure.communication.callingserver.models; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CreateCallResult.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CreateCallResult.java deleted file mode 100644 index 981ea014242aa..0000000000000 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/CreateCallResult.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callingserver.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The response payload of the create call operation. */ -@Fluent -public final class CreateCallResult { - /* - * Call leg id of the call. - */ - @JsonProperty(value = "callLegId") - private String callLegId; - - /** - * Get the callLegId property: Call leg id of the call. - * - * @return the callLegId value. - */ - public String getCallLegId() { - return this.callLegId; - } - - /** - * Set the callLegId property: Call leg id of the call. - * - * @param callLegId the callLegId value to set. - * @return the CreateCallResponse object itself. - */ - public CreateCallResult setCallLegId(String callLegId) { - this.callLegId = callLegId; - return this; - } -} diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/GetCallRecordingStateResponse.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/GetCallRecordingStateResponse.java similarity index 94% rename from sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/GetCallRecordingStateResponse.java rename to sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/GetCallRecordingStateResponse.java index 80fd2318b0e34..9f63c85c21ef3 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/GetCallRecordingStateResponse.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/GetCallRecordingStateResponse.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.communication.callingserver.implementation.models; +package com.azure.communication.callingserver.models; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/GetCallRecordingStateResult.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/GetCallRecordingStateResult.java deleted file mode 100644 index 8ed57a7f59440..0000000000000 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/GetCallRecordingStateResult.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callingserver.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The GetCallRecordingStateResult model. */ -@Fluent -public final class GetCallRecordingStateResult { - /* - * The recording state of the recording - */ - @JsonProperty(value = "recordingState") - private CallRecordingState recordingState; - - /** - * Get the recordingState property: The recording state of the recording. - * - * @return the recordingState value. - */ - public CallRecordingState getRecordingState() { - return this.recordingState; - } - - /** - * Set the recordingState property: The recording state of the recording. - * - * @param recordingState the recordingState value to set. - * @return the GetCallRecordingStateResult object itself. - */ - public GetCallRecordingStateResult setRecordingState(CallRecordingState recordingState) { - this.recordingState = recordingState; - return this; - } -} diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/OperationStatus.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/OperationStatus.java index a3983a5aaae7b..1c06cc1709063 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/OperationStatus.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/OperationStatus.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.callingserver.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; - import java.util.Collection; /** Defines values for OperationStatus. */ diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/PlayAudioResponse.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/PlayAudioResponse.java index c2bbea7ca5fb5..724c5c8e124b2 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/PlayAudioResponse.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/PlayAudioResponse.java @@ -4,7 +4,6 @@ package com.azure.communication.callingserver.models; -import com.azure.communication.callingserver.implementation.models.OperationStatus; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingRequest.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingRequest.java deleted file mode 100644 index 82aefce690f3b..0000000000000 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingRequest.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callingserver.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The request payload start call recording operation. */ -@Fluent -public final class StartCallRecordingRequest { - /* - * The uri to send notifications to. - */ - @JsonProperty(value = "recordingStateCallbackUri") - private String recordingStateCallbackUri; - - /** - * Get the recordingStateCallbackUri property: The uri to send notifications to. - * - * @return the recordingStateCallbackUri value. - */ - public String getRecordingStateCallbackUri() { - return this.recordingStateCallbackUri; - } - - /** - * Set the recordingStateCallbackUri property: The uri to send notifications to. - * - * @param recordingStateCallbackUri the recordingStateCallbackUri value to set. - * @return the StartCallRecordingRequestInternal object itself. - */ - public StartCallRecordingRequest setRecordingStateCallbackUri(String recordingStateCallbackUri) { - this.recordingStateCallbackUri = recordingStateCallbackUri; - return this; - } -} diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/StartCallRecordingResponse.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingResponse.java similarity index 94% rename from sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/StartCallRecordingResponse.java rename to sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingResponse.java index f77755c00cb86..3caf6be222c38 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/implementation/models/StartCallRecordingResponse.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingResponse.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.communication.callingserver.implementation.models; +package com.azure.communication.callingserver.models; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingResult.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingResult.java deleted file mode 100644 index 91b2004244e9c..0000000000000 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/models/StartCallRecordingResult.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.communication.callingserver.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The response payload of start call recording operation. */ -@Fluent -public final class StartCallRecordingResult { - /* - * The recording id of the started recording - */ - @JsonProperty(value = "recordingId") - private String recordingId; - - /** - * Get the recordingId property: The recording id of the started recording. - * - * @return the recordingId value. - */ - public String getRecordingId() { - return this.recordingId; - } - - /** - * Set the recordingId property: The recording id of the started recording. - * - * @param recordingId the recordingId value to set. - * @return the StartCallRecordingResult object itself. - */ - public StartCallRecordingResult setRecordingId(String recordingId) { - this.recordingId = recordingId; - return this; - } -} 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 c559878e26f4b..1cd6837d34121 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 @@ -6,7 +6,7 @@ import com.azure.communication.callingserver.implementation.models.CallModality; import com.azure.communication.callingserver.implementation.models.EventSubscriptionType; import com.azure.communication.callingserver.models.CreateCallOptions; -import com.azure.communication.callingserver.models.CreateCallResult; +import com.azure.communication.callingserver.models.CreateCallResponse; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import java.util.ArrayList; @@ -74,7 +74,7 @@ public void createCall() { requestedModalities, requestedCallEvents); - CreateCallResult createCallResult = callClient.createCall(source, targets, createCallOptions); + CreateCallResponse createCallResult = callClient.createCall(source, targets, createCallOptions); String callId = createCallResult.getCallLegId(); } diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAsyncClientTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAsyncClientTests.java index 6870ed96b5c33..60af74a5dde83 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAsyncClientTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAsyncClientTests.java @@ -10,7 +10,7 @@ import com.azure.communication.callingserver.implementation.models.CallModality; import com.azure.communication.callingserver.implementation.models.EventSubscriptionType; import com.azure.communication.callingserver.models.CreateCallOptions; -import com.azure.communication.callingserver.models.CreateCallResult; +import com.azure.communication.callingserver.models.CreateCallResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; @@ -49,7 +49,7 @@ public void runCreatePlayAudioHangupScenarioAsync(HttpClient httpClient) throws options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); - CreateCallResult createCallResult = callAsyncClient.createCall( + CreateCallResponse createCallResult = callAsyncClient.createCall( new CommunicationUserIdentifier(from), new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), options).block(); @@ -90,7 +90,7 @@ public void runCreatePlayAudioHangupScenarioWithResponseAsync(HttpClient httpCli options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); - Response createCallResponse = callAsyncClient.createCallWithResponse( + Response createCallResponse = callAsyncClient.createCallWithResponse( new CommunicationUserIdentifier(from), new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), options, @@ -133,7 +133,7 @@ public void inviteUserRemoveParticipantScenarioAsync(HttpClient httpClient) thro options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); - CreateCallResult createCallResult = callAsyncClient.createCall( + CreateCallResponse createCallResult = callAsyncClient.createCall( new CommunicationUserIdentifier(from), new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), options).block(); @@ -172,7 +172,7 @@ public void inviteUserRemoveParticipantScenarioWithResponseAsync(HttpClient http options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); - Response createCallResponse = callAsyncClient.createCallWithResponse( + Response createCallResponse = callAsyncClient.createCallWithResponse( new CommunicationUserIdentifier(from), new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), options, diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallClientTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallClientTests.java index 26e3c46943e2c..15b20d8fa51ce 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallClientTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallClientTests.java @@ -10,7 +10,7 @@ import com.azure.communication.callingserver.implementation.models.CallModality; import com.azure.communication.callingserver.implementation.models.EventSubscriptionType; import com.azure.communication.callingserver.models.CreateCallOptions; -import com.azure.communication.callingserver.models.CreateCallResult; +import com.azure.communication.callingserver.models.CreateCallResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; @@ -49,7 +49,7 @@ public void runCreatePlayAudioHangupScenario(HttpClient httpClient) throws URISy options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); - CreateCallResult createCallResult = callClient.createCall( + CreateCallResponse createCallResult = callClient.createCall( new CommunicationUserIdentifier(from), new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), options); @@ -90,7 +90,7 @@ public void runCreatePlayAudioHangupScenarioWithResponse(HttpClient httpClient) options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); - Response createCallResponse = callClient.createCallWithResponse( + Response createCallResponse = callClient.createCallWithResponse( new CommunicationUserIdentifier(from), new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), options, @@ -134,7 +134,7 @@ public void inviteUserRemoveParticipantScenario(HttpClient httpClient) throws UR options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); - CreateCallResult createCallResult = callClient.createCall( + CreateCallResponse createCallResult = callClient.createCall( new CommunicationUserIdentifier(from), new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), options); @@ -173,7 +173,7 @@ public void inviteUserRemoveParticipantScenarioWithResponse(HttpClient httpClien options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); - Response createCallResponse = callClient.createCallWithResponse( + Response createCallResponse = callClient.createCallWithResponse( new CommunicationUserIdentifier(from), new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), options, diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerTestUtils.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerTestUtils.java index 7b7b60728f618..669b4e0af5e23 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerTestUtils.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerTestUtils.java @@ -5,20 +5,20 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import com.azure.communication.callingserver.implementation.models.OperationStatus; -import com.azure.communication.callingserver.models.CreateCallResult; +import com.azure.communication.callingserver.models.CreateCallResponse; +import com.azure.communication.callingserver.models.OperationStatus; import com.azure.communication.callingserver.models.PlayAudioResponse; import com.azure.core.http.rest.Response; public class CallingServerTestUtils { - protected static void validateCreateCallResponse(Response createCallResponse) { + protected static void validateCreateCallResponse(Response createCallResponse) { assertNotNull(createCallResponse); assertTrue(createCallResponse.getStatusCode() == 201); assertNotNull(createCallResponse.getValue()); validateCreateCallResult(createCallResponse.getValue()); } - protected static void validateCreateCallResult(CreateCallResult createCallResult) { + protected static void validateCreateCallResult(CreateCallResponse createCallResult) { assertNotNull(createCallResult); assertNotNull(createCallResult.getCallLegId()); assertTrue(!createCallResult.getCallLegId().isEmpty()); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ConversationAsyncClientTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ConversationAsyncClientTests.java index 1eee87fcf1a8a..b5960334d0f20 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ConversationAsyncClientTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ConversationAsyncClientTests.java @@ -11,9 +11,9 @@ import com.azure.communication.callingserver.models.CallRecordingState; import com.azure.communication.callingserver.implementation.models.CommunicationErrorException; -import com.azure.communication.callingserver.models.GetCallRecordingStateResult; +import com.azure.communication.callingserver.models.GetCallRecordingStateResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; -import com.azure.communication.callingserver.models.StartCallRecordingResult; +import com.azure.communication.callingserver.models.StartCallRecordingResponse; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; @@ -37,7 +37,7 @@ public void runAllClientFunctionsAsync(HttpClient httpClient) throws URISyntaxEx URI recordingStateCallbackUri = new URI("https://dev.skype.net:6448"); try { - StartCallRecordingResult startCallRecordingResponse = conversationAsyncClient.startRecording(conversationId, recordingStateCallbackUri).block(); + StartCallRecordingResponse startCallRecordingResponse = conversationAsyncClient.startRecording(conversationId, recordingStateCallbackUri).block(); recordingId = startCallRecordingResponse.getRecordingId(); validateCallRecordingState(conversationAsyncClient, conversationId, recordingId, CallRecordingState.ACTIVE); @@ -64,9 +64,9 @@ public void runAllClientFunctionsWithResponseAsync(HttpClient httpClient) throws System.out.println("conversationId: " + conversationId); try { - Response response = conversationAsyncClient.startRecordingWithResponse(conversationId, recordingStateCallbackUri).block(); + Response response = conversationAsyncClient.startRecordingWithResponse(conversationId, recordingStateCallbackUri).block(); assertEquals(response.getStatusCode(), 200); - StartCallRecordingResult startCallRecordingResponse = response.getValue(); + StartCallRecordingResponse startCallRecordingResponse = response.getValue(); recordingId = startCallRecordingResponse.getRecordingId(); validateCallRecordingState(conversationAsyncClient, conversationId, recordingId, CallRecordingState.ACTIVE); @@ -135,7 +135,7 @@ public void startRecordingFailsAsync(HttpClient httpClient) throws URISyntaxExce System.out.println("conversationId: " + invalidConversationId); try { - Response response = conversationAsyncClient.startRecordingWithResponse(invalidConversationId, recordingStateCallbackUri).block(); + Response response = conversationAsyncClient.startRecordingWithResponse(invalidConversationId, recordingStateCallbackUri).block(); assertEquals(response.getStatusCode(), 400); } catch (CommunicationErrorException e) { assertEquals(e.getResponse().getStatusCode(), 400); @@ -161,7 +161,7 @@ private void validateCallRecordingState(ConversationAsyncClient conversationAsyn */ sleepIfRunningAgainstService(6000); - GetCallRecordingStateResult callRecordingStateResult = conversationAsyncClient.getRecordingState(conversationId, recordingId).block(); + GetCallRecordingStateResponse callRecordingStateResult = conversationAsyncClient.getRecordingState(conversationId, recordingId).block(); assertEquals(callRecordingStateResult.getRecordingState(), expectedCallRecordingState); } } diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ConversationClientTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ConversationClientTests.java index db72a0d1bbc2e..715292eb5388f 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ConversationClientTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ConversationClientTests.java @@ -11,9 +11,9 @@ import com.azure.communication.callingserver.models.CallRecordingState; import com.azure.communication.callingserver.implementation.models.CommunicationErrorException; -import com.azure.communication.callingserver.models.GetCallRecordingStateResult; +import com.azure.communication.callingserver.models.GetCallRecordingStateResponse; import com.azure.communication.callingserver.models.PlayAudioResponse; -import com.azure.communication.callingserver.models.StartCallRecordingResult; +import com.azure.communication.callingserver.models.StartCallRecordingResponse; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -38,7 +38,7 @@ public void runAllClientFunctions(HttpClient httpClient) throws URISyntaxExcepti URI recordingStateCallbackUri = new URI("https://dev.skype.net:6448"); try { - StartCallRecordingResult startCallRecordingResponse = conversationAsyncClient.startRecording(conversationId, recordingStateCallbackUri); + StartCallRecordingResponse startCallRecordingResponse = conversationAsyncClient.startRecording(conversationId, recordingStateCallbackUri); recordingId = startCallRecordingResponse.getRecordingId(); validateCallRecordingState(conversationAsyncClient, conversationId, recordingId, CallRecordingState.ACTIVE); @@ -65,9 +65,9 @@ public void runAllClientFunctionsWithResponse(HttpClient httpClient) throws URIS System.out.println("conversationId: " + conversationId); try { - Response response = conversationClient.startRecordingWithResponse(conversationId, recordingStateCallbackUri, Context.NONE); + Response response = conversationClient.startRecordingWithResponse(conversationId, recordingStateCallbackUri, Context.NONE); assertEquals(response.getStatusCode(), 200); - StartCallRecordingResult startCallRecordingResponse = response.getValue(); + StartCallRecordingResponse startCallRecordingResponse = response.getValue(); recordingId = startCallRecordingResponse.getRecordingId(); validateCallRecordingState(conversationClient, conversationId, recordingId, CallRecordingState.ACTIVE); @@ -134,7 +134,7 @@ public void startRecordingFails(HttpClient httpClient) throws URISyntaxException System.out.println("conversationId: " + invalidConversationId); try { - Response response = conversationClient.startRecordingWithResponse(invalidConversationId, recordingStateCallbackUri, Context.NONE); + Response response = conversationClient.startRecordingWithResponse(invalidConversationId, recordingStateCallbackUri, Context.NONE); assertEquals(response.getStatusCode(), 400); } catch (CommunicationErrorException e) { assertEquals(e.getResponse().getStatusCode(), 400); @@ -160,7 +160,7 @@ private void validateCallRecordingState(ConversationClient conversationClient, S */ sleepIfRunningAgainstService(6000); - GetCallRecordingStateResult callRecordingStateResult = conversationClient.getRecordingState(conversationId, recordingId); + GetCallRecordingStateResponse callRecordingStateResult = conversationClient.getRecordingState(conversationId, recordingId); assertEquals(callRecordingStateResult.getRecordingState(), expectedCallRecordingState); } } diff --git a/sdk/communication/azure-communication-callingserver/swagger/README.md b/sdk/communication/azure-communication-callingserver/swagger/README.md index ecd29e6b281ed..1ba279c58b4c9 100644 --- a/sdk/communication/azure-communication-callingserver/swagger/README.md +++ b/sdk/communication/azure-communication-callingserver/swagger/README.md @@ -37,7 +37,7 @@ java: true output-folder: ..\ license-header: MICROSOFT_MIT_SMALL namespace: com.azure.communication.callingserver -custom-types: ToneValue,ToneInfo,ResultInfo,JoinCallResponse,CancelAllMediaOperationsResponse,PlayAudioResponse +custom-types: ToneValue,ToneInfo,ResultInfo,JoinCallResponse,CancelAllMediaOperationsResponse,PlayAudioResponse,OperationStatus,StartCallRecordingResponse,GetCallRecordingStateResponse,CallRecordingState,CallState,CreateCallResponse custom-types-subpackage: models generate-client-as-impl: true models-subpackage: implementation.models