From 410f96dcd3d75f1f70e2562746a485c2cb1a0857 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 1 Oct 2024 01:29:05 +0000 Subject: [PATCH] CodeGen from PR 30346 in Azure/azure-rest-api-specs Merge c87844561dd481653d4fbe44d43eeb99a8d16ce7 into ad60d7f8eba124edc6999677c55aba2184e303b0 --- .../azure-communication-messages/CHANGELOG.md | 148 +++++++++++++- .../messages/MessagesServiceVersion.java | 9 +- .../NotificationMessagesAsyncClient.java | 2 +- .../messages/NotificationMessagesClient.java | 2 +- .../NotificationMessagesClientImpl.java | 4 +- .../models/AudioNotificationContent.java | 120 +++++++++++ .../models/CommunicationMessageKind.java | 26 ++- .../models/DocumentNotificationContent.java | 186 ++++++++++++++++++ .../models/ImageNotificationContent.java | 153 ++++++++++++++ .../models/MediaNotificationContent.java | 6 +- .../messages/models/NotificationContent.java | 10 +- .../models/VideoNotificationContent.java | 153 ++++++++++++++ ...unication-messages_apiview_properties.json | 4 + .../messages/generated/DownloadMedia.java | 22 +++ .../tsp-location.yaml | 4 +- 15 files changed, 833 insertions(+), 16 deletions(-) create mode 100644 sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/AudioNotificationContent.java create mode 100644 sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/DocumentNotificationContent.java create mode 100644 sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/ImageNotificationContent.java create mode 100644 sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/VideoNotificationContent.java create mode 100644 sdk/communication/azure-communication-messages/src/samples/java/com/azure/communication/messages/generated/DownloadMedia.java diff --git a/sdk/communication/azure-communication-messages/CHANGELOG.md b/sdk/communication/azure-communication-messages/CHANGELOG.md index bd2a0843a41b7..7beea77daae3e 100644 --- a/sdk/communication/azure-communication-messages/CHANGELOG.md +++ b/sdk/communication/azure-communication-messages/CHANGELOG.md @@ -2,14 +2,156 @@ ## 1.1.0-beta.1 (Unreleased) +### Breaking Changes + +* `implementation.models.MessageDataStream` was removed + +#### `implementation.NotificationMessagesClientImpl$NotificationMessagesClientService` was modified + +* `send(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was removed +* `sendSync(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was removed + ### Features Added -### Breaking Changes +* `models.ImageNotificationContent` was added -### Bugs Fixed +* `models.CommunicationMessagesChannel` was added -### Other Changes +* `implementation.accesshelpers.MessageTemplateItemAccessHelper` was added + +* `models.AudioNotificationContent` was added + +* `models.DocumentNotificationContent` was added + +* `implementation.accesshelpers.MessageTemplateItemAccessHelper$MessageTemplateItemAccessor` was added + +* `models.VideoNotificationContent` was added + +* `models.MessageTemplateValueKind` was added + +* `models.CommunicationMessageKind` was added + +* `models.MessageTemplateBindingsKind` was added + +#### `models.MessageTemplateImage` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SendMessageResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MessageTemplate` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MessageTemplateQuickAction` was modified + +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MessageTemplateBindings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `getKind()` was added + +#### `models.channels.WhatsAppMessageTemplateBindings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added + +#### `models.MessageTemplateVideo` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MessageTemplateText` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added + +#### `models.NotificationContent` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TextNotificationContent` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added + +#### `models.MediaNotificationContent` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MessageTemplateItem` was modified + +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MessageTemplateValue` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `getKind()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TemplateNotificationContent` was modified + +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MessageReceipt` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MessageTemplateLocation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.channels.WhatsAppMessageTemplateBindingsButton` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MessageTemplateDocument` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `getKind()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.channels.WhatsAppMessageTemplateItem` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `getKind()` was added + +#### `models.channels.WhatsAppMessageTemplateBindingsComponent` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `implementation.NotificationMessagesClientImpl$NotificationMessagesClientService` was modified +* `sendSync(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was added +* `send(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was added ## 1.0.7 (2024-09-27) diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessagesServiceVersion.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessagesServiceVersion.java index e09840cd4d7ad..8673e42220368 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessagesServiceVersion.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessagesServiceVersion.java @@ -13,7 +13,12 @@ public enum MessagesServiceVersion implements ServiceVersion { /** * Enum value 2024-02-01. */ - V2024_02_01("2024-02-01"); + V2024_02_01("2024-02-01"), + + /** + * Enum value 2024-08-30. + */ + V2024_08_30("2024-08-30"); private final String version; @@ -35,6 +40,6 @@ public String getVersion() { * @return The latest {@link MessagesServiceVersion}. */ public static MessagesServiceVersion getLatest() { - return V2024_02_01; + return V2024_08_30; } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java index 2374283383fe0..435f82449d3b1 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesAsyncClient.java @@ -55,7 +55,7 @@ public final class NotificationMessagesAsyncClient { *
      * {@code
      * {
-     *     kind: String(text/image/template) (Required)
+     *     kind: String(text/image/image_v0/document/video/audio/template) (Required)
      *     channelRegistrationId: String (Required)
      *     to (Required): [
      *         String (Required)
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java
index 9578f7260c053..59266523b678f 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClient.java
@@ -53,7 +53,7 @@ public final class NotificationMessagesClient {
      * 
      * {@code
      * {
-     *     kind: String(text/image/template) (Required)
+     *     kind: String(text/image/image_v0/document/video/audio/template) (Required)
      *     channelRegistrationId: String (Required)
      *     to (Required): [
      *         String (Required)
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java
index 1861083bdada6..a9176df99148d 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java
@@ -212,7 +212,7 @@ Response downloadMediaSync(@HostParam("endpoint") String endpoint,
      * 
      * {@code
      * {
-     *     kind: String(text/image/template) (Required)
+     *     kind: String(text/image/image_v0/document/video/audio/template) (Required)
      *     channelRegistrationId: String (Required)
      *     to (Required): [
      *         String (Required)
@@ -284,7 +284,7 @@ public Mono> sendWithResponseAsync(BinaryData notificationC
      * 
      * {@code
      * {
-     *     kind: String(text/image/template) (Required)
+     *     kind: String(text/image/image_v0/document/video/audio/template) (Required)
      *     channelRegistrationId: String (Required)
      *     to (Required): [
      *         String (Required)
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/AudioNotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/AudioNotificationContent.java
new file mode 100644
index 0000000000000..058418cd11a6c
--- /dev/null
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/AudioNotificationContent.java
@@ -0,0 +1,120 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.communication.messages.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * A request to send an audio notification.
+ */
+@Immutable
+public final class AudioNotificationContent extends NotificationContent {
+    /*
+     * The type discriminator describing a notification type.
+     */
+    @Generated
+    private CommunicationMessageKind kind = CommunicationMessageKind.AUDIO;
+
+    /*
+     * A media url for the file. Required if the type is one of the supported media types, e.g. image
+     */
+    @Generated
+    private final String mediaUrl;
+
+    /**
+     * Creates an instance of AudioNotificationContent class.
+     * 
+     * @param channelRegistrationId the channelRegistrationId value to set.
+     * @param to the to value to set.
+     * @param mediaUrl the mediaUrl value to set.
+     */
+    @Generated
+    public AudioNotificationContent(String channelRegistrationId, List to, String mediaUrl) {
+        super(channelRegistrationId, to);
+        this.mediaUrl = mediaUrl;
+    }
+
+    /**
+     * Get the kind property: The type discriminator describing a notification type.
+     * 
+     * @return the kind value.
+     */
+    @Generated
+    @Override
+    public CommunicationMessageKind getKind() {
+        return this.kind;
+    }
+
+    /**
+     * Get the mediaUrl property: A media url for the file. Required if the type is one of the supported media types,
+     * e.g. image.
+     * 
+     * @return the mediaUrl value.
+     */
+    @Generated
+    public String getMediaUrl() {
+        return this.mediaUrl;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Generated
+    @Override
+    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+        jsonWriter.writeStartObject();
+        jsonWriter.writeStringField("channelRegistrationId", getChannelRegistrationId());
+        jsonWriter.writeArrayField("to", getTo(), (writer, element) -> writer.writeString(element));
+        jsonWriter.writeStringField("mediaUri", this.mediaUrl);
+        jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
+        return jsonWriter.writeEndObject();
+    }
+
+    /**
+     * Reads an instance of AudioNotificationContent from the JsonReader.
+     * 
+     * @param jsonReader The JsonReader being read.
+     * @return An instance of AudioNotificationContent if the JsonReader was pointing to an instance of it, or null if
+     * it was pointing to JSON null.
+     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+     * @throws IOException If an error occurs while reading the AudioNotificationContent.
+     */
+    @Generated
+    public static AudioNotificationContent fromJson(JsonReader jsonReader) throws IOException {
+        return jsonReader.readObject(reader -> {
+            String channelRegistrationId = null;
+            List to = null;
+            String mediaUrl = null;
+            CommunicationMessageKind kind = CommunicationMessageKind.AUDIO;
+            while (reader.nextToken() != JsonToken.END_OBJECT) {
+                String fieldName = reader.getFieldName();
+                reader.nextToken();
+
+                if ("channelRegistrationId".equals(fieldName)) {
+                    channelRegistrationId = reader.getString();
+                } else if ("to".equals(fieldName)) {
+                    to = reader.readArray(reader1 -> reader1.getString());
+                } else if ("mediaUri".equals(fieldName)) {
+                    mediaUrl = reader.getString();
+                } else if ("kind".equals(fieldName)) {
+                    kind = CommunicationMessageKind.fromString(reader.getString());
+                } else {
+                    reader.skipChildren();
+                }
+            }
+            AudioNotificationContent deserializedAudioNotificationContent
+                = new AudioNotificationContent(channelRegistrationId, to, mediaUrl);
+            deserializedAudioNotificationContent.kind = kind;
+
+            return deserializedAudioNotificationContent;
+        });
+    }
+}
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessageKind.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessageKind.java
index 8aedde4b16f37..29be7959b8763 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessageKind.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/CommunicationMessageKind.java
@@ -8,7 +8,7 @@
 import java.util.Collection;
 
 /**
- * The type of message. Supports text, image, template.
+ * The type of message.
  */
 public final class CommunicationMessageKind extends ExpandableStringEnum {
 
@@ -60,4 +60,28 @@ public static CommunicationMessageKind fromString(String name) {
     public static Collection values() {
         return values(CommunicationMessageKind.class);
     }
+
+    /**
+     * Image message type. Legacy image type for `MediaNotificationContent` which is being deprecated.
+     */
+    @Generated
+    public static final CommunicationMessageKind IMAGE_V0 = fromString("image_v0");
+
+    /**
+     * Document message type.
+     */
+    @Generated
+    public static final CommunicationMessageKind DOCUMENT = fromString("document");
+
+    /**
+     * Video message type.
+     */
+    @Generated
+    public static final CommunicationMessageKind VIDEO = fromString("video");
+
+    /**
+     * Audio message type.
+     */
+    @Generated
+    public static final CommunicationMessageKind AUDIO = fromString("audio");
 }
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/DocumentNotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/DocumentNotificationContent.java
new file mode 100644
index 0000000000000..539aefefcd934
--- /dev/null
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/DocumentNotificationContent.java
@@ -0,0 +1,186 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.communication.messages.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Generated;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * A request to send a document notification.
+ */
+@Fluent
+public final class DocumentNotificationContent extends NotificationContent {
+    /*
+     * The type discriminator describing a notification type.
+     */
+    @Generated
+    private CommunicationMessageKind kind = CommunicationMessageKind.DOCUMENT;
+
+    /*
+     * Optional text content.
+     */
+    @Generated
+    private String caption;
+
+    /*
+     * Optional name for the file.
+     */
+    @Generated
+    private String fileName;
+
+    /*
+     * A media url for the file. Required if the type is one of the supported media types, e.g. image
+     */
+    @Generated
+    private final String mediaUrl;
+
+    /**
+     * Creates an instance of DocumentNotificationContent class.
+     * 
+     * @param channelRegistrationId the channelRegistrationId value to set.
+     * @param to the to value to set.
+     * @param mediaUrl the mediaUrl value to set.
+     */
+    @Generated
+    public DocumentNotificationContent(String channelRegistrationId, List to, String mediaUrl) {
+        super(channelRegistrationId, to);
+        this.mediaUrl = mediaUrl;
+    }
+
+    /**
+     * Get the kind property: The type discriminator describing a notification type.
+     * 
+     * @return the kind value.
+     */
+    @Generated
+    @Override
+    public CommunicationMessageKind getKind() {
+        return this.kind;
+    }
+
+    /**
+     * Get the caption property: Optional text content.
+     * 
+     * @return the caption value.
+     */
+    @Generated
+    public String getCaption() {
+        return this.caption;
+    }
+
+    /**
+     * Set the caption property: Optional text content.
+     * 
+     * @param caption the caption value to set.
+     * @return the DocumentNotificationContent object itself.
+     */
+    @Generated
+    public DocumentNotificationContent setCaption(String caption) {
+        this.caption = caption;
+        return this;
+    }
+
+    /**
+     * Get the fileName property: Optional name for the file.
+     * 
+     * @return the fileName value.
+     */
+    @Generated
+    public String getFileName() {
+        return this.fileName;
+    }
+
+    /**
+     * Set the fileName property: Optional name for the file.
+     * 
+     * @param fileName the fileName value to set.
+     * @return the DocumentNotificationContent object itself.
+     */
+    @Generated
+    public DocumentNotificationContent setFileName(String fileName) {
+        this.fileName = fileName;
+        return this;
+    }
+
+    /**
+     * Get the mediaUrl property: A media url for the file. Required if the type is one of the supported media types,
+     * e.g. image.
+     * 
+     * @return the mediaUrl value.
+     */
+    @Generated
+    public String getMediaUrl() {
+        return this.mediaUrl;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Generated
+    @Override
+    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+        jsonWriter.writeStartObject();
+        jsonWriter.writeStringField("channelRegistrationId", getChannelRegistrationId());
+        jsonWriter.writeArrayField("to", getTo(), (writer, element) -> writer.writeString(element));
+        jsonWriter.writeStringField("mediaUri", this.mediaUrl);
+        jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
+        jsonWriter.writeStringField("caption", this.caption);
+        jsonWriter.writeStringField("fileName", this.fileName);
+        return jsonWriter.writeEndObject();
+    }
+
+    /**
+     * Reads an instance of DocumentNotificationContent from the JsonReader.
+     * 
+     * @param jsonReader The JsonReader being read.
+     * @return An instance of DocumentNotificationContent if the JsonReader was pointing to an instance of it, or null
+     * if it was pointing to JSON null.
+     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+     * @throws IOException If an error occurs while reading the DocumentNotificationContent.
+     */
+    @Generated
+    public static DocumentNotificationContent fromJson(JsonReader jsonReader) throws IOException {
+        return jsonReader.readObject(reader -> {
+            String channelRegistrationId = null;
+            List to = null;
+            String mediaUrl = null;
+            CommunicationMessageKind kind = CommunicationMessageKind.DOCUMENT;
+            String caption = null;
+            String fileName = null;
+            while (reader.nextToken() != JsonToken.END_OBJECT) {
+                String fieldName = reader.getFieldName();
+                reader.nextToken();
+
+                if ("channelRegistrationId".equals(fieldName)) {
+                    channelRegistrationId = reader.getString();
+                } else if ("to".equals(fieldName)) {
+                    to = reader.readArray(reader1 -> reader1.getString());
+                } else if ("mediaUri".equals(fieldName)) {
+                    mediaUrl = reader.getString();
+                } else if ("kind".equals(fieldName)) {
+                    kind = CommunicationMessageKind.fromString(reader.getString());
+                } else if ("caption".equals(fieldName)) {
+                    caption = reader.getString();
+                } else if ("fileName".equals(fieldName)) {
+                    fileName = reader.getString();
+                } else {
+                    reader.skipChildren();
+                }
+            }
+            DocumentNotificationContent deserializedDocumentNotificationContent
+                = new DocumentNotificationContent(channelRegistrationId, to, mediaUrl);
+            deserializedDocumentNotificationContent.kind = kind;
+            deserializedDocumentNotificationContent.caption = caption;
+            deserializedDocumentNotificationContent.fileName = fileName;
+
+            return deserializedDocumentNotificationContent;
+        });
+    }
+}
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/ImageNotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/ImageNotificationContent.java
new file mode 100644
index 0000000000000..05b2952958c50
--- /dev/null
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/ImageNotificationContent.java
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.communication.messages.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Generated;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * A request to send an image notification.
+ */
+@Fluent
+public final class ImageNotificationContent extends NotificationContent {
+    /*
+     * The type discriminator describing a notification type.
+     */
+    @Generated
+    private CommunicationMessageKind kind = CommunicationMessageKind.IMAGE;
+
+    /*
+     * Optional text content.
+     */
+    @Generated
+    private String caption;
+
+    /*
+     * A media url for the file. Required if the type is one of the supported media types, e.g. image
+     */
+    @Generated
+    private final String mediaUrl;
+
+    /**
+     * Creates an instance of ImageNotificationContent class.
+     * 
+     * @param channelRegistrationId the channelRegistrationId value to set.
+     * @param to the to value to set.
+     * @param mediaUrl the mediaUrl value to set.
+     */
+    @Generated
+    public ImageNotificationContent(String channelRegistrationId, List to, String mediaUrl) {
+        super(channelRegistrationId, to);
+        this.mediaUrl = mediaUrl;
+    }
+
+    /**
+     * Get the kind property: The type discriminator describing a notification type.
+     * 
+     * @return the kind value.
+     */
+    @Generated
+    @Override
+    public CommunicationMessageKind getKind() {
+        return this.kind;
+    }
+
+    /**
+     * Get the caption property: Optional text content.
+     * 
+     * @return the caption value.
+     */
+    @Generated
+    public String getCaption() {
+        return this.caption;
+    }
+
+    /**
+     * Set the caption property: Optional text content.
+     * 
+     * @param caption the caption value to set.
+     * @return the ImageNotificationContent object itself.
+     */
+    @Generated
+    public ImageNotificationContent setCaption(String caption) {
+        this.caption = caption;
+        return this;
+    }
+
+    /**
+     * Get the mediaUrl property: A media url for the file. Required if the type is one of the supported media types,
+     * e.g. image.
+     * 
+     * @return the mediaUrl value.
+     */
+    @Generated
+    public String getMediaUrl() {
+        return this.mediaUrl;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Generated
+    @Override
+    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+        jsonWriter.writeStartObject();
+        jsonWriter.writeStringField("channelRegistrationId", getChannelRegistrationId());
+        jsonWriter.writeArrayField("to", getTo(), (writer, element) -> writer.writeString(element));
+        jsonWriter.writeStringField("mediaUri", this.mediaUrl);
+        jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
+        jsonWriter.writeStringField("caption", this.caption);
+        return jsonWriter.writeEndObject();
+    }
+
+    /**
+     * Reads an instance of ImageNotificationContent from the JsonReader.
+     * 
+     * @param jsonReader The JsonReader being read.
+     * @return An instance of ImageNotificationContent if the JsonReader was pointing to an instance of it, or null if
+     * it was pointing to JSON null.
+     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+     * @throws IOException If an error occurs while reading the ImageNotificationContent.
+     */
+    @Generated
+    public static ImageNotificationContent fromJson(JsonReader jsonReader) throws IOException {
+        return jsonReader.readObject(reader -> {
+            String channelRegistrationId = null;
+            List to = null;
+            String mediaUrl = null;
+            CommunicationMessageKind kind = CommunicationMessageKind.IMAGE;
+            String caption = null;
+            while (reader.nextToken() != JsonToken.END_OBJECT) {
+                String fieldName = reader.getFieldName();
+                reader.nextToken();
+
+                if ("channelRegistrationId".equals(fieldName)) {
+                    channelRegistrationId = reader.getString();
+                } else if ("to".equals(fieldName)) {
+                    to = reader.readArray(reader1 -> reader1.getString());
+                } else if ("mediaUri".equals(fieldName)) {
+                    mediaUrl = reader.getString();
+                } else if ("kind".equals(fieldName)) {
+                    kind = CommunicationMessageKind.fromString(reader.getString());
+                } else if ("caption".equals(fieldName)) {
+                    caption = reader.getString();
+                } else {
+                    reader.skipChildren();
+                }
+            }
+            ImageNotificationContent deserializedImageNotificationContent
+                = new ImageNotificationContent(channelRegistrationId, to, mediaUrl);
+            deserializedImageNotificationContent.kind = kind;
+            deserializedImageNotificationContent.caption = caption;
+
+            return deserializedImageNotificationContent;
+        });
+    }
+}
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MediaNotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MediaNotificationContent.java
index 26b337f5b1634..d28773b4030f2 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MediaNotificationContent.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/MediaNotificationContent.java
@@ -12,7 +12,7 @@
 import java.util.List;
 
 /**
- * A request to send a media notification.
+ * A request to send an image notification.
  */
 @Fluent
 public final class MediaNotificationContent extends NotificationContent {
@@ -21,7 +21,7 @@ public final class MediaNotificationContent extends NotificationContent {
      * The type discriminator describing a notification type.
      */
     @Generated
-    private CommunicationMessageKind kind = CommunicationMessageKind.IMAGE;
+    private CommunicationMessageKind kind = CommunicationMessageKind.IMAGE_V0;
 
     /*
      * Optional text content.
@@ -122,7 +122,7 @@ public static MediaNotificationContent fromJson(JsonReader jsonReader) throws IO
             String channelRegistrationId = null;
             List to = null;
             String mediaUrl = null;
-            CommunicationMessageKind kind = CommunicationMessageKind.IMAGE;
+            CommunicationMessageKind kind = CommunicationMessageKind.IMAGE_V0;
             String content = null;
             while (reader.nextToken() != JsonToken.END_OBJECT) {
                 String fieldName = reader.getFieldName();
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/NotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/NotificationContent.java
index 4471be0dfff5a..fe4eaf266c6ba 100644
--- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/NotificationContent.java
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/NotificationContent.java
@@ -120,8 +120,16 @@ public static NotificationContent fromJson(JsonReader jsonReader) throws IOExcep
                 // Use the discriminator value to determine which subtype should be deserialized.
                 if ("text".equals(discriminatorValue)) {
                     return TextNotificationContent.fromJson(readerToUse.reset());
-                } else if ("image".equals(discriminatorValue)) {
+                } else if ("image_v0".equals(discriminatorValue)) {
                     return MediaNotificationContent.fromJson(readerToUse.reset());
+                } else if ("image".equals(discriminatorValue)) {
+                    return ImageNotificationContent.fromJson(readerToUse.reset());
+                } else if ("document".equals(discriminatorValue)) {
+                    return DocumentNotificationContent.fromJson(readerToUse.reset());
+                } else if ("video".equals(discriminatorValue)) {
+                    return VideoNotificationContent.fromJson(readerToUse.reset());
+                } else if ("audio".equals(discriminatorValue)) {
+                    return AudioNotificationContent.fromJson(readerToUse.reset());
                 } else if ("template".equals(discriminatorValue)) {
                     return TemplateNotificationContent.fromJson(readerToUse.reset());
                 } else {
diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/VideoNotificationContent.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/VideoNotificationContent.java
new file mode 100644
index 0000000000000..0a736c027c163
--- /dev/null
+++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/VideoNotificationContent.java
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.communication.messages.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Generated;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * A request to send a video notification.
+ */
+@Fluent
+public final class VideoNotificationContent extends NotificationContent {
+    /*
+     * The type discriminator describing a notification type.
+     */
+    @Generated
+    private CommunicationMessageKind kind = CommunicationMessageKind.VIDEO;
+
+    /*
+     * Optional text content.
+     */
+    @Generated
+    private String caption;
+
+    /*
+     * A media url for the file. Required if the type is one of the supported media types, e.g. image
+     */
+    @Generated
+    private final String mediaUrl;
+
+    /**
+     * Creates an instance of VideoNotificationContent class.
+     * 
+     * @param channelRegistrationId the channelRegistrationId value to set.
+     * @param to the to value to set.
+     * @param mediaUrl the mediaUrl value to set.
+     */
+    @Generated
+    public VideoNotificationContent(String channelRegistrationId, List to, String mediaUrl) {
+        super(channelRegistrationId, to);
+        this.mediaUrl = mediaUrl;
+    }
+
+    /**
+     * Get the kind property: The type discriminator describing a notification type.
+     * 
+     * @return the kind value.
+     */
+    @Generated
+    @Override
+    public CommunicationMessageKind getKind() {
+        return this.kind;
+    }
+
+    /**
+     * Get the caption property: Optional text content.
+     * 
+     * @return the caption value.
+     */
+    @Generated
+    public String getCaption() {
+        return this.caption;
+    }
+
+    /**
+     * Set the caption property: Optional text content.
+     * 
+     * @param caption the caption value to set.
+     * @return the VideoNotificationContent object itself.
+     */
+    @Generated
+    public VideoNotificationContent setCaption(String caption) {
+        this.caption = caption;
+        return this;
+    }
+
+    /**
+     * Get the mediaUrl property: A media url for the file. Required if the type is one of the supported media types,
+     * e.g. image.
+     * 
+     * @return the mediaUrl value.
+     */
+    @Generated
+    public String getMediaUrl() {
+        return this.mediaUrl;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Generated
+    @Override
+    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+        jsonWriter.writeStartObject();
+        jsonWriter.writeStringField("channelRegistrationId", getChannelRegistrationId());
+        jsonWriter.writeArrayField("to", getTo(), (writer, element) -> writer.writeString(element));
+        jsonWriter.writeStringField("mediaUri", this.mediaUrl);
+        jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
+        jsonWriter.writeStringField("caption", this.caption);
+        return jsonWriter.writeEndObject();
+    }
+
+    /**
+     * Reads an instance of VideoNotificationContent from the JsonReader.
+     * 
+     * @param jsonReader The JsonReader being read.
+     * @return An instance of VideoNotificationContent if the JsonReader was pointing to an instance of it, or null if
+     * it was pointing to JSON null.
+     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+     * @throws IOException If an error occurs while reading the VideoNotificationContent.
+     */
+    @Generated
+    public static VideoNotificationContent fromJson(JsonReader jsonReader) throws IOException {
+        return jsonReader.readObject(reader -> {
+            String channelRegistrationId = null;
+            List to = null;
+            String mediaUrl = null;
+            CommunicationMessageKind kind = CommunicationMessageKind.VIDEO;
+            String caption = null;
+            while (reader.nextToken() != JsonToken.END_OBJECT) {
+                String fieldName = reader.getFieldName();
+                reader.nextToken();
+
+                if ("channelRegistrationId".equals(fieldName)) {
+                    channelRegistrationId = reader.getString();
+                } else if ("to".equals(fieldName)) {
+                    to = reader.readArray(reader1 -> reader1.getString());
+                } else if ("mediaUri".equals(fieldName)) {
+                    mediaUrl = reader.getString();
+                } else if ("kind".equals(fieldName)) {
+                    kind = CommunicationMessageKind.fromString(reader.getString());
+                } else if ("caption".equals(fieldName)) {
+                    caption = reader.getString();
+                } else {
+                    reader.skipChildren();
+                }
+            }
+            VideoNotificationContent deserializedVideoNotificationContent
+                = new VideoNotificationContent(channelRegistrationId, to, mediaUrl);
+            deserializedVideoNotificationContent.kind = kind;
+            deserializedVideoNotificationContent.caption = caption;
+
+            return deserializedVideoNotificationContent;
+        });
+    }
+}
diff --git a/sdk/communication/azure-communication-messages/src/main/resources/META-INF/azure-communication-messages_apiview_properties.json b/sdk/communication/azure-communication-messages/src/main/resources/META-INF/azure-communication-messages_apiview_properties.json
index d1daa4831af35..47302ac76e22f 100644
--- a/sdk/communication/azure-communication-messages/src/main/resources/META-INF/azure-communication-messages_apiview_properties.json
+++ b/sdk/communication/azure-communication-messages/src/main/resources/META-INF/azure-communication-messages_apiview_properties.json
@@ -17,8 +17,11 @@
     "com.azure.communication.messages.NotificationMessagesClient.send": "Azure.Communication.MessagesService.NotificationMessagesClient.send",
     "com.azure.communication.messages.NotificationMessagesClient.sendWithResponse": "Azure.Communication.MessagesService.NotificationMessagesClient.send",
     "com.azure.communication.messages.NotificationMessagesClientBuilder": "ClientForAcsMessages.NotificationMessagesClient",
+    "com.azure.communication.messages.models.AudioNotificationContent": "Azure.Communication.MessagesService.AudioNotificationContent",
     "com.azure.communication.messages.models.CommunicationMessageKind": "Azure.Communication.MessagesService.CommunicationMessageKind",
     "com.azure.communication.messages.models.CommunicationMessagesChannel": "Azure.Communication.MessagesService.CommunicationMessagesChannel",
+    "com.azure.communication.messages.models.DocumentNotificationContent": "Azure.Communication.MessagesService.DocumentNotificationContent",
+    "com.azure.communication.messages.models.ImageNotificationContent": "Azure.Communication.MessagesService.ImageNotificationContent",
     "com.azure.communication.messages.models.MediaNotificationContent": "Azure.Communication.MessagesService.MediaNotificationContent",
     "com.azure.communication.messages.models.MessageReceipt": "Azure.Communication.MessagesService.MessageReceipt",
     "com.azure.communication.messages.models.MessageTemplate": "Azure.Communication.MessagesService.MessageTemplate",
@@ -38,6 +41,7 @@
     "com.azure.communication.messages.models.SendMessageResult": "Azure.Communication.MessagesService.SendMessageResult",
     "com.azure.communication.messages.models.TemplateNotificationContent": "Azure.Communication.MessagesService.TemplateNotificationContent",
     "com.azure.communication.messages.models.TextNotificationContent": "Azure.Communication.MessagesService.TextNotificationContent",
+    "com.azure.communication.messages.models.VideoNotificationContent": "Azure.Communication.MessagesService.VideoNotificationContent",
     "com.azure.communication.messages.models.channels.WhatsAppMessageButtonSubType": "Azure.Communication.MessagesService.WhatsAppMessageButtonSubType",
     "com.azure.communication.messages.models.channels.WhatsAppMessageTemplateBindings": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings",
     "com.azure.communication.messages.models.channels.WhatsAppMessageTemplateBindingsButton": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton",
diff --git a/sdk/communication/azure-communication-messages/src/samples/java/com/azure/communication/messages/generated/DownloadMedia.java b/sdk/communication/azure-communication-messages/src/samples/java/com/azure/communication/messages/generated/DownloadMedia.java
new file mode 100644
index 0000000000000..489134d13bcb9
--- /dev/null
+++ b/sdk/communication/azure-communication-messages/src/samples/java/com/azure/communication/messages/generated/DownloadMedia.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.communication.messages.generated;
+
+import com.azure.communication.messages.NotificationMessagesClient;
+import com.azure.communication.messages.NotificationMessagesClientBuilder;
+import com.azure.core.util.BinaryData;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class DownloadMedia {
+    public static void main(String[] args) {
+        NotificationMessagesClient notificationMessagesClient
+            = new NotificationMessagesClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
+                .endpoint("https://my-resource.communication.azure.com")
+                .buildClient();
+        // BEGIN:com.azure.communication.messages.generated.downloadmedia.downloadmedia
+        BinaryData response = notificationMessagesClient.downloadMedia("d19e68ec-bdd6-4a50-8dfb-cbb1642df6ab");
+        // END:com.azure.communication.messages.generated.downloadmedia.downloadmedia
+    }
+}
diff --git a/sdk/communication/azure-communication-messages/tsp-location.yaml b/sdk/communication/azure-communication-messages/tsp-location.yaml
index 31194c444abf7..3bcb01b3c9f8b 100644
--- a/sdk/communication/azure-communication-messages/tsp-location.yaml
+++ b/sdk/communication/azure-communication-messages/tsp-location.yaml
@@ -1,4 +1,4 @@
 directory: specification/communication/Communication.Messages
-commit: 60dde357b17863d4c569c660464f6f6eb894b3b0
+commit: afa8bf55e170efa3661303ccfb426727e4b220e2
 repo: Azure/azure-rest-api-specs
-additionalDirectories: null
+additionalDirectories: