createCallWithResponse(
- CreateCallRequestInternal createCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return createCallWithResponseAsync(createCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context)
- .block();
+ public CallConnectionPropertiesInternal createCall(CreateCallRequestInternal createCallRequest) {
+ return createCallWithResponse(createCallRequest, Context.NONE).getValue();
}
/**
- * Answer a call using the IncomingCallContext from Event Grid.
+ * Answer a Call.
+ *
+ * Answer a call using the IncomingCallContext from Event Grid.
*
* @param answerCallRequest The answer call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return properties of a call connection.
+ * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> answerCallWithResponseAsync(
- AnswerCallRequestInternal answerCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
+ AnswerCallRequestInternal answerCallRequest) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return FluxUtil.withContext(
context ->
service.answerCall(
this.getEndpoint(),
this.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
answerCallRequest,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context));
}
/**
- * Answer a call using the IncomingCallContext from Event Grid.
+ * Answer a Call.
+ *
+ * Answer a call using the IncomingCallContext from Event Grid.
*
* @param answerCallRequest The answer call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return properties of a call connection.
+ * @return properties of a call connection along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> answerCallWithResponseAsync(
- AnswerCallRequestInternal answerCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
+ AnswerCallRequestInternal answerCallRequest, Context context) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return service.answerCall(
this.getEndpoint(),
this.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
answerCallRequest,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context);
}
/**
- * Answer a call using the IncomingCallContext from Event Grid.
+ * Answer a Call.
+ *
+ * Answer a call using the IncomingCallContext from Event Grid.
*
* @param answerCallRequest The answer call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return properties of a call connection.
+ * @return properties of a call connection on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono answerCallAsync(
- AnswerCallRequestInternal answerCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
- return answerCallWithResponseAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ public Mono answerCallAsync(AnswerCallRequestInternal answerCallRequest) {
+ return answerCallWithResponseAsync(answerCallRequest).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
- * Answer a call using the IncomingCallContext from Event Grid.
+ * Answer a Call.
+ *
+ * Answer a call using the IncomingCallContext from Event Grid.
*
* @param answerCallRequest The answer call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return properties of a call connection.
+ * @return properties of a call connection on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono answerCallAsync(
- AnswerCallRequestInternal answerCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return answerCallWithResponseAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ AnswerCallRequestInternal answerCallRequest, Context context) {
+ return answerCallWithResponseAsync(answerCallRequest, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
- * Answer a call using the IncomingCallContext from Event Grid.
+ * Answer a Call.
+ *
+ * Answer a call using the IncomingCallContext from Event Grid.
*
* @param answerCallRequest The answer call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return properties of a call connection.
+ * @return properties of a call connection along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public CallConnectionPropertiesInternal answerCall(
- AnswerCallRequestInternal answerCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
- return answerCallAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block();
+ public Response answerCallWithResponse(
+ AnswerCallRequestInternal answerCallRequest, Context context) {
+ return answerCallWithResponseAsync(answerCallRequest, context).block();
}
/**
- * Answer a call using the IncomingCallContext from Event Grid.
+ * Answer a Call.
+ *
+ * Answer a call using the IncomingCallContext from Event Grid.
*
* @param answerCallRequest The answer call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return properties of a call connection.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response answerCallWithResponse(
- AnswerCallRequestInternal answerCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return answerCallWithResponseAsync(answerCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context)
- .block();
+ public CallConnectionPropertiesInternal answerCall(AnswerCallRequestInternal answerCallRequest) {
+ return answerCallWithResponse(answerCallRequest, Context.NONE).getValue();
}
/**
* Redirect a call.
*
* @param redirectCallRequest The redirect call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> redirectCallWithResponseAsync(
- RedirectCallRequestInternal redirectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
+ public Mono> redirectCallWithResponseAsync(RedirectCallRequestInternal redirectCallRequest) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return FluxUtil.withContext(
context ->
service.redirectCall(
this.getEndpoint(),
this.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
redirectCallRequest,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context));
}
@@ -677,36 +498,25 @@ public Mono> redirectCallWithResponseAsync(
* Redirect a call.
*
* @param redirectCallRequest The redirect call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> redirectCallWithResponseAsync(
- RedirectCallRequestInternal redirectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
+ RedirectCallRequestInternal redirectCallRequest, Context context) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return service.redirectCall(
this.getEndpoint(),
this.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
redirectCallRequest,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context);
}
@@ -714,144 +524,82 @@ public Mono> redirectCallWithResponseAsync(
* Redirect a call.
*
* @param redirectCallRequest The redirect call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono redirectCallAsync(
- RedirectCallRequestInternal redirectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
- return redirectCallWithResponseAsync(redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent)
- .flatMap((Response res) -> Mono.empty());
+ public Mono redirectCallAsync(RedirectCallRequestInternal redirectCallRequest) {
+ return redirectCallWithResponseAsync(redirectCallRequest).flatMap(ignored -> Mono.empty());
}
/**
* Redirect a call.
*
* @param redirectCallRequest The redirect call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono redirectCallAsync(
- RedirectCallRequestInternal redirectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return redirectCallWithResponseAsync(
- redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context)
- .flatMap((Response res) -> Mono.empty());
+ public Mono redirectCallAsync(RedirectCallRequestInternal redirectCallRequest, Context context) {
+ return redirectCallWithResponseAsync(redirectCallRequest, context).flatMap(ignored -> Mono.empty());
}
/**
* Redirect a call.
*
* @param redirectCallRequest The redirect call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public void redirectCall(
- RedirectCallRequestInternal redirectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
- redirectCallAsync(redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block();
+ public Response redirectCallWithResponse(RedirectCallRequestInternal redirectCallRequest, Context context) {
+ return redirectCallWithResponseAsync(redirectCallRequest, context).block();
}
/**
* Redirect a call.
*
* @param redirectCallRequest The redirect call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response redirectCallWithResponse(
- RedirectCallRequestInternal redirectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return redirectCallWithResponseAsync(
- redirectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context)
- .block();
+ public void redirectCall(RedirectCallRequestInternal redirectCallRequest) {
+ redirectCallWithResponse(redirectCallRequest, Context.NONE);
}
/**
* Reject the call.
*
* @param rejectCallRequest The reject call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> rejectCallWithResponseAsync(
- RejectCallRequestInternal rejectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
+ public Mono> rejectCallWithResponseAsync(RejectCallRequestInternal rejectCallRequest) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return FluxUtil.withContext(
context ->
service.rejectCall(
this.getEndpoint(),
this.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
rejectCallRequest,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context));
}
@@ -859,36 +607,25 @@ public Mono> rejectCallWithResponseAsync(
* Reject the call.
*
* @param rejectCallRequest The reject call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> rejectCallWithResponseAsync(
- RejectCallRequestInternal rejectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
+ RejectCallRequestInternal rejectCallRequest, Context context) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return service.rejectCall(
this.getEndpoint(),
this.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
rejectCallRequest,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context);
}
@@ -896,105 +633,56 @@ public Mono> rejectCallWithResponseAsync(
* Reject the call.
*
* @param rejectCallRequest The reject call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono rejectCallAsync(
- RejectCallRequestInternal rejectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
- return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent)
- .flatMap((Response res) -> Mono.empty());
+ public Mono rejectCallAsync(RejectCallRequestInternal rejectCallRequest) {
+ return rejectCallWithResponseAsync(rejectCallRequest).flatMap(ignored -> Mono.empty());
}
/**
* Reject the call.
*
* @param rejectCallRequest The reject call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono rejectCallAsync(
- RejectCallRequestInternal rejectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context)
- .flatMap((Response res) -> Mono.empty());
+ public Mono rejectCallAsync(RejectCallRequestInternal rejectCallRequest, Context context) {
+ return rejectCallWithResponseAsync(rejectCallRequest, context).flatMap(ignored -> Mono.empty());
}
/**
* Reject the call.
*
* @param rejectCallRequest The reject call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public void rejectCall(
- RejectCallRequestInternal rejectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
- rejectCallAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent).block();
+ public Response rejectCallWithResponse(RejectCallRequestInternal rejectCallRequest, Context context) {
+ return rejectCallWithResponseAsync(rejectCallRequest, context).block();
}
/**
* Reject the call.
*
* @param rejectCallRequest The reject call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response rejectCallWithResponse(
- RejectCallRequestInternal rejectCallRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return rejectCallWithResponseAsync(rejectCallRequest, repeatabilityRequestID, repeatabilityFirstSent, context)
- .block();
+ public void rejectCall(RejectCallRequestInternal rejectCallRequest) {
+ rejectCallWithResponse(rejectCallRequest, Context.NONE);
}
}
diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImplBuilder.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImplBuilder.java
index 83fd9474f153..677c6381728e 100644
--- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImplBuilder.java
+++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/AzureCommunicationCallAutomationServiceImplBuilder.java
@@ -4,182 +4,225 @@
package com.azure.communication.callautomation.implementation;
+import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.client.traits.AzureKeyCredentialTrait;
+import com.azure.core.client.traits.ConfigurationTrait;
+import com.azure.core.client.traits.EndpointTrait;
+import com.azure.core.client.traits.HttpTrait;
+import com.azure.core.credential.AzureKeyCredential;
import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
-import com.azure.core.http.policy.CookiePolicy;
+import com.azure.core.http.HttpPipelinePosition;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.AddHeadersFromContextPolicy;
+import com.azure.core.http.policy.AddHeadersPolicy;
+import com.azure.core.http.policy.AzureKeyCredentialPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.util.ClientOptions;
import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.builder.ClientBuilderUtil;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
/** A builder for creating a new instance of the AzureCommunicationCallAutomationService type. */
@ServiceClientBuilder(serviceClients = {AzureCommunicationCallAutomationServiceImpl.class})
-public final class AzureCommunicationCallAutomationServiceImplBuilder {
- private static final String SDK_NAME = "name";
+public final class AzureCommunicationCallAutomationServiceImplBuilder
+ implements HttpTrait,
+ ConfigurationTrait,
+ AzureKeyCredentialTrait,
+ EndpointTrait {
+ @Generated private static final String SDK_NAME = "name";
- private static final String SDK_VERSION = "version";
+ @Generated private static final String SDK_VERSION = "version";
- private final Map properties = new HashMap<>();
+ @Generated private static final Map PROPERTIES = new HashMap<>();
+
+ @Generated private final List pipelinePolicies;
/** Create an instance of the AzureCommunicationCallAutomationServiceImplBuilder. */
+ @Generated
public AzureCommunicationCallAutomationServiceImplBuilder() {
this.pipelinePolicies = new ArrayList<>();
}
/*
- * The endpoint of the Azure Communication resource.
+ * The HTTP pipeline to send requests through.
*/
- private String endpoint;
+ @Generated private HttpPipeline pipeline;
- /**
- * Sets The endpoint of the Azure Communication resource.
- *
- * @param endpoint the endpoint value.
- * @return the AzureCommunicationCallAutomationServiceImplBuilder.
- */
- public AzureCommunicationCallAutomationServiceImplBuilder endpoint(String endpoint) {
- this.endpoint = endpoint;
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public AzureCommunicationCallAutomationServiceImplBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
return this;
}
/*
- * Api Version
+ * The HTTP client used to send the request.
*/
- private String apiVersion;
+ @Generated private HttpClient httpClient;
- /**
- * Sets Api Version.
- *
- * @param apiVersion the apiVersion value.
- * @return the AzureCommunicationCallAutomationServiceImplBuilder.
- */
- public AzureCommunicationCallAutomationServiceImplBuilder apiVersion(String apiVersion) {
- this.apiVersion = apiVersion;
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public AzureCommunicationCallAutomationServiceImplBuilder httpClient(HttpClient httpClient) {
+ this.httpClient = httpClient;
return this;
}
/*
- * The HTTP pipeline to send requests through
+ * The logging configuration for HTTP requests and responses.
*/
- private HttpPipeline pipeline;
+ @Generated private HttpLogOptions httpLogOptions;
- /**
- * Sets The HTTP pipeline to send requests through.
- *
- * @param pipeline the pipeline value.
- * @return the AzureCommunicationCallAutomationServiceImplBuilder.
- */
- public AzureCommunicationCallAutomationServiceImplBuilder pipeline(HttpPipeline pipeline) {
- this.pipeline = pipeline;
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public AzureCommunicationCallAutomationServiceImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = httpLogOptions;
return this;
}
/*
- * The serializer to serialize an object into a string
+ * The client options such as application ID and custom headers to set on a request.
*/
- private SerializerAdapter serializerAdapter;
+ @Generated private ClientOptions clientOptions;
- /**
- * Sets The serializer to serialize an object into a string.
- *
- * @param serializerAdapter the serializerAdapter value.
- * @return the AzureCommunicationCallAutomationServiceImplBuilder.
- */
- public AzureCommunicationCallAutomationServiceImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
- this.serializerAdapter = serializerAdapter;
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public AzureCommunicationCallAutomationServiceImplBuilder clientOptions(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
return this;
}
/*
- * The HTTP client used to send the request.
+ * The retry options to configure retry policy for failed requests.
*/
- private HttpClient httpClient;
+ @Generated private RetryOptions retryOptions;
- /**
- * Sets The HTTP client used to send the request.
- *
- * @param httpClient the httpClient value.
- * @return the AzureCommunicationCallAutomationServiceImplBuilder.
- */
- public AzureCommunicationCallAutomationServiceImplBuilder httpClient(HttpClient httpClient) {
- this.httpClient = httpClient;
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public AzureCommunicationCallAutomationServiceImplBuilder retryOptions(RetryOptions retryOptions) {
+ this.retryOptions = retryOptions;
+ return this;
+ }
+
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public AzureCommunicationCallAutomationServiceImplBuilder addPolicy(HttpPipelinePolicy customPolicy) {
+ Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null.");
+ pipelinePolicies.add(customPolicy);
return this;
}
/*
- * The configuration store that is used during construction of the service
- * client.
+ * The configuration store that is used during construction of the service client.
*/
- private Configuration configuration;
+ @Generated private Configuration configuration;
- /**
- * Sets The configuration store that is used during construction of the service client.
- *
- * @param configuration the configuration value.
- * @return the AzureCommunicationCallAutomationServiceImplBuilder.
- */
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
public AzureCommunicationCallAutomationServiceImplBuilder configuration(Configuration configuration) {
this.configuration = configuration;
return this;
}
/*
- * The logging configuration for HTTP requests and responses.
+ * The AzureKeyCredential used for authentication.
+ */
+ @Generated private AzureKeyCredential azureKeyCredential;
+
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public AzureCommunicationCallAutomationServiceImplBuilder credential(AzureKeyCredential azureKeyCredential) {
+ this.azureKeyCredential = azureKeyCredential;
+ return this;
+ }
+
+ /*
+ * The service endpoint
*/
- private HttpLogOptions httpLogOptions;
+ @Generated private String endpoint;
+
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public AzureCommunicationCallAutomationServiceImplBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * Api Version
+ */
+ @Generated private String apiVersion;
/**
- * Sets The logging configuration for HTTP requests and responses.
+ * Sets Api Version.
*
- * @param httpLogOptions the httpLogOptions value.
+ * @param apiVersion the apiVersion value.
* @return the AzureCommunicationCallAutomationServiceImplBuilder.
*/
- public AzureCommunicationCallAutomationServiceImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
- this.httpLogOptions = httpLogOptions;
+ @Generated
+ public AzureCommunicationCallAutomationServiceImplBuilder apiVersion(String apiVersion) {
+ this.apiVersion = apiVersion;
return this;
}
/*
- * The retry policy that will attempt to retry failed requests, if
- * applicable.
+ * The serializer to serialize an object into a string
*/
- private RetryPolicy retryPolicy;
+ @Generated private SerializerAdapter serializerAdapter;
/**
- * Sets The retry policy that will attempt to retry failed requests, if applicable.
+ * Sets The serializer to serialize an object into a string.
*
- * @param retryPolicy the retryPolicy value.
+ * @param serializerAdapter the serializerAdapter value.
* @return the AzureCommunicationCallAutomationServiceImplBuilder.
*/
- public AzureCommunicationCallAutomationServiceImplBuilder retryPolicy(RetryPolicy retryPolicy) {
- this.retryPolicy = retryPolicy;
+ @Generated
+ public AzureCommunicationCallAutomationServiceImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
return this;
}
/*
- * The list of Http pipeline policies to add.
+ * The retry policy that will attempt to retry failed requests, if applicable.
*/
- private final List pipelinePolicies;
+ @Generated private RetryPolicy retryPolicy;
/**
- * Adds a custom Http pipeline policy.
+ * Sets The retry policy that will attempt to retry failed requests, if applicable.
*
- * @param customPolicy The custom Http pipeline policy to add.
+ * @param retryPolicy the retryPolicy value.
* @return the AzureCommunicationCallAutomationServiceImplBuilder.
*/
- public AzureCommunicationCallAutomationServiceImplBuilder addPolicy(HttpPipelinePolicy customPolicy) {
- pipelinePolicies.add(customPolicy);
+ @Generated
+ public AzureCommunicationCallAutomationServiceImplBuilder retryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = retryPolicy;
return this;
}
@@ -188,42 +231,57 @@ public AzureCommunicationCallAutomationServiceImplBuilder addPolicy(HttpPipeline
*
* @return an instance of AzureCommunicationCallAutomationServiceImpl.
*/
+ @Generated
public AzureCommunicationCallAutomationServiceImpl buildClient() {
- if (apiVersion == null) {
- this.apiVersion = "2023-10-03-preview";
- }
- if (pipeline == null) {
- this.pipeline = createHttpPipeline();
- }
- if (serializerAdapter == null) {
- this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter();
- }
+ HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline();
+ String localApiVersion = (apiVersion != null) ? apiVersion : "2023-10-15";
+ SerializerAdapter localSerializerAdapter =
+ (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter();
AzureCommunicationCallAutomationServiceImpl client =
- new AzureCommunicationCallAutomationServiceImpl(pipeline, serializerAdapter, endpoint, apiVersion);
+ new AzureCommunicationCallAutomationServiceImpl(
+ localPipeline, localSerializerAdapter, this.endpoint, localApiVersion);
return client;
}
+ @Generated
private HttpPipeline createHttpPipeline() {
Configuration buildConfiguration =
(configuration == null) ? Configuration.getGlobalConfiguration() : configuration;
- if (httpLogOptions == null) {
- httpLogOptions = new HttpLogOptions();
- }
+ HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions;
+ ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions;
List policies = new ArrayList<>();
- String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");
- String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion");
- policies.add(
- new UserAgentPolicy(httpLogOptions.getApplicationId(), clientName, clientVersion, buildConfiguration));
+ String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName");
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+ String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions);
+ policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));
+ policies.add(new RequestIdPolicy());
+ policies.add(new AddHeadersFromContextPolicy());
+ HttpHeaders headers = new HttpHeaders();
+ localClientOptions
+ .getHeaders()
+ .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue()));
+ if (headers.getSize() > 0) {
+ policies.add(new AddHeadersPolicy(headers));
+ }
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .forEach(p -> policies.add(p));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
- policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy);
- policies.add(new CookiePolicy());
- policies.addAll(this.pipelinePolicies);
+ policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
+ policies.add(new AddDatePolicy());
+ if (azureKeyCredential != null) {
+ policies.add(new AzureKeyCredentialPolicy("Authorization", azureKeyCredential));
+ }
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .forEach(p -> policies.add(p));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
new HttpPipelineBuilder()
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.httpClient(httpClient)
+ .clientOptions(localClientOptions)
.build();
return httpPipeline;
}
diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallConnectionsImpl.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallConnectionsImpl.java
index 674302078c1a..23da6c9925f9 100644
--- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallConnectionsImpl.java
+++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/CallConnectionsImpl.java
@@ -18,8 +18,6 @@
import com.azure.communication.callautomation.implementation.models.RemoveParticipantResponseInternal;
import com.azure.communication.callautomation.implementation.models.TransferCallResponseInternal;
import com.azure.communication.callautomation.implementation.models.TransferToParticipantRequestInternal;
-import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsRequestInternal;
-import com.azure.communication.callautomation.implementation.models.UnmuteParticipantsResponseInternal;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
@@ -100,9 +98,9 @@ Mono> terminateCall(
@HostParam("endpoint") String endpoint,
@PathParam("callConnectionId") String callConnectionId,
@QueryParam("api-version") String apiVersion,
- @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID,
- @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent,
@HeaderParam("Accept") String accept,
+ @HeaderParam("repeatability-request-id") String repeatabilityRequestId,
+ @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent,
Context context);
@Post("/calling/callConnections/{callConnectionId}:transferToParticipant")
@@ -112,10 +110,10 @@ Mono> transferToParticipant(
@HostParam("endpoint") String endpoint,
@PathParam("callConnectionId") String callConnectionId,
@QueryParam("api-version") String apiVersion,
- @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID,
- @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent,
@BodyParam("application/json") TransferToParticipantRequestInternal transferToParticipantRequest,
@HeaderParam("Accept") String accept,
+ @HeaderParam("repeatability-request-id") String repeatabilityRequestId,
+ @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent,
Context context);
@Get("/calling/callConnections/{callConnectionId}/participants")
@@ -135,10 +133,10 @@ Mono> addParticipant(
@HostParam("endpoint") String endpoint,
@PathParam("callConnectionId") String callConnectionId,
@QueryParam("api-version") String apiVersion,
- @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID,
- @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent,
@BodyParam("application/json") AddParticipantRequestInternal addParticipantRequest,
@HeaderParam("Accept") String accept,
+ @HeaderParam("repeatability-request-id") String repeatabilityRequestId,
+ @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent,
Context context);
@Post("/calling/callConnections/{callConnectionId}/participants:remove")
@@ -148,10 +146,10 @@ Mono> removeParticipant(
@HostParam("endpoint") String endpoint,
@PathParam("callConnectionId") String callConnectionId,
@QueryParam("api-version") String apiVersion,
- @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID,
- @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent,
@BodyParam("application/json") RemoveParticipantRequestInternal removeParticipantRequest,
@HeaderParam("Accept") String accept,
+ @HeaderParam("repeatability-request-id") String repeatabilityRequestId,
+ @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent,
Context context);
@Post("/calling/callConnections/{callConnectionId}/participants:mute")
@@ -161,23 +159,10 @@ Mono> mute(
@HostParam("endpoint") String endpoint,
@PathParam("callConnectionId") String callConnectionId,
@QueryParam("api-version") String apiVersion,
- @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID,
- @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent,
@BodyParam("application/json") MuteParticipantsRequestInternal muteParticipantsRequest,
@HeaderParam("Accept") String accept,
- Context context);
-
- @Post("/calling/callConnections/{callConnectionId}/participants:unmute")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class)
- Mono> unmute(
- @HostParam("endpoint") String endpoint,
- @PathParam("callConnectionId") String callConnectionId,
- @QueryParam("api-version") String apiVersion,
- @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID,
- @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent,
- @BodyParam("application/json") UnmuteParticipantsRequestInternal unmuteParticipantsRequest,
- @HeaderParam("Accept") String accept,
+ @HeaderParam("repeatability-request-id") String repeatabilityRequestId,
+ @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent,
Context context);
@Post("/calling/callConnections/{callConnectionId}/participants:cancelAddParticipant")
@@ -187,10 +172,10 @@ Mono> cancelAddParticipant(
@HostParam("endpoint") String endpoint,
@PathParam("callConnectionId") String callConnectionId,
@QueryParam("api-version") String apiVersion,
- @HeaderParam("Repeatability-Request-ID") UUID repeatabilityRequestID,
- @HeaderParam("Repeatability-First-Sent") DateTimeRfc1123 repeatabilityFirstSent,
@BodyParam("application/json") CancelAddParticipantRequest cancelAddParticipantRequest,
@HeaderParam("Accept") String accept,
+ @HeaderParam("repeatability-request-id") String repeatabilityRequestId,
+ @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent,
Context context);
@Get("/calling/callConnections/{callConnectionId}/participants/{participantRawId}")
@@ -221,7 +206,8 @@ Mono> getParticipantsNext(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the detail properties of an ongoing call.
+ * @return the detail properties of an ongoing call along with {@link Response} on successful completion of {@link
+ * Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getCallWithResponseAsync(String callConnectionId) {
@@ -244,7 +230,8 @@ public Mono> getCallWithResponseAsync
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the detail properties of an ongoing call.
+ * @return the detail properties of an ongoing call along with {@link Response} on successful completion of {@link
+ * Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getCallWithResponseAsync(
@@ -261,19 +248,11 @@ public Mono> getCallWithResponseAsync
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the detail properties of an ongoing call.
+ * @return the detail properties of an ongoing call on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getCallAsync(String callConnectionId) {
- return getCallWithResponseAsync(callConnectionId)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ return getCallWithResponseAsync(callConnectionId).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -284,48 +263,40 @@ public Mono getCallAsync(String callConnection
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the detail properties of an ongoing call.
+ * @return the detail properties of an ongoing call on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getCallAsync(String callConnectionId, Context context) {
- return getCallWithResponseAsync(callConnectionId, context)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ return getCallWithResponseAsync(callConnectionId, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get the detail properties of an ongoing call.
*
* @param callConnectionId The call connection id.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the detail properties of an ongoing call.
+ * @return the detail properties of an ongoing call along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public CallConnectionPropertiesInternal getCall(String callConnectionId) {
- return getCallAsync(callConnectionId).block();
+ public Response getCallWithResponse(String callConnectionId, Context context) {
+ return getCallWithResponseAsync(callConnectionId, context).block();
}
/**
* Get the detail properties of an ongoing call.
*
* @param callConnectionId The call connection id.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the detail properties of an ongoing call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getCallWithResponse(String callConnectionId, Context context) {
- return getCallWithResponseAsync(callConnectionId, context).block();
+ public CallConnectionPropertiesInternal getCall(String callConnectionId) {
+ return getCallWithResponse(callConnectionId, Context.NONE).getValue();
}
/**
@@ -336,7 +307,7 @@ public Response getCallWithResponse(String cal
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> hangupCallWithResponseAsync(String callConnectionId) {
@@ -360,7 +331,7 @@ public Mono> hangupCallWithResponseAsync(String callConnectionId)
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> hangupCallWithResponseAsync(String callConnectionId, Context context) {
@@ -377,11 +348,11 @@ public Mono> hangupCallWithResponseAsync(String callConnectionId,
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono hangupCallAsync(String callConnectionId) {
- return hangupCallWithResponseAsync(callConnectionId).flatMap((Response res) -> Mono.empty());
+ return hangupCallWithResponseAsync(callConnectionId).flatMap(ignored -> Mono.empty());
}
/**
@@ -393,11 +364,11 @@ public Mono hangupCallAsync(String callConnectionId) {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono hangupCallAsync(String callConnectionId, Context context) {
- return hangupCallWithResponseAsync(callConnectionId, context).flatMap((Response res) -> Mono.empty());
+ return hangupCallWithResponseAsync(callConnectionId, context).flatMap(ignored -> Mono.empty());
}
/**
@@ -405,13 +376,15 @@ public Mono hangupCallAsync(String callConnectionId, Context context) {
* not terminate if there are more than 1 caller in the call.
*
* @param callConnectionId The call connection id.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public void hangupCall(String callConnectionId) {
- hangupCallAsync(callConnectionId).block();
+ public Response hangupCallWithResponse(String callConnectionId, Context context) {
+ return hangupCallWithResponseAsync(callConnectionId, context).block();
}
/**
@@ -419,49 +392,38 @@ public void hangupCall(String callConnectionId) {
* not terminate if there are more than 1 caller in the call.
*
* @param callConnectionId The call connection id.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response hangupCallWithResponse(String callConnectionId, Context context) {
- return hangupCallWithResponseAsync(callConnectionId, context).block();
+ public void hangupCall(String callConnectionId) {
+ hangupCallWithResponse(callConnectionId, Context.NONE);
}
/**
* Terminate a call using CallConnectionId.
*
* @param callConnectionId The terminate call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> terminateCallWithResponseAsync(
- String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) {
+ public Mono> terminateCallWithResponseAsync(String callConnectionId) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return FluxUtil.withContext(
context ->
service.terminateCall(
this.client.getEndpoint(),
callConnectionId,
this.client.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context));
}
@@ -469,36 +431,24 @@ public Mono> terminateCallWithResponseAsync(
* Terminate a call using CallConnectionId.
*
* @param callConnectionId The terminate call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> terminateCallWithResponseAsync(
- String callConnectionId,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
+ public Mono> terminateCallWithResponseAsync(String callConnectionId, Context context) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return service.terminateCall(
this.client.getEndpoint(),
callConnectionId,
this.client.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context);
}
@@ -506,102 +456,57 @@ public Mono> terminateCallWithResponseAsync(
* Terminate a call using CallConnectionId.
*
* @param callConnectionId The terminate call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono terminateCallAsync(
- String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) {
- return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent)
- .flatMap((Response res) -> Mono.empty());
+ public Mono terminateCallAsync(String callConnectionId) {
+ return terminateCallWithResponseAsync(callConnectionId).flatMap(ignored -> Mono.empty());
}
/**
* Terminate a call using CallConnectionId.
*
* @param callConnectionId The terminate call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the completion.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono terminateCallAsync(
- String callConnectionId,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent, context)
- .flatMap((Response res) -> Mono.empty());
+ public Mono terminateCallAsync(String callConnectionId, Context context) {
+ return terminateCallWithResponseAsync(callConnectionId, context).flatMap(ignored -> Mono.empty());
}
/**
* Terminate a call using CallConnectionId.
*
* @param callConnectionId The terminate call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public void terminateCall(
- String callConnectionId, UUID repeatabilityRequestID, OffsetDateTime repeatabilityFirstSent) {
- terminateCallAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent).block();
+ public Response terminateCallWithResponse(String callConnectionId, Context context) {
+ return terminateCallWithResponseAsync(callConnectionId, context).block();
}
/**
* Terminate a call using CallConnectionId.
*
* @param callConnectionId The terminate call request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response terminateCallWithResponse(
- String callConnectionId,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
- Context context) {
- return terminateCallWithResponseAsync(callConnectionId, repeatabilityRequestID, repeatabilityFirstSent, context)
- .block();
+ public void terminateCall(String callConnectionId) {
+ terminateCallWithResponse(callConnectionId, Context.NONE);
}
/**
@@ -609,38 +514,28 @@ public Response terminateCallWithResponse(
*
* @param callConnectionId The call connection id.
* @param transferToParticipantRequest The transfer to participant request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response payload for transferring the call.
+ * @return the response payload for transferring the call along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> transferToParticipantWithResponseAsync(
- String callConnectionId,
- TransferToParticipantRequestInternal transferToParticipantRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
+ String callConnectionId, TransferToParticipantRequestInternal transferToParticipantRequest) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return FluxUtil.withContext(
context ->
service.transferToParticipant(
this.client.getEndpoint(),
callConnectionId,
this.client.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
transferToParticipantRequest,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context));
}
@@ -649,38 +544,29 @@ public Mono> transferToParticipantWithRes
*
* @param callConnectionId The call connection id.
* @param transferToParticipantRequest The transfer to participant request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response payload for transferring the call.
+ * @return the response payload for transferring the call along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> transferToParticipantWithResponseAsync(
String callConnectionId,
TransferToParticipantRequestInternal transferToParticipantRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
Context context) {
final String accept = "application/json";
- DateTimeRfc1123 repeatabilityFirstSentConverted =
- repeatabilityFirstSent == null ? null : new DateTimeRfc1123(repeatabilityFirstSent);
+ String repeatabilityRequestId = UUID.randomUUID().toString();
+ String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now());
return service.transferToParticipant(
this.client.getEndpoint(),
callConnectionId,
this.client.getApiVersion(),
- repeatabilityRequestID,
- repeatabilityFirstSentConverted,
transferToParticipantRequest,
accept,
+ repeatabilityRequestId,
+ repeatabilityFirstSent,
context);
}
@@ -689,35 +575,16 @@ public Mono> transferToParticipantWithRes
*
* @param callConnectionId The call connection id.
* @param transferToParticipantRequest The transfer to participant request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response payload for transferring the call.
+ * @return the response payload for transferring the call on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono transferToParticipantAsync(
- String callConnectionId,
- TransferToParticipantRequestInternal transferToParticipantRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent) {
- return transferToParticipantWithResponseAsync(
- callConnectionId, transferToParticipantRequest, repeatabilityRequestID, repeatabilityFirstSent)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ String callConnectionId, TransferToParticipantRequestInternal transferToParticipantRequest) {
+ return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -725,41 +592,19 @@ public Mono transferToParticipantAsync(
*
* @param callConnectionId The call connection id.
* @param transferToParticipantRequest The transfer to participant request.
- * @param repeatabilityRequestID If specified, the client directs that the request is repeatable; that is, that the
- * client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate
- * response without the server executing the request multiple times. The value of the Repeatability-Request-Id
- * is an opaque string representing a client-generated unique identifier for the request. It is a version 4
- * (random) UUID.
- * @param repeatabilityFirstSent If Repeatability-Request-ID header is specified, then Repeatability-First-Sent
- * header must also be specified. The value should be the date and time at which the request was first created,
- * expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws CommunicationErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response payload for transferring the call.
+ * @return the response payload for transferring the call on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono transferToParticipantAsync(
String callConnectionId,
TransferToParticipantRequestInternal transferToParticipantRequest,
- UUID repeatabilityRequestID,
- OffsetDateTime repeatabilityFirstSent,
Context context) {
- return transferToParticipantWithResponseAsync(
- callConnectionId,
- transferToParticipantRequest,
- repeatabilityRequestID,
- repeatabilityFirstSent,
- context)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ return transferToParticipantWithResponseAsync(callConnectionId, transferToParticipantRequest, context)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -767,28 +612,18 @@ public Mono