Skip to content

Commit e3d5037

Browse files
author
SDKAuto
committed
CodeGen from PR 31549 in Azure/azure-rest-api-specs
Merge 5caa814369a82f0f43630140cfbeb2b9dbc517c4 into b562f5020f499c2fab13f1454c1908123c33b8a2
1 parent 3f90501 commit e3d5037

31 files changed

+2513
-12
lines changed

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

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,51 @@
44

55
### Features Added
66

7-
### Breaking Changes
7+
* `models.channels.WhatsAppListActionBindings` was added
88

9-
### Bugs Fixed
9+
* `models.ActionGroupItem` was added
1010

11-
### Other Changes
11+
* `models.ImageMessageContent` was added
12+
13+
* `models.ButtonSetContent` was added
14+
15+
* `models.MessageContent` was added
16+
17+
* `models.StickerNotificationContent` was added
18+
19+
* `models.channels.WhatsAppUrlActionBindings` was added
20+
21+
* `models.ActionGroup` was added
22+
23+
* `models.InteractiveMessage` was added
24+
25+
* `models.VideoMessageContent` was added
26+
27+
* `models.InteractiveNotificationContent` was added
28+
29+
* `models.ReactionNotificationContent` was added
30+
31+
* `models.DocumentMessageContent` was added
32+
33+
* `models.ButtonContent` was added
34+
35+
* `models.ActionGroupContent` was added
36+
37+
* `models.LinkContent` was added
38+
39+
* `models.MessageContentKind` was added
40+
41+
* `models.ActionBindings` was added
42+
43+
* `models.MessageActionBindingKind` was added
44+
45+
* `models.channels.WhatsAppButtonActionBindings` was added
46+
47+
* `models.TextMessageContent` was added
48+
49+
#### `models.channels.WhatsAppMessageTemplateItem` was modified
1250

51+
* `getName()` was added
1352

