Skip to content

Commit

Permalink
CodeGen from PR 29723 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 1c43309c5e794189096ab97ca9cad19501af2872 into 73e33d06b7f3c08b11717374837332cfc5f96a5d
  • Loading branch information
SDKAuto committed Jul 9, 2024
1 parent 3b7e612 commit d648604
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 25 deletions.
67 changes: 64 additions & 3 deletions sdk/communication/azure-communication-messages/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,73 @@

### Features Added

### Breaking Changes
* `models.CommunicationMessagesChannel` was added

### Bugs Fixed
* `models.MessageTemplateValueKind` was added

### Other Changes
* `models.CommunicationMessageKind` was added

* `models.MessageTemplateBindingsKind` was added

#### `models.MessageTemplateImage` was modified

* `getKind()` was added

#### `models.MessageTemplateQuickAction` was modified

* `getKind()` was added

#### `models.MessageTemplateBindings` was modified

* `getKind()` was added

#### `models.channels.WhatsAppMessageTemplateBindings` was modified

* `getKind()` was added

#### `models.MessageTemplateVideo` was modified

* `getKind()` was added

#### `models.MessageTemplateText` was modified

* `getKind()` was added

#### `models.NotificationContent` was modified

* `getKind()` was added

#### `models.TextNotificationContent` was modified

* `getKind()` was added

#### `models.MediaNotificationContent` was modified

* `getKind()` was added

#### `models.MessageTemplateItem` was modified

* `getKind()` was added

#### `models.MessageTemplateValue` was modified

* `getKind()` was added

#### `models.TemplateNotificationContent` was modified

* `getKind()` was added

#### `models.MessageTemplateLocation` was modified

* `getKind()` was added

#### `models.MessageTemplateDocument` was modified

* `getKind()` was added

#### `models.channels.WhatsAppMessageTemplateItem` was modified

* `getKind()` was added

## 1.0.4 (2024-06-27)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public final class NotificationMessagesAsyncClient {
* }
* }</pre>
*
* @param body Body parameter.
* @param notificationContent Details of the message to send.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
Expand All @@ -86,8 +86,8 @@ public final class NotificationMessagesAsyncClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> sendWithResponse(BinaryData body, RequestOptions requestOptions) {
return this.serviceClient.sendWithResponseAsync(body, requestOptions);
public Mono<Response<BinaryData>> sendWithResponse(BinaryData notificationContent, RequestOptions requestOptions) {
return this.serviceClient.sendWithResponseAsync(notificationContent, requestOptions);
}

/**
Expand Down Expand Up @@ -115,7 +115,7 @@ public Mono<Response<BinaryData>> downloadMediaWithResponse(String mediaId, Requ
/**
* Sends a notification message from Business to User.
*
* @param body Body parameter.
* @param notificationContent Details of the message to send.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
Expand All @@ -126,10 +126,10 @@ public Mono<Response<BinaryData>> downloadMediaWithResponse(String mediaId, Requ
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<SendMessageResult> send(NotificationContent body) {
public Mono<SendMessageResult> send(NotificationContent notificationContent) {
// Generated convenience method for sendWithResponse
RequestOptions requestOptions = new RequestOptions();
return sendWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono)
return sendWithResponse(BinaryData.fromObject(notificationContent), requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(SendMessageResult.class));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public final class NotificationMessagesClient {
* }
* }</pre>
*
* @param body Body parameter.
* @param notificationContent Details of the message to send.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
Expand All @@ -83,8 +83,8 @@ public final class NotificationMessagesClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> sendWithResponse(BinaryData body, RequestOptions requestOptions) {
return this.serviceClient.sendWithResponse(body, requestOptions);
public Response<BinaryData> sendWithResponse(BinaryData notificationContent, RequestOptions requestOptions) {
return this.serviceClient.sendWithResponse(notificationContent, requestOptions);
}

/**
Expand Down Expand Up @@ -112,7 +112,7 @@ public Response<BinaryData> downloadMediaWithResponse(String mediaId, RequestOpt
/**
* Sends a notification message from Business to User.
*
* @param body Body parameter.
* @param notificationContent Details of the message to send.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
Expand All @@ -123,10 +123,10 @@ public Response<BinaryData> downloadMediaWithResponse(String mediaId, RequestOpt
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public SendMessageResult send(NotificationContent body) {
public SendMessageResult send(NotificationContent notificationContent) {
// Generated convenience method for sendWithResponse
RequestOptions requestOptions = new RequestOptions();
return sendWithResponse(BinaryData.fromObject(body), requestOptions).getValue()
return sendWithResponse(BinaryData.fromObject(notificationContent), requestOptions).getValue()
.toObject(SendMessageResult.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ public interface NotificationMessagesClientService {
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono<Response<BinaryData>> send(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
@BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
@BodyParam("application/json") BinaryData notificationContent, RequestOptions requestOptions,
Context context);

@Post("/messages/notifications:send")
@ExpectedResponses({ 202 })
Expand All @@ -171,7 +172,8 @@ Mono<Response<BinaryData>> send(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response<BinaryData> sendSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
@BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context);
@BodyParam("application/json") BinaryData notificationContent, RequestOptions requestOptions,
Context context);

@Get("/messages/streams/{id}")
@ExpectedResponses({ 200 })
Expand Down Expand Up @@ -230,7 +232,7 @@ Response<BinaryData> downloadMediaSync(@HostParam("endpoint") String endpoint,
* }
* }</pre>
*
* @param body Body parameter.
* @param notificationContent Details of the message to send.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
Expand All @@ -240,7 +242,8 @@ Response<BinaryData> downloadMediaSync(@HostParam("endpoint") String endpoint,
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> sendWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
public Mono<Response<BinaryData>> sendWithResponseAsync(BinaryData notificationContent,
RequestOptions requestOptions) {
final String accept = "application/json";
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
requestOptionsLocal.addRequestCallback(requestLocal -> {
Expand All @@ -257,7 +260,7 @@ public Mono<Response<BinaryData>> sendWithResponseAsync(BinaryData body, Request
}
});
return FluxUtil.withContext(context -> service.send(this.getEndpoint(), this.getServiceVersion().getVersion(),
accept, body, requestOptionsLocal, context));
accept, notificationContent, requestOptionsLocal, context));
}

/**
Expand Down Expand Up @@ -296,7 +299,7 @@ public Mono<Response<BinaryData>> sendWithResponseAsync(BinaryData body, Request
* }
* }</pre>
*
* @param body Body parameter.
* @param notificationContent Details of the message to send.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
Expand All @@ -305,7 +308,7 @@ public Mono<Response<BinaryData>> sendWithResponseAsync(BinaryData body, Request
* @return result of the send message operation along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> sendWithResponse(BinaryData body, RequestOptions requestOptions) {
public Response<BinaryData> sendWithResponse(BinaryData notificationContent, RequestOptions requestOptions) {
final String accept = "application/json";
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
requestOptionsLocal.addRequestCallback(requestLocal -> {
Expand All @@ -321,7 +324,7 @@ public Response<BinaryData> sendWithResponse(BinaryData body, RequestOptions req
DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()));
}
});
return service.sendSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body,
return service.sendSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, notificationContent,
requestOptionsLocal, Context.NONE);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
directory: specification/communication/Communication.Messages
commit: 3cb1b51638616435470fc10ea00de92512186ece
commit: aa8ba6edab8682393ca46c6e2d18fc60fc87a727
repo: Azure/azure-rest-api-specs
additionalDirectories: null
additionalDirectories:

0 comments on commit d648604

Please sign in to comment.