Skip to content

Commit ea3297d

Browse files
author
SDKAuto
committed
CodeGen from PR 32475 in Azure/azure-rest-api-specs
Merge 0fb7ec89a31887a71abf89f3ff95c798f0791536 into fcd1c4977ad31417ab298205e87727c4cc8474f1
1 parent 783a724 commit ea3297d

File tree

7 files changed

+170
-73
lines changed

7 files changed

+170
-73
lines changed

sdk/communication/azure-communication-messages/CHANGELOG.md

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,95 @@
22

33
## 1.2.0-beta.1 (2025-02-11)
44

5+
### Breaking Changes
6+
7+
#### `NotificationMessagesAsyncClient` was modified
8+
9+
* `downloadMedia(java.lang.String)` was removed
10+
* `downloadMediaWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was removed
11+
12+
#### `NotificationMessagesClient` was modified
13+
14+
* `downloadMedia(java.lang.String)` was removed
15+
* `downloadMediaWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was removed
16+
17+
#### `implementation.NotificationMessagesClientImpl` was modified
18+
19+
* `downloadMediaWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was removed
20+
* `downloadMediaWithResponseAsync(java.lang.String,com.azure.core.http.rest.RequestOptions)` was removed
21+
22+
#### `implementation.NotificationMessagesClientImpl$NotificationMessagesClientService` was modified
23+
24+
* `downloadMediaSync(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was removed
25+
* `downloadMedia(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was removed
26+
527
### Features Added
6-
- Added Interactive Message.
7-
- Added Reaction Message.
8-
- Added Sticker Message.
928

29+
* `models.channels.WhatsAppListActionBindings` was added
30+
31+
* `models.ActionGroupItem` was added
32+
33+
* `models.ImageMessageContent` was added
34+
35+
* `models.ButtonSetContent` was added
36+
37+
* `models.MessageContent` was added
38+
39+
* `models.StickerNotificationContent` was added
40+
41+
* `models.channels.WhatsAppUrlActionBindings` was added
42+
43+
* `models.ActionGroup` was added
44+
45+
* `models.InteractiveMessage` was added
46+
47+
* `models.VideoMessageContent` was added
48+
49+
* `models.InteractiveNotificationContent` was added
50+
51+
* `models.ReactionNotificationContent` was added
52+
53+
* `models.DocumentMessageContent` was added
54+
55+
* `models.ButtonContent` was added
56+
57+
* `models.ActionGroupContent` was added
58+
59+
* `models.LinkContent` was added
60+
61+
* `models.MessageContentKind` was added
62+
63+
* `models.ActionBindings` was added
64+
65+
* `models.MessageActionBindingKind` was added
66+
67+
* `models.channels.WhatsAppButtonActionBindings` was added
68+
69+
* `models.TextMessageContent` was added
70+
71+
#### `NotificationMessagesAsyncClient` was modified
72+
73+
* `downloadMedia()` was added
74+
* `downloadMediaWithResponse(com.azure.core.http.rest.RequestOptions)` was added
75+
76+
#### `NotificationMessagesClient` was modified
77+
78+
* `downloadMediaWithResponse(com.azure.core.http.rest.RequestOptions)` was added
79+
* `downloadMedia()` was added
80+
81+
#### `implementation.NotificationMessagesClientImpl` was modified
82+
83+
* `downloadMediaWithResponse(com.azure.core.http.rest.RequestOptions)` was added
84+
* `downloadMediaWithResponseAsync(com.azure.core.http.rest.RequestOptions)` was added
85+
86+
#### `models.channels.WhatsAppMessageTemplateItem` was modified
87+
88+
* `getName()` was added
89+
90+
#### `implementation.NotificationMessagesClientImpl$NotificationMessagesClientService` was modified
91+
92+
* `downloadMedia(java.lang.String,java.lang.String,java.lang.String,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was added
93+
* `downloadMediaSync(java.lang.String,java.lang.String,java.lang.String,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was added
1094

1195
## 1.1.1 (2024-12-04)
1296

sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,55 +95,52 @@ public Mono<Response<BinaryData>> sendWithResponse(BinaryData notificationConten
9595
}
9696

9797
/**
98-
* Download the Media payload from a User to Business message.
99-
* <p><strong>Response Body Schema</strong></p>
100-
*
101-
* <pre>
102-
* {@code
103-
* BinaryData
104-
* }
105-
* </pre>
98+
* Sends a notification message from Business to User.
10699
*
107-
* @param mediaId The stream ID.
108-
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
100+
* @param notificationContent Details of the message to send.
101+
* @throws IllegalArgumentException thrown if parameters fail the validation.
109102
* @throws HttpResponseException thrown if the request is rejected by server.
110103
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
111104
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
112105
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
113-
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
106+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
107+
* @return result of the send message operation on successful completion of {@link Mono}.
114108
*/
115109
@Generated
116110
@ServiceMethod(returns = ReturnType.SINGLE)
117-
public Mono<Response<BinaryData>> downloadMediaWithResponse(String mediaId, RequestOptions requestOptions) {
118-
return this.serviceClient.downloadMediaWithResponseAsync(mediaId, requestOptions);
111+
public Mono<SendMessageResult> send(NotificationContent notificationContent) {
112+
// Generated convenience method for sendWithResponse
113+
RequestOptions requestOptions = new RequestOptions();
114+
return sendWithResponse(BinaryData.fromObject(notificationContent), requestOptions).flatMap(FluxUtil::toMono)
115+
.map(protocolMethodData -> protocolMethodData.toObject(SendMessageResult.class));
119116
}
120117

121118
/**
122-
* Sends a notification message from Business to User.
119+
* Download the Media payload from a User to Business message.
120+
* <p><strong>Response Body Schema</strong></p>
121+
*
122+
* <pre>
123+
* {@code
124+
* BinaryData
125+
* }
126+
* </pre>
123127
*
124-
* @param notificationContent Details of the message to send.
125-
* @throws IllegalArgumentException thrown if parameters fail the validation.
128+
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
126129
* @throws HttpResponseException thrown if the request is rejected by server.
127130
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
128131
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
129132
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
130-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
131-
* @return result of the send message operation on successful completion of {@link Mono}.
133+
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
132134
*/
133135
@Generated
134136
@ServiceMethod(returns = ReturnType.SINGLE)
135-
public Mono<SendMessageResult> send(NotificationContent notificationContent) {
136-
// Generated convenience method for sendWithResponse
137-
RequestOptions requestOptions = new RequestOptions();
138-
return sendWithResponse(BinaryData.fromObject(notificationContent), requestOptions).flatMap(FluxUtil::toMono)
139-
.map(protocolMethodData -> protocolMethodData.toObject(SendMessageResult.class));
137+
public Mono<Response<BinaryData>> downloadMediaWithResponse(RequestOptions requestOptions) {
138+
return this.serviceClient.downloadMediaWithResponseAsync(requestOptions);
140139
}
141140

142141
/**
143142
* Download the Media payload from a User to Business message.
144143
*
145-
* @param mediaId The stream ID.
146-
* @throws IllegalArgumentException thrown if parameters fail the validation.
147144
* @throws HttpResponseException thrown if the request is rejected by server.
148145
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
149146
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
@@ -153,9 +150,9 @@ public Mono<SendMessageResult> send(NotificationContent notificationContent) {
153150
*/
154151
@Generated
155152
@ServiceMethod(returns = ReturnType.SINGLE)
156-
public Mono<BinaryData> downloadMedia(String mediaId) {
153+
public Mono<BinaryData> downloadMedia() {
157154
// Generated convenience method for downloadMediaWithResponse
158155
RequestOptions requestOptions = new RequestOptions();
159-
return downloadMediaWithResponse(mediaId, requestOptions).flatMap(FluxUtil::toMono);
156+
return downloadMediaWithResponse(requestOptions).flatMap(FluxUtil::toMono);
160157
}
161158
}

sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -92,55 +92,52 @@ public Response<BinaryData> sendWithResponse(BinaryData notificationContent, Req
9292
}
9393

9494
/**
95-
* Download the Media payload from a User to Business message.
96-
* <p><strong>Response Body Schema</strong></p>
97-
*
98-
* <pre>
99-
* {@code
100-
* BinaryData
101-
* }
102-
* </pre>
95+
* Sends a notification message from Business to User.
10396
*
104-
* @param mediaId The stream ID.
105-
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
97+
* @param notificationContent Details of the message to send.
98+
* @throws IllegalArgumentException thrown if parameters fail the validation.
10699
* @throws HttpResponseException thrown if the request is rejected by server.
107100
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
108101
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
109102
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
110-
* @return the response body along with {@link Response}.
103+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
104+
* @return result of the send message operation.
111105
*/
112106
@Generated
113107
@ServiceMethod(returns = ReturnType.SINGLE)
114-
public Response<BinaryData> downloadMediaWithResponse(String mediaId, RequestOptions requestOptions) {
115-
return this.serviceClient.downloadMediaWithResponse(mediaId, requestOptions);
108+
public SendMessageResult send(NotificationContent notificationContent) {
109+
// Generated convenience method for sendWithResponse
110+
RequestOptions requestOptions = new RequestOptions();
111+
return sendWithResponse(BinaryData.fromObject(notificationContent), requestOptions).getValue()
112+
.toObject(SendMessageResult.class);
116113
}
117114

118115
/**
119-
* Sends a notification message from Business to User.
116+
* Download the Media payload from a User to Business message.
117+
* <p><strong>Response Body Schema</strong></p>
118+
*
119+
* <pre>
120+
* {@code
121+
* BinaryData
122+
* }
123+
* </pre>
120124
*
121-
* @param notificationContent Details of the message to send.
122-
* @throws IllegalArgumentException thrown if parameters fail the validation.
125+
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
123126
* @throws HttpResponseException thrown if the request is rejected by server.
124127
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
125128
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
126129
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
127-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
128-
* @return result of the send message operation.
130+
* @return the response body along with {@link Response}.
129131
*/
130132
@Generated
131133
@ServiceMethod(returns = ReturnType.SINGLE)
132-
public SendMessageResult send(NotificationContent notificationContent) {
133-
// Generated convenience method for sendWithResponse
134-
RequestOptions requestOptions = new RequestOptions();
135-
return sendWithResponse(BinaryData.fromObject(notificationContent), requestOptions).getValue()
136-
.toObject(SendMessageResult.class);
134+
public Response<BinaryData> downloadMediaWithResponse(RequestOptions requestOptions) {
135+
return this.serviceClient.downloadMediaWithResponse(requestOptions);
137136
}
138137

139138
/**
140139
* Download the Media payload from a User to Business message.
141140
*
142-
* @param mediaId The stream ID.
143-
* @throws IllegalArgumentException thrown if parameters fail the validation.
144141
* @throws HttpResponseException thrown if the request is rejected by server.
145142
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
146143
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
@@ -150,9 +147,9 @@ public SendMessageResult send(NotificationContent notificationContent) {
150147
*/
151148
@Generated
152149
@ServiceMethod(returns = ReturnType.SINGLE)
153-
public BinaryData downloadMedia(String mediaId) {
150+
public BinaryData downloadMedia() {
154151
// Generated convenience method for downloadMediaWithResponse
155152
RequestOptions requestOptions = new RequestOptions();
156-
return downloadMediaWithResponse(mediaId, requestOptions).getValue();
153+
return downloadMediaWithResponse(requestOptions).getValue();
157154
}
158155
}

sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import com.azure.core.annotation.HeaderParam;
1212
import com.azure.core.annotation.Host;
1313
import com.azure.core.annotation.HostParam;
14-
import com.azure.core.annotation.PathParam;
1514
import com.azure.core.annotation.Post;
1615
import com.azure.core.annotation.QueryParam;
1716
import com.azure.core.annotation.ReturnType;
@@ -175,25 +174,25 @@ Response<BinaryData> sendSync(@HostParam("endpoint") String endpoint,
175174
@HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData notificationContent,
176175
RequestOptions requestOptions, Context context);
177176

178-
@Get("/messages/streams/{id}")
177+
@Get("/")
179178
@ExpectedResponses({ 200 })
180179
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
181180
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
182181
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
183182
@UnexpectedResponseExceptionType(HttpResponseException.class)
184183
Mono<Response<BinaryData>> downloadMedia(@HostParam("endpoint") String endpoint,
185-
@QueryParam("api-version") String apiVersion, @PathParam("id") String mediaId,
186-
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
184+
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
185+
RequestOptions requestOptions, Context context);
187186

188-
@Get("/messages/streams/{id}")
187+
@Get("/")
189188
@ExpectedResponses({ 200 })
190189
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
191190
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
192191
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
193192
@UnexpectedResponseExceptionType(HttpResponseException.class)
194193
Response<BinaryData> downloadMediaSync(@HostParam("endpoint") String endpoint,
195-
@QueryParam("api-version") String apiVersion, @PathParam("id") String mediaId,
196-
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
194+
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
195+
RequestOptions requestOptions, Context context);
197196
}
198197

199198
/**
@@ -348,7 +347,6 @@ public Response<BinaryData> sendWithResponse(BinaryData notificationContent, Req
348347
* }
349348
* </pre>
350349
*
351-
* @param mediaId The stream ID.
352350
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
353351
* @throws HttpResponseException thrown if the request is rejected by server.
354352
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
@@ -357,10 +355,10 @@ public Response<BinaryData> sendWithResponse(BinaryData notificationContent, Req
357355
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
358356
*/
359357
@ServiceMethod(returns = ReturnType.SINGLE)
360-
public Mono<Response<BinaryData>> downloadMediaWithResponseAsync(String mediaId, RequestOptions requestOptions) {
358+
public Mono<Response<BinaryData>> downloadMediaWithResponseAsync(RequestOptions requestOptions) {
361359
final String accept = "application/octet-stream";
362360
return FluxUtil.withContext(context -> service.downloadMedia(this.getEndpoint(),
363-
this.getServiceVersion().getVersion(), mediaId, accept, requestOptions, context));
361+
this.getServiceVersion().getVersion(), accept, requestOptions, context));
364362
}
365363

366364
/**
@@ -373,7 +371,6 @@ public Mono<Response<BinaryData>> downloadMediaWithResponseAsync(String mediaId,
373371
* }
374372
* </pre>
375373
*
376-
* @param mediaId The stream ID.
377374
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
378375
* @throws HttpResponseException thrown if the request is rejected by server.
379376
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
@@ -382,9 +379,9 @@ public Mono<Response<BinaryData>> downloadMediaWithResponseAsync(String mediaId,
382379
* @return the response body along with {@link Response}.
383380
*/
384381
@ServiceMethod(returns = ReturnType.SINGLE)
385-
public Response<BinaryData> downloadMediaWithResponse(String mediaId, RequestOptions requestOptions) {
382+
public Response<BinaryData> downloadMediaWithResponse(RequestOptions requestOptions) {
386383
final String accept = "application/octet-stream";
387-
return service.downloadMediaSync(this.getEndpoint(), this.getServiceVersion().getVersion(), mediaId, accept,
384+
return service.downloadMediaSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
388385
requestOptions, Context.NONE);
389386
}
390387
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.communication.messages.generated;
6+
7+
import com.azure.communication.messages.NotificationMessagesClient;
8+
import com.azure.communication.messages.NotificationMessagesClientBuilder;
9+
import com.azure.core.util.BinaryData;
10+
import com.azure.identity.DefaultAzureCredentialBuilder;
11+
12+
public class DownloadMedia {
13+
public static void main(String[] args) {
14+
NotificationMessagesClient notificationMessagesClient
15+
= new NotificationMessagesClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
16+
.endpoint("https://my-resource.communication.azure.com")
17+
.buildClient();
18+
// BEGIN:com.azure.communication.messages.generated.downloadmedia.downloadmedia
19+
BinaryData response = notificationMessagesClient.downloadMedia();
20+
// END:com.azure.communication.messages.generated.downloadmedia.downloadmedia
21+
}
22+
}

sdk/communication/azure-communication-messages/src/test/java/com/azure/communication/messages/generated/DownloadMediaTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public final class DownloadMediaTests extends NotificationMessagesClientTestBase
1515
@Disabled
1616
public void testDownloadMediaTests() {
1717
// method invocation
18-
BinaryData response = notificationMessagesClient.downloadMedia("d19e68ec-bdd6-4a50-8dfb-cbb1642df6ab");
18+
BinaryData response = notificationMessagesClient.downloadMedia();
1919

2020
// response assertion
2121
Assertions.assertNotNull(response);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
directory: specification/communication/Communication.Messages
2-
commit: 7797d20dce4f18ee2b3709b894f22634d6fb8b1e
2+
commit: 40904c4fa0c964f8b11c91a2b5afd9ae83cd6c4d
33
repo: Azure/azure-rest-api-specs
4-
additionalDirectories: null
4+
additionalDirectories:

0 commit comments

Comments
 (0)