diff --git a/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.net8.0.cs b/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.net8.0.cs index d93a3a55747a..0c82a311ba80 100644 --- a/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.net8.0.cs +++ b/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.net8.0.cs @@ -1,5 +1,52 @@ namespace Azure.Communication.Messages { + public abstract partial class ActionBindings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ActionBindings() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroup : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroup(string title, System.Collections.Generic.IEnumerable items) { } + public System.Collections.Generic.IList Items { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroupContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroupContent(string title, System.Collections.Generic.IEnumerable groups) { } + public System.Collections.Generic.IList Groups { get { throw null; } } + public string Title { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroupItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroupItem(string id, string title, string description) { } + public string Description { get { throw null; } } + public string Id { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AudioNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AudioNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -11,20 +58,50 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ButtonContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ButtonContent(string id, string title) { } + public string Id { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ButtonSetContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ButtonSetContent(System.Collections.Generic.IEnumerable buttons) { } + public System.Collections.Generic.IList Buttons { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonSetContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonSetContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class CommunicationMessagesClientOptions : Azure.Core.ClientOptions { - public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2024_08_30) { } + public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2025_01_15_Preview) { } public enum ServiceVersion { V2024_02_01 = 1, V2024_08_30 = 2, + V2025_01_15_Preview = 3, } } public static partial class CommunicationMessagesModelFactory { + public static Azure.Communication.Messages.ActionGroupContent ActionGroupContent(string title = null, System.Collections.Generic.IEnumerable groups = null) { throw null; } public static Azure.Communication.Messages.AudioNotificationContent AudioNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.DocumentMessageContent DocumentMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.DocumentNotificationContent DocumentNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, string fileName = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.ImageMessageContent ImageMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.ImageNotificationContent ImageNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.InteractiveMessage InteractiveMessage(Azure.Communication.Messages.MessageContent header = null, Azure.Communication.Messages.TextMessageContent body = null, Azure.Communication.Messages.TextMessageContent footer = null, Azure.Communication.Messages.ActionBindings action = null) { throw null; } + public static Azure.Communication.Messages.InteractiveNotificationContent InteractiveNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, Azure.Communication.Messages.InteractiveMessage interactiveMessage = null) { throw null; } + public static Azure.Communication.Messages.LinkContent LinkContent(string title = null, System.Uri uri = null) { throw null; } public static Azure.Communication.Messages.MediaNotificationContent MediaNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = null, System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.MessageReceipt MessageReceipt(string messageId = null, string to = null) { throw null; } public static Azure.Communication.Messages.MessageTemplate MessageTemplate(string name = null, string language = null, System.Collections.Generic.IEnumerable values = null, Azure.Communication.Messages.MessageTemplateBindings bindings = null) { throw null; } @@ -36,11 +113,29 @@ public static partial class CommunicationMessagesModelFactory public static Azure.Communication.Messages.MessageTemplateValue MessageTemplateValue(string name = null, string kind = null) { throw null; } public static Azure.Communication.Messages.MessageTemplateVideo MessageTemplateVideo(string name = null, System.Uri uri = null, string caption = null, string fileName = null) { throw null; } public static Azure.Communication.Messages.NotificationContent NotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string kind = null) { throw null; } + public static Azure.Communication.Messages.ReactionNotificationContent ReactionNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string emoji = null, string messageId = null) { throw null; } public static Azure.Communication.Messages.SendMessageResult SendMessageResult(System.Collections.Generic.IEnumerable receipts = null) { throw null; } + public static Azure.Communication.Messages.StickerNotificationContent StickerNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.TemplateNotificationContent TemplateNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, Azure.Communication.Messages.MessageTemplate template = null) { throw null; } + public static Azure.Communication.Messages.TextMessageContent TextMessageContent(string text = null) { throw null; } public static Azure.Communication.Messages.TextNotificationContent TextNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = null) { throw null; } + public static Azure.Communication.Messages.VideoMessageContent VideoMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.VideoNotificationContent VideoNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.WhatsAppButtonActionBindings WhatsAppButtonActionBindings(Azure.Communication.Messages.ButtonSetContent content = null) { throw null; } + public static Azure.Communication.Messages.WhatsAppListActionBindings WhatsAppListActionBindings(Azure.Communication.Messages.ActionGroupContent content = null) { throw null; } public static Azure.Communication.Messages.Models.Channels.WhatsAppMessageTemplateItem WhatsAppMessageTemplateItem(string name = null, string language = null, Azure.Communication.Messages.MessageTemplateStatus status = default(Azure.Communication.Messages.MessageTemplateStatus), System.BinaryData content = null) { throw null; } + public static Azure.Communication.Messages.WhatsAppUrlActionBindings WhatsAppUrlActionBindings(Azure.Communication.Messages.LinkContent content = null) { throw null; } + } + public partial class DocumentMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DocumentNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -55,6 +150,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ImageMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ImageNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ImageNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -67,6 +173,43 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class InteractiveMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InteractiveMessage(Azure.Communication.Messages.TextMessageContent body, Azure.Communication.Messages.ActionBindings action) { } + public Azure.Communication.Messages.ActionBindings Action { get { throw null; } } + public Azure.Communication.Messages.TextMessageContent Body { get { throw null; } } + public Azure.Communication.Messages.TextMessageContent Footer { get { throw null; } set { } } + public Azure.Communication.Messages.MessageContent Header { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InteractiveNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InteractiveNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.InteractiveMessage interactiveMessage) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public Azure.Communication.Messages.InteractiveMessage InteractiveMessage { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkContent(string title, System.Uri uri) { } + public string Title { get { throw null; } } + public System.Uri Uri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.LinkContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.LinkContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.ObsoleteAttribute("`MediaNotificationContent` is being deprecated, we encourage you to use the new `ImageNotificationContent` for sending images instead.")] public partial class MediaNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -80,6 +223,16 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public abstract partial class MessageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected MessageContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.MessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.MessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class MessageReceipt : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageReceipt() { } @@ -283,6 +436,18 @@ public NotificationMessagesClient(System.Uri endpoint, Azure.Core.TokenCredentia public virtual System.Threading.Tasks.Task> SendAsync(Azure.Communication.Messages.NotificationContent notificationContent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task SendAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } + public partial class ReactionNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReactionNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, string emoji, string messageId) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public string Emoji { get { throw null; } } + public string MessageId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ReactionNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ReactionNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SendMessageResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SendMessageResult() { } @@ -294,6 +459,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class StickerNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StickerNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.StickerNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.StickerNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TemplateNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TemplateNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.MessageTemplate template) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -305,6 +481,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class TextMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TextMessageContent(string text) { } + public string Text { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TextNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TextNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, string content) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -316,6 +503,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class VideoMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VideoMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class VideoNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VideoNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -328,6 +526,39 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class WhatsAppButtonActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppButtonActionBindings(Azure.Communication.Messages.ButtonSetContent content) { } + public Azure.Communication.Messages.ButtonSetContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppButtonActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppButtonActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WhatsAppListActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppListActionBindings(Azure.Communication.Messages.ActionGroupContent content) { } + public Azure.Communication.Messages.ActionGroupContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppListActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppListActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WhatsAppUrlActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppUrlActionBindings(Azure.Communication.Messages.LinkContent content) { } + public Azure.Communication.Messages.LinkContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppUrlActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppUrlActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } namespace Azure.Communication.Messages.Models.Channels { diff --git a/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs b/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs index d93a3a55747a..0c82a311ba80 100644 --- a/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs @@ -1,5 +1,52 @@ namespace Azure.Communication.Messages { + public abstract partial class ActionBindings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ActionBindings() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroup : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroup(string title, System.Collections.Generic.IEnumerable items) { } + public System.Collections.Generic.IList Items { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroupContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroupContent(string title, System.Collections.Generic.IEnumerable groups) { } + public System.Collections.Generic.IList Groups { get { throw null; } } + public string Title { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroupItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroupItem(string id, string title, string description) { } + public string Description { get { throw null; } } + public string Id { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AudioNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AudioNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -11,20 +58,50 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ButtonContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ButtonContent(string id, string title) { } + public string Id { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ButtonSetContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ButtonSetContent(System.Collections.Generic.IEnumerable buttons) { } + public System.Collections.Generic.IList Buttons { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonSetContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonSetContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class CommunicationMessagesClientOptions : Azure.Core.ClientOptions { - public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2024_08_30) { } + public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2025_01_15_Preview) { } public enum ServiceVersion { V2024_02_01 = 1, V2024_08_30 = 2, + V2025_01_15_Preview = 3, } } public static partial class CommunicationMessagesModelFactory { + public static Azure.Communication.Messages.ActionGroupContent ActionGroupContent(string title = null, System.Collections.Generic.IEnumerable groups = null) { throw null; } public static Azure.Communication.Messages.AudioNotificationContent AudioNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.DocumentMessageContent DocumentMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.DocumentNotificationContent DocumentNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, string fileName = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.ImageMessageContent ImageMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.ImageNotificationContent ImageNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.InteractiveMessage InteractiveMessage(Azure.Communication.Messages.MessageContent header = null, Azure.Communication.Messages.TextMessageContent body = null, Azure.Communication.Messages.TextMessageContent footer = null, Azure.Communication.Messages.ActionBindings action = null) { throw null; } + public static Azure.Communication.Messages.InteractiveNotificationContent InteractiveNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, Azure.Communication.Messages.InteractiveMessage interactiveMessage = null) { throw null; } + public static Azure.Communication.Messages.LinkContent LinkContent(string title = null, System.Uri uri = null) { throw null; } public static Azure.Communication.Messages.MediaNotificationContent MediaNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = null, System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.MessageReceipt MessageReceipt(string messageId = null, string to = null) { throw null; } public static Azure.Communication.Messages.MessageTemplate MessageTemplate(string name = null, string language = null, System.Collections.Generic.IEnumerable values = null, Azure.Communication.Messages.MessageTemplateBindings bindings = null) { throw null; } @@ -36,11 +113,29 @@ public static partial class CommunicationMessagesModelFactory public static Azure.Communication.Messages.MessageTemplateValue MessageTemplateValue(string name = null, string kind = null) { throw null; } public static Azure.Communication.Messages.MessageTemplateVideo MessageTemplateVideo(string name = null, System.Uri uri = null, string caption = null, string fileName = null) { throw null; } public static Azure.Communication.Messages.NotificationContent NotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string kind = null) { throw null; } + public static Azure.Communication.Messages.ReactionNotificationContent ReactionNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string emoji = null, string messageId = null) { throw null; } public static Azure.Communication.Messages.SendMessageResult SendMessageResult(System.Collections.Generic.IEnumerable receipts = null) { throw null; } + public static Azure.Communication.Messages.StickerNotificationContent StickerNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.TemplateNotificationContent TemplateNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, Azure.Communication.Messages.MessageTemplate template = null) { throw null; } + public static Azure.Communication.Messages.TextMessageContent TextMessageContent(string text = null) { throw null; } public static Azure.Communication.Messages.TextNotificationContent TextNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = null) { throw null; } + public static Azure.Communication.Messages.VideoMessageContent VideoMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.VideoNotificationContent VideoNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.WhatsAppButtonActionBindings WhatsAppButtonActionBindings(Azure.Communication.Messages.ButtonSetContent content = null) { throw null; } + public static Azure.Communication.Messages.WhatsAppListActionBindings WhatsAppListActionBindings(Azure.Communication.Messages.ActionGroupContent content = null) { throw null; } public static Azure.Communication.Messages.Models.Channels.WhatsAppMessageTemplateItem WhatsAppMessageTemplateItem(string name = null, string language = null, Azure.Communication.Messages.MessageTemplateStatus status = default(Azure.Communication.Messages.MessageTemplateStatus), System.BinaryData content = null) { throw null; } + public static Azure.Communication.Messages.WhatsAppUrlActionBindings WhatsAppUrlActionBindings(Azure.Communication.Messages.LinkContent content = null) { throw null; } + } + public partial class DocumentMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DocumentNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -55,6 +150,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ImageMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ImageNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ImageNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -67,6 +173,43 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class InteractiveMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InteractiveMessage(Azure.Communication.Messages.TextMessageContent body, Azure.Communication.Messages.ActionBindings action) { } + public Azure.Communication.Messages.ActionBindings Action { get { throw null; } } + public Azure.Communication.Messages.TextMessageContent Body { get { throw null; } } + public Azure.Communication.Messages.TextMessageContent Footer { get { throw null; } set { } } + public Azure.Communication.Messages.MessageContent Header { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InteractiveNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InteractiveNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.InteractiveMessage interactiveMessage) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public Azure.Communication.Messages.InteractiveMessage InteractiveMessage { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkContent(string title, System.Uri uri) { } + public string Title { get { throw null; } } + public System.Uri Uri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.LinkContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.LinkContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.ObsoleteAttribute("`MediaNotificationContent` is being deprecated, we encourage you to use the new `ImageNotificationContent` for sending images instead.")] public partial class MediaNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -80,6 +223,16 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public abstract partial class MessageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected MessageContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.MessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.MessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class MessageReceipt : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageReceipt() { } @@ -283,6 +436,18 @@ public NotificationMessagesClient(System.Uri endpoint, Azure.Core.TokenCredentia public virtual System.Threading.Tasks.Task> SendAsync(Azure.Communication.Messages.NotificationContent notificationContent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task SendAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } + public partial class ReactionNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReactionNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, string emoji, string messageId) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public string Emoji { get { throw null; } } + public string MessageId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ReactionNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ReactionNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SendMessageResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SendMessageResult() { } @@ -294,6 +459,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class StickerNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StickerNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.StickerNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.StickerNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TemplateNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TemplateNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.MessageTemplate template) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -305,6 +481,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class TextMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TextMessageContent(string text) { } + public string Text { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TextNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TextNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, string content) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -316,6 +503,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class VideoMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VideoMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class VideoNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VideoNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -328,6 +526,39 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class WhatsAppButtonActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppButtonActionBindings(Azure.Communication.Messages.ButtonSetContent content) { } + public Azure.Communication.Messages.ButtonSetContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppButtonActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppButtonActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WhatsAppListActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppListActionBindings(Azure.Communication.Messages.ActionGroupContent content) { } + public Azure.Communication.Messages.ActionGroupContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppListActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppListActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WhatsAppUrlActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppUrlActionBindings(Azure.Communication.Messages.LinkContent content) { } + public Azure.Communication.Messages.LinkContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppUrlActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppUrlActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } namespace Azure.Communication.Messages.Models.Channels { diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.Serialization.cs new file mode 100644 index 000000000000..29550713f1c8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [PersistableModelProxy(typeof(UnknownActionBindings))] + public partial class ActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionBindings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionBindings(document.RootElement, options); + } + + internal static ActionBindings DeserializeActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "whatsAppButtonAction": return WhatsAppButtonActionBindings.DeserializeWhatsAppButtonActionBindings(element, options); + case "whatsAppListAction": return WhatsAppListActionBindings.DeserializeWhatsAppListActionBindings(element, options); + case "whatsAppUrlAction": return WhatsAppUrlActionBindings.DeserializeWhatsAppUrlActionBindings(element, options); + } + } + return UnknownActionBindings.DeserializeUnknownActionBindings(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionBindings)} does not support writing '{options.Format}' format."); + } + } + + ActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeActionBindings(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.cs new file mode 100644 index 000000000000..6437442744c0 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// + /// Binding actions to the interactive message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class ActionBindings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ActionBindings() + { + } + + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + internal ActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData) + { + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Kind of the MessageActionBinding. + internal MessageActionBindingKind Kind { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.Serialization.cs new file mode 100644 index 000000000000..9c8cb78ca93f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ActionGroup : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroup)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("items"u8); + writer.WriteStartArray(); + foreach (var item in Items) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroup)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionGroup(document.RootElement, options); + } + + internal static ActionGroup DeserializeActionGroup(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string title = default; + IList items = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("items"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ActionGroupItem.DeserializeActionGroupItem(item, options)); + } + items = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionGroup(title, items, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionGroup)} does not support writing '{options.Format}' format."); + } + } + + ActionGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionGroup(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionGroup)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ActionGroup FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeActionGroup(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.cs new file mode 100644 index 000000000000..3f3b38a21c4f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.Messages +{ + /// The Action Group content. + public partial class ActionGroup + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Title of the ActionGroup. + /// Array of items in ActionGroup. + /// or is null. + public ActionGroup(string title, IEnumerable items) + { + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(items, nameof(items)); + + Title = title; + Items = items.ToList(); + } + + /// Initializes a new instance of . + /// Title of the ActionGroup. + /// Array of items in ActionGroup. + /// Keeps track of any properties unknown to the library. + internal ActionGroup(string title, IList items, IDictionary serializedAdditionalRawData) + { + Title = title; + Items = items; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ActionGroup() + { + } + + /// Title of the ActionGroup. + public string Title { get; } + /// Array of items in ActionGroup. + public IList Items { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.Serialization.cs new file mode 100644 index 000000000000..e4b45a901c43 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ActionGroupContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroupContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("groups"u8); + writer.WriteStartArray(); + foreach (var item in Groups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + ActionGroupContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroupContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionGroupContent(document.RootElement, options); + } + + internal static ActionGroupContent DeserializeActionGroupContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string title = default; + IList groups = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ActionGroup.DeserializeActionGroup(item, options)); + } + groups = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionGroupContent(kind, serializedAdditionalRawData, title, groups); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionGroupContent)} does not support writing '{options.Format}' format."); + } + } + + ActionGroupContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionGroupContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionGroupContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ActionGroupContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeActionGroupContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.cs new file mode 100644 index 000000000000..5acb5286f34a --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.Messages +{ + /// The action content of type ActionGroup. + public partial class ActionGroupContent : MessageContent + { + /// Initializes a new instance of . + /// Title of the actionGroup content. + /// Set or group of actions. + /// or is null. + public ActionGroupContent(string title, IEnumerable groups) + { + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(groups, nameof(groups)); + + Kind = MessageContentKind.Group; + Title = title; + Groups = groups.ToList(); + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// Title of the actionGroup content. + /// Set or group of actions. + internal ActionGroupContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, string title, IList groups) : base(kind, serializedAdditionalRawData) + { + Title = title; + Groups = groups; + } + + /// Initializes a new instance of for deserialization. + internal ActionGroupContent() + { + } + + /// Title of the actionGroup content. + public string Title { get; } + /// Set or group of actions. + public IList Groups { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.Serialization.cs new file mode 100644 index 000000000000..7fa2ac487dfd --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ActionGroupItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroupItem)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionGroupItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroupItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionGroupItem(document.RootElement, options); + } + + internal static ActionGroupItem DeserializeActionGroupItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string title = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionGroupItem(id, title, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionGroupItem)} does not support writing '{options.Format}' format."); + } + } + + ActionGroupItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionGroupItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionGroupItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ActionGroupItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeActionGroupItem(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.cs new file mode 100644 index 000000000000..ad2701d6511d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The Action group item in the content. + public partial class ActionGroupItem + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Id of the Item. + /// Title of the Item. + /// Description of the Item. + /// , or is null. + public ActionGroupItem(string id, string title, string description) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(description, nameof(description)); + + Id = id; + Title = title; + Description = description; + } + + /// Initializes a new instance of . + /// Id of the Item. + /// Title of the Item. + /// Description of the Item. + /// Keeps track of any properties unknown to the library. + internal ActionGroupItem(string id, string title, string description, IDictionary serializedAdditionalRawData) + { + Id = id; + Title = title; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ActionGroupItem() + { + } + + /// Id of the Item. + public string Id { get; } + /// Title of the Item. + public string Title { get; } + /// Description of the Item. + public string Description { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs new file mode 100644 index 000000000000..b968bcb761c0 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ButtonContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ButtonContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ButtonContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ButtonContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeButtonContent(document.RootElement, options); + } + + internal static ButtonContent DeserializeButtonContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string title = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ButtonContent(id, title, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ButtonContent)} does not support writing '{options.Format}' format."); + } + } + + ButtonContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeButtonContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ButtonContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ButtonContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeButtonContent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.cs new file mode 100644 index 000000000000..33b08cdda8bb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type Button information. + public partial class ButtonContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Unique Id of the button content. + /// Title of the button content. + /// or is null. + public ButtonContent(string id, string title) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(title, nameof(title)); + + Id = id; + Title = title; + } + + /// Initializes a new instance of . + /// Unique Id of the button content. + /// Title of the button content. + /// Keeps track of any properties unknown to the library. + internal ButtonContent(string id, string title, IDictionary serializedAdditionalRawData) + { + Id = id; + Title = title; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ButtonContent() + { + } + + /// Unique Id of the button content. + public string Id { get; } + /// Title of the button content. + public string Title { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.Serialization.cs new file mode 100644 index 000000000000..d8a2c7668311 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ButtonSetContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ButtonSetContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("buttons"u8); + writer.WriteStartArray(); + foreach (var item in Buttons) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + ButtonSetContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ButtonSetContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeButtonSetContent(document.RootElement, options); + } + + internal static ButtonSetContent DeserializeButtonSetContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList buttons = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("buttons"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ButtonContent.DeserializeButtonContent(item, options)); + } + buttons = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ButtonSetContent(kind, serializedAdditionalRawData, buttons); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ButtonSetContent)} does not support writing '{options.Format}' format."); + } + } + + ButtonSetContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeButtonSetContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ButtonSetContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ButtonSetContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeButtonSetContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.cs new file mode 100644 index 000000000000..330216be54e6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.Messages +{ + /// The message content of type ButtonSet/ List of buttons information. + public partial class ButtonSetContent : MessageContent + { + /// Initializes a new instance of . + /// Unique Id of the button content. + /// is null. + public ButtonSetContent(IEnumerable buttons) + { + Argument.AssertNotNull(buttons, nameof(buttons)); + + Kind = MessageContentKind.ButtonSet; + Buttons = buttons.ToList(); + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// Unique Id of the button content. + internal ButtonSetContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, IList buttons) : base(kind, serializedAdditionalRawData) + { + Buttons = buttons; + } + + /// Initializes a new instance of for deserialization. + internal ButtonSetContent() + { + } + + /// Unique Id of the button content. + public IList Buttons { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessageKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessageKind.cs index 6183b42f3e9f..8f44d43631b6 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessageKind.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessageKind.cs @@ -29,6 +29,9 @@ public CommunicationMessageKind(string value) private const string VideoValue = "video"; private const string AudioValue = "audio"; private const string TemplateValue = "template"; + private const string StickerValue = "sticker"; + private const string ReactionValue = "reaction"; + private const string InteractiveValue = "interactive"; /// Text message type. public static CommunicationMessageKind Text { get; } = new CommunicationMessageKind(TextValue); @@ -44,6 +47,12 @@ public CommunicationMessageKind(string value) public static CommunicationMessageKind Audio { get; } = new CommunicationMessageKind(AudioValue); /// Template message type. public static CommunicationMessageKind Template { get; } = new CommunicationMessageKind(TemplateValue); + /// Sticker message type. + public static CommunicationMessageKind Sticker { get; } = new CommunicationMessageKind(StickerValue); + /// Reaction message type. + public static CommunicationMessageKind Reaction { get; } = new CommunicationMessageKind(ReactionValue); + /// Interactive Actionable message type. + public static CommunicationMessageKind Interactive { get; } = new CommunicationMessageKind(InteractiveValue); /// Determines if two values are the same. public static bool operator ==(CommunicationMessageKind left, CommunicationMessageKind right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs index 58b29e477642..9322a32fee38 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs @@ -13,7 +13,7 @@ namespace Azure.Communication.Messages /// Client options for Azure.Communication.Messages library clients. public partial class CommunicationMessagesClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_08_30; + private const ServiceVersion LatestVersion = ServiceVersion.V2025_01_15_Preview; /// The version of the service to use. public enum ServiceVersion @@ -22,6 +22,8 @@ public enum ServiceVersion V2024_02_01 = 1, /// Service version "2024-08-30". V2024_08_30 = 2, + /// Service version "2025-01-15-preview". + V2025_01_15_Preview = 3, } internal string Version { get; } @@ -33,6 +35,7 @@ public CommunicationMessagesClientOptions(ServiceVersion version = LatestVersion { ServiceVersion.V2024_02_01 => "2024-02-01", ServiceVersion.V2024_08_30 => "2024-08-30", + ServiceVersion.V2025_01_15_Preview => "2025-01-15-preview", _ => throw new NotSupportedException() }; } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs index 8d1a11241d35..13fd5e4e68a6 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs @@ -110,6 +110,144 @@ public static AudioNotificationContent AudioNotificationContent(Guid channelRegi return new AudioNotificationContent(channelRegistrationId, to?.ToList(), CommunicationMessageKind.Audio, serializedAdditionalRawData: null, mediaUri); } + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// emoji content like \uD83D\uDE00. + /// ID of the previous message you want to reply to. + /// A new instance for mocking. + public static ReactionNotificationContent ReactionNotificationContent(Guid channelRegistrationId = default, IEnumerable to = null, string emoji = null, string messageId = null) + { + to ??= new List(); + + return new ReactionNotificationContent( + channelRegistrationId, + to?.ToList(), + CommunicationMessageKind.Reaction, + serializedAdditionalRawData: null, + emoji, + messageId); + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// A new instance for mocking. + public static StickerNotificationContent StickerNotificationContent(Guid channelRegistrationId = default, IEnumerable to = null, Uri mediaUri = null) + { + to ??= new List(); + + return new StickerNotificationContent(channelRegistrationId, to?.ToList(), CommunicationMessageKind.Sticker, serializedAdditionalRawData: null, mediaUri); + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The interactive message content. + /// A new instance for mocking. + public static InteractiveNotificationContent InteractiveNotificationContent(Guid channelRegistrationId = default, IEnumerable to = null, InteractiveMessage interactiveMessage = null) + { + to ??= new List(); + + return new InteractiveNotificationContent(channelRegistrationId, to?.ToList(), CommunicationMessageKind.Interactive, serializedAdditionalRawData: null, interactiveMessage); + } + + /// Initializes a new instance of . + /// + /// Gets or Sets Header content. Supports the following types:text, images etc. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// Gets or Sets Message body content. Emojis, markdown, and links are supported. + /// Gets or Sets Message footer content. Emojis, markdown, and links are supported. + /// + /// The binding object to get or set Action which describes options user have to respond to message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// A new instance for mocking. + public static InteractiveMessage InteractiveMessage(MessageContent header = null, TextMessageContent body = null, TextMessageContent footer = null, ActionBindings action = null) + { + return new InteractiveMessage(header, body, footer, action, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The text value. + /// A new instance for mocking. + public static TextMessageContent TextMessageContent(string text = null) + { + return new TextMessageContent(MessageContentKind.Text, serializedAdditionalRawData: null, text); + } + + /// Initializes a new instance of . + /// MediaUri of the media content. + /// A new instance for mocking. + public static DocumentMessageContent DocumentMessageContent(Uri mediaUri = null) + { + return new DocumentMessageContent(MessageContentKind.Document, serializedAdditionalRawData: null, mediaUri); + } + + /// Initializes a new instance of . + /// MediaUri of the media content. + /// A new instance for mocking. + public static ImageMessageContent ImageMessageContent(Uri mediaUri = null) + { + return new ImageMessageContent(MessageContentKind.Image, serializedAdditionalRawData: null, mediaUri); + } + + /// Initializes a new instance of . + /// MediaUri of the media content. + /// A new instance for mocking. + public static VideoMessageContent VideoMessageContent(Uri mediaUri = null) + { + return new VideoMessageContent(MessageContentKind.Video, serializedAdditionalRawData: null, mediaUri); + } + + /// Initializes a new instance of . + /// Title of the url content. + /// The url in the content. + /// A new instance for mocking. + public static LinkContent LinkContent(string title = null, Uri uri = null) + { + return new LinkContent(MessageContentKind.Url, serializedAdditionalRawData: null, title, uri); + } + + /// Initializes a new instance of . + /// Title of the actionGroup content. + /// Set or group of actions. + /// A new instance for mocking. + public static ActionGroupContent ActionGroupContent(string title = null, IEnumerable groups = null) + { + groups ??= new List(); + + return new ActionGroupContent(MessageContentKind.Group, serializedAdditionalRawData: null, title, groups?.ToList()); + } + + /// Initializes a new instance of . + /// Action content of Interactive message. + /// A new instance for mocking. + public static WhatsAppListActionBindings WhatsAppListActionBindings(ActionGroupContent content = null) + { + return new WhatsAppListActionBindings(MessageActionBindingKind.WhatsAppListAction, serializedAdditionalRawData: null, content); + } + + /// Initializes a new instance of . + /// Action content of Interactive message. + /// A new instance for mocking. + public static WhatsAppButtonActionBindings WhatsAppButtonActionBindings(ButtonSetContent content = null) + { + return new WhatsAppButtonActionBindings(MessageActionBindingKind.WhatsAppButtonAction, serializedAdditionalRawData: null, content); + } + + /// Initializes a new instance of . + /// Action content of Interactive message. + /// A new instance for mocking. + public static WhatsAppUrlActionBindings WhatsAppUrlActionBindings(LinkContent content = null) + { + return new WhatsAppUrlActionBindings(MessageActionBindingKind.WhatsAppUrlAction, serializedAdditionalRawData: null, content); + } + /// Initializes a new instance of . /// The Channel Registration ID for the Business Identifier. /// The native external platform user identifiers of the recipient. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.Serialization.cs new file mode 100644 index 000000000000..0c14527386fd --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class DocumentMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + DocumentMessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentMessageContent(document.RootElement, options); + } + + internal static DocumentMessageContent DeserializeDocumentMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentMessageContent(kind, serializedAdditionalRawData, mediaUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentMessageContent)} does not support writing '{options.Format}' format."); + } + } + + DocumentMessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentMessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DocumentMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.cs new file mode 100644 index 000000000000..03e671f0e1ce --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type document information. + public partial class DocumentMessageContent : MessageContent + { + /// Initializes a new instance of . + /// MediaUri of the media content. + /// is null. + public DocumentMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = MessageContentKind.Document; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// MediaUri of the media content. + internal DocumentMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal DocumentMessageContent() + { + } + + /// MediaUri of the media content. + public Uri MediaUri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.Serialization.cs new file mode 100644 index 000000000000..47a86890f011 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ImageMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + ImageMessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageMessageContent(document.RootElement, options); + } + + internal static ImageMessageContent DeserializeImageMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageMessageContent(kind, serializedAdditionalRawData, mediaUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageMessageContent)} does not support writing '{options.Format}' format."); + } + } + + ImageMessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageMessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ImageMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.cs new file mode 100644 index 000000000000..5a4a0016ef09 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type image information. + public partial class ImageMessageContent : MessageContent + { + /// Initializes a new instance of . + /// MediaUri of the media content. + /// is null. + public ImageMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = MessageContentKind.Image; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// MediaUri of the media content. + internal ImageMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal ImageMessageContent() + { + } + + /// MediaUri of the media content. + public Uri MediaUri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.Serialization.cs new file mode 100644 index 000000000000..663d9ff1bfe2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class InteractiveMessage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InteractiveMessage)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Header)) + { + writer.WritePropertyName("header"u8); + writer.WriteObjectValue(Header, options); + } + writer.WritePropertyName("body"u8); + writer.WriteObjectValue(Body, options); + if (Optional.IsDefined(Footer)) + { + writer.WritePropertyName("footer"u8); + writer.WriteObjectValue(Footer, options); + } + writer.WritePropertyName("action"u8); + writer.WriteObjectValue(Action, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InteractiveMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InteractiveMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInteractiveMessage(document.RootElement, options); + } + + internal static InteractiveMessage DeserializeInteractiveMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageContent header = default; + TextMessageContent body = default; + TextMessageContent footer = default; + ActionBindings action = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("header"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + header = MessageContent.DeserializeMessageContent(property.Value, options); + continue; + } + if (property.NameEquals("body"u8)) + { + body = TextMessageContent.DeserializeTextMessageContent(property.Value, options); + continue; + } + if (property.NameEquals("footer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + footer = TextMessageContent.DeserializeTextMessageContent(property.Value, options); + continue; + } + if (property.NameEquals("action"u8)) + { + action = ActionBindings.DeserializeActionBindings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InteractiveMessage(header, body, footer, action, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InteractiveMessage)} does not support writing '{options.Format}' format."); + } + } + + InteractiveMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInteractiveMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InteractiveMessage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InteractiveMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInteractiveMessage(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.cs new file mode 100644 index 000000000000..a757c34251ea --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The Interactive message content to which user can read and respond. + public partial class InteractiveMessage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or Sets Message body content. Emojis, markdown, and links are supported. + /// + /// The binding object to get or set Action which describes options user have to respond to message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// or is null. + public InteractiveMessage(TextMessageContent body, ActionBindings action) + { + Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNull(action, nameof(action)); + + Body = body; + Action = action; + } + + /// Initializes a new instance of . + /// + /// Gets or Sets Header content. Supports the following types:text, images etc. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// Gets or Sets Message body content. Emojis, markdown, and links are supported. + /// Gets or Sets Message footer content. Emojis, markdown, and links are supported. + /// + /// The binding object to get or set Action which describes options user have to respond to message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Keeps track of any properties unknown to the library. + internal InteractiveMessage(MessageContent header, TextMessageContent body, TextMessageContent footer, ActionBindings action, IDictionary serializedAdditionalRawData) + { + Header = header; + Body = body; + Footer = footer; + Action = action; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InteractiveMessage() + { + } + + /// + /// Gets or Sets Header content. Supports the following types:text, images etc. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public MessageContent Header { get; set; } + /// Gets or Sets Message body content. Emojis, markdown, and links are supported. + public TextMessageContent Body { get; } + /// Gets or Sets Message footer content. Emojis, markdown, and links are supported. + public TextMessageContent Footer { get; set; } + /// + /// The binding object to get or set Action which describes options user have to respond to message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public ActionBindings Action { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.Serialization.cs new file mode 100644 index 000000000000..75ee75d90f80 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class InteractiveNotificationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InteractiveNotificationContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("interactiveMessage"u8); + writer.WriteObjectValue(InteractiveMessage, options); + } + + InteractiveNotificationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InteractiveNotificationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInteractiveNotificationContent(document.RootElement, options); + } + + internal static InteractiveNotificationContent DeserializeInteractiveNotificationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InteractiveMessage interactiveMessage = default; + Guid channelRegistrationId = default; + IList to = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("interactiveMessage"u8)) + { + interactiveMessage = InteractiveMessage.DeserializeInteractiveMessage(property.Value, options); + continue; + } + if (property.NameEquals("channelRegistrationId"u8)) + { + channelRegistrationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("to"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + to = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new CommunicationMessageKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InteractiveNotificationContent(channelRegistrationId, to, kind, serializedAdditionalRawData, interactiveMessage); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InteractiveNotificationContent)} does not support writing '{options.Format}' format."); + } + } + + InteractiveNotificationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInteractiveNotificationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InteractiveNotificationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new InteractiveNotificationContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInteractiveNotificationContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.cs new file mode 100644 index 000000000000..c7c60c7fbdc1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// A request to send an Interactive message notification. + public partial class InteractiveNotificationContent : NotificationContent + { + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The interactive message content. + /// or is null. + public InteractiveNotificationContent(Guid channelRegistrationId, IEnumerable to, InteractiveMessage interactiveMessage) : base(channelRegistrationId, to) + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(interactiveMessage, nameof(interactiveMessage)); + + Kind = CommunicationMessageKind.Interactive; + InteractiveMessage = interactiveMessage; + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type discriminator describing a notification type. + /// Keeps track of any properties unknown to the library. + /// The interactive message content. + internal InteractiveNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, InteractiveMessage interactiveMessage) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) + { + InteractiveMessage = interactiveMessage; + } + + /// Initializes a new instance of for deserialization. + internal InteractiveNotificationContent() + { + } + + /// The interactive message content. + public InteractiveMessage InteractiveMessage { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.Serialization.cs new file mode 100644 index 000000000000..50233e91ff71 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class LinkContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + + LinkContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkContent(document.RootElement, options); + } + + internal static LinkContent DeserializeLinkContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string title = default; + Uri url = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkContent(kind, serializedAdditionalRawData, title, url); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LinkContent)} does not support writing '{options.Format}' format."); + } + } + + LinkContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLinkContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new LinkContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLinkContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.cs new file mode 100644 index 000000000000..eb9f674d1936 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type Url information. + public partial class LinkContent : MessageContent + { + /// Initializes a new instance of . + /// Title of the url content. + /// The url in the content. + /// or is null. + public LinkContent(string title, Uri uri) + { + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(uri, nameof(uri)); + + Kind = MessageContentKind.Url; + Title = title; + Uri = uri; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// Title of the url content. + /// The url in the content. + internal LinkContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, string title, Uri uri) : base(kind, serializedAdditionalRawData) + { + Title = title; + Uri = uri; + } + + /// Initializes a new instance of for deserialization. + internal LinkContent() + { + } + + /// Title of the url content. + public string Title { get; } + /// The url in the content. + public Uri Uri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageActionBindingKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageActionBindingKind.cs new file mode 100644 index 000000000000..862ceb70f5de --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageActionBindingKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The Kind of interactive message channel action binding like WhatsAppListAction. + internal readonly partial struct MessageActionBindingKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MessageActionBindingKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WhatsAppListActionValue = "whatsAppListAction"; + private const string WhatsAppButtonActionValue = "whatsAppButtonAction"; + private const string WhatsAppUrlActionValue = "whatsAppUrlAction"; + + /// The WhatsApp List action binding kind. + public static MessageActionBindingKind WhatsAppListAction { get; } = new MessageActionBindingKind(WhatsAppListActionValue); + /// The WhatsApp Button action binding kind. + public static MessageActionBindingKind WhatsAppButtonAction { get; } = new MessageActionBindingKind(WhatsAppButtonActionValue); + /// The WhatsApp Url action binding kind. + public static MessageActionBindingKind WhatsAppUrlAction { get; } = new MessageActionBindingKind(WhatsAppUrlActionValue); + /// Determines if two values are the same. + public static bool operator ==(MessageActionBindingKind left, MessageActionBindingKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MessageActionBindingKind left, MessageActionBindingKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MessageActionBindingKind(string value) => new MessageActionBindingKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MessageActionBindingKind other && Equals(other); + /// + public bool Equals(MessageActionBindingKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.Serialization.cs new file mode 100644 index 000000000000..2ca15f3b5a84 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [PersistableModelProxy(typeof(UnknownMessageContent))] + public partial class MessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageContent(document.RootElement, options); + } + + internal static MessageContent DeserializeMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "buttonSet": return ButtonSetContent.DeserializeButtonSetContent(element, options); + case "document": return DocumentMessageContent.DeserializeDocumentMessageContent(element, options); + case "group": return ActionGroupContent.DeserializeActionGroupContent(element, options); + case "image": return ImageMessageContent.DeserializeImageMessageContent(element, options); + case "text": return TextMessageContent.DeserializeTextMessageContent(element, options); + case "url": return LinkContent.DeserializeLinkContent(element, options); + case "video": return VideoMessageContent.DeserializeVideoMessageContent(element, options); + } + } + return UnknownMessageContent.DeserializeUnknownMessageContent(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MessageContent)} does not support writing '{options.Format}' format."); + } + } + + MessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeMessageContent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.cs new file mode 100644 index 000000000000..1c807fdacda6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// + /// The message content object used to create interactive messages components. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public abstract partial class MessageContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected MessageContent() + { + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + internal MessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData) + { + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Kind of MessageContent. + internal MessageContentKind Kind { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContentKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContentKind.cs new file mode 100644 index 000000000000..df01e1a492fc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContentKind.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The kind of Interactive message content. + internal readonly partial struct MessageContentKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MessageContentKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TextValue = "text"; + private const string ImageValue = "image"; + private const string VideoValue = "video"; + private const string DocumentValue = "document"; + private const string GroupValue = "group"; + private const string ButtonSetValue = "buttonSet"; + private const string UrlValue = "url"; + + /// The text content type. + public static MessageContentKind Text { get; } = new MessageContentKind(TextValue); + /// The image content type. + public static MessageContentKind Image { get; } = new MessageContentKind(ImageValue); + /// The video content type. + public static MessageContentKind Video { get; } = new MessageContentKind(VideoValue); + /// The document content type. + public static MessageContentKind Document { get; } = new MessageContentKind(DocumentValue); + /// The ActionSet content type. + public static MessageContentKind Group { get; } = new MessageContentKind(GroupValue); + /// The ButtonSet content type. + public static MessageContentKind ButtonSet { get; } = new MessageContentKind(ButtonSetValue); + /// The Url content type. + public static MessageContentKind Url { get; } = new MessageContentKind(UrlValue); + /// Determines if two values are the same. + public static bool operator ==(MessageContentKind left, MessageContentKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MessageContentKind left, MessageContentKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MessageContentKind(string value) => new MessageContentKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MessageContentKind other && Equals(other); + /// + public bool Equals(MessageContentKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs index 68f1f22e3469..dfc45e35fc3f 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs @@ -14,7 +14,7 @@ namespace Azure.Communication.Messages /// /// Details of the message to send. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , , , , and . /// public abstract partial class NotificationContent { diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.Serialization.cs new file mode 100644 index 000000000000..eb19413dcbed --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ReactionNotificationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReactionNotificationContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("emoji"u8); + writer.WriteStringValue(Emoji); + writer.WritePropertyName("messageId"u8); + writer.WriteStringValue(MessageId); + } + + ReactionNotificationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReactionNotificationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReactionNotificationContent(document.RootElement, options); + } + + internal static ReactionNotificationContent DeserializeReactionNotificationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string emoji = default; + string messageId = default; + Guid channelRegistrationId = default; + IList to = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("emoji"u8)) + { + emoji = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageId"u8)) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelRegistrationId"u8)) + { + channelRegistrationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("to"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + to = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new CommunicationMessageKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReactionNotificationContent( + channelRegistrationId, + to, + kind, + serializedAdditionalRawData, + emoji, + messageId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReactionNotificationContent)} does not support writing '{options.Format}' format."); + } + } + + ReactionNotificationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReactionNotificationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReactionNotificationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ReactionNotificationContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReactionNotificationContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.cs new file mode 100644 index 000000000000..a06858477fbe --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// A request to send a Reaction notification. + public partial class ReactionNotificationContent : NotificationContent + { + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// emoji content like \uD83D\uDE00. + /// ID of the previous message you want to reply to. + /// , or is null. + public ReactionNotificationContent(Guid channelRegistrationId, IEnumerable to, string emoji, string messageId) : base(channelRegistrationId, to) + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(emoji, nameof(emoji)); + Argument.AssertNotNull(messageId, nameof(messageId)); + + Kind = CommunicationMessageKind.Reaction; + Emoji = emoji; + MessageId = messageId; + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type discriminator describing a notification type. + /// Keeps track of any properties unknown to the library. + /// emoji content like \uD83D\uDE00. + /// ID of the previous message you want to reply to. + internal ReactionNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, string emoji, string messageId) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) + { + Emoji = emoji; + MessageId = messageId; + } + + /// Initializes a new instance of for deserialization. + internal ReactionNotificationContent() + { + } + + /// emoji content like \uD83D\uDE00. + public string Emoji { get; } + /// ID of the previous message you want to reply to. + public string MessageId { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.Serialization.cs new file mode 100644 index 000000000000..e00d50c93f77 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class StickerNotificationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StickerNotificationContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + StickerNotificationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StickerNotificationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStickerNotificationContent(document.RootElement, options); + } + + internal static StickerNotificationContent DeserializeStickerNotificationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = default; + Guid channelRegistrationId = default; + IList to = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("channelRegistrationId"u8)) + { + channelRegistrationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("to"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + to = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new CommunicationMessageKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StickerNotificationContent(channelRegistrationId, to, kind, serializedAdditionalRawData, mediaUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StickerNotificationContent)} does not support writing '{options.Format}' format."); + } + } + + StickerNotificationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStickerNotificationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StickerNotificationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new StickerNotificationContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeStickerNotificationContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.cs new file mode 100644 index 000000000000..b90c6584db92 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// A request to send a Sticker notification. + public partial class StickerNotificationContent : NotificationContent + { + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// or is null. + public StickerNotificationContent(Guid channelRegistrationId, IEnumerable to, Uri mediaUri) : base(channelRegistrationId, to) + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = CommunicationMessageKind.Sticker; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type discriminator describing a notification type. + /// Keeps track of any properties unknown to the library. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + internal StickerNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal StickerNotificationContent() + { + } + + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + public Uri MediaUri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.Serialization.cs new file mode 100644 index 000000000000..1e250ef6c9b1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class TextMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + + TextMessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextMessageContent(document.RootElement, options); + } + + internal static TextMessageContent DeserializeTextMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextMessageContent(kind, serializedAdditionalRawData, text); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextMessageContent)} does not support writing '{options.Format}' format."); + } + } + + TextMessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTextMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextMessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new TextMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.cs new file mode 100644 index 000000000000..5bb81059ded6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type text information. + public partial class TextMessageContent : MessageContent + { + /// Initializes a new instance of . + /// The text value. + /// is null. + public TextMessageContent(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Kind = MessageContentKind.Text; + Text = text; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// The text value. + internal TextMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, string text) : base(kind, serializedAdditionalRawData) + { + Text = text; + } + + /// Initializes a new instance of for deserialization. + internal TextMessageContent() + { + } + + /// The text value. + public string Text { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.Serialization.cs new file mode 100644 index 000000000000..5a57e9e89df4 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class UnknownActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionBindings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionBindings(document.RootElement, options); + } + + internal static UnknownActionBindings DeserializeUnknownActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageActionBindingKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new MessageActionBindingKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownActionBindings(kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionBindings)} does not support writing '{options.Format}' format."); + } + } + + ActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownActionBindings(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.cs new file mode 100644 index 000000000000..a6a3ee87536f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Unknown version of ActionBindings. + internal partial class UnknownActionBindings : ActionBindings + { + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + internal UnknownActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownActionBindings() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.Serialization.cs new file mode 100644 index 000000000000..21f7dfbf5383 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class UnknownMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + MessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageContent(document.RootElement, options); + } + + internal static UnknownMessageContent DeserializeUnknownMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageContentKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownMessageContent(kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MessageContent)} does not support writing '{options.Format}' format."); + } + } + + MessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.cs new file mode 100644 index 000000000000..b41ad6a768fb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Unknown version of MessageContent. + internal partial class UnknownMessageContent : MessageContent + { + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + internal UnknownMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownMessageContent() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.Serialization.cs new file mode 100644 index 000000000000..c4787e3c5944 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class VideoMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VideoMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + VideoMessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VideoMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVideoMessageContent(document.RootElement, options); + } + + internal static VideoMessageContent DeserializeVideoMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VideoMessageContent(kind, serializedAdditionalRawData, mediaUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VideoMessageContent)} does not support writing '{options.Format}' format."); + } + } + + VideoMessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVideoMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VideoMessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new VideoMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeVideoMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.cs new file mode 100644 index 000000000000..acc98d909c2c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type video information. + public partial class VideoMessageContent : MessageContent + { + /// Initializes a new instance of . + /// MediaUri of the media content. + /// is null. + public VideoMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = MessageContentKind.Video; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// MediaUri of the media content. + internal VideoMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal VideoMessageContent() + { + } + + /// MediaUri of the media content. + public Uri MediaUri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.Serialization.cs new file mode 100644 index 000000000000..191a3a476583 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class WhatsAppButtonActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppButtonActionBindings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content, options); + } + + WhatsAppButtonActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppButtonActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWhatsAppButtonActionBindings(document.RootElement, options); + } + + internal static WhatsAppButtonActionBindings DeserializeWhatsAppButtonActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ButtonSetContent content = default; + MessageActionBindingKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = ButtonSetContent.DeserializeButtonSetContent(property.Value, options); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageActionBindingKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WhatsAppButtonActionBindings(kind, serializedAdditionalRawData, content); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WhatsAppButtonActionBindings)} does not support writing '{options.Format}' format."); + } + } + + WhatsAppButtonActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWhatsAppButtonActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WhatsAppButtonActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WhatsAppButtonActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWhatsAppButtonActionBindings(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.cs new file mode 100644 index 000000000000..9b8bc35a4ce1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// WhatsApp Binding actions to the interactive message. + public partial class WhatsAppButtonActionBindings : ActionBindings + { + /// Initializes a new instance of . + /// Action content of Interactive message. + /// is null. + public WhatsAppButtonActionBindings(ButtonSetContent content) + { + Argument.AssertNotNull(content, nameof(content)); + + Kind = MessageActionBindingKind.WhatsAppButtonAction; + Content = content; + } + + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + /// Action content of Interactive message. + internal WhatsAppButtonActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData, ButtonSetContent content) : base(kind, serializedAdditionalRawData) + { + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal WhatsAppButtonActionBindings() + { + } + + /// Action content of Interactive message. + public ButtonSetContent Content { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.Serialization.cs new file mode 100644 index 000000000000..b062e48ac80c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class WhatsAppListActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppListActionBindings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content, options); + } + + WhatsAppListActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppListActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWhatsAppListActionBindings(document.RootElement, options); + } + + internal static WhatsAppListActionBindings DeserializeWhatsAppListActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ActionGroupContent content = default; + MessageActionBindingKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = ActionGroupContent.DeserializeActionGroupContent(property.Value, options); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageActionBindingKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WhatsAppListActionBindings(kind, serializedAdditionalRawData, content); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WhatsAppListActionBindings)} does not support writing '{options.Format}' format."); + } + } + + WhatsAppListActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWhatsAppListActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WhatsAppListActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WhatsAppListActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWhatsAppListActionBindings(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.cs new file mode 100644 index 000000000000..dfef2414c604 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// WhatsApp List Binding actions to the interactive message. + public partial class WhatsAppListActionBindings : ActionBindings + { + /// Initializes a new instance of . + /// Action content of Interactive message. + /// is null. + public WhatsAppListActionBindings(ActionGroupContent content) + { + Argument.AssertNotNull(content, nameof(content)); + + Kind = MessageActionBindingKind.WhatsAppListAction; + Content = content; + } + + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + /// Action content of Interactive message. + internal WhatsAppListActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData, ActionGroupContent content) : base(kind, serializedAdditionalRawData) + { + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal WhatsAppListActionBindings() + { + } + + /// Action content of Interactive message. + public ActionGroupContent Content { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.Serialization.cs new file mode 100644 index 000000000000..67b5e6db7382 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class WhatsAppUrlActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppUrlActionBindings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content, options); + } + + WhatsAppUrlActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppUrlActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWhatsAppUrlActionBindings(document.RootElement, options); + } + + internal static WhatsAppUrlActionBindings DeserializeWhatsAppUrlActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + LinkContent content = default; + MessageActionBindingKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = LinkContent.DeserializeLinkContent(property.Value, options); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageActionBindingKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WhatsAppUrlActionBindings(kind, serializedAdditionalRawData, content); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WhatsAppUrlActionBindings)} does not support writing '{options.Format}' format."); + } + } + + WhatsAppUrlActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWhatsAppUrlActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WhatsAppUrlActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WhatsAppUrlActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWhatsAppUrlActionBindings(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.cs new file mode 100644 index 000000000000..90030635b88d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// WhatsApp Binding actions to the interactive message. + public partial class WhatsAppUrlActionBindings : ActionBindings + { + /// Initializes a new instance of . + /// Action content of Interactive message. + /// is null. + public WhatsAppUrlActionBindings(LinkContent content) + { + Argument.AssertNotNull(content, nameof(content)); + + Kind = MessageActionBindingKind.WhatsAppUrlAction; + Content = content; + } + + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + /// Action content of Interactive message. + internal WhatsAppUrlActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData, LinkContent content) : base(kind, serializedAdditionalRawData) + { + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal WhatsAppUrlActionBindings() + { + } + + /// Action content of Interactive message. + public LinkContent Content { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml index 9c9e66f49dcd..a426286de933 100644 --- a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml +++ b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: abe3209e7c6924a58ab560ebab2349bc8fde6aa7 directory: specification/communication/Communication.Messages -additionalDirectories: [] +commit: 28b747d09b04748fa0efbe3d6496f1af6613e7e5 repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/communication/Azure.Communication.Messages/tspCodeModel.json b/sdk/communication/Azure.Communication.Messages/tspCodeModel.json index 22426e0a310a..3bfdede55980 100644 --- a/sdk/communication/Azure.Communication.Messages/tspCodeModel.json +++ b/sdk/communication/Azure.Communication.Messages/tspCodeModel.json @@ -3,7 +3,8 @@ "Name": "Azure.Communication.MessagesService", "ApiVersions": [ "2024-02-01", - "2024-08-30" + "2024-08-30", + "2025-01-15-preview" ], "Enums": [ { @@ -144,6 +145,60 @@ }, "doc": "Template message type.", "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "sticker", + "value": "sticker", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Sticker message type.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "reaction", + "value": "reaction", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Reaction message type.", + "decorators": [] + }, + { + "$id": "22", + "kind": "enumvalue", + "name": "interactive", + "value": "interactive", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Interactive Actionable message type.", + "decorators": [] } ], "clientNamespace": "Azure.Communication.MessagesService", @@ -154,12 +209,12 @@ "decorators": [] }, { - "$id": "18", + "$id": "24", "kind": "enum", - "name": "MessageTemplateValueKind", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValueKind", + "name": "MessageContentKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageContentKind", "valueType": { - "$id": "19", + "$id": "25", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -167,128 +222,146 @@ }, "values": [ { - "$id": "20", + "$id": "26", "kind": "enumvalue", "name": "text", "value": "text", "valueType": { - "$id": "21", + "$id": "27", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The text template parameter type.", + "doc": "The text content type.", "decorators": [] }, { - "$id": "22", + "$id": "28", "kind": "enumvalue", "name": "image", "value": "image", "valueType": { - "$id": "23", + "$id": "29", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The image template parameter type.", + "doc": "The image content type.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "video", + "value": "video", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "24" + }, + "doc": "The video content type.", "decorators": [] }, { - "$id": "24", + "$id": "32", "kind": "enumvalue", "name": "document", "value": "document", "valueType": { - "$id": "25", + "$id": "33", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The document template parameter type.", + "doc": "The document content type.", "decorators": [] }, { - "$id": "26", + "$id": "34", "kind": "enumvalue", - "name": "video", - "value": "video", + "name": "group", + "value": "group", "valueType": { - "$id": "27", + "$id": "35", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The video template parameter type.", + "doc": "The ActionSet content type.", "decorators": [] }, { - "$id": "28", + "$id": "36", "kind": "enumvalue", - "name": "location", - "value": "location", + "name": "buttonSet", + "value": "buttonSet", "valueType": { - "$id": "29", + "$id": "37", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The location template parameter type.", + "doc": "The ButtonSet content type.", "decorators": [] }, { - "$id": "30", + "$id": "38", "kind": "enumvalue", - "name": "quickAction", - "value": "quickAction", + "name": "url", + "value": "url", "valueType": { - "$id": "31", + "$id": "39", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The quick action template parameter type.", + "doc": "The Url content type.", "decorators": [] } ], "clientNamespace": "Azure.Communication.MessagesService", - "doc": "The type of the template parameter.", + "doc": "The kind of Interactive message content.", "isFixed": false, "isFlags": false, "usage": "Input,Json", "decorators": [] }, { - "$id": "32", + "$id": "40", "kind": "enum", - "name": "MessageTemplateBindingsKind", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindingsKind", + "name": "MessageActionBindingKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageActionBindingKind", "valueType": { - "$id": "33", + "$id": "41", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -296,95 +369,74 @@ }, "values": [ { - "$id": "34", + "$id": "42", "kind": "enumvalue", - "name": "whatsApp", - "value": "whatsApp", + "name": "whatsAppListAction", + "value": "whatsAppListAction", "valueType": { - "$id": "35", + "$id": "43", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "32" + "$ref": "40" }, - "doc": "The WhatsApp template type.", + "doc": "The WhatsApp List action binding kind.", "decorators": [] - } - ], - "clientNamespace": "Azure.Communication.MessagesService", - "doc": "The type of the message template.", - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "36", - "kind": "enum", - "name": "WhatsAppMessageButtonSubType", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageButtonSubType", - "valueType": { - "$id": "37", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ + }, { - "$id": "38", + "$id": "44", "kind": "enumvalue", - "name": "quickReply", - "value": "quickReply", + "name": "whatsAppButtonAction", + "value": "whatsAppButtonAction", "valueType": { - "$id": "39", + "$id": "45", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "36" + "$ref": "40" }, - "doc": "The WhatsApp button sub type is quick reply.", + "doc": "The WhatsApp Button action binding kind.", "decorators": [] }, { - "$id": "40", + "$id": "46", "kind": "enumvalue", - "name": "url", - "value": "url", + "name": "whatsAppUrlAction", + "value": "whatsAppUrlAction", "valueType": { - "$id": "41", + "$id": "47", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "36" + "$ref": "40" }, - "doc": "The WhatsApp button sub type is url.", + "doc": "The WhatsApp Url action binding kind.", "decorators": [] } ], "clientNamespace": "Azure.Communication.MessagesService", - "doc": "The WhatsApp button sub type.", + "doc": "The Kind of interactive message channel action binding like WhatsAppListAction.", "isFixed": false, "isFlags": false, "usage": "Input,Json", "decorators": [] }, { - "$id": "42", + "$id": "48", "kind": "enum", - "name": "Versions", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Versions", + "name": "MessageTemplateValueKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValueKind", "valueType": { - "$id": "43", + "$id": "49", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -392,69 +444,48 @@ }, "values": [ { - "$id": "44", + "$id": "50", "kind": "enumvalue", - "name": "c2024_02_01", - "value": "2024-02-01", + "name": "text", + "value": "text", "valueType": { - "$id": "45", + "$id": "51", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "42" + "$ref": "48" }, - "doc": "Azure Communication Messages 2024-02-01 api version", + "doc": "The text template parameter type.", "decorators": [] }, { - "$id": "46", + "$id": "52", "kind": "enumvalue", - "name": "c2024_08_30", - "value": "2024-08-30", + "name": "image", + "value": "image", "valueType": { - "$id": "47", + "$id": "53", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "42" + "$ref": "48" }, - "doc": "Azure Communication Messages 2024-08-30 api version", + "doc": "The image template parameter type.", "decorators": [] - } - ], - "clientNamespace": "Azure.Communication.MessagesService", - "doc": "Azure Communication Messages Versions", - "isFixed": true, - "isFlags": false, - "usage": "ApiVersionEnum", - "decorators": [] - }, - { - "$id": "48", - "kind": "enum", - "name": "MessageTemplateStatus", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateStatus", - "valueType": { - "$id": "49", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ + }, { - "$id": "50", + "$id": "54", "kind": "enumvalue", - "name": "approved", - "value": "approved", + "name": "document", + "value": "document", "valueType": { - "$id": "51", + "$id": "55", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -463,16 +494,16 @@ "enumType": { "$ref": "48" }, - "doc": "Message template is approved.", + "doc": "The document template parameter type.", "decorators": [] }, { - "$id": "52", + "$id": "56", "kind": "enumvalue", - "name": "rejected", - "value": "rejected", + "name": "video", + "value": "video", "valueType": { - "$id": "53", + "$id": "57", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -481,16 +512,16 @@ "enumType": { "$ref": "48" }, - "doc": "Message template is rejected.", + "doc": "The video template parameter type.", "decorators": [] }, { - "$id": "54", + "$id": "58", "kind": "enumvalue", - "name": "pending", - "value": "pending", + "name": "location", + "value": "location", "valueType": { - "$id": "55", + "$id": "59", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -499,16 +530,16 @@ "enumType": { "$ref": "48" }, - "doc": "Message template is pending.", + "doc": "The location template parameter type.", "decorators": [] }, { - "$id": "56", + "$id": "60", "kind": "enumvalue", - "name": "paused", - "value": "paused", + "name": "quickAction", + "value": "quickAction", "valueType": { - "$id": "57", + "$id": "61", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -517,24 +548,24 @@ "enumType": { "$ref": "48" }, - "doc": "Message template is paused.", + "doc": "The quick action template parameter type.", "decorators": [] } ], "clientNamespace": "Azure.Communication.MessagesService", - "doc": "The aggregated template status.", + "doc": "The type of the template parameter.", "isFixed": false, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Json", "decorators": [] }, { - "$id": "58", + "$id": "62", "kind": "enum", - "name": "CommunicationMessagesChannel", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.CommunicationMessagesChannel", + "name": "MessageTemplateBindingsKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindingsKind", "valueType": { - "$id": "59", + "$id": "63", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -542,38 +573,38 @@ }, "values": [ { - "$id": "60", + "$id": "64", "kind": "enumvalue", "name": "whatsApp", "value": "whatsApp", "valueType": { - "$id": "61", + "$id": "65", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "58" + "$ref": "62" }, - "doc": "The WhatsApp communication messages channel type.", + "doc": "The WhatsApp template type.", "decorators": [] } ], "clientNamespace": "Azure.Communication.MessagesService", - "doc": "The type of the communication messages channel.", + "doc": "The type of the message template.", "isFixed": false, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Json", "decorators": [] }, { - "$id": "62", + "$id": "66", "kind": "enum", - "name": "RepeatabilityResult", - "crossLanguageDefinitionId": "Azure.Core.RepeatabilityResult", + "name": "WhatsAppMessageButtonSubType", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageButtonSubType", "valueType": { - "$id": "63", + "$id": "67", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -581,37 +612,301 @@ }, "values": [ { - "$id": "64", + "$id": "68", "kind": "enumvalue", - "name": "accepted", - "value": "accepted", + "name": "quickReply", + "value": "quickReply", "valueType": { - "$id": "65", + "$id": "69", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "62" + "$ref": "66" + }, + "doc": "The WhatsApp button sub type is quick reply.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "url", + "value": "url", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "The WhatsApp button sub type is url.", + "decorators": [] + } + ], + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The WhatsApp button sub type.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "72", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Versions", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "74", + "kind": "enumvalue", + "name": "c2024_02_01", + "value": "2024-02-01", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Azure Communication Messages 2024-02-01 api version", + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "c2024_08_30", + "value": "2024-08-30", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Azure Communication Messages 2024-08-30 api version", + "decorators": [] + }, + { + "$id": "78", + "kind": "enumvalue", + "name": "c2025_01_15_Preview", + "value": "2025-01-15-preview", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Azure Communication Messages 2025-01-15-preview api version", + "decorators": [] + } + ], + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "Azure Communication Messages Versions", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + }, + { + "$id": "80", + "kind": "enum", + "name": "MessageTemplateStatus", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateStatus", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "82", + "kind": "enumvalue", + "name": "approved", + "value": "approved", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Message template is approved.", + "decorators": [] + }, + { + "$id": "84", + "kind": "enumvalue", + "name": "rejected", + "value": "rejected", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Message template is rejected.", + "decorators": [] + }, + { + "$id": "86", + "kind": "enumvalue", + "name": "pending", + "value": "pending", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Message template is pending.", + "decorators": [] + }, + { + "$id": "88", + "kind": "enumvalue", + "name": "paused", + "value": "paused", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Message template is paused.", + "decorators": [] + } + ], + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The aggregated template status.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "90", + "kind": "enum", + "name": "CommunicationMessagesChannel", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.CommunicationMessagesChannel", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "92", + "kind": "enumvalue", + "name": "whatsApp", + "value": "whatsApp", + "valueType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "90" + }, + "doc": "The WhatsApp communication messages channel type.", + "decorators": [] + } + ], + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The type of the communication messages channel.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "94", + "kind": "enum", + "name": "RepeatabilityResult", + "crossLanguageDefinitionId": "Azure.Core.RepeatabilityResult", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "96", + "kind": "enumvalue", + "name": "accepted", + "value": "accepted", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "94" }, "doc": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation.", "decorators": [] }, { - "$id": "66", + "$id": "98", "kind": "enumvalue", "name": "rejected", "value": "rejected", "valueType": { - "$id": "67", + "$id": "99", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "62" + "$ref": "94" }, "doc": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server.", "decorators": [] @@ -627,7 +922,7 @@ ], "Models": [ { - "$id": "68", + "$id": "100", "kind": "model", "name": "NotificationContent", "clientNamespace": "Azure.Communication.MessagesService", @@ -636,7 +931,7 @@ "doc": "Details of the message to send.", "decorators": [], "discriminatorProperty": { - "$id": "69", + "$id": "101", "kind": "property", "name": "kind", "serializedName": "kind", @@ -651,27 +946,27 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.kind", "serializationOptions": { - "$id": "70", + "$id": "102", "json": { - "$id": "71", + "$id": "103", "name": "kind" } } }, "properties": [ { - "$id": "72", + "$id": "104", "kind": "property", "name": "channelRegistrationId", "serializedName": "channelRegistrationId", "doc": "The Channel Registration ID for the Business Identifier.", "type": { - "$id": "73", + "$id": "105", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "74", + "$id": "106", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -686,25 +981,25 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.channelRegistrationId", "serializationOptions": { - "$id": "75", + "$id": "107", "json": { - "$id": "76", + "$id": "108", "name": "channelRegistrationId" } } }, { - "$id": "77", + "$id": "109", "kind": "property", "name": "to", "serializedName": "to", "doc": "The native external platform user identifiers of the recipient.", "type": { - "$id": "78", + "$id": "110", "kind": "array", "name": "Array", "valueType": { - "$id": "79", + "$id": "111", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -720,21 +1015,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.to", "serializationOptions": { - "$id": "80", + "$id": "112", "json": { - "$id": "81", + "$id": "113", "name": "to" } } }, { - "$ref": "69" + "$ref": "101" } ], "discriminatedSubtypes": { - "$id": "82", + "$id": "114", "text": { - "$id": "83", + "$id": "115", "kind": "model", "name": "TextNotificationContent", "clientNamespace": "Azure.Communication.MessagesService", @@ -744,20 +1039,20 @@ "discriminatorValue": "text", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "84", + "$id": "116", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is text.", "type": { - "$id": "85", + "$id": "117", "kind": "constant", "valueType": { - "$id": "86", + "$id": "118", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -773,21 +1068,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent.kind", "serializationOptions": { - "$id": "87", + "$id": "119", "json": { - "$id": "88", + "$id": "120", "name": "kind" } } }, { - "$id": "89", + "$id": "121", "kind": "property", "name": "content", "serializedName": "content", "doc": "Message content.", "type": { - "$id": "90", + "$id": "122", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -800,9 +1095,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent.content", "serializationOptions": { - "$id": "91", + "$id": "123", "json": { - "$id": "92", + "$id": "124", "name": "content" } } @@ -810,7 +1105,7 @@ ] }, "image_v0": { - "$id": "93", + "$id": "125", "kind": "model", "name": "MediaNotificationContent", "clientNamespace": "Azure.Communication.MessagesService", @@ -821,20 +1116,20 @@ "discriminatorValue": "image_v0", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "94", + "$id": "126", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "95", + "$id": "127", "kind": "constant", "valueType": { - "$id": "96", + "$id": "128", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -850,21 +1145,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.kind", "serializationOptions": { - "$id": "97", + "$id": "129", "json": { - "$id": "98", + "$id": "130", "name": "kind" } } }, { - "$id": "99", + "$id": "131", "kind": "property", "name": "content", "serializedName": "content", "doc": "Optional text content.", "type": { - "$id": "100", + "$id": "132", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -877,21 +1172,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.content", "serializationOptions": { - "$id": "101", + "$id": "133", "json": { - "$id": "102", + "$id": "134", "name": "content" } } }, { - "$id": "103", + "$id": "135", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "104", + "$id": "136", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -904,9 +1199,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.mediaUri", "serializationOptions": { - "$id": "105", + "$id": "137", "json": { - "$id": "106", + "$id": "138", "name": "mediaUri" } } @@ -914,7 +1209,7 @@ ] }, "image": { - "$id": "107", + "$id": "139", "kind": "model", "name": "ImageNotificationContent", "clientNamespace": "Azure.Communication.MessagesService", @@ -924,20 +1219,20 @@ "discriminatorValue": "image", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "108", + "$id": "140", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "109", + "$id": "141", "kind": "constant", "valueType": { - "$id": "110", + "$id": "142", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -953,21 +1248,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.kind", "serializationOptions": { - "$id": "111", + "$id": "143", "json": { - "$id": "112", + "$id": "144", "name": "kind" } } }, { - "$id": "113", + "$id": "145", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "114", + "$id": "146", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -980,21 +1275,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.caption", "serializationOptions": { - "$id": "115", + "$id": "147", "json": { - "$id": "116", + "$id": "148", "name": "caption" } } }, { - "$id": "117", + "$id": "149", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "118", + "$id": "150", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1007,9 +1302,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.mediaUri", "serializationOptions": { - "$id": "119", + "$id": "151", "json": { - "$id": "120", + "$id": "152", "name": "mediaUri" } } @@ -1017,7 +1312,7 @@ ] }, "document": { - "$id": "121", + "$id": "153", "kind": "model", "name": "DocumentNotificationContent", "clientNamespace": "Azure.Communication.MessagesService", @@ -1027,20 +1322,20 @@ "discriminatorValue": "document", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "122", + "$id": "154", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "123", + "$id": "155", "kind": "constant", "valueType": { - "$id": "124", + "$id": "156", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1056,21 +1351,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.kind", "serializationOptions": { - "$id": "125", + "$id": "157", "json": { - "$id": "126", + "$id": "158", "name": "kind" } } }, { - "$id": "127", + "$id": "159", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "128", + "$id": "160", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1083,21 +1378,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.caption", "serializationOptions": { - "$id": "129", + "$id": "161", "json": { - "$id": "130", + "$id": "162", "name": "caption" } } }, { - "$id": "131", + "$id": "163", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "Optional name for the file.", "type": { - "$id": "132", + "$id": "164", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1110,21 +1405,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.fileName", "serializationOptions": { - "$id": "133", + "$id": "165", "json": { - "$id": "134", + "$id": "166", "name": "fileName" } } }, { - "$id": "135", + "$id": "167", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "136", + "$id": "168", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1137,9 +1432,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.mediaUri", "serializationOptions": { - "$id": "137", + "$id": "169", "json": { - "$id": "138", + "$id": "170", "name": "mediaUri" } } @@ -1147,7 +1442,7 @@ ] }, "video": { - "$id": "139", + "$id": "171", "kind": "model", "name": "VideoNotificationContent", "clientNamespace": "Azure.Communication.MessagesService", @@ -1157,20 +1452,20 @@ "discriminatorValue": "video", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "140", + "$id": "172", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "141", + "$id": "173", "kind": "constant", "valueType": { - "$id": "142", + "$id": "174", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1186,21 +1481,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.kind", "serializationOptions": { - "$id": "143", + "$id": "175", "json": { - "$id": "144", + "$id": "176", "name": "kind" } } }, { - "$id": "145", + "$id": "177", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "146", + "$id": "178", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1213,21 +1508,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.caption", "serializationOptions": { - "$id": "147", + "$id": "179", "json": { - "$id": "148", + "$id": "180", "name": "caption" } } }, { - "$id": "149", + "$id": "181", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "150", + "$id": "182", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1240,9 +1535,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.mediaUri", "serializationOptions": { - "$id": "151", + "$id": "183", "json": { - "$id": "152", + "$id": "184", "name": "mediaUri" } } @@ -1250,7 +1545,7 @@ ] }, "audio": { - "$id": "153", + "$id": "185", "kind": "model", "name": "AudioNotificationContent", "clientNamespace": "Azure.Communication.MessagesService", @@ -1260,20 +1555,20 @@ "discriminatorValue": "audio", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "154", + "$id": "186", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is audio.", "type": { - "$id": "155", + "$id": "187", "kind": "constant", "valueType": { - "$id": "156", + "$id": "188", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1289,21 +1584,200 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent.kind", "serializationOptions": { - "$id": "157", + "$id": "189", "json": { - "$id": "158", + "$id": "190", "name": "kind" } } }, { - "$id": "159", + "$id": "191", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "160", + "$id": "192", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent.mediaUri", + "serializationOptions": { + "$id": "193", + "json": { + "$id": "194", + "name": "mediaUri" + } + } + } + ] + }, + "reaction": { + "$id": "195", + "kind": "model", + "name": "ReactionNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ReactionNotificationContent", + "usage": "Input,Json", + "doc": "A request to send a Reaction notification.", + "discriminatorValue": "reaction", + "decorators": [], + "baseModel": { + "$ref": "100" + }, + "properties": [ + { + "$id": "196", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is reaction.", + "type": { + "$id": "197", + "kind": "constant", + "valueType": { + "$id": "198", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "reaction", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ReactionNotificationContent.kind", + "serializationOptions": { + "$id": "199", + "json": { + "$id": "200", + "name": "kind" + } + } + }, + { + "$id": "201", + "kind": "property", + "name": "emoji", + "serializedName": "emoji", + "doc": "emoji content like \\uD83D\\uDE00.", + "type": { + "$id": "202", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ReactionNotificationContent.emoji", + "serializationOptions": { + "$id": "203", + "json": { + "$id": "204", + "name": "emoji" + } + } + }, + { + "$id": "205", + "kind": "property", + "name": "messageId", + "serializedName": "messageId", + "doc": "ID of the previous message you want to reply to.", + "type": { + "$id": "206", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ReactionNotificationContent.messageId", + "serializationOptions": { + "$id": "207", + "json": { + "$id": "208", + "name": "messageId" + } + } + } + ] + }, + "sticker": { + "$id": "209", + "kind": "model", + "name": "StickerNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.StickerNotificationContent", + "usage": "Input,Json", + "doc": "A request to send a Sticker notification.", + "discriminatorValue": "sticker", + "decorators": [], + "baseModel": { + "$ref": "100" + }, + "properties": [ + { + "$id": "210", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is sticker.", + "type": { + "$id": "211", + "kind": "constant", + "valueType": { + "$id": "212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "sticker", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.StickerNotificationContent.kind", + "serializationOptions": { + "$id": "213", + "json": { + "$id": "214", + "name": "kind" + } + } + }, + { + "$id": "215", + "kind": "property", + "name": "mediaUri", + "serializedName": "mediaUri", + "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", + "type": { + "$id": "216", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1314,19 +1788,1295 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent.mediaUri", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.StickerNotificationContent.mediaUri", + "serializationOptions": { + "$id": "217", + "json": { + "$id": "218", + "name": "mediaUri" + } + } + } + ] + }, + "interactive": { + "$id": "219", + "kind": "model", + "name": "InteractiveNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveNotificationContent", + "usage": "Input,Json", + "doc": "A request to send an Interactive message notification.", + "discriminatorValue": "interactive", + "decorators": [], + "baseModel": { + "$ref": "100" + }, + "properties": [ + { + "$id": "220", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is Interactive.", + "type": { + "$id": "221", + "kind": "constant", + "valueType": { + "$id": "222", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "interactive", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveNotificationContent.kind", + "serializationOptions": { + "$id": "223", + "json": { + "$id": "224", + "name": "kind" + } + } + }, + { + "$id": "225", + "kind": "property", + "name": "interactiveMessage", + "serializedName": "interactiveMessage", + "doc": "The interactive message content.", + "type": { + "$id": "226", + "kind": "model", + "name": "InteractiveMessage", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage", + "usage": "Input,Json", + "doc": "The Interactive message content to which user can read and respond.", + "decorators": [], + "properties": [ + { + "$id": "227", + "kind": "property", + "name": "header", + "serializedName": "header", + "doc": "Gets or Sets Header content. Supports the following types:text, images etc.", + "type": { + "$id": "228", + "kind": "model", + "name": "MessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageContent", + "usage": "Input,Json", + "doc": "The message content object used to create interactive messages components.", + "decorators": [], + "discriminatorProperty": { + "$id": "229", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Kind of MessageContent.", + "type": { + "$ref": "24" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageContent.kind", + "serializationOptions": { + "$id": "230", + "json": { + "$id": "231", + "name": "kind" + } + } + }, + "properties": [ + { + "$ref": "229" + } + ], + "discriminatedSubtypes": { + "$id": "232", + "text": { + "$id": "233", + "kind": "model", + "name": "TextMessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextMessageContent", + "usage": "Input,Json", + "doc": "The message content of type text information.", + "discriminatorValue": "text", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "234", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is text.", + "type": { + "$id": "235", + "kind": "constant", + "valueType": { + "$id": "236", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextMessageContent.kind", + "serializationOptions": { + "$id": "237", + "json": { + "$id": "238", + "name": "kind" + } + } + }, + { + "$id": "239", + "kind": "property", + "name": "text", + "serializedName": "text", + "doc": "The text value.", + "type": { + "$id": "240", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextMessageContent.text", + "serializationOptions": { + "$id": "241", + "json": { + "$id": "242", + "name": "text" + } + } + } + ] + }, + "document": { + "$id": "243", + "kind": "model", + "name": "DocumentMessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentMessageContent", + "usage": "Input,Json", + "doc": "The message content of type document information.", + "discriminatorValue": "document", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "244", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is document.", + "type": { + "$id": "245", + "kind": "constant", + "valueType": { + "$id": "246", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "document", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentMessageContent.kind", + "serializationOptions": { + "$id": "247", + "json": { + "$id": "248", + "name": "kind" + } + } + }, + { + "$id": "249", + "kind": "property", + "name": "mediaUri", + "serializedName": "mediaUri", + "doc": "MediaUri of the media content.", + "type": { + "$id": "250", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentMessageContent.mediaUri", + "serializationOptions": { + "$id": "251", + "json": { + "$id": "252", + "name": "mediaUri" + } + } + } + ] + }, + "image": { + "$id": "253", + "kind": "model", + "name": "ImageMessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageMessageContent", + "usage": "Input,Json", + "doc": "The message content of type image information.", + "discriminatorValue": "image", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "254", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is image.", + "type": { + "$id": "255", + "kind": "constant", + "valueType": { + "$id": "256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "image", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageMessageContent.kind", + "serializationOptions": { + "$id": "257", + "json": { + "$id": "258", + "name": "kind" + } + } + }, + { + "$id": "259", + "kind": "property", + "name": "mediaUri", + "serializedName": "mediaUri", + "doc": "MediaUri of the media content.", + "type": { + "$id": "260", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageMessageContent.mediaUri", + "serializationOptions": { + "$id": "261", + "json": { + "$id": "262", + "name": "mediaUri" + } + } + } + ] + }, + "video": { + "$id": "263", + "kind": "model", + "name": "VideoMessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoMessageContent", + "usage": "Input,Json", + "doc": "The message content of type video information.", + "discriminatorValue": "video", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "264", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is video.", + "type": { + "$id": "265", + "kind": "constant", + "valueType": { + "$id": "266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "video", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoMessageContent.kind", + "serializationOptions": { + "$id": "267", + "json": { + "$id": "268", + "name": "kind" + } + } + }, + { + "$id": "269", + "kind": "property", + "name": "mediaUri", + "serializedName": "mediaUri", + "doc": "MediaUri of the media content.", + "type": { + "$id": "270", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoMessageContent.mediaUri", + "serializationOptions": { + "$id": "271", + "json": { + "$id": "272", + "name": "mediaUri" + } + } + } + ] + }, + "buttonSet": { + "$id": "273", + "kind": "model", + "name": "ButtonSetContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonSetContent", + "usage": "Input,Json", + "doc": "The message content of type ButtonSet/ List of buttons information.", + "discriminatorValue": "buttonSet", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "274", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is Button.", + "type": { + "$id": "275", + "kind": "constant", + "valueType": { + "$id": "276", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "buttonSet", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonSetContent.kind", + "serializationOptions": { + "$id": "277", + "json": { + "$id": "278", + "name": "kind" + } + } + }, + { + "$id": "279", + "kind": "property", + "name": "buttons", + "serializedName": "buttons", + "doc": "Unique Id of the button content.", + "type": { + "$id": "280", + "kind": "array", + "name": "ArrayButtonContent", + "valueType": { + "$id": "281", + "kind": "model", + "name": "ButtonContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonContent", + "usage": "Input,Json", + "doc": "The message content of type Button information.", + "decorators": [], + "properties": [ + { + "$id": "282", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Unique Id of the button content.", + "type": { + "$id": "283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonContent.id", + "serializationOptions": { + "$id": "284", + "json": { + "$id": "285", + "name": "id" + } + } + }, + { + "$id": "286", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the button content.", + "type": { + "$id": "287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonContent.title", + "serializationOptions": { + "$id": "288", + "json": { + "$id": "289", + "name": "title" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonSetContent.buttons", + "serializationOptions": { + "$id": "290", + "json": { + "$id": "291", + "name": "buttons" + } + } + } + ] + }, + "url": { + "$id": "292", + "kind": "model", + "name": "LinkContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.LinkContent", + "usage": "Input,Json", + "doc": "The message content of type Url information.", + "discriminatorValue": "url", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "293", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is url.", + "type": { + "$id": "294", + "kind": "constant", + "valueType": { + "$id": "295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.LinkContent.kind", + "serializationOptions": { + "$id": "296", + "json": { + "$id": "297", + "name": "kind" + } + } + }, + { + "$id": "298", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the url content.", + "type": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.LinkContent.title", + "serializationOptions": { + "$id": "300", + "json": { + "$id": "301", + "name": "title" + } + } + }, + { + "$id": "302", + "kind": "property", + "name": "uri", + "serializedName": "url", + "doc": "The url in the content.", + "type": { + "$id": "303", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.LinkContent.url", + "serializationOptions": { + "$id": "304", + "json": { + "$id": "305", + "name": "url" + } + } + } + ] + }, + "group": { + "$id": "306", + "kind": "model", + "name": "ActionGroupContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupContent", + "usage": "Input,Json", + "doc": "The action content of type ActionGroup.", + "discriminatorValue": "group", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "307", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is actionGroup.", + "type": { + "$id": "308", + "kind": "constant", + "valueType": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "group", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupContent.kind", + "serializationOptions": { + "$id": "310", + "json": { + "$id": "311", + "name": "kind" + } + } + }, + { + "$id": "312", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the actionGroup content.", + "type": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupContent.title", + "serializationOptions": { + "$id": "314", + "json": { + "$id": "315", + "name": "title" + } + } + }, + { + "$id": "316", + "kind": "property", + "name": "groups", + "serializedName": "groups", + "doc": "Set or group of actions.", + "type": { + "$id": "317", + "kind": "array", + "name": "ArrayActionGroup", + "valueType": { + "$id": "318", + "kind": "model", + "name": "ActionGroup", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroup", + "usage": "Input,Json", + "doc": "The Action Group content.", + "decorators": [], + "properties": [ + { + "$id": "319", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the ActionGroup.", + "type": { + "$id": "320", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroup.title", + "serializationOptions": { + "$id": "321", + "json": { + "$id": "322", + "name": "title" + } + } + }, + { + "$id": "323", + "kind": "property", + "name": "items", + "serializedName": "items", + "doc": "Array of items in ActionGroup.", + "type": { + "$id": "324", + "kind": "array", + "name": "ArrayActionGroupItem", + "valueType": { + "$id": "325", + "kind": "model", + "name": "ActionGroupItem", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupItem", + "usage": "Input,Json", + "doc": "The Action group item in the content.", + "decorators": [], + "properties": [ + { + "$id": "326", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Id of the Item.", + "type": { + "$id": "327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupItem.id", + "serializationOptions": { + "$id": "328", + "json": { + "$id": "329", + "name": "id" + } + } + }, + { + "$id": "330", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the Item.", + "type": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupItem.title", + "serializationOptions": { + "$id": "332", + "json": { + "$id": "333", + "name": "title" + } + } + }, + { + "$id": "334", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Description of the Item.", + "type": { + "$id": "335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupItem.description", + "serializationOptions": { + "$id": "336", + "json": { + "$id": "337", + "name": "description" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroup.items", + "serializationOptions": { + "$id": "338", + "json": { + "$id": "339", + "name": "items" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupContent.groups", + "serializationOptions": { + "$id": "340", + "json": { + "$id": "341", + "name": "groups" + } + } + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage.header", + "serializationOptions": { + "$id": "342", + "json": { + "$id": "343", + "name": "header" + } + } + }, + { + "$id": "344", + "kind": "property", + "name": "body", + "serializedName": "body", + "doc": "Gets or Sets Message body content. Emojis, markdown, and links are supported.", + "type": { + "$ref": "233" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage.body", + "serializationOptions": { + "$id": "345", + "json": { + "$id": "346", + "name": "body" + } + } + }, + { + "$id": "347", + "kind": "property", + "name": "footer", + "serializedName": "footer", + "doc": "Gets or Sets Message footer content. Emojis, markdown, and links are supported.", + "type": { + "$ref": "233" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage.footer", + "serializationOptions": { + "$id": "348", + "json": { + "$id": "349", + "name": "footer" + } + } + }, + { + "$id": "350", + "kind": "property", + "name": "action", + "serializedName": "action", + "doc": "The binding object to get or set Action which describes options user have to respond to message.", + "type": { + "$id": "351", + "kind": "model", + "name": "ActionBindings", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionBindings", + "usage": "Input,Json", + "doc": "Binding actions to the interactive message.", + "decorators": [], + "discriminatorProperty": { + "$id": "352", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Kind of the MessageActionBinding.", + "type": { + "$ref": "40" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionBindings.kind", + "serializationOptions": { + "$id": "353", + "json": { + "$id": "354", + "name": "kind" + } + } + }, + "properties": [ + { + "$ref": "352" + } + ], + "discriminatedSubtypes": { + "$id": "355", + "whatsAppListAction": { + "$id": "356", + "kind": "model", + "name": "WhatsAppListActionBindings", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppListActionBindings", + "usage": "Input,Json", + "doc": "WhatsApp List Binding actions to the interactive message.", + "discriminatorValue": "whatsAppListAction", + "decorators": [], + "baseModel": { + "$ref": "351" + }, + "properties": [ + { + "$id": "357", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message action binding type is WhatsAppListAction.", + "type": { + "$id": "358", + "kind": "constant", + "valueType": { + "$id": "359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "whatsAppListAction", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppListActionBindings.kind", + "serializationOptions": { + "$id": "360", + "json": { + "$id": "361", + "name": "kind" + } + } + }, + { + "$id": "362", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Action content of Interactive message.", + "type": { + "$ref": "306" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppListActionBindings.content", + "serializationOptions": { + "$id": "363", + "json": { + "$id": "364", + "name": "content" + } + } + } + ] + }, + "whatsAppButtonAction": { + "$id": "365", + "kind": "model", + "name": "WhatsAppButtonActionBindings", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppButtonActionBindings", + "usage": "Input,Json", + "doc": "WhatsApp Binding actions to the interactive message.", + "discriminatorValue": "whatsAppButtonAction", + "decorators": [], + "baseModel": { + "$ref": "351" + }, + "properties": [ + { + "$id": "366", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message action binding type is WhatsAppButtonAction.", + "type": { + "$id": "367", + "kind": "constant", + "valueType": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "whatsAppButtonAction", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppButtonActionBindings.kind", + "serializationOptions": { + "$id": "369", + "json": { + "$id": "370", + "name": "kind" + } + } + }, + { + "$id": "371", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Action content of Interactive message.", + "type": { + "$ref": "273" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppButtonActionBindings.content", + "serializationOptions": { + "$id": "372", + "json": { + "$id": "373", + "name": "content" + } + } + } + ] + }, + "whatsAppUrlAction": { + "$id": "374", + "kind": "model", + "name": "WhatsAppUrlActionBindings", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppUrlActionBindings", + "usage": "Input,Json", + "doc": "WhatsApp Binding actions to the interactive message.", + "discriminatorValue": "whatsAppUrlAction", + "decorators": [], + "baseModel": { + "$ref": "351" + }, + "properties": [ + { + "$id": "375", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message action binding type is WhatsAppUrlAction.", + "type": { + "$id": "376", + "kind": "constant", + "valueType": { + "$id": "377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "whatsAppUrlAction", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppUrlActionBindings.kind", + "serializationOptions": { + "$id": "378", + "json": { + "$id": "379", + "name": "kind" + } + } + }, + { + "$id": "380", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Action content of Interactive message.", + "type": { + "$ref": "292" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppUrlActionBindings.content", + "serializationOptions": { + "$id": "381", + "json": { + "$id": "382", + "name": "content" + } + } + } + ] + } + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage.action", + "serializationOptions": { + "$id": "383", + "json": { + "$id": "384", + "name": "action" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveNotificationContent.interactiveMessage", "serializationOptions": { - "$id": "161", + "$id": "385", "json": { - "$id": "162", - "name": "mediaUri" + "$id": "386", + "name": "interactiveMessage" } } } ] }, "template": { - "$id": "163", + "$id": "387", "kind": "model", "name": "TemplateNotificationContent", "clientNamespace": "Azure.Communication.MessagesService", @@ -1336,20 +3086,20 @@ "discriminatorValue": "template", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "164", + "$id": "388", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is template.", "type": { - "$id": "165", + "$id": "389", "kind": "constant", "valueType": { - "$id": "166", + "$id": "390", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1365,21 +3115,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent.kind", "serializationOptions": { - "$id": "167", + "$id": "391", "json": { - "$id": "168", + "$id": "392", "name": "kind" } } }, { - "$id": "169", + "$id": "393", "kind": "property", "name": "template", "serializedName": "template", "doc": "The template object used to create templates.", "type": { - "$id": "170", + "$id": "394", "kind": "model", "name": "MessageTemplate", "clientNamespace": "Azure.Communication.MessagesService", @@ -1389,13 +3139,13 @@ "decorators": [], "properties": [ { - "$id": "171", + "$id": "395", "kind": "property", "name": "name", "serializedName": "name", "doc": "Name of the template.", "type": { - "$id": "172", + "$id": "396", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1408,21 +3158,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.name", "serializationOptions": { - "$id": "173", + "$id": "397", "json": { - "$id": "174", + "$id": "398", "name": "name" } } }, { - "$id": "175", + "$id": "399", "kind": "property", "name": "language", "serializedName": "language", "doc": "The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.", "type": { - "$id": "176", + "$id": "400", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1435,25 +3185,25 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.language", "serializationOptions": { - "$id": "177", + "$id": "401", "json": { - "$id": "178", + "$id": "402", "name": "language" } } }, { - "$id": "179", + "$id": "403", "kind": "property", "name": "values", "serializedName": "values", "doc": "The template values.", "type": { - "$id": "180", + "$id": "404", "kind": "array", "name": "ArrayMessageTemplateValue", "valueType": { - "$id": "181", + "$id": "405", "kind": "model", "name": "MessageTemplateValue", "clientNamespace": "Azure.Communication.MessagesService", @@ -1462,13 +3212,13 @@ "doc": "The class describes a parameter of a template.", "decorators": [], "discriminatorProperty": { - "$id": "182", + "$id": "406", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "The type discriminator describing a template parameter type.", "type": { - "$ref": "18" + "$ref": "48" }, "optional": false, "readOnly": false, @@ -1477,22 +3227,22 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue.kind", "serializationOptions": { - "$id": "183", + "$id": "407", "json": { - "$id": "184", + "$id": "408", "name": "kind" } } }, "properties": [ { - "$id": "185", + "$id": "409", "kind": "property", "name": "name", "serializedName": "name", "doc": "Template binding reference name", "type": { - "$id": "186", + "$id": "410", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1505,21 +3255,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue.name", "serializationOptions": { - "$id": "187", + "$id": "411", "json": { - "$id": "188", + "$id": "412", "name": "name" } } }, { - "$ref": "182" + "$ref": "406" } ], "discriminatedSubtypes": { - "$id": "189", + "$id": "413", "text": { - "$id": "190", + "$id": "414", "kind": "model", "name": "MessageTemplateText", "clientNamespace": "Azure.Communication.MessagesService", @@ -1529,20 +3279,20 @@ "discriminatorValue": "text", "decorators": [], "baseModel": { - "$ref": "181" + "$ref": "405" }, "properties": [ { - "$id": "191", + "$id": "415", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is text.", "type": { - "$id": "192", + "$id": "416", "kind": "constant", "valueType": { - "$id": "193", + "$id": "417", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1558,21 +3308,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText.kind", "serializationOptions": { - "$id": "194", + "$id": "418", "json": { - "$id": "195", + "$id": "419", "name": "kind" } } }, { - "$id": "196", + "$id": "420", "kind": "property", "name": "text", "serializedName": "text", "doc": "The text value.", "type": { - "$id": "197", + "$id": "421", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1585,9 +3335,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText.text", "serializationOptions": { - "$id": "198", + "$id": "422", "json": { - "$id": "199", + "$id": "423", "name": "text" } } @@ -1595,7 +3345,7 @@ ] }, "image": { - "$id": "200", + "$id": "424", "kind": "model", "name": "MessageTemplateImage", "clientNamespace": "Azure.Communication.MessagesService", @@ -1605,20 +3355,20 @@ "discriminatorValue": "image", "decorators": [], "baseModel": { - "$ref": "181" + "$ref": "405" }, "properties": [ { - "$id": "201", + "$id": "425", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is image.", "type": { - "$id": "202", + "$id": "426", "kind": "constant", "valueType": { - "$id": "203", + "$id": "427", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1634,21 +3384,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.kind", "serializationOptions": { - "$id": "204", + "$id": "428", "json": { - "$id": "205", + "$id": "429", "name": "kind" } } }, { - "$id": "206", + "$id": "430", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "207", + "$id": "431", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1661,21 +3411,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.url", "serializationOptions": { - "$id": "208", + "$id": "432", "json": { - "$id": "209", + "$id": "433", "name": "url" } } }, { - "$id": "210", + "$id": "434", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "211", + "$id": "435", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1688,21 +3438,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.caption", "serializationOptions": { - "$id": "212", + "$id": "436", "json": { - "$id": "213", + "$id": "437", "name": "caption" } } }, { - "$id": "214", + "$id": "438", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "215", + "$id": "439", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1715,9 +3465,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.fileName", "serializationOptions": { - "$id": "216", + "$id": "440", "json": { - "$id": "217", + "$id": "441", "name": "fileName" } } @@ -1725,7 +3475,7 @@ ] }, "document": { - "$id": "218", + "$id": "442", "kind": "model", "name": "MessageTemplateDocument", "clientNamespace": "Azure.Communication.MessagesService", @@ -1735,20 +3485,20 @@ "discriminatorValue": "document", "decorators": [], "baseModel": { - "$ref": "181" + "$ref": "405" }, "properties": [ { - "$id": "219", + "$id": "443", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is document.", "type": { - "$id": "220", + "$id": "444", "kind": "constant", "valueType": { - "$id": "221", + "$id": "445", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1764,21 +3514,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.kind", "serializationOptions": { - "$id": "222", + "$id": "446", "json": { - "$id": "223", + "$id": "447", "name": "kind" } } }, { - "$id": "224", + "$id": "448", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "225", + "$id": "449", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1791,21 +3541,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.url", "serializationOptions": { - "$id": "226", + "$id": "450", "json": { - "$id": "227", + "$id": "451", "name": "url" } } }, { - "$id": "228", + "$id": "452", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "229", + "$id": "453", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1818,21 +3568,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.caption", "serializationOptions": { - "$id": "230", + "$id": "454", "json": { - "$id": "231", + "$id": "455", "name": "caption" } } }, { - "$id": "232", + "$id": "456", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "233", + "$id": "457", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1845,9 +3595,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.fileName", "serializationOptions": { - "$id": "234", + "$id": "458", "json": { - "$id": "235", + "$id": "459", "name": "fileName" } } @@ -1855,7 +3605,7 @@ ] }, "video": { - "$id": "236", + "$id": "460", "kind": "model", "name": "MessageTemplateVideo", "clientNamespace": "Azure.Communication.MessagesService", @@ -1865,20 +3615,20 @@ "discriminatorValue": "video", "decorators": [], "baseModel": { - "$ref": "181" + "$ref": "405" }, "properties": [ { - "$id": "237", + "$id": "461", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is video.", "type": { - "$id": "238", + "$id": "462", "kind": "constant", "valueType": { - "$id": "239", + "$id": "463", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1894,21 +3644,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.kind", "serializationOptions": { - "$id": "240", + "$id": "464", "json": { - "$id": "241", + "$id": "465", "name": "kind" } } }, { - "$id": "242", + "$id": "466", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "243", + "$id": "467", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1921,21 +3671,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.url", "serializationOptions": { - "$id": "244", + "$id": "468", "json": { - "$id": "245", + "$id": "469", "name": "url" } } }, { - "$id": "246", + "$id": "470", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "247", + "$id": "471", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1948,21 +3698,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.caption", "serializationOptions": { - "$id": "248", + "$id": "472", "json": { - "$id": "249", + "$id": "473", "name": "caption" } } }, { - "$id": "250", + "$id": "474", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "251", + "$id": "475", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1975,9 +3725,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.fileName", "serializationOptions": { - "$id": "252", + "$id": "476", "json": { - "$id": "253", + "$id": "477", "name": "fileName" } } @@ -1985,7 +3735,7 @@ ] }, "location": { - "$id": "254", + "$id": "478", "kind": "model", "name": "MessageTemplateLocation", "clientNamespace": "Azure.Communication.MessagesService", @@ -1995,20 +3745,20 @@ "discriminatorValue": "location", "decorators": [], "baseModel": { - "$ref": "181" + "$ref": "405" }, "properties": [ { - "$id": "255", + "$id": "479", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is location.", "type": { - "$id": "256", + "$id": "480", "kind": "constant", "valueType": { - "$id": "257", + "$id": "481", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2024,21 +3774,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.kind", "serializationOptions": { - "$id": "258", + "$id": "482", "json": { - "$id": "259", + "$id": "483", "name": "kind" } } }, { - "$id": "260", + "$id": "484", "kind": "property", "name": "locationName", "serializedName": "locationName", "doc": "The [Optional] name of the location.", "type": { - "$id": "261", + "$id": "485", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2051,21 +3801,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.locationName", "serializationOptions": { - "$id": "262", + "$id": "486", "json": { - "$id": "263", + "$id": "487", "name": "locationName" } } }, { - "$id": "264", + "$id": "488", "kind": "property", "name": "address", "serializedName": "address", "doc": "The [Optional] address of the location.", "type": { - "$id": "265", + "$id": "489", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2078,21 +3828,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.address", "serializationOptions": { - "$id": "266", + "$id": "490", "json": { - "$id": "267", + "$id": "491", "name": "address" } } }, { - "$id": "268", + "$id": "492", "kind": "property", "name": "latitude", "serializedName": "latitude", "doc": "The latitude of the location.", "type": { - "$id": "269", + "$id": "493", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -2105,21 +3855,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.latitude", "serializationOptions": { - "$id": "270", + "$id": "494", "json": { - "$id": "271", + "$id": "495", "name": "latitude" } } }, { - "$id": "272", + "$id": "496", "kind": "property", "name": "longitude", "serializedName": "longitude", "doc": "The longitude of the location.", "type": { - "$id": "273", + "$id": "497", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -2132,9 +3882,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.longitude", "serializationOptions": { - "$id": "274", + "$id": "498", "json": { - "$id": "275", + "$id": "499", "name": "longitude" } } @@ -2142,7 +3892,7 @@ ] }, "quickAction": { - "$id": "276", + "$id": "500", "kind": "model", "name": "MessageTemplateQuickAction", "clientNamespace": "Azure.Communication.MessagesService", @@ -2152,20 +3902,20 @@ "discriminatorValue": "quickAction", "decorators": [], "baseModel": { - "$ref": "181" + "$ref": "405" }, "properties": [ { - "$id": "277", + "$id": "501", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is quick action.", "type": { - "$id": "278", + "$id": "502", "kind": "constant", "valueType": { - "$id": "279", + "$id": "503", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2181,21 +3931,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.kind", "serializationOptions": { - "$id": "280", + "$id": "504", "json": { - "$id": "281", + "$id": "505", "name": "kind" } } }, { - "$id": "282", + "$id": "506", "kind": "property", "name": "text", "serializedName": "text", "doc": "The [Optional] quick action text", "type": { - "$id": "283", + "$id": "507", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2208,21 +3958,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.text", "serializationOptions": { - "$id": "284", + "$id": "508", "json": { - "$id": "285", + "$id": "509", "name": "text" } } }, { - "$id": "286", + "$id": "510", "kind": "property", "name": "payload", "serializedName": "payload", "doc": "The [Optional] quick action payload", "type": { - "$id": "287", + "$id": "511", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2235,9 +3985,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.payload", "serializationOptions": { - "$id": "288", + "$id": "512", "json": { - "$id": "289", + "$id": "513", "name": "payload" } } @@ -2256,21 +4006,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.values", "serializationOptions": { - "$id": "290", + "$id": "514", "json": { - "$id": "291", + "$id": "515", "name": "values" } } }, { - "$id": "292", + "$id": "516", "kind": "property", "name": "bindings", "serializedName": "bindings", "doc": "The binding object to link values to the template specific locations", "type": { - "$id": "293", + "$id": "517", "kind": "model", "name": "MessageTemplateBindings", "clientNamespace": "Azure.Communication.MessagesService", @@ -2279,13 +4029,13 @@ "doc": "The binding object to link values to the template specific locations", "decorators": [], "discriminatorProperty": { - "$id": "294", + "$id": "518", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "The type discriminator describing a template bindings type.", "type": { - "$ref": "32" + "$ref": "62" }, "optional": false, "readOnly": false, @@ -2294,22 +4044,22 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindings.kind", "serializationOptions": { - "$id": "295", + "$id": "519", "json": { - "$id": "296", + "$id": "520", "name": "kind" } } }, "properties": [ { - "$ref": "294" + "$ref": "518" } ], "discriminatedSubtypes": { - "$id": "297", + "$id": "521", "whatsApp": { - "$id": "298", + "$id": "522", "kind": "model", "name": "WhatsAppMessageTemplateBindings", "clientNamespace": "Azure.Communication.MessagesService", @@ -2319,20 +4069,20 @@ "discriminatorValue": "whatsApp", "decorators": [], "baseModel": { - "$ref": "293" + "$ref": "517" }, "properties": [ { - "$id": "299", + "$id": "523", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "MessageTemplateBindings is whatsApp", "type": { - "$id": "300", + "$id": "524", "kind": "constant", "valueType": { - "$id": "301", + "$id": "525", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2348,25 +4098,25 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.kind", "serializationOptions": { - "$id": "302", + "$id": "526", "json": { - "$id": "303", + "$id": "527", "name": "kind" } } }, { - "$id": "304", + "$id": "528", "kind": "property", "name": "header", "serializedName": "header", "doc": "The header template bindings", "type": { - "$id": "305", + "$id": "529", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$id": "306", + "$id": "530", "kind": "model", "name": "WhatsAppMessageTemplateBindingsComponent", "clientNamespace": "Azure.Communication.MessagesService", @@ -2376,13 +4126,13 @@ "decorators": [], "properties": [ { - "$id": "307", + "$id": "531", "kind": "property", "name": "refValue", "serializedName": "refValue", "doc": "The name of the referenced item in the template values.", "type": { - "$id": "308", + "$id": "532", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2395,9 +4145,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsComponent.refValue", "serializationOptions": { - "$id": "309", + "$id": "533", "json": { - "$id": "310", + "$id": "534", "name": "refValue" } } @@ -2414,25 +4164,25 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.header", "serializationOptions": { - "$id": "311", + "$id": "535", "json": { - "$id": "312", + "$id": "536", "name": "header" } } }, { - "$id": "313", + "$id": "537", "kind": "property", "name": "body", "serializedName": "body", "doc": "The body template bindings", "type": { - "$id": "314", + "$id": "538", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$ref": "306" + "$ref": "530" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -2444,25 +4194,25 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.body", "serializationOptions": { - "$id": "315", + "$id": "539", "json": { - "$id": "316", + "$id": "540", "name": "body" } } }, { - "$id": "317", + "$id": "541", "kind": "property", "name": "footer", "serializedName": "footer", "doc": "The footer template bindings", "type": { - "$id": "318", + "$id": "542", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$ref": "306" + "$ref": "530" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -2474,25 +4224,25 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.footer", "serializationOptions": { - "$id": "319", + "$id": "543", "json": { - "$id": "320", + "$id": "544", "name": "footer" } } }, { - "$id": "321", + "$id": "545", "kind": "property", "name": "buttons", "serializedName": "buttons", "doc": "The button template bindings", "type": { - "$id": "322", + "$id": "546", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsButton", "valueType": { - "$id": "323", + "$id": "547", "kind": "model", "name": "WhatsAppMessageTemplateBindingsButton", "clientNamespace": "Azure.Communication.MessagesService", @@ -2502,13 +4252,13 @@ "decorators": [], "properties": [ { - "$id": "324", + "$id": "548", "kind": "property", "name": "subType", "serializedName": "subType", "doc": "The WhatsApp button sub type", "type": { - "$ref": "36" + "$ref": "66" }, "optional": false, "readOnly": false, @@ -2517,21 +4267,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton.subType", "serializationOptions": { - "$id": "325", + "$id": "549", "json": { - "$id": "326", + "$id": "550", "name": "subType" } } }, { - "$id": "327", + "$id": "551", "kind": "property", "name": "refValue", "serializedName": "refValue", "doc": "The name of the referenced item in the template values.", "type": { - "$id": "328", + "$id": "552", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2544,9 +4294,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton.refValue", "serializationOptions": { - "$id": "329", + "$id": "553", "json": { - "$id": "330", + "$id": "554", "name": "refValue" } } @@ -2563,9 +4313,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.buttons", "serializationOptions": { - "$id": "331", + "$id": "555", "json": { - "$id": "332", + "$id": "556", "name": "buttons" } } @@ -2581,9 +4331,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.bindings", "serializationOptions": { - "$id": "333", + "$id": "557", "json": { - "$id": "334", + "$id": "558", "name": "bindings" } } @@ -2597,9 +4347,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent.template", "serializationOptions": { - "$id": "335", + "$id": "559", "json": { - "$id": "336", + "$id": "560", "name": "template" } } @@ -2609,64 +4359,121 @@ } }, { - "$ref": "83" + "$ref": "115" + }, + { + "$ref": "125" }, { - "$ref": "93" + "$ref": "139" }, { - "$ref": "107" + "$ref": "153" }, { - "$ref": "121" + "$ref": "171" }, { - "$ref": "139" + "$ref": "185" }, { - "$ref": "153" + "$ref": "195" }, { - "$ref": "163" + "$ref": "209" }, { - "$ref": "170" + "$ref": "219" }, { - "$ref": "181" + "$ref": "226" }, { - "$ref": "190" + "$ref": "228" }, { - "$ref": "200" + "$ref": "233" }, { - "$ref": "218" + "$ref": "243" }, { - "$ref": "236" + "$ref": "253" }, { - "$ref": "254" + "$ref": "263" }, { - "$ref": "276" + "$ref": "273" }, { - "$ref": "293" + "$ref": "281" }, { - "$ref": "298" + "$ref": "292" }, { "$ref": "306" }, { - "$ref": "323" + "$ref": "318" + }, + { + "$ref": "325" + }, + { + "$ref": "351" + }, + { + "$ref": "356" + }, + { + "$ref": "365" + }, + { + "$ref": "374" + }, + { + "$ref": "387" + }, + { + "$ref": "394" + }, + { + "$ref": "405" + }, + { + "$ref": "414" + }, + { + "$ref": "424" + }, + { + "$ref": "442" + }, + { + "$ref": "460" + }, + { + "$ref": "478" + }, + { + "$ref": "500" + }, + { + "$ref": "517" + }, + { + "$ref": "522" + }, + { + "$ref": "530" + }, + { + "$ref": "547" }, { - "$id": "337", + "$id": "561", "kind": "model", "name": "SendMessageResult", "clientNamespace": "Azure.Communication.MessagesService", @@ -2676,17 +4483,17 @@ "decorators": [], "properties": [ { - "$id": "338", + "$id": "562", "kind": "property", "name": "receipts", "serializedName": "receipts", "doc": "Receipts of the send message operation.", "type": { - "$id": "339", + "$id": "563", "kind": "array", "name": "ArrayMessageReceipt", "valueType": { - "$id": "340", + "$id": "564", "kind": "model", "name": "MessageReceipt", "clientNamespace": "Azure.Communication.MessagesService", @@ -2696,13 +4503,13 @@ "decorators": [], "properties": [ { - "$id": "341", + "$id": "565", "kind": "property", "name": "messageId", "serializedName": "messageId", "doc": "The message id.", "type": { - "$id": "342", + "$id": "566", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2715,21 +4522,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt.messageId", "serializationOptions": { - "$id": "343", + "$id": "567", "json": { - "$id": "344", + "$id": "568", "name": "messageId" } } }, { - "$id": "345", + "$id": "569", "kind": "property", "name": "to", "serializedName": "to", "doc": "The native external platform user identifier of the recipient.", "type": { - "$id": "346", + "$id": "570", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2742,9 +4549,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt.to", "serializationOptions": { - "$id": "347", + "$id": "571", "json": { - "$id": "348", + "$id": "572", "name": "to" } } @@ -2761,9 +4568,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendMessageResult.receipts", "serializationOptions": { - "$id": "349", + "$id": "573", "json": { - "$id": "350", + "$id": "574", "name": "receipts" } } @@ -2771,10 +4578,10 @@ ] }, { - "$ref": "340" + "$ref": "564" }, { - "$id": "351", + "$id": "575", "kind": "model", "name": "MessageTemplateItem", "clientNamespace": "Azure.Communication.MessagesService", @@ -2783,13 +4590,13 @@ "doc": "The message template as returned from the service.", "decorators": [], "discriminatorProperty": { - "$id": "352", + "$id": "576", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "The type discriminator describing a template type.", "type": { - "$ref": "58" + "$ref": "90" }, "optional": false, "readOnly": false, @@ -2798,22 +4605,22 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.kind", "serializationOptions": { - "$id": "353", + "$id": "577", "json": { - "$id": "354", + "$id": "578", "name": "kind" } } }, "properties": [ { - "$id": "355", + "$id": "579", "kind": "property", "name": "name", "serializedName": "name", "doc": "The template's name.", "type": { - "$id": "356", + "$id": "580", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2826,21 +4633,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.name", "serializationOptions": { - "$id": "357", + "$id": "581", "json": { - "$id": "358", + "$id": "582", "name": "name" } } }, { - "$id": "359", + "$id": "583", "kind": "property", "name": "language", "serializedName": "language", "doc": "The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.", "type": { - "$id": "360", + "$id": "584", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2853,21 +4660,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.language", "serializationOptions": { - "$id": "361", + "$id": "585", "json": { - "$id": "362", + "$id": "586", "name": "language" } } }, { - "$id": "363", + "$id": "587", "kind": "property", "name": "status", "serializedName": "status", "doc": "The aggregated template status.", "type": { - "$ref": "48" + "$ref": "80" }, "optional": false, "readOnly": false, @@ -2876,21 +4683,21 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.status", "serializationOptions": { - "$id": "364", + "$id": "588", "json": { - "$id": "365", + "$id": "589", "name": "status" } } }, { - "$ref": "352" + "$ref": "576" } ], "discriminatedSubtypes": { - "$id": "366", + "$id": "590", "whatsApp": { - "$id": "367", + "$id": "591", "kind": "model", "name": "WhatsAppMessageTemplateItem", "clientNamespace": "Azure.Communication.MessagesService", @@ -2900,17 +4707,17 @@ "discriminatorValue": "whatsApp", "decorators": [], "baseModel": { - "$ref": "351" + "$ref": "575" }, "properties": [ { - "$id": "368", + "$id": "592", "kind": "property", "name": "content", "serializedName": "content", "doc": "WhatsApp platform's template content. This is the payload returned from WhatsApp API.", "type": { - "$id": "369", + "$id": "593", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -2923,24 +4730,24 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem.content", "serializationOptions": { - "$id": "370", + "$id": "594", "json": { - "$id": "371", + "$id": "595", "name": "content" } } }, { - "$id": "372", + "$id": "596", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message template response type is whatsApp.", "type": { - "$id": "373", + "$id": "597", "kind": "constant", "valueType": { - "$id": "374", + "$id": "598", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2956,9 +4763,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem.kind", "serializationOptions": { - "$id": "375", + "$id": "599", "json": { - "$id": "376", + "$id": "600", "name": "kind" } } @@ -2968,10 +4775,10 @@ } }, { - "$ref": "367" + "$ref": "591" }, { - "$id": "377", + "$id": "601", "kind": "model", "name": "PagedMessageTemplateItem", "clientNamespace": "Azure.Core.Foundations", @@ -2981,17 +4788,17 @@ "decorators": [], "properties": [ { - "$id": "378", + "$id": "602", "kind": "property", "name": "value", "serializedName": "value", "doc": "The MessageTemplateItem items on this page", "type": { - "$id": "379", + "$id": "603", "kind": "array", "name": "ArrayMessageTemplateItem", "valueType": { - "$ref": "351" + "$ref": "575" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -3003,26 +4810,26 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value", "serializationOptions": { - "$id": "380", + "$id": "604", "json": { - "$id": "381", + "$id": "605", "name": "value" } } }, { - "$id": "382", + "$id": "606", "kind": "property", "name": "nextLink", "serializedName": "nextLink", "doc": "The link to the next page of items", "type": { - "$id": "383", + "$id": "607", "kind": "url", "name": "ResourceLocation", "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", "baseType": { - "$id": "384", + "$id": "608", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -3037,9 +4844,9 @@ "decorators": [], "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink", "serializationOptions": { - "$id": "385", + "$id": "609", "json": { - "$id": "386", + "$id": "610", "name": "nextLink" } } @@ -3049,24 +4856,24 @@ ], "Clients": [ { - "$id": "387", + "$id": "611", "Name": "NotificationMessagesClient", "ClientNamespace": "ClientForAcsMessages", "Operations": [ { - "$id": "388", + "$id": "612", "Name": "send", "ResourceName": "NotificationMessagesClient", "Doc": "Sends a notification message from Business to User.", "Accessibility": "public", "Parameters": [ { - "$id": "389", + "$id": "613", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "390", + "$id": "614", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3080,25 +4887,25 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "391", + "$id": "615", "Type": { - "$id": "392", + "$id": "616", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "2024-08-30" + "Value": "2025-01-15-preview" }, "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "393", + "$id": "617", "Name": "repeatabilityRequestId", "NameInRequest": "Repeatability-Request-ID", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "394", + "$id": "618", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3115,17 +4922,17 @@ "SkipUrlEncoding": false }, { - "$id": "395", + "$id": "619", "Name": "repeatabilityFirstSent", "NameInRequest": "Repeatability-First-Sent", "Doc": "Specifies the date and time at which the request was first created.", "Type": { - "$id": "396", + "$id": "620", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "397", + "$id": "621", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3145,17 +4952,17 @@ "SkipUrlEncoding": false }, { - "$id": "398", + "$id": "622", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "399", + "$id": "623", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "400", + "$id": "624", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3174,15 +4981,15 @@ "SkipUrlEncoding": false }, { - "$id": "401", + "$id": "625", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "402", + "$id": "626", "kind": "constant", "valueType": { - "$id": "403", + "$id": "627", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3202,14 +5009,14 @@ "SkipUrlEncoding": false }, { - "$id": "404", + "$id": "628", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "405", + "$id": "629", "kind": "constant", "valueType": { - "$id": "406", + "$id": "630", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3229,12 +5036,12 @@ "SkipUrlEncoding": false }, { - "$id": "407", + "$id": "631", "Name": "notificationContent", "NameInRequest": "notificationContent", "Doc": "Details of the message to send.", "Type": { - "$ref": "68" + "$ref": "100" }, "Location": "Body", "IsApiVersion": false, @@ -3249,36 +5056,36 @@ ], "Responses": [ { - "$id": "408", + "$id": "632", "StatusCodes": [ 202 ], "BodyType": { - "$ref": "337" + "$ref": "561" }, "BodyMediaType": "Json", "Headers": [ { - "$id": "409", + "$id": "633", "Name": "repeatabilityResult", "NameInResponse": "Repeatability-Result", "Doc": "Indicates whether the repeatable request was accepted or rejected.", "Type": { - "$ref": "62" + "$ref": "94" } }, { - "$id": "410", + "$id": "634", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "411", + "$id": "635", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "412", + "$id": "636", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3308,19 +5115,19 @@ "Decorators": [] }, { - "$id": "413", + "$id": "637", "Name": "downloadMediaInternal", "ResourceName": "MessageDataStream", "Doc": "Download the Media payload from a User to Business message.", "Accessibility": "internal", "Parameters": [ { - "$id": "414", + "$id": "638", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "415", + "$id": "639", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3334,25 +5141,25 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "416", + "$id": "640", "Type": { - "$id": "417", + "$id": "641", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "2024-08-30" + "Value": "2025-01-15-preview" }, "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "418", + "$id": "642", "Name": "id", "NameInRequest": "id", "Doc": "The stream ID.", "Type": { - "$id": "419", + "$id": "643", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3369,17 +5176,17 @@ "SkipUrlEncoding": false }, { - "$id": "420", + "$id": "644", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "421", + "$id": "645", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "422", + "$id": "646", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3398,14 +5205,14 @@ "SkipUrlEncoding": false }, { - "$id": "423", + "$id": "647", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "424", + "$id": "648", "kind": "constant", "valueType": { - "$id": "425", + "$id": "649", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3427,12 +5234,12 @@ ], "Responses": [ { - "$id": "426", + "$id": "650", "StatusCodes": [ 200 ], "BodyType": { - "$id": "427", + "$id": "651", "kind": "bytes", "name": "bytes", "crossLanguageDefinitionId": "TypeSpec.bytes", @@ -3441,17 +5248,17 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "428", + "$id": "652", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "429", + "$id": "653", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "430", + "$id": "654", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3461,15 +5268,15 @@ } }, { - "$id": "431", + "$id": "655", "Name": "contentType", "NameInResponse": "content-type", "Doc": "The stream content type.", "Type": { - "$id": "432", + "$id": "656", "kind": "constant", "valueType": { - "$id": "433", + "$id": "657", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3497,36 +5304,36 @@ "Decorators": [], "Examples": [ { - "$id": "434", + "$id": "658", "kind": "http", "name": "Download media", "description": "Download media", - "filePath": "2024-08-30/Stream_GetMedia.json", + "filePath": "2025-01-15-preview/Stream_GetMedia.json", "parameters": [ { - "$id": "435", + "$id": "659", "parameter": { - "$ref": "414" + "$ref": "638" }, "value": { - "$id": "436", + "$id": "660", "kind": "string", "type": { - "$ref": "415" + "$ref": "639" }, - "value": "2024-08-30" + "value": "2025-01-15-preview" } }, { - "$id": "437", + "$id": "661", "parameter": { - "$ref": "418" + "$ref": "642" }, "value": { - "$id": "438", + "$id": "662", "kind": "string", "type": { - "$ref": "419" + "$ref": "643" }, "value": "d19e68ec-bdd6-4a50-8dfb-cbb1642df6ab" } @@ -3534,16 +5341,16 @@ ], "responses": [ { - "$id": "439", + "$id": "663", "response": { - "$ref": "426" + "$ref": "650" }, "statusCode": 200, "bodyValue": { - "$id": "440", + "$id": "664", "kind": "string", "type": { - "$ref": "427" + "$ref": "651" }, "value": "" } @@ -3554,16 +5361,16 @@ } ], "Protocol": { - "$id": "441" + "$id": "665" }, "Parameters": [ { - "$id": "442", + "$id": "666", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "The communication resource, for example https://my-resource.communication.azure.com", "Type": { - "$id": "443", + "$id": "667", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3582,24 +5389,24 @@ "Decorators": [] }, { - "$id": "444", + "$id": "668", "Name": "MessageTemplateClient", "ClientNamespace": "ClientForAcsMessages", "Operations": [ { - "$id": "445", + "$id": "669", "Name": "getTemplates", "ResourceName": "MessageTemplateItem", "Doc": "List all templates for given Azure Communication Services channel", "Accessibility": "public", "Parameters": [ { - "$id": "446", + "$id": "670", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "447", + "$id": "671", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3613,30 +5420,30 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "448", + "$id": "672", "Type": { - "$id": "449", + "$id": "673", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "2024-08-30" + "Value": "2025-01-15-preview" }, "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "450", + "$id": "674", "Name": "channelId", "NameInRequest": "channelId", "Doc": "The registration ID of the channel.", "Type": { - "$id": "451", + "$id": "675", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "452", + "$id": "676", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3655,12 +5462,12 @@ "SkipUrlEncoding": false }, { - "$id": "453", + "$id": "677", "Name": "maxpagesize", "NameInRequest": "maxpagesize", "Doc": "Number of objects to return per page.", "Type": { - "$id": "454", + "$id": "678", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3677,17 +5484,17 @@ "SkipUrlEncoding": false }, { - "$id": "455", + "$id": "679", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "456", + "$id": "680", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "457", + "$id": "681", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3706,14 +5513,14 @@ "SkipUrlEncoding": false }, { - "$id": "458", + "$id": "682", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "459", + "$id": "683", "kind": "constant", "valueType": { - "$id": "460", + "$id": "684", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3735,27 +5542,27 @@ ], "Responses": [ { - "$id": "461", + "$id": "685", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "377" + "$ref": "601" }, "BodyMediaType": "Json", "Headers": [ { - "$id": "462", + "$id": "686", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "463", + "$id": "687", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "464", + "$id": "688", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3777,7 +5584,7 @@ "Path": "/messages/channels/{channelId}/templates", "BufferResponse": true, "Paging": { - "$id": "465", + "$id": "689", "ItemName": "value", "NextLinkName": "nextLink" }, @@ -3788,16 +5595,16 @@ } ], "Protocol": { - "$id": "466" + "$id": "690" }, "Parameters": [ { - "$id": "467", + "$id": "691", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "The communication resource, for example https://my-resource.communication.azure.com", "Type": { - "$id": "468", + "$id": "692", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3817,15 +5624,15 @@ } ], "Auth": { - "$id": "469", + "$id": "693", "OAuth2": { - "$id": "470", + "$id": "694", "Scopes": [ "https://communication.azure.com/.default" ] }, "ApiKey": { - "$id": "471", + "$id": "695", "Name": "Authorization", "In": "header" }