1453
## 1.1.1 (2024-12-04)
1554

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ public enum MessagesServiceVersion implements ServiceVersion {
1818
/**
1919
* Enum value 2024-08-30.
2020
*/
21-
V2024_08_30("2024-08-30");
21+
V2024_08_30("2024-08-30"),
22+
23+
/**
24+
* Enum value 2025-01-15-preview.
25+
*/
26+
V2025_01_15_PREVIEW("2025-01-15-preview");
2227

2328
private final String version;
2429

@@ -40,6 +45,6 @@ public String getVersion() {
4045
* @return The latest {@link MessagesServiceVersion}.
4146
*/
4247
public static MessagesServiceVersion getLatest() {
43-
return V2024_08_30;
48+
return V2025_01_15_PREVIEW;
4449
}
4550
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public final class NotificationMessagesAsyncClient {
5555
* <pre>
5656
* {@code
5757
* {
58-
* kind: String(text/image/image_v0/document/video/audio/template) (Required)
58+
* kind: String(text/image/image_v0/document/video/audio/template/sticker/reaction/interactive) (Required)
5959
* channelRegistrationId: String (Required)
6060
* to (Required): [
6161
* String (Required)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public final class NotificationMessagesClient {
5353
* <pre>
5454
* {@code
5555
* {
56-
* kind: String(text/image/image_v0/document/video/audio/template) (Required)
56+
* kind: String(text/image/image_v0/document/video/audio/template/sticker/reaction/interactive) (Required)
5757
* channelRegistrationId: String (Required)
5858
* to (Required): [
5959
* String (Required)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Response<BinaryData> downloadMediaSync(@HostParam("endpoint") String endpoint,
212212
* <pre>
213213
* {@code
214214
* {
215-
* kind: String(text/image/image_v0/document/video/audio/template) (Required)
215+
* kind: String(text/image/image_v0/document/video/audio/template/sticker/reaction/interactive) (Required)
216216
* channelRegistrationId: String (Required)
217217
* to (Required): [
218218
* String (Required)
@@ -284,7 +284,7 @@ public Mono<Response<BinaryData>> sendWithResponseAsync(BinaryData notificationC
284284
* <pre>
285285
* {@code
286286
* {
287-
* kind: String(text/image/image_v0/document/video/audio/template) (Required)
287+
* kind: String(text/image/image_v0/document/video/audio/template/sticker/reaction/interactive) (Required)
288288
* channelRegistrationId: String (Required)
289289
* to (Required): [
290290
* String (Required)
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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.models;
6+
7+
import com.azure.communication.messages.models.channels.WhatsAppButtonActionBindings;
8+
import com.azure.communication.messages.models.channels.WhatsAppListActionBindings;
9+
import com.azure.communication.messages.models.channels.WhatsAppUrlActionBindings;
10+
import com.azure.core.annotation.Generated;
11+
import com.azure.core.annotation.Immutable;
12+
import com.azure.json.JsonReader;
13+
import com.azure.json.JsonSerializable;
14+
import com.azure.json.JsonToken;
15+
import com.azure.json.JsonWriter;
16+
import java.io.IOException;
17+
18+
/**
19+
* Binding actions to the interactive message.
20+
*/
21+
@Immutable
22+
public class ActionBindings implements JsonSerializable<ActionBindings> {
23+
/*
24+
* Kind of the MessageActionBinding.
25+
*/
26+
@Generated
27+
private MessageActionBindingKind kind = MessageActionBindingKind.fromString("ActionBindings");
28+
29+
/**
30+
* Creates an instance of ActionBindings class.
31+
*/
32+
@Generated
33+
public ActionBindings() {
34+
}
35+
36+
/**
37+
* Get the kind property: Kind of the MessageActionBinding.
38+
*
39+
* @return the kind value.
40+
*/
41+
@Generated
42+
public MessageActionBindingKind getKind() {
43+
return this.kind;
44+
}
45+
46+
/**
47+
* {@inheritDoc}
48+
*/
49+
@Generated
50+
@Override
51+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
52+
jsonWriter.writeStartObject();
53+
jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
54+
return jsonWriter.writeEndObject();
55+
}
56+
57+
/**
58+
* Reads an instance of ActionBindings from the JsonReader.
59+
*
60+
* @param jsonReader The JsonReader being read.
61+
* @return An instance of ActionBindings if the JsonReader was pointing to an instance of it, or null if it was
62+
* pointing to JSON null.
63+
* @throws IOException If an error occurs while reading the ActionBindings.
64+
*/
65+
@Generated
66+
public static ActionBindings fromJson(JsonReader jsonReader) throws IOException {
67+
return jsonReader.readObject(reader -> {
68+
String discriminatorValue = null;
69+
try (JsonReader readerToUse = reader.bufferObject()) {
70+
readerToUse.nextToken(); // Prepare for reading
71+
while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
72+
String fieldName = readerToUse.getFieldName();
73+
readerToUse.nextToken();
74+
if ("kind".equals(fieldName)) {
75+
discriminatorValue = readerToUse.getString();
76+
break;
77+
} else {
78+
readerToUse.skipChildren();
79+
}
80+
}
81+
// Use the discriminator value to determine which subtype should be deserialized.
82+
if ("whatsAppListAction".equals(discriminatorValue)) {
83+
return WhatsAppListActionBindings.fromJson(readerToUse.reset());
84+
} else if ("whatsAppButtonAction".equals(discriminatorValue)) {
85+
return WhatsAppButtonActionBindings.fromJson(readerToUse.reset());
86+
} else if ("whatsAppUrlAction".equals(discriminatorValue)) {
87+
return WhatsAppUrlActionBindings.fromJson(readerToUse.reset());
88+
} else {
89+
return fromJsonKnownDiscriminator(readerToUse.reset());
90+
}
91+
}
92+
});
93+
}
94+
95+
@Generated
96+
static ActionBindings fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
97+
return jsonReader.readObject(reader -> {
98+
ActionBindings deserializedActionBindings = new ActionBindings();
99+
while (reader.nextToken() != JsonToken.END_OBJECT) {
100+
String fieldName = reader.getFieldName();
101+
reader.nextToken();
102+
103+
if ("kind".equals(fieldName)) {
104+
deserializedActionBindings.kind = MessageActionBindingKind.fromString(reader.getString());
105+
} else {
106+
reader.skipChildren();
107+
}
108+
}
109+
110+
return deserializedActionBindings;
111+
});
112+
}
113+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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.models;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.annotation.Immutable;
9+
import com.azure.json.JsonReader;
10+
import com.azure.json.JsonSerializable;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
13+
import java.io.IOException;
14+
import java.util.List;
15+
16+
/**
17+
* The Action Group content.
18+
*/
19+
@Immutable
20+
public final class ActionGroup implements JsonSerializable<ActionGroup> {
21+
/*
22+
* Title of the ActionGroup.
23+
*/
24+
@Generated
25+
private final String title;
26+
27+
/*
28+
* Array of items in ActionGroup.
29+
*/
30+
@Generated
31+
private final List<ActionGroupItem> items;
32+
33+
/**
34+
* Creates an instance of ActionGroup class.
35+
*
36+
* @param title the title value to set.
37+
* @param items the items value to set.
38+
*/
39+
@Generated
40+
public ActionGroup(String title, List<ActionGroupItem> items) {
41+
this.title = title;
42+
this.items = items;
43+
}
44+
45+
/**
46+
* Get the title property: Title of the ActionGroup.
47+
*
48+
* @return the title value.
49+
*/
50+
@Generated
51+
public String getTitle() {
52+
return this.title;
53+
}
54+
55+
/**
56+
* Get the items property: Array of items in ActionGroup.
57+
*
58+
* @return the items value.
59+
*/
60+
@Generated
61+
public List<ActionGroupItem> getItems() {
62+
return this.items;
63+
}
64+
65+
/**
66+
* {@inheritDoc}
67+
*/
68+
@Generated
69+
@Override
70+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
71+
jsonWriter.writeStartObject();
72+
jsonWriter.writeStringField("title", this.title);
73+
jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element));
74+
return jsonWriter.writeEndObject();
75+
}
76+
77+
/**
78+
* Reads an instance of ActionGroup from the JsonReader.
79+
*
80+
* @param jsonReader The JsonReader being read.
81+
* @return An instance of ActionGroup if the JsonReader was pointing to an instance of it, or null if it was
82+
* pointing to JSON null.
83+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
84+
* @throws IOException If an error occurs while reading the ActionGroup.
85+
*/
86+
@Generated
87+
public static ActionGroup fromJson(JsonReader jsonReader) throws IOException {
88+
return jsonReader.readObject(reader -> {
89+
String title = null;
90+
List<ActionGroupItem> items = null;
91+
while (reader.nextToken() != JsonToken.END_OBJECT) {
92+
String fieldName = reader.getFieldName();
93+
reader.nextToken();
94+
95+
if ("title".equals(fieldName)) {
96+
title = reader.getString();
97+
} else if ("items".equals(fieldName)) {
98+
items = reader.readArray(reader1 -> ActionGroupItem.fromJson(reader1));
99+
} else {
100+
reader.skipChildren();
101+
}
102+
}
103+
return new ActionGroup(title, items);
104+
});
105+
}
106+
}

0 commit comments

Comments
 (0)