diff --git a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md index 2235a7514cf8..7d2380717597 100644 --- a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 2.0.0-beta.1 (Unreleased) + +### Features Added + +- Add Threaded Conversation + ## 1.2.0-beta.1 (Unreleased) ### Features Added 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..cd601eeb3330 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,38 @@ namespace Azure.Communication.Messages { + public partial class AddParticipantsRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AddParticipantsRequest(System.Collections.Generic.IEnumerable participants) { } + public System.Collections.Generic.IList Participants { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.AddParticipantsRequest 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.AddParticipantsRequest 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 AddParticipantsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AddParticipantsResult() { } + public System.Collections.Generic.IReadOnlyList InvalidParticipants { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.AddParticipantsResult 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.AddParticipantsResult 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 AudioConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AudioConversationMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.AudioConversationMessageContent 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.AudioConversationMessageContent 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 +44,48 @@ 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 BotContact : Azure.Communication.Messages.ConversationContact, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BotContact(string id, string botAppId) : base (default(string)) { } + public string BotAppId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.BotContact 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.BotContact 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 CommunicationContact : Azure.Communication.Messages.ConversationContact, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CommunicationContact(string id) : base (default(string)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.CommunicationContact 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.CommunicationContact 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_03_01_Preview) { } public enum ServiceVersion { V2024_02_01 = 1, V2024_08_30 = 2, + V2025_03_01_Preview = 3, } } public static partial class CommunicationMessagesModelFactory { + public static Azure.Communication.Messages.AddParticipantsResult AddParticipantsResult(System.Collections.Generic.IEnumerable invalidParticipants = 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.Conversation Conversation(string id = null, string topic = null, System.Collections.Generic.IEnumerable deliveryChannelIds = null, Azure.Communication.Messages.OutboundDeliveryStrategyKind? outboundDeliveryStrategy = default(Azure.Communication.Messages.OutboundDeliveryStrategyKind?), System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Communication.Messages.ConversationMessageItem ConversationMessageItem(string id = null, long? sequenceId = default(long?), Azure.Communication.Messages.ConversationMessageContent message = null, string senderDisplayName = null, string senderCommunicationIdentifier = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset)) { 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.ExternalParticipant ExternalParticipant(string id = null, string displayName = null, System.Collections.Generic.IEnumerable contacts = null) { throw null; } + public static Azure.Communication.Messages.GetConversationMessagesAnalysisResult GetConversationMessagesAnalysisResult(string summary = 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.InternalParticipant InternalParticipant(string id = null, string displayName = null, Azure.Communication.Messages.ConversationContact contact = 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,12 +97,172 @@ 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.Participant Participant(string id = null, string displayName = null, string kind = null) { throw null; } + public static Azure.Communication.Messages.ParticipantsResult ParticipantsResult(string id = null, Azure.ResponseError error = null) { throw null; } + public static Azure.Communication.Messages.RemoveParticipantsResult RemoveParticipantsResult(System.Collections.Generic.IEnumerable invalidParticipants = null) { throw null; } + public static Azure.Communication.Messages.SendConversationMessageRequest SendConversationMessageRequest(Azure.Communication.Messages.ConversationMessageContent request = null, Azure.Communication.Messages.OutboundDeliveryStrategyKind? outboundDeliveryStrategy = default(Azure.Communication.Messages.OutboundDeliveryStrategyKind?)) { throw null; } + public static Azure.Communication.Messages.SendConversationMessageResult SendConversationMessageResult(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.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.TextNotificationContent TextNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = 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.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 partial class Conversation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Conversation() { } + public System.Collections.Generic.IList DeliveryChannelIds { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Communication.Messages.OutboundDeliveryStrategyKind? OutboundDeliveryStrategy { get { throw null; } set { } } + public System.Collections.Generic.IList Participants { get { throw null; } } + public string Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Conversation 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.Conversation 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 abstract partial class ConversationContact : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ConversationContact(string id) { } + public string Id { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ConversationContact 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.ConversationContact 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 ConversationManagementClient + { + protected ConversationManagementClient() { } + public ConversationManagementClient(string connectionString) { } + public ConversationManagementClient(string connectionString, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public ConversationManagementClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public ConversationManagementClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Communication.Messages.CommunicationMessagesClientOptions options = null) { } + public ConversationManagementClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ConversationManagementClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response AddParticipants(string conversationId, Azure.Communication.Messages.AddParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddParticipants(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> AddParticipantsAsync(string conversationId, Azure.Communication.Messages.AddParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AddParticipantsAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response AnalyzeConversation(string conversationId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response AnalyzeConversation(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AnalyzeConversationAsync(string conversationId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeConversationAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateConversation(Azure.Communication.Messages.Conversation conversation, Azure.Communication.Messages.ConversationMessage initialMessage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateConversation(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> CreateConversationAsync(Azure.Communication.Messages.Conversation conversation, Azure.Communication.Messages.ConversationMessage initialMessage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateConversationAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteConversation(string conversationId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteConversationAsync(string conversationId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetConversation(string conversationId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetConversation(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetConversationAsync(string conversationId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetConversationAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetConversations(int? maxpagesize, string participantId, System.Guid? channelId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetConversations(int? maxpagesize = default(int?), string participantId = null, System.Guid? channelId = default(System.Guid?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetConversationsAsync(int? maxpagesize, string participantId, System.Guid? channelId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetConversationsAsync(int? maxpagesize = default(int?), string participantId = null, System.Guid? channelId = default(System.Guid?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetMessages(string conversationId, int? maxpagesize, string participantId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetMessages(string conversationId, int? maxpagesize = default(int?), string participantId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize, string participantId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize = default(int?), string participantId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveParticipants(string conversationId, Azure.Communication.Messages.RemoveParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveParticipants(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveParticipantsAsync(string conversationId, Azure.Communication.Messages.RemoveParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RemoveParticipantsAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response TerminateConversation(string conversationId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task TerminateConversationAsync(string conversationId, Azure.RequestContext context = null) { throw null; } + } + public partial class ConversationMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationMessage(string content) { } + public string Content { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ConversationMessage 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.ConversationMessage 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 abstract partial class ConversationMessageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ConversationMessageContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ConversationMessageContent 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.ConversationMessageContent 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 ConversationMessageItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConversationMessageItem() { } + public System.DateTimeOffset CreatedOn { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Communication.Messages.ConversationMessageContent Message { get { throw null; } } + public string SenderCommunicationIdentifier { get { throw null; } } + public string SenderDisplayName { get { throw null; } } + public long? SequenceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ConversationMessageItem 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.ConversationMessageItem 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 ConversationMessagesClient + { + protected ConversationMessagesClient() { } + public ConversationMessagesClient(string connectionString) { } + public ConversationMessagesClient(string connectionString, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Communication.Messages.CommunicationMessagesClientOptions options = null) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.Communication.CommunicationTokenCredential communicationTokenCredential, Azure.Communication.Messages.CommunicationMessagesClientOptions options = null) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response AddParticipants(string conversationId, Azure.Communication.Messages.AddParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddParticipants(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> AddParticipantsAsync(string conversationId, Azure.Communication.Messages.AddParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AddParticipantsAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response AnalyzeConversation(string conversationId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response AnalyzeConversation(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AnalyzeConversationAsync(string conversationId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeConversationAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetConversations(int? maxpagesize, string participantId, System.Guid? channelId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetConversations(int? maxpagesize = default(int?), string participantId = null, System.Guid? channelId = default(System.Guid?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetConversationsAsync(int? maxpagesize, string participantId, System.Guid? channelId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetConversationsAsync(int? maxpagesize = default(int?), string participantId = null, System.Guid? channelId = default(System.Guid?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetMessages(string conversationId, int? maxpagesize, string participantId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetMessages(string conversationId, int? maxpagesize = default(int?), string participantId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize, string participantId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize = default(int?), string participantId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveParticipants(string conversationId, Azure.Communication.Messages.RemoveParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveParticipants(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveParticipantsAsync(string conversationId, Azure.Communication.Messages.RemoveParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RemoveParticipantsAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response SendMessage(string conversationId, Azure.Communication.Messages.SendConversationMessageRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SendMessage(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> SendMessageAsync(string conversationId, Azure.Communication.Messages.SendConversationMessageRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SendMessageAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class DocumentConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentConversationMessageContent(System.Uri mediaUri) { } + public string Caption { get { throw null; } set { } } + public string FileName { get { throw null; } set { } } + public System.Uri MediaUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentConversationMessageContent 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.DocumentConversationMessageContent 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 { public DocumentNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -55,6 +276,40 @@ 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 ExternalParticipant : Azure.Communication.Messages.Participant, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExternalParticipant(System.Collections.Generic.IEnumerable contacts) { } + public System.Collections.Generic.IList Contacts { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ExternalParticipant 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.ExternalParticipant 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 GetConversationMessagesAnalysisResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal GetConversationMessagesAnalysisResult() { } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.GetConversationMessagesAnalysisResult 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.GetConversationMessagesAnalysisResult 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 ImageConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageConversationMessageContent(System.Uri mediaUri) { } + public string Caption { get { throw null; } set { } } + public System.Uri MediaUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageConversationMessageContent 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.ImageConversationMessageContent 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 +322,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 InternalParticipant : Azure.Communication.Messages.Participant, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InternalParticipant(Azure.Communication.Messages.ConversationContact contact) { } + public Azure.Communication.Messages.ConversationContact Contact { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InternalParticipant 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.InternalParticipant 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 { @@ -96,8 +362,8 @@ public partial class MessageTemplate : System.ClientModel.Primitives.IJsonModel< { public MessageTemplate(string name, string language) { } public Azure.Communication.Messages.MessageTemplateBindings Bindings { get { throw null; } set { } } - public string Language { get { throw null; } } - public string Name { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Name { get { throw null; } set { } } public System.Collections.Generic.IList Values { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -136,7 +402,7 @@ public partial class MessageTemplateDocument : Azure.Communication.Messages.Mess public MessageTemplateDocument(string name, System.Uri uri) : base (default(string)) { } public string Caption { get { throw null; } set { } } public string FileName { get { throw null; } set { } } - public System.Uri Uri { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateDocument 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) { } @@ -149,7 +415,7 @@ public partial class MessageTemplateImage : Azure.Communication.Messages.Message public MessageTemplateImage(string name, System.Uri uri) : base (default(string)) { } public string Caption { get { throw null; } set { } } public string FileName { get { throw null; } set { } } - public System.Uri Uri { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateImage 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) { } @@ -218,7 +484,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class MessageTemplateText : Azure.Communication.Messages.MessageTemplateValue, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MessageTemplateText(string name, string text) : base (default(string)) { } - public string Text { get { throw null; } } + public string Text { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateText 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) { } @@ -229,7 +495,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public abstract partial class MessageTemplateValue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected MessageTemplateValue(string name) { } - public string Name { get { throw null; } } + public string Name { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateValue 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) { } @@ -242,7 +508,7 @@ public partial class MessageTemplateVideo : Azure.Communication.Messages.Message public MessageTemplateVideo(string name, System.Uri uri) : base (default(string)) { } public string Caption { get { throw null; } set { } } public string FileName { get { throw null; } set { } } - public System.Uri Uri { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateVideo 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) { } @@ -283,6 +549,93 @@ 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; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OutboundDeliveryStrategyKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OutboundDeliveryStrategyKind(string value) { throw null; } + public static Azure.Communication.Messages.OutboundDeliveryStrategyKind AllParticipants { get { throw null; } } + public static Azure.Communication.Messages.OutboundDeliveryStrategyKind InternalOnly { get { throw null; } } + public bool Equals(Azure.Communication.Messages.OutboundDeliveryStrategyKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Communication.Messages.OutboundDeliveryStrategyKind left, Azure.Communication.Messages.OutboundDeliveryStrategyKind right) { throw null; } + public static implicit operator Azure.Communication.Messages.OutboundDeliveryStrategyKind (string value) { throw null; } + public static bool operator !=(Azure.Communication.Messages.OutboundDeliveryStrategyKind left, Azure.Communication.Messages.OutboundDeliveryStrategyKind right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class Participant : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected Participant() { } + public string DisplayName { get { throw null; } set { } } + public string Id { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Participant 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.Participant 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 ParticipantsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ParticipantsResult() { } + public Azure.ResponseError Error { get { throw null; } } + public string Id { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ParticipantsResult 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.ParticipantsResult 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 RemoveParticipantsRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemoveParticipantsRequest(System.Collections.Generic.IEnumerable participantIds) { } + public System.Collections.Generic.IList ParticipantIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.RemoveParticipantsRequest 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.RemoveParticipantsRequest 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 RemoveParticipantsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RemoveParticipantsResult() { } + public System.Collections.Generic.IReadOnlyList InvalidParticipants { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.RemoveParticipantsResult 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.RemoveParticipantsResult 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 SendConversationMessageRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SendConversationMessageRequest(Azure.Communication.Messages.ConversationMessageContent request) { } + public Azure.Communication.Messages.OutboundDeliveryStrategyKind? OutboundDeliveryStrategy { get { throw null; } set { } } + public Azure.Communication.Messages.ConversationMessageContent Request { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.SendConversationMessageRequest 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.SendConversationMessageRequest 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 SendConversationMessageResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SendConversationMessageResult() { } + public string MessageId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.SendConversationMessageResult 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.SendConversationMessageResult 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 +647,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 TemplateConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TemplateConversationMessageContent(Azure.Communication.Messages.MessageTemplate template) { } + public Azure.Communication.Messages.MessageTemplate Template { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TemplateConversationMessageContent 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.TemplateConversationMessageContent 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 +669,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 TextConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TextConversationMessageContent(string content) { } + public string Content { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextConversationMessageContent 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.TextConversationMessageContent 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 +691,18 @@ 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 VideoConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VideoConversationMessageContent(System.Uri mediaUri) { } + public string Caption { get { throw null; } set { } } + public System.Uri MediaUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoConversationMessageContent 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.VideoConversationMessageContent 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 +715,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 partial class WhatsAppContact : Azure.Communication.Messages.ConversationContact, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppContact(string id) : base (default(string)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppContact 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.WhatsAppContact 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 { @@ -366,7 +763,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class WhatsAppMessageTemplateBindingsButton : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public WhatsAppMessageTemplateBindingsButton(string subType, string refValue) { } - public string RefValue { get { throw null; } } + public string RefValue { get { throw null; } set { } } public string SubType { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.Models.Channels.WhatsAppMessageTemplateBindingsButton System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -378,7 +775,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class WhatsAppMessageTemplateBindingsComponent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public WhatsAppMessageTemplateBindingsComponent(string refValue) { } - public string RefValue { get { throw null; } } + public string RefValue { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.Models.Channels.WhatsAppMessageTemplateBindingsComponent 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) { } @@ -402,6 +799,12 @@ namespace Microsoft.Extensions.Azure { public static partial class CommunicationMessagesClientBuilderExtensions { + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddMessageTemplateClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddMessageTemplateClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddMessageTemplateClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } 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..cd601eeb3330 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,38 @@ namespace Azure.Communication.Messages { + public partial class AddParticipantsRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AddParticipantsRequest(System.Collections.Generic.IEnumerable participants) { } + public System.Collections.Generic.IList Participants { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.AddParticipantsRequest 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.AddParticipantsRequest 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 AddParticipantsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AddParticipantsResult() { } + public System.Collections.Generic.IReadOnlyList InvalidParticipants { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.AddParticipantsResult 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.AddParticipantsResult 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 AudioConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AudioConversationMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.AudioConversationMessageContent 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.AudioConversationMessageContent 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 +44,48 @@ 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 BotContact : Azure.Communication.Messages.ConversationContact, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BotContact(string id, string botAppId) : base (default(string)) { } + public string BotAppId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.BotContact 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.BotContact 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 CommunicationContact : Azure.Communication.Messages.ConversationContact, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CommunicationContact(string id) : base (default(string)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.CommunicationContact 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.CommunicationContact 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_03_01_Preview) { } public enum ServiceVersion { V2024_02_01 = 1, V2024_08_30 = 2, + V2025_03_01_Preview = 3, } } public static partial class CommunicationMessagesModelFactory { + public static Azure.Communication.Messages.AddParticipantsResult AddParticipantsResult(System.Collections.Generic.IEnumerable invalidParticipants = 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.Conversation Conversation(string id = null, string topic = null, System.Collections.Generic.IEnumerable deliveryChannelIds = null, Azure.Communication.Messages.OutboundDeliveryStrategyKind? outboundDeliveryStrategy = default(Azure.Communication.Messages.OutboundDeliveryStrategyKind?), System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Communication.Messages.ConversationMessageItem ConversationMessageItem(string id = null, long? sequenceId = default(long?), Azure.Communication.Messages.ConversationMessageContent message = null, string senderDisplayName = null, string senderCommunicationIdentifier = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset)) { 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.ExternalParticipant ExternalParticipant(string id = null, string displayName = null, System.Collections.Generic.IEnumerable contacts = null) { throw null; } + public static Azure.Communication.Messages.GetConversationMessagesAnalysisResult GetConversationMessagesAnalysisResult(string summary = 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.InternalParticipant InternalParticipant(string id = null, string displayName = null, Azure.Communication.Messages.ConversationContact contact = 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,12 +97,172 @@ 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.Participant Participant(string id = null, string displayName = null, string kind = null) { throw null; } + public static Azure.Communication.Messages.ParticipantsResult ParticipantsResult(string id = null, Azure.ResponseError error = null) { throw null; } + public static Azure.Communication.Messages.RemoveParticipantsResult RemoveParticipantsResult(System.Collections.Generic.IEnumerable invalidParticipants = null) { throw null; } + public static Azure.Communication.Messages.SendConversationMessageRequest SendConversationMessageRequest(Azure.Communication.Messages.ConversationMessageContent request = null, Azure.Communication.Messages.OutboundDeliveryStrategyKind? outboundDeliveryStrategy = default(Azure.Communication.Messages.OutboundDeliveryStrategyKind?)) { throw null; } + public static Azure.Communication.Messages.SendConversationMessageResult SendConversationMessageResult(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.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.TextNotificationContent TextNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = 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.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 partial class Conversation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Conversation() { } + public System.Collections.Generic.IList DeliveryChannelIds { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Communication.Messages.OutboundDeliveryStrategyKind? OutboundDeliveryStrategy { get { throw null; } set { } } + public System.Collections.Generic.IList Participants { get { throw null; } } + public string Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Conversation 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.Conversation 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 abstract partial class ConversationContact : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ConversationContact(string id) { } + public string Id { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ConversationContact 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.ConversationContact 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 ConversationManagementClient + { + protected ConversationManagementClient() { } + public ConversationManagementClient(string connectionString) { } + public ConversationManagementClient(string connectionString, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public ConversationManagementClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public ConversationManagementClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Communication.Messages.CommunicationMessagesClientOptions options = null) { } + public ConversationManagementClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ConversationManagementClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response AddParticipants(string conversationId, Azure.Communication.Messages.AddParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddParticipants(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> AddParticipantsAsync(string conversationId, Azure.Communication.Messages.AddParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AddParticipantsAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response AnalyzeConversation(string conversationId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response AnalyzeConversation(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AnalyzeConversationAsync(string conversationId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeConversationAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateConversation(Azure.Communication.Messages.Conversation conversation, Azure.Communication.Messages.ConversationMessage initialMessage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateConversation(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> CreateConversationAsync(Azure.Communication.Messages.Conversation conversation, Azure.Communication.Messages.ConversationMessage initialMessage = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateConversationAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteConversation(string conversationId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteConversationAsync(string conversationId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetConversation(string conversationId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetConversation(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetConversationAsync(string conversationId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetConversationAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetConversations(int? maxpagesize, string participantId, System.Guid? channelId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetConversations(int? maxpagesize = default(int?), string participantId = null, System.Guid? channelId = default(System.Guid?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetConversationsAsync(int? maxpagesize, string participantId, System.Guid? channelId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetConversationsAsync(int? maxpagesize = default(int?), string participantId = null, System.Guid? channelId = default(System.Guid?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetMessages(string conversationId, int? maxpagesize, string participantId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetMessages(string conversationId, int? maxpagesize = default(int?), string participantId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize, string participantId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize = default(int?), string participantId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveParticipants(string conversationId, Azure.Communication.Messages.RemoveParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveParticipants(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveParticipantsAsync(string conversationId, Azure.Communication.Messages.RemoveParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RemoveParticipantsAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response TerminateConversation(string conversationId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task TerminateConversationAsync(string conversationId, Azure.RequestContext context = null) { throw null; } + } + public partial class ConversationMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationMessage(string content) { } + public string Content { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ConversationMessage 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.ConversationMessage 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 abstract partial class ConversationMessageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ConversationMessageContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ConversationMessageContent 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.ConversationMessageContent 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 ConversationMessageItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConversationMessageItem() { } + public System.DateTimeOffset CreatedOn { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Communication.Messages.ConversationMessageContent Message { get { throw null; } } + public string SenderCommunicationIdentifier { get { throw null; } } + public string SenderDisplayName { get { throw null; } } + public long? SequenceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ConversationMessageItem 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.ConversationMessageItem 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 ConversationMessagesClient + { + protected ConversationMessagesClient() { } + public ConversationMessagesClient(string connectionString) { } + public ConversationMessagesClient(string connectionString, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Communication.Messages.CommunicationMessagesClientOptions options = null) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.Communication.CommunicationTokenCredential communicationTokenCredential, Azure.Communication.Messages.CommunicationMessagesClientOptions options = null) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ConversationMessagesClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response AddParticipants(string conversationId, Azure.Communication.Messages.AddParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddParticipants(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> AddParticipantsAsync(string conversationId, Azure.Communication.Messages.AddParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AddParticipantsAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response AnalyzeConversation(string conversationId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response AnalyzeConversation(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AnalyzeConversationAsync(string conversationId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeConversationAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetConversations(int? maxpagesize, string participantId, System.Guid? channelId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetConversations(int? maxpagesize = default(int?), string participantId = null, System.Guid? channelId = default(System.Guid?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetConversationsAsync(int? maxpagesize, string participantId, System.Guid? channelId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetConversationsAsync(int? maxpagesize = default(int?), string participantId = null, System.Guid? channelId = default(System.Guid?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetMessages(string conversationId, int? maxpagesize, string participantId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetMessages(string conversationId, int? maxpagesize = default(int?), string participantId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize, string participantId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize = default(int?), string participantId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveParticipants(string conversationId, Azure.Communication.Messages.RemoveParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveParticipants(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveParticipantsAsync(string conversationId, Azure.Communication.Messages.RemoveParticipantsRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RemoveParticipantsAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response SendMessage(string conversationId, Azure.Communication.Messages.SendConversationMessageRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SendMessage(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> SendMessageAsync(string conversationId, Azure.Communication.Messages.SendConversationMessageRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SendMessageAsync(string conversationId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class DocumentConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentConversationMessageContent(System.Uri mediaUri) { } + public string Caption { get { throw null; } set { } } + public string FileName { get { throw null; } set { } } + public System.Uri MediaUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentConversationMessageContent 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.DocumentConversationMessageContent 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 { public DocumentNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -55,6 +276,40 @@ 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 ExternalParticipant : Azure.Communication.Messages.Participant, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExternalParticipant(System.Collections.Generic.IEnumerable contacts) { } + public System.Collections.Generic.IList Contacts { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ExternalParticipant 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.ExternalParticipant 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 GetConversationMessagesAnalysisResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal GetConversationMessagesAnalysisResult() { } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.GetConversationMessagesAnalysisResult 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.GetConversationMessagesAnalysisResult 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 ImageConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageConversationMessageContent(System.Uri mediaUri) { } + public string Caption { get { throw null; } set { } } + public System.Uri MediaUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageConversationMessageContent 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.ImageConversationMessageContent 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 +322,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 InternalParticipant : Azure.Communication.Messages.Participant, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InternalParticipant(Azure.Communication.Messages.ConversationContact contact) { } + public Azure.Communication.Messages.ConversationContact Contact { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InternalParticipant 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.InternalParticipant 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 { @@ -96,8 +362,8 @@ public partial class MessageTemplate : System.ClientModel.Primitives.IJsonModel< { public MessageTemplate(string name, string language) { } public Azure.Communication.Messages.MessageTemplateBindings Bindings { get { throw null; } set { } } - public string Language { get { throw null; } } - public string Name { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Name { get { throw null; } set { } } public System.Collections.Generic.IList Values { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -136,7 +402,7 @@ public partial class MessageTemplateDocument : Azure.Communication.Messages.Mess public MessageTemplateDocument(string name, System.Uri uri) : base (default(string)) { } public string Caption { get { throw null; } set { } } public string FileName { get { throw null; } set { } } - public System.Uri Uri { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateDocument 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) { } @@ -149,7 +415,7 @@ public partial class MessageTemplateImage : Azure.Communication.Messages.Message public MessageTemplateImage(string name, System.Uri uri) : base (default(string)) { } public string Caption { get { throw null; } set { } } public string FileName { get { throw null; } set { } } - public System.Uri Uri { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateImage 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) { } @@ -218,7 +484,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class MessageTemplateText : Azure.Communication.Messages.MessageTemplateValue, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MessageTemplateText(string name, string text) : base (default(string)) { } - public string Text { get { throw null; } } + public string Text { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateText 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) { } @@ -229,7 +495,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public abstract partial class MessageTemplateValue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected MessageTemplateValue(string name) { } - public string Name { get { throw null; } } + public string Name { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateValue 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) { } @@ -242,7 +508,7 @@ public partial class MessageTemplateVideo : Azure.Communication.Messages.Message public MessageTemplateVideo(string name, System.Uri uri) : base (default(string)) { } public string Caption { get { throw null; } set { } } public string FileName { get { throw null; } set { } } - public System.Uri Uri { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.MessageTemplateVideo 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) { } @@ -283,6 +549,93 @@ 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; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OutboundDeliveryStrategyKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OutboundDeliveryStrategyKind(string value) { throw null; } + public static Azure.Communication.Messages.OutboundDeliveryStrategyKind AllParticipants { get { throw null; } } + public static Azure.Communication.Messages.OutboundDeliveryStrategyKind InternalOnly { get { throw null; } } + public bool Equals(Azure.Communication.Messages.OutboundDeliveryStrategyKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Communication.Messages.OutboundDeliveryStrategyKind left, Azure.Communication.Messages.OutboundDeliveryStrategyKind right) { throw null; } + public static implicit operator Azure.Communication.Messages.OutboundDeliveryStrategyKind (string value) { throw null; } + public static bool operator !=(Azure.Communication.Messages.OutboundDeliveryStrategyKind left, Azure.Communication.Messages.OutboundDeliveryStrategyKind right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class Participant : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected Participant() { } + public string DisplayName { get { throw null; } set { } } + public string Id { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Participant 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.Participant 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 ParticipantsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ParticipantsResult() { } + public Azure.ResponseError Error { get { throw null; } } + public string Id { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ParticipantsResult 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.ParticipantsResult 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 RemoveParticipantsRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemoveParticipantsRequest(System.Collections.Generic.IEnumerable participantIds) { } + public System.Collections.Generic.IList ParticipantIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.RemoveParticipantsRequest 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.RemoveParticipantsRequest 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 RemoveParticipantsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RemoveParticipantsResult() { } + public System.Collections.Generic.IReadOnlyList InvalidParticipants { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.RemoveParticipantsResult 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.RemoveParticipantsResult 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 SendConversationMessageRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SendConversationMessageRequest(Azure.Communication.Messages.ConversationMessageContent request) { } + public Azure.Communication.Messages.OutboundDeliveryStrategyKind? OutboundDeliveryStrategy { get { throw null; } set { } } + public Azure.Communication.Messages.ConversationMessageContent Request { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.SendConversationMessageRequest 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.SendConversationMessageRequest 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 SendConversationMessageResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SendConversationMessageResult() { } + public string MessageId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.SendConversationMessageResult 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.SendConversationMessageResult 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 +647,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 TemplateConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TemplateConversationMessageContent(Azure.Communication.Messages.MessageTemplate template) { } + public Azure.Communication.Messages.MessageTemplate Template { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TemplateConversationMessageContent 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.TemplateConversationMessageContent 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 +669,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 TextConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TextConversationMessageContent(string content) { } + public string Content { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextConversationMessageContent 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.TextConversationMessageContent 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 +691,18 @@ 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 VideoConversationMessageContent : Azure.Communication.Messages.ConversationMessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VideoConversationMessageContent(System.Uri mediaUri) { } + public string Caption { get { throw null; } set { } } + public System.Uri MediaUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoConversationMessageContent 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.VideoConversationMessageContent 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 +715,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 partial class WhatsAppContact : Azure.Communication.Messages.ConversationContact, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppContact(string id) : base (default(string)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.WhatsAppContact 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.WhatsAppContact 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 { @@ -366,7 +763,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class WhatsAppMessageTemplateBindingsButton : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public WhatsAppMessageTemplateBindingsButton(string subType, string refValue) { } - public string RefValue { get { throw null; } } + public string RefValue { get { throw null; } set { } } public string SubType { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.Models.Channels.WhatsAppMessageTemplateBindingsButton System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -378,7 +775,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class WhatsAppMessageTemplateBindingsComponent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public WhatsAppMessageTemplateBindingsComponent(string refValue) { } - public string RefValue { get { throw null; } } + public string RefValue { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.Messages.Models.Channels.WhatsAppMessageTemplateBindingsComponent 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) { } @@ -402,6 +799,12 @@ namespace Microsoft.Extensions.Azure { public static partial class CommunicationMessagesClientBuilderExtensions { + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddMessageTemplateClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddMessageTemplateClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddMessageTemplateClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } diff --git a/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj b/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj index c0822883c897..7fcd979547ea 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj +++ b/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj @@ -5,17 +5,21 @@ This client library enables working with the Microsoft Azure Communication Messages service. Azure Communication Messages Service - 1.2.0-beta.1 + 2.0.0-beta.1 1.1.0 Microsoft Azure Communication Messages Service;Microsoft;Azure;Azure Communication Service;Azure Communication Messages Service;Messages;Communication $(RequiredTargetFrameworks) true + $(NoWarn);AZC0007 + $(NoWarn);AZC0012 + $(NoWarn);AZC0030 + diff --git a/sdk/communication/Azure.Communication.Messages/src/ConversationManagementClient.cs b/sdk/communication/Azure.Communication.Messages/src/ConversationManagementClient.cs new file mode 100644 index 000000000000..9dc9872b6164 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/ConversationManagementClient.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using System.Threading; +using Azure.Communication.Pipeline; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + /// + /// The Azure Communication Services Conversation Management client. + /// + + public partial class ConversationManagementClient + { + #region public constructors + + /// + /// Initializes a new instance of . + /// + /// Connection string acquired from the Azure Communication Services resource. + public ConversationManagementClient(string connectionString) + : this( + ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// Connection string acquired from the Azure Communication Services resource. + /// Client options exposing , , , etc. + public ConversationManagementClient(string connectionString, CommunicationMessagesClientOptions options) + : this( + ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + options ?? new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// The URI of the Azure Communication Services resource. + /// The used to authenticate requests. + /// Client options exposing , , , etc. + public ConversationManagementClient(Uri endpoint, AzureKeyCredential credential, CommunicationMessagesClientOptions options = default) + : this( + Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, + Argument.CheckNotNull(credential, nameof(credential)), + options ?? new CommunicationMessagesClientOptions()) + { + _keyCredential = credential; + } + + #endregion + + #region private constructors + private ConversationManagementClient(ConnectionString connectionString, CommunicationMessagesClientOptions options) + : this(new Uri(connectionString.GetRequired("endpoint")), options.BuildHttpPipeline(connectionString), options) + { } + + private ConversationManagementClient(string endpoint, AzureKeyCredential keyCredential, CommunicationMessagesClientOptions options) + : this(new Uri(endpoint), options.BuildHttpPipeline(keyCredential), options) + { } + + private ConversationManagementClient(Uri endpoint, HttpPipeline httpPipeline, CommunicationMessagesClientOptions options) + { + ClientDiagnostics = new ClientDiagnostics(options); + _pipeline = httpPipeline; + _endpoint = endpoint; + _apiVersion = options.Version; + } + + #endregion + + /// Initializes a new instance of ConversationManagementClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// is null. + internal ConversationManagementClient(Uri endpoint) : this(endpoint, new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of ConversationManagementClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// The options for configuring the client. + /// is null. + internal ConversationManagementClient(Uri endpoint, CommunicationMessagesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new CommunicationMessagesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), Array.Empty(), new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Initializes a new instance of for mocking. + protected ConversationManagementClient() + { + ClientDiagnostics = null!; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/ConversationMessagesClient.cs b/sdk/communication/Azure.Communication.Messages/src/ConversationMessagesClient.cs new file mode 100644 index 000000000000..9d855678dce1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/ConversationMessagesClient.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Net; +using Azure.Communication.Pipeline; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + /// + /// The Azure Communication Services Conversation Messages client. + /// + + public partial class ConversationMessagesClient + { + #region public constructors + + /// + /// Initializes a new instance of . + /// + /// Connection string acquired from the Azure Communication Services resource. + public ConversationMessagesClient(string connectionString) + : this( + ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// Connection string acquired from the Azure Communication Services resource. + /// Client options exposing , , , etc. + public ConversationMessagesClient(string connectionString, CommunicationMessagesClientOptions options) + : this( + ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + options ?? new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// The URI of the Azure Communication Services resource. + /// The used to authenticate requests. + /// Client options exposing , , , etc. + public ConversationMessagesClient(Uri endpoint, AzureKeyCredential credential, CommunicationMessagesClientOptions options = default) + : this( + Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, + Argument.CheckNotNull(credential, nameof(credential)), + options ?? new CommunicationMessagesClientOptions()) + { + _keyCredential = credential; + } + + /// + /// Initializes a new instance of the class. + /// + /// The URI of the Azure Communication Services resource. + /// The used to authenticate requests. + /// Client options exposing , , , etc. + public ConversationMessagesClient(Uri endpoint, CommunicationTokenCredential communicationTokenCredential, CommunicationMessagesClientOptions options = default) + : this( + Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, + Argument.CheckNotNull(communicationTokenCredential, nameof(communicationTokenCredential)), + options ?? new CommunicationMessagesClientOptions()) + { + _tokenCredential = new CommunicationBearerTokenCredential(communicationTokenCredential); + } + + #endregion + + #region private constructors + private ConversationMessagesClient(ConnectionString connectionString, CommunicationMessagesClientOptions options) + : this(new Uri(connectionString.GetRequired("endpoint")), options.BuildHttpPipeline(connectionString), options) + { } + + private ConversationMessagesClient(string endpoint, AzureKeyCredential keyCredential, CommunicationMessagesClientOptions options) + : this(new Uri(endpoint), options.BuildHttpPipeline(keyCredential), options) + { } + + private ConversationMessagesClient(string endpoint, CommunicationTokenCredential communicationTokenCredential, CommunicationMessagesClientOptions options) + : this(new Uri(endpoint), options.BuildHttpPipeline(new CommunicationBearerTokenCredential(communicationTokenCredential)), options) + { + } + + private ConversationMessagesClient(Uri endpoint, HttpPipeline httpPipeline, CommunicationMessagesClientOptions options) + { + ClientDiagnostics = new ClientDiagnostics(options); + _pipeline = httpPipeline; + _endpoint = endpoint; + _apiVersion = options.Version; + } + + #endregion + + /// Initializes a new instance of ConversationMessagesClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// is null. + internal ConversationMessagesClient(Uri endpoint) : this(endpoint, new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of ConversationMessagesClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// The options for configuring the client. + /// is null. + internal ConversationMessagesClient(Uri endpoint, CommunicationMessagesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new CommunicationMessagesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), Array.Empty(), new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Initializes a new instance of for mocking. + protected ConversationMessagesClient() + { + ClientDiagnostics = null!; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsRequest.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsRequest.Serialization.cs new file mode 100644 index 000000000000..849aed25d73d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsRequest.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 AddParticipantsRequest : 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(AddParticipantsRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("participants"u8); + writer.WriteStartArray(); + foreach (var item in Participants) + { + 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 + } + } + } + + AddParticipantsRequest 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(AddParticipantsRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAddParticipantsRequest(document.RootElement, options); + } + + internal static AddParticipantsRequest DeserializeAddParticipantsRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList participants = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("participants"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Participant.DeserializeParticipant(item, options)); + } + participants = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AddParticipantsRequest(participants, 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(AddParticipantsRequest)} does not support writing '{options.Format}' format."); + } + } + + AddParticipantsRequest 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 DeserializeAddParticipantsRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AddParticipantsRequest)} 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 AddParticipantsRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAddParticipantsRequest(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/AddParticipantsRequest.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsRequest.cs new file mode 100644 index 000000000000..961946546e4d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsRequest.cs @@ -0,0 +1,88 @@ +// 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 +{ + /// Request payload for adding participants to a conversation. + public partial class AddParticipantsRequest + { + /// + /// 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 . + /// + /// List of participants to add. + /// 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 . + /// + /// is null. + public AddParticipantsRequest(IEnumerable participants) + { + Argument.AssertNotNull(participants, nameof(participants)); + + Participants = participants.ToList(); + } + + /// Initializes a new instance of . + /// + /// List of participants to add. + /// 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 AddParticipantsRequest(IList participants, IDictionary serializedAdditionalRawData) + { + Participants = participants; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AddParticipantsRequest() + { + } + + /// + /// List of participants to add. + /// 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 IList Participants { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsResult.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsResult.Serialization.cs new file mode 100644 index 000000000000..640791b680dc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsResult.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 AddParticipantsResult : 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(AddParticipantsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("invalidParticipants"u8); + writer.WriteStartArray(); + foreach (var item in InvalidParticipants) + { + 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 + } + } + } + + AddParticipantsResult 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(AddParticipantsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAddParticipantsResult(document.RootElement, options); + } + + internal static AddParticipantsResult DeserializeAddParticipantsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList invalidParticipants = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("invalidParticipants"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ParticipantsResult.DeserializeParticipantsResult(item, options)); + } + invalidParticipants = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AddParticipantsResult(invalidParticipants, 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(AddParticipantsResult)} does not support writing '{options.Format}' format."); + } + } + + AddParticipantsResult 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 DeserializeAddParticipantsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AddParticipantsResult)} 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 AddParticipantsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAddParticipantsResult(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/AddParticipantsResult.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsResult.cs new file mode 100644 index 000000000000..bec8f5758a50 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/AddParticipantsResult.cs @@ -0,0 +1,76 @@ +// 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 +{ + /// Response for the add participants operation. + public partial class AddParticipantsResult + { + /// + /// 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 . + /// List of Ids with Errors if failed to be added. + /// is null. + internal AddParticipantsResult(IEnumerable invalidParticipants) + { + Argument.AssertNotNull(invalidParticipants, nameof(invalidParticipants)); + + InvalidParticipants = invalidParticipants.ToList(); + } + + /// Initializes a new instance of . + /// List of Ids with Errors if failed to be added. + /// Keeps track of any properties unknown to the library. + internal AddParticipantsResult(IReadOnlyList invalidParticipants, IDictionary serializedAdditionalRawData) + { + InvalidParticipants = invalidParticipants; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AddParticipantsResult() + { + } + + /// List of Ids with Errors if failed to be added. + public IReadOnlyList InvalidParticipants { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/AudioConversationMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/AudioConversationMessageContent.Serialization.cs new file mode 100644 index 000000000000..9f11b7beea89 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/AudioConversationMessageContent.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 AudioConversationMessageContent : 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(AudioConversationMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + AudioConversationMessageContent 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(AudioConversationMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAudioConversationMessageContent(document.RootElement, options); + } + + internal static AudioConversationMessageContent DeserializeAudioConversationMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = 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("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 AudioConversationMessageContent(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(AudioConversationMessageContent)} does not support writing '{options.Format}' format."); + } + } + + AudioConversationMessageContent 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 DeserializeAudioConversationMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AudioConversationMessageContent)} 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 AudioConversationMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAudioConversationMessageContent(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/AudioConversationMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/AudioConversationMessageContent.cs new file mode 100644 index 000000000000..45727d927894 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/AudioConversationMessageContent.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 +{ + /// A request to send an audio conversation message. + public partial class AudioConversationMessageContent : ConversationMessageContent + { + /// Initializes a new instance of . + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// is null. + public AudioConversationMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = CommunicationMessageKind.Audio; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// The type discriminator describing a message 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 AudioConversationMessageContent(CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal AudioConversationMessageContent() + { + } + + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + public Uri MediaUri { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/AudioNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/AudioNotificationContent.cs index 653d644d43db..c5609d2078ac 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/AudioNotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/AudioNotificationContent.cs @@ -30,7 +30,7 @@ public AudioNotificationContent(Guid channelRegistrationId, IEnumerable /// 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. + /// The type discriminator describing a message 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 AudioNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/BotContact.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/BotContact.Serialization.cs new file mode 100644 index 000000000000..9adaa4faac2f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/BotContact.Serialization.cs @@ -0,0 +1,140 @@ +// 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 BotContact : 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(BotContact)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("botAppId"u8); + writer.WriteStringValue(BotAppId); + } + + BotContact 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(BotContact)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBotContact(document.RootElement, options); + } + + internal static BotContact DeserializeBotContact(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string botAppId = default; + string id = default; + MessagePlatformKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("botAppId"u8)) + { + botAppId = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessagePlatformKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BotContact(id, kind, serializedAdditionalRawData, botAppId); + } + + 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(BotContact)} does not support writing '{options.Format}' format."); + } + } + + BotContact 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 DeserializeBotContact(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BotContact)} 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 BotContact FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBotContact(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/BotContact.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/BotContact.cs new file mode 100644 index 000000000000..fe9f8ea215cb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/BotContact.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Bot Contact. + public partial class BotContact : ConversationContact + { + /// Initializes a new instance of . + /// External platform identifier. + /// Bot App Id of the Bot Contact. + /// or is null. + public BotContact(string id, string botAppId) : base(id) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(botAppId, nameof(botAppId)); + + Kind = MessagePlatformKind.Bot; + BotAppId = botAppId; + } + + /// Initializes a new instance of . + /// External platform identifier. + /// Type of message platform (e.g., WhatsApp). + /// Keeps track of any properties unknown to the library. + /// Bot App Id of the Bot Contact. + internal BotContact(string id, MessagePlatformKind kind, IDictionary serializedAdditionalRawData, string botAppId) : base(id, kind, serializedAdditionalRawData) + { + BotAppId = botAppId; + } + + /// Initializes a new instance of for deserialization. + internal BotContact() + { + } + + /// Bot App Id of the Bot Contact. + public string BotAppId { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationContact.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationContact.Serialization.cs new file mode 100644 index 000000000000..161251a2ab45 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationContact.Serialization.cs @@ -0,0 +1,132 @@ +// 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 CommunicationContact : 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(CommunicationContact)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + CommunicationContact 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(CommunicationContact)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommunicationContact(document.RootElement, options); + } + + internal static CommunicationContact DeserializeCommunicationContact(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + MessagePlatformKind kind = 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("kind"u8)) + { + kind = new MessagePlatformKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommunicationContact(id, 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(CommunicationContact)} does not support writing '{options.Format}' format."); + } + } + + CommunicationContact 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 DeserializeCommunicationContact(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommunicationContact)} 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 CommunicationContact FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCommunicationContact(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/CommunicationContact.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationContact.cs new file mode 100644 index 000000000000..41b2101542d9 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationContact.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Communication Contact. + public partial class CommunicationContact : ConversationContact + { + /// Initializes a new instance of . + /// External platform identifier. + /// is null. + public CommunicationContact(string id) : base(id) + { + Argument.AssertNotNull(id, nameof(id)); + + Kind = MessagePlatformKind.Communication; + } + + /// Initializes a new instance of . + /// External platform identifier. + /// Type of message platform (e.g., WhatsApp). + /// Keeps track of any properties unknown to the library. + internal CommunicationContact(string id, MessagePlatformKind kind, IDictionary serializedAdditionalRawData) : base(id, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal CommunicationContact() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientBuilderExtensions.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientBuilderExtensions.cs index ed2d8514d8be..aa8b33d27984 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientBuilderExtensions.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientBuilderExtensions.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.Azure { - /// Extension methods to add , to client builder. + /// Extension methods to add , , , to client builder. public static partial class CommunicationMessagesClientBuilderExtensions { /// Registers a instance. @@ -53,6 +53,44 @@ public static IAzureClientBuilder((options, cred) => new MessageTemplateClient(endpoint, cred, options)); } + /// Registers a instance. + /// The builder to register with. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new ConversationManagementClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The communication resource, for example https://my-resource.communication.azure.com. + public static IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ConversationManagementClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new ConversationMessagesClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The communication resource, for example https://my-resource.communication.azure.com. + public static IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ConversationMessagesClient(endpoint, cred, options)); + } + /// Registers a instance. /// The builder to register with. /// The configuration values. @@ -69,5 +107,21 @@ public static IAzureClientBuilder(configuration); } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddConversationManagementClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddConversationMessagesClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } } } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs index 58b29e477642..7e1df9aa49df 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_03_01_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-03-01-preview". + V2025_03_01_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_03_01_Preview => "2025-03-01-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..7b5e750f58fc 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs @@ -18,7 +18,7 @@ public static partial class CommunicationMessagesModelFactory /// 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. + /// The type discriminator describing a message type. /// A new instance for mocking. public static NotificationContent NotificationContent(Guid channelRegistrationId = default, IEnumerable to = null, string kind = null) { @@ -122,106 +122,6 @@ public static TemplateNotificationContent TemplateNotificationContent(Guid chann return new TemplateNotificationContent(channelRegistrationId, to?.ToList(), CommunicationMessageKind.Template, serializedAdditionalRawData: null, template); } - /// Initializes a new instance of . - /// Name of the template. - /// 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'. - /// - /// The template values. - /// 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 binding object to link values to the template specific locations - /// 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 . - /// - /// A new instance for mocking. - public static MessageTemplate MessageTemplate(string name = null, string language = null, IEnumerable values = null, MessageTemplateBindings bindings = null) - { - values ??= new List(); - - return new MessageTemplate(name, language, values?.ToList(), bindings, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Template binding reference name. - /// The type discriminator describing a template parameter type. - /// A new instance for mocking. - public static MessageTemplateValue MessageTemplateValue(string name = null, string kind = null) - { - return new UnknownMessageTemplateValue(name, kind == null ? default : new MessageTemplateValueKind(kind), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Template binding reference name. - /// The text value. - /// A new instance for mocking. - public static MessageTemplateText MessageTemplateText(string name = null, string text = null) - { - return new MessageTemplateText(name, MessageTemplateValueKind.Text, serializedAdditionalRawData: null, text); - } - - /// Initializes a new instance of . - /// Template binding reference name. - /// The (public) URL of the media. - /// The [optional] caption of the media object. - /// The [optional] filename of the media file. - /// A new instance for mocking. - public static MessageTemplateImage MessageTemplateImage(string name = null, Uri uri = null, string caption = null, string fileName = null) - { - return new MessageTemplateImage( - name, - MessageTemplateValueKind.Image, - serializedAdditionalRawData: null, - uri, - caption, - fileName); - } - - /// Initializes a new instance of . - /// Template binding reference name. - /// The (public) URL of the media. - /// The [optional] caption of the media object. - /// The [optional] filename of the media file. - /// A new instance for mocking. - public static MessageTemplateDocument MessageTemplateDocument(string name = null, Uri uri = null, string caption = null, string fileName = null) - { - return new MessageTemplateDocument( - name, - MessageTemplateValueKind.Document, - serializedAdditionalRawData: null, - uri, - caption, - fileName); - } - - /// Initializes a new instance of . - /// Template binding reference name. - /// The (public) URL of the media. - /// The [optional] caption of the media object. - /// The [optional] filename of the media file. - /// A new instance for mocking. - public static MessageTemplateVideo MessageTemplateVideo(string name = null, Uri uri = null, string caption = null, string fileName = null) - { - return new MessageTemplateVideo( - name, - MessageTemplateValueKind.Video, - serializedAdditionalRawData: null, - uri, - caption, - fileName); - } - - /// Initializes a new instance of . - /// Template binding reference name. - /// The [Optional] quick action text. - /// The [Optional] quick action payload. - /// A new instance for mocking. - public static MessageTemplateQuickAction MessageTemplateQuickAction(string name = null, string text = null, string payload = null) - { - return new MessageTemplateQuickAction(name, MessageTemplateValueKind.QuickAction, serializedAdditionalRawData: null, text, payload); - } - /// Initializes a new instance of . /// Receipts of the send message operation. /// A new instance for mocking. @@ -268,5 +168,155 @@ public static WhatsAppMessageTemplateItem WhatsAppMessageTemplateItem(string nam serializedAdditionalRawData: null, content); } + + /// Initializes a new instance of . + /// The conversation ID. + /// The conversation topic. + /// List of delivery channel IDs. + /// Outbound delivery strategy for the conversation. + /// + /// List of participants involved in the conversation. + /// 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 Conversation Conversation(string id = null, string topic = null, IEnumerable deliveryChannelIds = null, OutboundDeliveryStrategyKind? outboundDeliveryStrategy = null, IEnumerable participants = null) + { + deliveryChannelIds ??= new List(); + participants ??= new List(); + + return new Conversation( + id, + topic, + deliveryChannelIds?.ToList(), + outboundDeliveryStrategy, + participants?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Participant Identifier. + /// Participant display name. + /// The type discriminator describing a participant type. + /// A new instance for mocking. + public static Participant Participant(string id = null, string displayName = null, string kind = null) + { + return new UnknownParticipant(id, displayName, kind == null ? default : new ParticipantKind(kind), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Participant Identifier. + /// Participant display name. + /// + /// The internal platform identifiers for the participant. + /// 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 InternalParticipant InternalParticipant(string id = null, string displayName = null, ConversationContact contact = null) + { + return new InternalParticipant(id, displayName, ParticipantKind.Internal, serializedAdditionalRawData: null, contact); + } + + /// Initializes a new instance of . + /// Participant Identifier. + /// Participant display name. + /// + /// List of external platform identifiers for the participant. + /// 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 ExternalParticipant ExternalParticipant(string id = null, string displayName = null, IEnumerable contacts = null) + { + contacts ??= new List(); + + return new ExternalParticipant(id, displayName, ParticipantKind.External, serializedAdditionalRawData: null, contacts?.ToList()); + } + + /// Initializes a new instance of . + /// Message ID. + /// Message sequence ID. + /// + /// Payload of a threaded conversation 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 . + /// + /// The display name of the message sender. + /// The communication identifier of the message sender. + /// Timestamp when the message is sent. + /// A new instance for mocking. + public static ConversationMessageItem ConversationMessageItem(string id = null, long? sequenceId = null, ConversationMessageContent message = null, string senderDisplayName = null, string senderCommunicationIdentifier = null, DateTimeOffset createdOn = default) + { + return new ConversationMessageItem( + id, + sequenceId, + message, + senderDisplayName, + senderCommunicationIdentifier, + createdOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// List of Ids with Errors if failed to be added. + /// A new instance for mocking. + public static AddParticipantsResult AddParticipantsResult(IEnumerable invalidParticipants = null) + { + invalidParticipants ??= new List(); + + return new AddParticipantsResult(invalidParticipants?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Participant User Id. + /// Error of the participant operation. + /// A new instance for mocking. + public static ParticipantsResult ParticipantsResult(string id = null, ResponseError error = null) + { + return new ParticipantsResult(id, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// List of Ids with Errors if failed to be added. + /// A new instance for mocking. + public static RemoveParticipantsResult RemoveParticipantsResult(IEnumerable invalidParticipants = null) + { + invalidParticipants ??= new List(); + + return new RemoveParticipantsResult(invalidParticipants?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The AI summary of the conversation messages. + /// A new instance for mocking. + public static GetConversationMessagesAnalysisResult GetConversationMessagesAnalysisResult(string summary = null) + { + return new GetConversationMessagesAnalysisResult(summary, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Details of a send conversation message request. + /// 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 options of the outbound delivery strategy for messages sent by emplyees in a conversation. + /// Supports internalOnly, allChannels. + /// + /// A new instance for mocking. + public static SendConversationMessageRequest SendConversationMessageRequest(ConversationMessageContent request = null, OutboundDeliveryStrategyKind? outboundDeliveryStrategy = null) + { + return new SendConversationMessageRequest(request, outboundDeliveryStrategy, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A server-generated Advanced Messaging conversation message id. + /// A new instance for mocking. + public static SendConversationMessageResult SendConversationMessageResult(string messageId = null) + { + return new SendConversationMessageResult(messageId, serializedAdditionalRawData: null); + } } } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Conversation.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Conversation.Serialization.cs new file mode 100644 index 000000000000..a93a810918ca --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Conversation.Serialization.cs @@ -0,0 +1,227 @@ +// 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 Conversation : 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(Conversation)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Topic)) + { + writer.WritePropertyName("topic"u8); + writer.WriteStringValue(Topic); + } + if (Optional.IsCollectionDefined(DeliveryChannelIds)) + { + writer.WritePropertyName("deliveryChannelIds"u8); + writer.WriteStartArray(); + foreach (var item in DeliveryChannelIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(OutboundDeliveryStrategy)) + { + writer.WritePropertyName("outboundDeliveryStrategy"u8); + writer.WriteStringValue(OutboundDeliveryStrategy.Value.ToString()); + } + if (Optional.IsCollectionDefined(Participants)) + { + writer.WritePropertyName("participants"u8); + writer.WriteStartArray(); + foreach (var item in Participants) + { + 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 + } + } + } + + Conversation 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(Conversation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversation(document.RootElement, options); + } + + internal static Conversation DeserializeConversation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string topic = default; + IList deliveryChannelIds = default; + OutboundDeliveryStrategyKind? outboundDeliveryStrategy = default; + IList participants = 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("topic"u8)) + { + topic = property.Value.GetString(); + continue; + } + if (property.NameEquals("deliveryChannelIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + deliveryChannelIds = array; + continue; + } + if (property.NameEquals("outboundDeliveryStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outboundDeliveryStrategy = new OutboundDeliveryStrategyKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("participants"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Participant.DeserializeParticipant(item, options)); + } + participants = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Conversation( + id, + topic, + deliveryChannelIds ?? new ChangeTrackingList(), + outboundDeliveryStrategy, + participants ?? new ChangeTrackingList(), + 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(Conversation)} does not support writing '{options.Format}' format."); + } + } + + Conversation 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 DeserializeConversation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Conversation)} 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 Conversation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversation(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/Conversation.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Conversation.cs new file mode 100644 index 000000000000..ec2054f51d6f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Conversation.cs @@ -0,0 +1,91 @@ +// 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 conversation. + public partial class Conversation + { + /// + /// 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 . + public Conversation() + { + DeliveryChannelIds = new ChangeTrackingList(); + Participants = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The conversation ID. + /// The conversation topic. + /// List of delivery channel IDs. + /// Outbound delivery strategy for the conversation. + /// + /// List of participants involved in the conversation. + /// 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 Conversation(string id, string topic, IList deliveryChannelIds, OutboundDeliveryStrategyKind? outboundDeliveryStrategy, IList participants, IDictionary serializedAdditionalRawData) + { + Id = id; + Topic = topic; + DeliveryChannelIds = deliveryChannelIds; + OutboundDeliveryStrategy = outboundDeliveryStrategy; + Participants = participants; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The conversation ID. + public string Id { get; } + /// The conversation topic. + public string Topic { get; set; } + /// List of delivery channel IDs. + public IList DeliveryChannelIds { get; } + /// Outbound delivery strategy for the conversation. + public OutboundDeliveryStrategyKind? OutboundDeliveryStrategy { get; set; } + /// + /// List of participants involved in the conversation. + /// 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 IList Participants { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationContact.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationContact.Serialization.cs new file mode 100644 index 000000000000..b7576641cafe --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationContact.Serialization.cs @@ -0,0 +1,137 @@ +// 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(UnknownConversationContact))] + public partial class ConversationContact : 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(ConversationContact)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + 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 + } + } + } + + ConversationContact 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(ConversationContact)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationContact(document.RootElement, options); + } + + internal static ConversationContact DeserializeConversationContact(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 "bot": return BotContact.DeserializeBotContact(element, options); + case "communication": return CommunicationContact.DeserializeCommunicationContact(element, options); + case "whatsApp": return WhatsAppContact.DeserializeWhatsAppContact(element, options); + } + } + return UnknownConversationContact.DeserializeUnknownConversationContact(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(ConversationContact)} does not support writing '{options.Format}' format."); + } + } + + ConversationContact 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 DeserializeConversationContact(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationContact)} 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 ConversationContact FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationContact(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/ConversationContact.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationContact.cs new file mode 100644 index 000000000000..81d3958af8a9 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationContact.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; + +namespace Azure.Communication.Messages +{ + /// + /// Details of an external platform contact. + /// 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 ConversationContact + { + /// + /// 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 . + /// External platform identifier. + /// is null. + protected ConversationContact(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + } + + /// Initializes a new instance of . + /// External platform identifier. + /// Type of message platform (e.g., WhatsApp). + /// Keeps track of any properties unknown to the library. + internal ConversationContact(string id, MessagePlatformKind kind, IDictionary serializedAdditionalRawData) + { + Id = id; + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationContact() + { + } + + /// External platform identifier. + public string Id { get; set; } + /// Type of message platform (e.g., WhatsApp). + internal MessagePlatformKind Kind { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationManagementClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationManagementClient.cs new file mode 100644 index 000000000000..4a3e90cff2a8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationManagementClient.cs @@ -0,0 +1,1193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + // Data plane generated client. + /// The ConversationManagement service client. + public partial class ConversationManagementClient + { + private const string AuthorizationHeader = "Authorization"; + private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "Bearer"; + private static readonly string[] AuthorizationScopes = new string[] { "https://communication.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ConversationManagementClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ConversationManagementClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of ConversationManagementClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ConversationManagementClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of ConversationManagementClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ConversationManagementClient(Uri endpoint, TokenCredential credential, CommunicationMessagesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new CommunicationMessagesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Creates a new conversation. This is only for create operation. + /// The conversation details. + /// An intial message within the conversation. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> CreateConversationAsync(Conversation conversation, ConversationMessage initialMessage = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(conversation, nameof(conversation)); + + CreateConversationRequest createConversationRequest = new CreateConversationRequest(conversation, initialMessage, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateConversationAsync(createConversationRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(Conversation.FromResponse(response), response); + } + + /// Creates a new conversation. This is only for create operation. + /// The conversation details. + /// An intial message within the conversation. + /// The cancellation token to use. + /// is null. + /// + public virtual Response CreateConversation(Conversation conversation, ConversationMessage initialMessage = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(conversation, nameof(conversation)); + + CreateConversationRequest createConversationRequest = new CreateConversationRequest(conversation, initialMessage, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateConversation(createConversationRequest.ToRequestContent(), context); + return Response.FromValue(Conversation.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates a new conversation. This is only for create operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateConversationAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.CreateConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateConversationRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new conversation. This is only for create operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateConversation(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.CreateConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateConversationRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a specific conversation. + /// The conversation ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetConversationAsync(string conversationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetConversationAsync(conversationId, context).ConfigureAwait(false); + return Response.FromValue(Conversation.FromResponse(response), response); + } + + /// Gets the details of a specific conversation. + /// The conversation ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetConversation(string conversationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetConversation(conversationId, context); + return Response.FromValue(Conversation.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetConversationAsync(string conversationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.GetConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateGetConversationRequest(conversationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetConversation(string conversationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.GetConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateGetConversationRequest(conversationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteConversationAsync(string conversationId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.DeleteConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteConversationRequest(conversationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteConversation(string conversationId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.DeleteConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteConversationRequest(conversationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Terminates a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task TerminateConversationAsync(string conversationId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.TerminateConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateTerminateConversationRequest(conversationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Terminates a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response TerminateConversation(string conversationId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.TerminateConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateTerminateConversationRequest(conversationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Adds participants to a specific conversation. + /// The conversation ID. + /// Details of the payload for adding participants to a conversation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> AddParticipantsAsync(string conversationId, AddParticipantsRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AddParticipantsAsync(conversationId, content, context).ConfigureAwait(false); + return Response.FromValue(AddParticipantsResult.FromResponse(response), response); + } + + /// Adds participants to a specific conversation. + /// The conversation ID. + /// Details of the payload for adding participants to a conversation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response AddParticipants(string conversationId, AddParticipantsRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AddParticipants(conversationId, content, context); + return Response.FromValue(AddParticipantsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Adds participants to a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddParticipantsAsync(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.AddParticipants"); + scope.Start(); + try + { + using HttpMessage message = CreateAddParticipantsRequest(conversationId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds participants to a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response AddParticipants(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.AddParticipants"); + scope.Start(); + try + { + using HttpMessage message = CreateAddParticipantsRequest(conversationId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// remove a participant from a conversation. + /// The conversation ID. + /// Details of the request body for removing participants from a conversation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> RemoveParticipantsAsync(string conversationId, RemoveParticipantsRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await RemoveParticipantsAsync(conversationId, content, context).ConfigureAwait(false); + return Response.FromValue(RemoveParticipantsResult.FromResponse(response), response); + } + + /// remove a participant from a conversation. + /// The conversation ID. + /// Details of the request body for removing participants from a conversation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response RemoveParticipants(string conversationId, RemoveParticipantsRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = RemoveParticipants(conversationId, content, context); + return Response.FromValue(RemoveParticipantsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] remove a participant from a conversation + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RemoveParticipantsAsync(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.RemoveParticipants"); + scope.Start(); + try + { + using HttpMessage message = CreateRemoveParticipantsRequest(conversationId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] remove a participant from a conversation + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response RemoveParticipants(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.RemoveParticipants"); + scope.Start(); + try + { + using HttpMessage message = CreateRemoveParticipantsRequest(conversationId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get AI Analysis of a conversation. + /// The conversation ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> AnalyzeConversationAsync(string conversationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AnalyzeConversationAsync(conversationId, context).ConfigureAwait(false); + return Response.FromValue(GetConversationMessagesAnalysisResult.FromResponse(response), response); + } + + /// Get AI Analysis of a conversation. + /// The conversation ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response AnalyzeConversation(string conversationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AnalyzeConversation(conversationId, context); + return Response.FromValue(GetConversationMessagesAnalysisResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get AI Analysis of a conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AnalyzeConversationAsync(string conversationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.AnalyzeConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateAnalyzeConversationRequest(conversationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get AI Analysis of a conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response AnalyzeConversation(string conversationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationManagementClient.AnalyzeConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateAnalyzeConversationRequest(conversationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves list of conversations. + /// Number of objects to return per page. + /// The participant user ID. + /// The id of channel. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetConversationsAsync(int? maxpagesize = null, string participantId = null, Guid? channelId = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConversationsRequest(pageSizeHint, participantId, channelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConversationsNextPageRequest(nextLink, pageSizeHint, participantId, channelId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Conversation.DeserializeConversation(e), ClientDiagnostics, _pipeline, "ConversationManagementClient.GetConversations", "value", "nextLink", maxpagesize, context); + } + + /// Retrieves list of conversations. + /// Number of objects to return per page. + /// The participant user ID. + /// The id of channel. + /// The cancellation token to use. + /// + public virtual Pageable GetConversations(int? maxpagesize = null, string participantId = null, Guid? channelId = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConversationsRequest(pageSizeHint, participantId, channelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConversationsNextPageRequest(nextLink, pageSizeHint, participantId, channelId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Conversation.DeserializeConversation(e), ClientDiagnostics, _pipeline, "ConversationManagementClient.GetConversations", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieves list of conversations. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Number of objects to return per page. + /// The participant user ID. + /// The id of channel. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetConversationsAsync(int? maxpagesize, string participantId, Guid? channelId, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConversationsRequest(pageSizeHint, participantId, channelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConversationsNextPageRequest(nextLink, pageSizeHint, participantId, channelId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationManagementClient.GetConversations", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieves list of conversations. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Number of objects to return per page. + /// The participant user ID. + /// The id of channel. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetConversations(int? maxpagesize, string participantId, Guid? channelId, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConversationsRequest(pageSizeHint, participantId, channelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConversationsNextPageRequest(nextLink, pageSizeHint, participantId, channelId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationManagementClient.GetConversations", "value", "nextLink", maxpagesize, context); + } + + /// Retrieves list of conversation messages. + /// The conversation ID. + /// Number of objects to return per page. + /// The participant user ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize = null, string participantId = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMessagesRequest(conversationId, pageSizeHint, participantId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMessagesNextPageRequest(nextLink, conversationId, pageSizeHint, participantId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ConversationMessageItem.DeserializeConversationMessageItem(e), ClientDiagnostics, _pipeline, "ConversationManagementClient.GetMessages", "value", "nextLink", maxpagesize, context); + } + + /// Retrieves list of conversation messages. + /// The conversation ID. + /// Number of objects to return per page. + /// The participant user ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetMessages(string conversationId, int? maxpagesize = null, string participantId = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMessagesRequest(conversationId, pageSizeHint, participantId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMessagesNextPageRequest(nextLink, conversationId, pageSizeHint, participantId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ConversationMessageItem.DeserializeConversationMessageItem(e), ClientDiagnostics, _pipeline, "ConversationManagementClient.GetMessages", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieves list of conversation messages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// Number of objects to return per page. + /// The participant user ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize, string participantId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMessagesRequest(conversationId, pageSizeHint, participantId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMessagesNextPageRequest(nextLink, conversationId, pageSizeHint, participantId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationManagementClient.GetMessages", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieves list of conversation messages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// Number of objects to return per page. + /// The participant user ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetMessages(string conversationId, int? maxpagesize, string participantId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMessagesRequest(conversationId, pageSizeHint, participantId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMessagesNextPageRequest(nextLink, conversationId, pageSizeHint, participantId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationManagementClient.GetMessages", "value", "nextLink", maxpagesize, context); + } + + internal HttpMessage CreateCreateConversationRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetConversationRequest(string conversationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteConversationRequest(string conversationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + return message; + } + + internal HttpMessage CreateTerminateConversationRequest(string conversationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath(":terminate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + return message; + } + + internal HttpMessage CreateGetConversationsRequest(int? maxpagesize, string participantId, Guid? channelId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (participantId != null) + { + uri.AppendQuery("participantId", participantId, true); + } + if (channelId != null) + { + uri.AppendQuery("channelId", channelId.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetMessagesRequest(string conversationId, int? maxpagesize, string participantId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath("/messages", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (participantId != null) + { + uri.AppendQuery("participantId", participantId, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAddParticipantsRequest(string conversationId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier207); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath("/participants:add", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateRemoveParticipantsRequest(string conversationId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier207); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath("/participants:remove", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateAnalyzeConversationRequest(string conversationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath(":analyze", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + return message; + } + + internal HttpMessage CreateGetConversationsNextPageRequest(string nextLink, int? maxpagesize, string participantId, Guid? channelId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetMessagesNextPageRequest(string nextLink, string conversationId, int? maxpagesize, string participantId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + private static ResponseClassifier _responseClassifier207; + private static ResponseClassifier ResponseClassifier207 => _responseClassifier207 ??= new StatusCodeClassifier(stackalloc ushort[] { 207 }); + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessage.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessage.Serialization.cs new file mode 100644 index 000000000000..1476f3e3bb7f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessage.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 ConversationMessage : 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(ConversationMessage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + 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 + } + } + } + + ConversationMessage 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(ConversationMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationMessage(document.RootElement, options); + } + + internal static ConversationMessage DeserializeConversationMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string content = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConversationMessage(content, 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(ConversationMessage)} does not support writing '{options.Format}' format."); + } + } + + ConversationMessage 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 DeserializeConversationMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationMessage)} 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 ConversationMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationMessage(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/ConversationMessage.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessage.cs new file mode 100644 index 000000000000..a1303fc67bbb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessage.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Details of a message. + public partial class ConversationMessage + { + /// + /// 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 . + /// Content of the message. + /// is null. + public ConversationMessage(string content) + { + Argument.AssertNotNull(content, nameof(content)); + + Content = content; + } + + /// Initializes a new instance of . + /// Content of the message. + /// Keeps track of any properties unknown to the library. + internal ConversationMessage(string content, IDictionary serializedAdditionalRawData) + { + Content = content; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationMessage() + { + } + + /// Content of the message. + public string Content { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageContent.Serialization.cs new file mode 100644 index 000000000000..07b243e28d04 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageContent.Serialization.cs @@ -0,0 +1,138 @@ +// 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(UnknownConversationMessageContent))] + public partial class ConversationMessageContent : 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(ConversationMessageContent)} 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 + } + } + } + + ConversationMessageContent 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(ConversationMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationMessageContent(document.RootElement, options); + } + + internal static ConversationMessageContent DeserializeConversationMessageContent(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 "audio": return AudioConversationMessageContent.DeserializeAudioConversationMessageContent(element, options); + case "document": return DocumentConversationMessageContent.DeserializeDocumentConversationMessageContent(element, options); + case "image": return ImageConversationMessageContent.DeserializeImageConversationMessageContent(element, options); + case "template": return TemplateConversationMessageContent.DeserializeTemplateConversationMessageContent(element, options); + case "text": return TextConversationMessageContent.DeserializeTextConversationMessageContent(element, options); + case "video": return VideoConversationMessageContent.DeserializeVideoConversationMessageContent(element, options); + } + } + return UnknownConversationMessageContent.DeserializeUnknownConversationMessageContent(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(ConversationMessageContent)} does not support writing '{options.Format}' format."); + } + } + + ConversationMessageContent 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 DeserializeConversationMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationMessageContent)} 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 ConversationMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationMessageContent(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/ConversationMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageContent.cs new file mode 100644 index 000000000000..8f1d32828735 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageContent.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 +{ + /// + /// Details of the conversation message content. + /// 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 ConversationMessageContent + { + /// + /// 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 ConversationMessageContent() + { + } + + /// Initializes a new instance of . + /// The type discriminator describing a message type. + /// Keeps track of any properties unknown to the library. + internal ConversationMessageContent(CommunicationMessageKind kind, IDictionary serializedAdditionalRawData) + { + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type discriminator describing a message type. + internal CommunicationMessageKind Kind { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageItem.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageItem.Serialization.cs new file mode 100644 index 000000000000..22b672c4d0dc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageItem.Serialization.cs @@ -0,0 +1,202 @@ +// 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 ConversationMessageItem : 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(ConversationMessageItem)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(SequenceId)) + { + writer.WritePropertyName("sequenceId"u8); + writer.WriteNumberValue(SequenceId.Value); + } + writer.WritePropertyName("message"u8); + writer.WriteObjectValue(Message, options); + if (Optional.IsDefined(SenderDisplayName)) + { + writer.WritePropertyName("senderDisplayName"u8); + writer.WriteStringValue(SenderDisplayName); + } + writer.WritePropertyName("senderCommunicationIdentifier"u8); + writer.WriteStringValue(SenderCommunicationIdentifier); + writer.WritePropertyName("createdOn"u8); + writer.WriteStringValue(CreatedOn, "O"); + 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 + } + } + } + + ConversationMessageItem 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(ConversationMessageItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationMessageItem(document.RootElement, options); + } + + internal static ConversationMessageItem DeserializeConversationMessageItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + long? sequenceId = default; + ConversationMessageContent message = default; + string senderDisplayName = default; + string senderCommunicationIdentifier = default; + DateTimeOffset createdOn = 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("sequenceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sequenceId = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = ConversationMessageContent.DeserializeConversationMessageContent(property.Value, options); + continue; + } + if (property.NameEquals("senderDisplayName"u8)) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier"u8)) + { + senderCommunicationIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdOn"u8)) + { + createdOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConversationMessageItem( + id, + sequenceId, + message, + senderDisplayName, + senderCommunicationIdentifier, + createdOn, + 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(ConversationMessageItem)} does not support writing '{options.Format}' format."); + } + } + + ConversationMessageItem 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 DeserializeConversationMessageItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationMessageItem)} 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 ConversationMessageItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationMessageItem(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/ConversationMessageItem.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageItem.cs new file mode 100644 index 000000000000..0a263823bc3e --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessageItem.cs @@ -0,0 +1,112 @@ +// 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 conversation message as returned from the service. + public partial class ConversationMessageItem + { + /// + /// 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 . + /// + /// Payload of a threaded conversation 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 . + /// + /// The communication identifier of the message sender. + /// Timestamp when the message is sent. + /// or is null. + internal ConversationMessageItem(ConversationMessageContent message, string senderCommunicationIdentifier, DateTimeOffset createdOn) + { + Argument.AssertNotNull(message, nameof(message)); + Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); + + Message = message; + SenderCommunicationIdentifier = senderCommunicationIdentifier; + CreatedOn = createdOn; + } + + /// Initializes a new instance of . + /// Message ID. + /// Message sequence ID. + /// + /// Payload of a threaded conversation 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 . + /// + /// The display name of the message sender. + /// The communication identifier of the message sender. + /// Timestamp when the message is sent. + /// Keeps track of any properties unknown to the library. + internal ConversationMessageItem(string id, long? sequenceId, ConversationMessageContent message, string senderDisplayName, string senderCommunicationIdentifier, DateTimeOffset createdOn, IDictionary serializedAdditionalRawData) + { + Id = id; + SequenceId = sequenceId; + Message = message; + SenderDisplayName = senderDisplayName; + SenderCommunicationIdentifier = senderCommunicationIdentifier; + CreatedOn = createdOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationMessageItem() + { + } + + /// Message ID. + public string Id { get; } + /// Message sequence ID. + public long? SequenceId { get; } + /// + /// Payload of a threaded conversation 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 ConversationMessageContent Message { get; } + /// The display name of the message sender. + public string SenderDisplayName { get; } + /// The communication identifier of the message sender. + public string SenderCommunicationIdentifier { get; } + /// Timestamp when the message is sent. + public DateTimeOffset CreatedOn { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessagesClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessagesClient.cs new file mode 100644 index 000000000000..e14f6ac981f5 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ConversationMessagesClient.cs @@ -0,0 +1,898 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + // Data plane generated client. + /// The ConversationMessages service client. + public partial class ConversationMessagesClient + { + private const string AuthorizationHeader = "Authorization"; + private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "Bearer"; + private static readonly string[] AuthorizationScopes = new string[] { "https://communication.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ConversationMessagesClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ConversationMessagesClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of ConversationMessagesClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ConversationMessagesClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of ConversationMessagesClient. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ConversationMessagesClient(Uri endpoint, TokenCredential credential, CommunicationMessagesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new CommunicationMessagesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Adds participants to a specific conversation. + /// The conversation ID. + /// Details of the payload for adding participants to a conversation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> AddParticipantsAsync(string conversationId, AddParticipantsRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AddParticipantsAsync(conversationId, content, context).ConfigureAwait(false); + return Response.FromValue(AddParticipantsResult.FromResponse(response), response); + } + + /// Adds participants to a specific conversation. + /// The conversation ID. + /// Details of the payload for adding participants to a conversation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response AddParticipants(string conversationId, AddParticipantsRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AddParticipants(conversationId, content, context); + return Response.FromValue(AddParticipantsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Adds participants to a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AddParticipantsAsync(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationMessagesClient.AddParticipants"); + scope.Start(); + try + { + using HttpMessage message = CreateAddParticipantsRequest(conversationId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds participants to a specific conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response AddParticipants(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationMessagesClient.AddParticipants"); + scope.Start(); + try + { + using HttpMessage message = CreateAddParticipantsRequest(conversationId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// remove a participant from a conversation. + /// The conversation ID. + /// Details of the request body for removing participants from a conversation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> RemoveParticipantsAsync(string conversationId, RemoveParticipantsRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await RemoveParticipantsAsync(conversationId, content, context).ConfigureAwait(false); + return Response.FromValue(RemoveParticipantsResult.FromResponse(response), response); + } + + /// remove a participant from a conversation. + /// The conversation ID. + /// Details of the request body for removing participants from a conversation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response RemoveParticipants(string conversationId, RemoveParticipantsRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = RemoveParticipants(conversationId, content, context); + return Response.FromValue(RemoveParticipantsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] remove a participant from a conversation + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RemoveParticipantsAsync(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationMessagesClient.RemoveParticipants"); + scope.Start(); + try + { + using HttpMessage message = CreateRemoveParticipantsRequest(conversationId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] remove a participant from a conversation + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response RemoveParticipants(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationMessagesClient.RemoveParticipants"); + scope.Start(); + try + { + using HttpMessage message = CreateRemoveParticipantsRequest(conversationId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Sends a conversation message from Business to User. + /// The conversation ID. + /// Details of the conversation message to send. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> SendMessageAsync(string conversationId, SendConversationMessageRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SendMessageAsync(conversationId, content, context).ConfigureAwait(false); + return Response.FromValue(SendConversationMessageResult.FromResponse(response), response); + } + + /// Sends a conversation message from Business to User. + /// The conversation ID. + /// Details of the conversation message to send. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response SendMessage(string conversationId, SendConversationMessageRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = SendMessage(conversationId, content, context); + return Response.FromValue(SendConversationMessageResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Sends a conversation message from Business to User. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task SendMessageAsync(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationMessagesClient.SendMessage"); + scope.Start(); + try + { + using HttpMessage message = CreateSendMessageRequest(conversationId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Sends a conversation message from Business to User. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response SendMessage(string conversationId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationMessagesClient.SendMessage"); + scope.Start(); + try + { + using HttpMessage message = CreateSendMessageRequest(conversationId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get AI Analysis of a conversation. + /// The conversation ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> AnalyzeConversationAsync(string conversationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AnalyzeConversationAsync(conversationId, context).ConfigureAwait(false); + return Response.FromValue(GetConversationMessagesAnalysisResult.FromResponse(response), response); + } + + /// Get AI Analysis of a conversation. + /// The conversation ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response AnalyzeConversation(string conversationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AnalyzeConversation(conversationId, context); + return Response.FromValue(GetConversationMessagesAnalysisResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get AI Analysis of a conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task AnalyzeConversationAsync(string conversationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationMessagesClient.AnalyzeConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateAnalyzeConversationRequest(conversationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get AI Analysis of a conversation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response AnalyzeConversation(string conversationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationMessagesClient.AnalyzeConversation"); + scope.Start(); + try + { + using HttpMessage message = CreateAnalyzeConversationRequest(conversationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves list of conversations. + /// Number of objects to return per page. + /// The participant user ID. + /// The id of channel. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetConversationsAsync(int? maxpagesize = null, string participantId = null, Guid? channelId = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConversationsRequest(pageSizeHint, participantId, channelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConversationsNextPageRequest(nextLink, pageSizeHint, participantId, channelId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Conversation.DeserializeConversation(e), ClientDiagnostics, _pipeline, "ConversationMessagesClient.GetConversations", "value", "nextLink", maxpagesize, context); + } + + /// Retrieves list of conversations. + /// Number of objects to return per page. + /// The participant user ID. + /// The id of channel. + /// The cancellation token to use. + /// + public virtual Pageable GetConversations(int? maxpagesize = null, string participantId = null, Guid? channelId = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConversationsRequest(pageSizeHint, participantId, channelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConversationsNextPageRequest(nextLink, pageSizeHint, participantId, channelId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Conversation.DeserializeConversation(e), ClientDiagnostics, _pipeline, "ConversationMessagesClient.GetConversations", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieves list of conversations. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Number of objects to return per page. + /// The participant user ID. + /// The id of channel. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetConversationsAsync(int? maxpagesize, string participantId, Guid? channelId, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConversationsRequest(pageSizeHint, participantId, channelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConversationsNextPageRequest(nextLink, pageSizeHint, participantId, channelId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationMessagesClient.GetConversations", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieves list of conversations. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Number of objects to return per page. + /// The participant user ID. + /// The id of channel. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetConversations(int? maxpagesize, string participantId, Guid? channelId, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConversationsRequest(pageSizeHint, participantId, channelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConversationsNextPageRequest(nextLink, pageSizeHint, participantId, channelId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationMessagesClient.GetConversations", "value", "nextLink", maxpagesize, context); + } + + /// Retrieves list of conversation messages. + /// The conversation ID. + /// Number of objects to return per page. + /// The participant user ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize = null, string participantId = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMessagesRequest(conversationId, pageSizeHint, participantId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMessagesNextPageRequest(nextLink, conversationId, pageSizeHint, participantId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ConversationMessageItem.DeserializeConversationMessageItem(e), ClientDiagnostics, _pipeline, "ConversationMessagesClient.GetMessages", "value", "nextLink", maxpagesize, context); + } + + /// Retrieves list of conversation messages. + /// The conversation ID. + /// Number of objects to return per page. + /// The participant user ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetMessages(string conversationId, int? maxpagesize = null, string participantId = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMessagesRequest(conversationId, pageSizeHint, participantId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMessagesNextPageRequest(nextLink, conversationId, pageSizeHint, participantId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ConversationMessageItem.DeserializeConversationMessageItem(e), ClientDiagnostics, _pipeline, "ConversationMessagesClient.GetMessages", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieves list of conversation messages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// Number of objects to return per page. + /// The participant user ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetMessagesAsync(string conversationId, int? maxpagesize, string participantId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMessagesRequest(conversationId, pageSizeHint, participantId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMessagesNextPageRequest(nextLink, conversationId, pageSizeHint, participantId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationMessagesClient.GetMessages", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieves list of conversation messages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The conversation ID. + /// Number of objects to return per page. + /// The participant user ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetMessages(string conversationId, int? maxpagesize, string participantId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(conversationId, nameof(conversationId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMessagesRequest(conversationId, pageSizeHint, participantId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMessagesNextPageRequest(nextLink, conversationId, pageSizeHint, participantId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationMessagesClient.GetMessages", "value", "nextLink", maxpagesize, context); + } + + internal HttpMessage CreateAddParticipantsRequest(string conversationId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier207); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath("/participants:add", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateRemoveParticipantsRequest(string conversationId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier207); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath("/participants:remove", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetConversationsRequest(int? maxpagesize, string participantId, Guid? channelId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (participantId != null) + { + uri.AppendQuery("participantId", participantId, true); + } + if (channelId != null) + { + uri.AppendQuery("channelId", channelId.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetMessagesRequest(string conversationId, int? maxpagesize, string participantId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath("/messages", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (participantId != null) + { + uri.AppendQuery("participantId", participantId, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateSendMessageRequest(string conversationId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath("/messages:send", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateAnalyzeConversationRequest(string conversationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/messages/conversations/", false); + uri.AppendPath(conversationId, true); + uri.AppendPath(":analyze", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + return message; + } + + internal HttpMessage CreateGetConversationsNextPageRequest(string nextLink, int? maxpagesize, string participantId, Guid? channelId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetMessagesNextPageRequest(string nextLink, string conversationId, int? maxpagesize, string participantId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier207; + private static ResponseClassifier ResponseClassifier207 => _responseClassifier207 ??= new StatusCodeClassifier(stackalloc ushort[] { 207 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CreateConversationRequest.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CreateConversationRequest.Serialization.cs new file mode 100644 index 000000000000..7f4dbbde7969 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CreateConversationRequest.Serialization.cs @@ -0,0 +1,157 @@ +// 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 CreateConversationRequest : 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(CreateConversationRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("conversation"u8); + writer.WriteObjectValue(Conversation, options); + if (Optional.IsDefined(InitialMessage)) + { + writer.WritePropertyName("initialMessage"u8); + writer.WriteObjectValue(InitialMessage, 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 + } + } + } + + CreateConversationRequest 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(CreateConversationRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateConversationRequest(document.RootElement, options); + } + + internal static CreateConversationRequest DeserializeCreateConversationRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Conversation conversation = default; + ConversationMessage initialMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("conversation"u8)) + { + conversation = Conversation.DeserializeConversation(property.Value, options); + continue; + } + if (property.NameEquals("initialMessage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialMessage = ConversationMessage.DeserializeConversationMessage(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateConversationRequest(conversation, initialMessage, 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(CreateConversationRequest)} does not support writing '{options.Format}' format."); + } + } + + CreateConversationRequest 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 DeserializeCreateConversationRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateConversationRequest)} 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 CreateConversationRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateConversationRequest(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/CreateConversationRequest.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CreateConversationRequest.cs new file mode 100644 index 000000000000..c101f239f16b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CreateConversationRequest.cs @@ -0,0 +1,79 @@ +// 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 CreateConversationRequest. + internal partial class CreateConversationRequest + { + /// + /// 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 . + /// The conversation details. + /// is null. + internal CreateConversationRequest(Conversation conversation) + { + Argument.AssertNotNull(conversation, nameof(conversation)); + + Conversation = conversation; + } + + /// Initializes a new instance of . + /// The conversation details. + /// An intial message within the conversation. + /// Keeps track of any properties unknown to the library. + internal CreateConversationRequest(Conversation conversation, ConversationMessage initialMessage, IDictionary serializedAdditionalRawData) + { + Conversation = conversation; + InitialMessage = initialMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateConversationRequest() + { + } + + /// The conversation details. + public Conversation Conversation { get; } + /// An intial message within the conversation. + public ConversationMessage InitialMessage { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Docs/ConversationManagementClient.xml b/sdk/communication/Azure.Communication.Messages/src/Generated/Docs/ConversationManagementClient.xml new file mode 100644 index 000000000000..711aaf2de76a --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Docs/ConversationManagementClient.xml @@ -0,0 +1,883 @@ + + + + + +This sample shows how to call CreateConversationAsync. + response = await client.CreateConversationAsync(conversation); +]]> +This sample shows how to call CreateConversationAsync with all parameters. +", + DeliveryChannelIds = { "" }, + OutboundDeliveryStrategy = OutboundDeliveryStrategyKind.InternalOnly, + Participants = {new InternalParticipant(new CommunicationContact("")) + { + DisplayName = "", + }}, +}; +ConversationMessage initialMessage = new ConversationMessage(""); +Response response = await client.CreateConversationAsync(conversation, initialMessage: initialMessage); +]]> + + + +This sample shows how to call CreateConversation. + response = client.CreateConversation(conversation); +]]> +This sample shows how to call CreateConversation with all parameters. +", + DeliveryChannelIds = { "" }, + OutboundDeliveryStrategy = OutboundDeliveryStrategyKind.InternalOnly, + Participants = {new InternalParticipant(new CommunicationContact("")) + { + DisplayName = "", + }}, +}; +ConversationMessage initialMessage = new ConversationMessage(""); +Response response = client.CreateConversation(conversation, initialMessage: initialMessage); +]]> + + + +This sample shows how to call CreateConversationAsync and parse the result. + +This sample shows how to call CreateConversationAsync with all request content and parse the result. +", + deliveryChannelIds = new object[] + { + "" + }, + outboundDeliveryStrategy = "internalOnly", + participants = new object[] + { + new + { + kind = "internal", + contact = new + { + kind = "communication", + id = "", + }, + displayName = "", + } + }, + }, + initialMessage = new + { + content = "", + }, +}); +Response response = await client.CreateConversationAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("topic").ToString()); +Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); +Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); +]]> + + + +This sample shows how to call CreateConversation and parse the result. + +This sample shows how to call CreateConversation with all request content and parse the result. +", + deliveryChannelIds = new object[] + { + "" + }, + outboundDeliveryStrategy = "internalOnly", + participants = new object[] + { + new + { + kind = "internal", + contact = new + { + kind = "communication", + id = "", + }, + displayName = "", + } + }, + }, + initialMessage = new + { + content = "", + }, +}); +Response response = client.CreateConversation(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("topic").ToString()); +Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); +Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); +]]> + + + +This sample shows how to call GetConversationAsync. + response = await client.GetConversationAsync(""); +]]> +This sample shows how to call GetConversationAsync with all parameters. + response = await client.GetConversationAsync(""); +]]> + + + +This sample shows how to call GetConversation. + response = client.GetConversation(""); +]]> +This sample shows how to call GetConversation with all parameters. + response = client.GetConversation(""); +]]> + + + +This sample shows how to call GetConversationAsync and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call GetConversationAsync with all parameters and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("topic").ToString()); +Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); +Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); +]]> + + + +This sample shows how to call GetConversation and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call GetConversation with all parameters and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("topic").ToString()); +Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); +Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); +]]> + + + +This sample shows how to call DeleteConversationAsync. +"); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteConversationAsync with all parameters. +"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteConversation. +"); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteConversation with all parameters. +"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call TerminateConversationAsync. +"); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call TerminateConversationAsync with all parameters. +"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call TerminateConversation. +"); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call TerminateConversation with all parameters. +"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call AddParticipantsAsync. +")) +}); +Response response = await client.AddParticipantsAsync("", body); +]]> +This sample shows how to call AddParticipantsAsync with all parameters. +")) + { + DisplayName = "", + } +}); +Response response = await client.AddParticipantsAsync("", body); +]]> + + + +This sample shows how to call AddParticipants. +")) +}); +Response response = client.AddParticipants("", body); +]]> +This sample shows how to call AddParticipants with all parameters. +")) + { + DisplayName = "", + } +}); +Response response = client.AddParticipants("", body); +]]> + + + +This sample shows how to call AddParticipantsAsync and parse the result. +", + }, + } + }, +}); +Response response = await client.AddParticipantsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +]]> +This sample shows how to call AddParticipantsAsync with all parameters and request content and parse the result. +", + }, + displayName = "", + } + }, +}); +Response response = await client.AddParticipantsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +]]> + + + +This sample shows how to call AddParticipants and parse the result. +", + }, + } + }, +}); +Response response = client.AddParticipants("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +]]> +This sample shows how to call AddParticipants with all parameters and request content and parse the result. +", + }, + displayName = "", + } + }, +}); +Response response = client.AddParticipants("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +]]> + + + +This sample shows how to call RemoveParticipantsAsync. +" }); +Response response = await client.RemoveParticipantsAsync("", body); +]]> +This sample shows how to call RemoveParticipantsAsync with all parameters. +" }); +Response response = await client.RemoveParticipantsAsync("", body); +]]> + + + +This sample shows how to call RemoveParticipants. +" }); +Response response = client.RemoveParticipants("", body); +]]> +This sample shows how to call RemoveParticipants with all parameters. +" }); +Response response = client.RemoveParticipants("", body); +]]> + + + +This sample shows how to call RemoveParticipantsAsync and parse the result. +" + }, +}); +Response response = await client.RemoveParticipantsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +]]> +This sample shows how to call RemoveParticipantsAsync with all parameters and request content and parse the result. +" + }, +}); +Response response = await client.RemoveParticipantsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +]]> + + + +This sample shows how to call RemoveParticipants and parse the result. +" + }, +}); +Response response = client.RemoveParticipants("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +]]> +This sample shows how to call RemoveParticipants with all parameters and request content and parse the result. +" + }, +}); +Response response = client.RemoveParticipants("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +]]> + + + +This sample shows how to call AnalyzeConversationAsync. + response = await client.AnalyzeConversationAsync(""); +]]> +This sample shows how to call AnalyzeConversationAsync with all parameters. + response = await client.AnalyzeConversationAsync(""); +]]> + + + +This sample shows how to call AnalyzeConversation. + response = client.AnalyzeConversation(""); +]]> +This sample shows how to call AnalyzeConversation with all parameters. + response = client.AnalyzeConversation(""); +]]> + + + +This sample shows how to call AnalyzeConversationAsync and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").ToString()); +]]> +This sample shows how to call AnalyzeConversationAsync with all parameters and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").ToString()); +]]> + + + +This sample shows how to call AnalyzeConversation and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").ToString()); +]]> +This sample shows how to call AnalyzeConversation with all parameters and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").ToString()); +]]> + + + +This sample shows how to call GetConversationsAsync. + +This sample shows how to call GetConversationsAsync with all parameters. +", channelId: Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"))) +{ +} +]]> + + + +This sample shows how to call GetConversations. + +This sample shows how to call GetConversations with all parameters. +", channelId: Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"))) +{ +} +]]> + + + +This sample shows how to call GetConversationsAsync and parse the result. + +This sample shows how to call GetConversationsAsync with all parameters and parse the result. +", Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); +} +]]> + + + +This sample shows how to call GetConversations and parse the result. + +This sample shows how to call GetConversations with all parameters and parse the result. +", Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); +} +]]> + + + +This sample shows how to call GetMessagesAsync. +")) +{ +} +]]> +This sample shows how to call GetMessagesAsync with all parameters. +", maxpagesize: 1234, participantId: "")) +{ +} +]]> + + + +This sample shows how to call GetMessages. +")) +{ +} +]]> +This sample shows how to call GetMessages with all parameters. +", maxpagesize: 1234, participantId: "")) +{ +} +]]> + + + +This sample shows how to call GetMessagesAsync and parse the result. +", null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); +} +]]> +This sample shows how to call GetMessagesAsync with all parameters and parse the result. +", 1234, "", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("sequenceId").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderDisplayName").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); +} +]]> + + + +This sample shows how to call GetMessages and parse the result. +", null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); +} +]]> +This sample shows how to call GetMessages with all parameters and parse the result. +", 1234, "", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("sequenceId").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderDisplayName").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Docs/ConversationMessagesClient.xml b/sdk/communication/Azure.Communication.Messages/src/Generated/Docs/ConversationMessagesClient.xml new file mode 100644 index 000000000000..3f321943e54b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Docs/ConversationMessagesClient.xml @@ -0,0 +1,665 @@ + + + + + +This sample shows how to call AddParticipantsAsync. +")) +}); +Response response = await client.AddParticipantsAsync("", body); +]]> +This sample shows how to call AddParticipantsAsync with all parameters. +")) + { + DisplayName = "", + } +}); +Response response = await client.AddParticipantsAsync("", body); +]]> + + + +This sample shows how to call AddParticipants. +")) +}); +Response response = client.AddParticipants("", body); +]]> +This sample shows how to call AddParticipants with all parameters. +")) + { + DisplayName = "", + } +}); +Response response = client.AddParticipants("", body); +]]> + + + +This sample shows how to call AddParticipantsAsync and parse the result. +", + }, + } + }, +}); +Response response = await client.AddParticipantsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +]]> +This sample shows how to call AddParticipantsAsync with all parameters and request content and parse the result. +", + }, + displayName = "", + } + }, +}); +Response response = await client.AddParticipantsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +]]> + + + +This sample shows how to call AddParticipants and parse the result. +", + }, + } + }, +}); +Response response = client.AddParticipants("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +]]> +This sample shows how to call AddParticipants with all parameters and request content and parse the result. +", + }, + displayName = "", + } + }, +}); +Response response = client.AddParticipants("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +]]> + + + +This sample shows how to call RemoveParticipantsAsync. +" }); +Response response = await client.RemoveParticipantsAsync("", body); +]]> +This sample shows how to call RemoveParticipantsAsync with all parameters. +" }); +Response response = await client.RemoveParticipantsAsync("", body); +]]> + + + +This sample shows how to call RemoveParticipants. +" }); +Response response = client.RemoveParticipants("", body); +]]> +This sample shows how to call RemoveParticipants with all parameters. +" }); +Response response = client.RemoveParticipants("", body); +]]> + + + +This sample shows how to call RemoveParticipantsAsync and parse the result. +" + }, +}); +Response response = await client.RemoveParticipantsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +]]> +This sample shows how to call RemoveParticipantsAsync with all parameters and request content and parse the result. +" + }, +}); +Response response = await client.RemoveParticipantsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +]]> + + + +This sample shows how to call RemoveParticipants and parse the result. +" + }, +}); +Response response = client.RemoveParticipants("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +]]> +This sample shows how to call RemoveParticipants with all parameters and request content and parse the result. +" + }, +}); +Response response = client.RemoveParticipants("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +]]> + + + +This sample shows how to call SendMessageAsync. +")); +Response response = await client.SendMessageAsync("", body); +]]> +This sample shows how to call SendMessageAsync with all parameters. +")) +{ + OutboundDeliveryStrategy = OutboundDeliveryStrategyKind.InternalOnly, +}; +Response response = await client.SendMessageAsync("", body); +]]> + + + +This sample shows how to call SendMessage. +")); +Response response = client.SendMessage("", body); +]]> +This sample shows how to call SendMessage with all parameters. +")) +{ + OutboundDeliveryStrategy = OutboundDeliveryStrategyKind.InternalOnly, +}; +Response response = client.SendMessage("", body); +]]> + + + +This sample shows how to call SendMessageAsync and parse the result. +", + }, +}); +Response response = await client.SendMessageAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("messageId").ToString()); +]]> +This sample shows how to call SendMessageAsync with all parameters and request content and parse the result. +", + }, + outboundDeliveryStrategy = "internalOnly", +}); +Response response = await client.SendMessageAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("messageId").ToString()); +]]> + + + +This sample shows how to call SendMessage and parse the result. +", + }, +}); +Response response = client.SendMessage("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("messageId").ToString()); +]]> +This sample shows how to call SendMessage with all parameters and request content and parse the result. +", + }, + outboundDeliveryStrategy = "internalOnly", +}); +Response response = client.SendMessage("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("messageId").ToString()); +]]> + + + +This sample shows how to call AnalyzeConversationAsync. + response = await client.AnalyzeConversationAsync(""); +]]> +This sample shows how to call AnalyzeConversationAsync with all parameters. + response = await client.AnalyzeConversationAsync(""); +]]> + + + +This sample shows how to call AnalyzeConversation. + response = client.AnalyzeConversation(""); +]]> +This sample shows how to call AnalyzeConversation with all parameters. + response = client.AnalyzeConversation(""); +]]> + + + +This sample shows how to call AnalyzeConversationAsync and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").ToString()); +]]> +This sample shows how to call AnalyzeConversationAsync with all parameters and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").ToString()); +]]> + + + +This sample shows how to call AnalyzeConversation and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").ToString()); +]]> +This sample shows how to call AnalyzeConversation with all parameters and parse the result. +", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").ToString()); +]]> + + + +This sample shows how to call GetConversationsAsync. + +This sample shows how to call GetConversationsAsync with all parameters. +", channelId: Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"))) +{ +} +]]> + + + +This sample shows how to call GetConversations. + +This sample shows how to call GetConversations with all parameters. +", channelId: Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"))) +{ +} +]]> + + + +This sample shows how to call GetConversationsAsync and parse the result. + +This sample shows how to call GetConversationsAsync with all parameters and parse the result. +", Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); +} +]]> + + + +This sample shows how to call GetConversations and parse the result. + +This sample shows how to call GetConversations with all parameters and parse the result. +", Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); +} +]]> + + + +This sample shows how to call GetMessagesAsync. +")) +{ +} +]]> +This sample shows how to call GetMessagesAsync with all parameters. +", maxpagesize: 1234, participantId: "")) +{ +} +]]> + + + +This sample shows how to call GetMessages. +")) +{ +} +]]> +This sample shows how to call GetMessages with all parameters. +", maxpagesize: 1234, participantId: "")) +{ +} +]]> + + + +This sample shows how to call GetMessagesAsync and parse the result. +", null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); +} +]]> +This sample shows how to call GetMessagesAsync with all parameters and parse the result. +", 1234, "", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("sequenceId").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderDisplayName").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); +} +]]> + + + +This sample shows how to call GetMessages and parse the result. +", null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); +} +]]> +This sample shows how to call GetMessages with all parameters and parse the result. +", 1234, "", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("sequenceId").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderDisplayName").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentConversationMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentConversationMessageContent.Serialization.cs new file mode 100644 index 000000000000..ba349617557a --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentConversationMessageContent.Serialization.cs @@ -0,0 +1,156 @@ +// 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 DocumentConversationMessageContent : 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(DocumentConversationMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Caption)) + { + writer.WritePropertyName("caption"u8); + writer.WriteStringValue(Caption); + } + if (Optional.IsDefined(FileName)) + { + writer.WritePropertyName("fileName"u8); + writer.WriteStringValue(FileName); + } + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + DocumentConversationMessageContent 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(DocumentConversationMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentConversationMessageContent(document.RootElement, options); + } + + internal static DocumentConversationMessageContent DeserializeDocumentConversationMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string caption = default; + string fileName = default; + Uri mediaUri = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("caption"u8)) + { + caption = property.Value.GetString(); + continue; + } + if (property.NameEquals("fileName"u8)) + { + fileName = property.Value.GetString(); + continue; + } + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + 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 DocumentConversationMessageContent(kind, serializedAdditionalRawData, caption, fileName, 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(DocumentConversationMessageContent)} does not support writing '{options.Format}' format."); + } + } + + DocumentConversationMessageContent 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 DeserializeDocumentConversationMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentConversationMessageContent)} 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 DocumentConversationMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentConversationMessageContent(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/DocumentConversationMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentConversationMessageContent.cs new file mode 100644 index 000000000000..086bd8371917 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentConversationMessageContent.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; + +namespace Azure.Communication.Messages +{ + /// A request to send a document conversation message. + public partial class DocumentConversationMessageContent : ConversationMessageContent + { + /// Initializes a new instance of . + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// is null. + public DocumentConversationMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = CommunicationMessageKind.Document; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// The type discriminator describing a message type. + /// Keeps track of any properties unknown to the library. + /// Optional text content. + /// Optional name for the file. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + internal DocumentConversationMessageContent(CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, string caption, string fileName, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + Caption = caption; + FileName = fileName; + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal DocumentConversationMessageContent() + { + } + + /// Optional text content. + public string Caption { get; set; } + /// Optional name for the file. + public string FileName { get; set; } + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + public Uri MediaUri { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentNotificationContent.cs index b0df98032fa7..ae3f8395cd3d 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentNotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentNotificationContent.cs @@ -30,7 +30,7 @@ public DocumentNotificationContent(Guid channelRegistrationId, IEnumerable 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. + /// The type discriminator describing a message type. /// Keeps track of any properties unknown to the library. /// Optional text content. /// Optional name for the file. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ExternalParticipant.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ExternalParticipant.Serialization.cs new file mode 100644 index 000000000000..dd46dd9dae41 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ExternalParticipant.Serialization.cs @@ -0,0 +1,156 @@ +// 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 ExternalParticipant : 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(ExternalParticipant)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("contacts"u8); + writer.WriteStartArray(); + foreach (var item in Contacts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + ExternalParticipant 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(ExternalParticipant)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExternalParticipant(document.RootElement, options); + } + + internal static ExternalParticipant DeserializeExternalParticipant(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList contacts = default; + string id = default; + string displayName = default; + ParticipantKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("contacts"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConversationContact.DeserializeConversationContact(item, options)); + } + contacts = array; + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new ParticipantKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExternalParticipant(id, displayName, kind, serializedAdditionalRawData, contacts); + } + + 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(ExternalParticipant)} does not support writing '{options.Format}' format."); + } + } + + ExternalParticipant 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 DeserializeExternalParticipant(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExternalParticipant)} 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 ExternalParticipant FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExternalParticipant(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/ExternalParticipant.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ExternalParticipant.cs new file mode 100644 index 000000000000..40287c34b1ab --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ExternalParticipant.cs @@ -0,0 +1,59 @@ +// 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 +{ + /// External conversation participant. + public partial class ExternalParticipant : Participant + { + /// Initializes a new instance of . + /// + /// List of external platform identifiers for the participant. + /// 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 . + /// + /// is null. + public ExternalParticipant(IEnumerable contacts) + { + Argument.AssertNotNull(contacts, nameof(contacts)); + + Kind = ParticipantKind.External; + Contacts = contacts.ToList(); + } + + /// Initializes a new instance of . + /// Participant Identifier. + /// Participant display name. + /// The type discriminator describing a participant type. + /// Keeps track of any properties unknown to the library. + /// + /// List of external platform identifiers for the participant. + /// 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 . + /// + internal ExternalParticipant(string id, string displayName, ParticipantKind kind, IDictionary serializedAdditionalRawData, IList contacts) : base(id, displayName, kind, serializedAdditionalRawData) + { + Contacts = contacts; + } + + /// Initializes a new instance of for deserialization. + internal ExternalParticipant() + { + } + + /// + /// List of external platform identifiers for the participant. + /// 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 IList Contacts { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/GetConversationMessagesAnalysisResult.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/GetConversationMessagesAnalysisResult.Serialization.cs new file mode 100644 index 000000000000..0eeaacaa29b6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/GetConversationMessagesAnalysisResult.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 GetConversationMessagesAnalysisResult : 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(GetConversationMessagesAnalysisResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("summary"u8); + writer.WriteStringValue(Summary); + 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 + } + } + } + + GetConversationMessagesAnalysisResult 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(GetConversationMessagesAnalysisResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetConversationMessagesAnalysisResult(document.RootElement, options); + } + + internal static GetConversationMessagesAnalysisResult DeserializeGetConversationMessagesAnalysisResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string summary = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("summary"u8)) + { + summary = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetConversationMessagesAnalysisResult(summary, 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(GetConversationMessagesAnalysisResult)} does not support writing '{options.Format}' format."); + } + } + + GetConversationMessagesAnalysisResult 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 DeserializeGetConversationMessagesAnalysisResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetConversationMessagesAnalysisResult)} 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 GetConversationMessagesAnalysisResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetConversationMessagesAnalysisResult(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/GetConversationMessagesAnalysisResult.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/GetConversationMessagesAnalysisResult.cs new file mode 100644 index 000000000000..e5ae2f6afa9f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/GetConversationMessagesAnalysisResult.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Result of the get conversation messages AI Analysis operation. + public partial class GetConversationMessagesAnalysisResult + { + /// + /// 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 . + /// The AI summary of the conversation messages. + /// is null. + internal GetConversationMessagesAnalysisResult(string summary) + { + Argument.AssertNotNull(summary, nameof(summary)); + + Summary = summary; + } + + /// Initializes a new instance of . + /// The AI summary of the conversation messages. + /// Keeps track of any properties unknown to the library. + internal GetConversationMessagesAnalysisResult(string summary, IDictionary serializedAdditionalRawData) + { + Summary = summary; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetConversationMessagesAnalysisResult() + { + } + + /// The AI summary of the conversation messages. + public string Summary { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ImageConversationMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageConversationMessageContent.Serialization.cs new file mode 100644 index 000000000000..81a7378c0d25 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageConversationMessageContent.Serialization.cs @@ -0,0 +1,145 @@ +// 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 ImageConversationMessageContent : 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(ImageConversationMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Caption)) + { + writer.WritePropertyName("caption"u8); + writer.WriteStringValue(Caption); + } + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + ImageConversationMessageContent 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(ImageConversationMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageConversationMessageContent(document.RootElement, options); + } + + internal static ImageConversationMessageContent DeserializeImageConversationMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string caption = default; + Uri mediaUri = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("caption"u8)) + { + caption = property.Value.GetString(); + continue; + } + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + 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 ImageConversationMessageContent(kind, serializedAdditionalRawData, caption, 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(ImageConversationMessageContent)} does not support writing '{options.Format}' format."); + } + } + + ImageConversationMessageContent 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 DeserializeImageConversationMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageConversationMessageContent)} 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 ImageConversationMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageConversationMessageContent(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/ImageConversationMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageConversationMessageContent.cs new file mode 100644 index 000000000000..318f856277a8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageConversationMessageContent.cs @@ -0,0 +1,48 @@ +// 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 image conversation message. + public partial class ImageConversationMessageContent : ConversationMessageContent + { + /// Initializes a new instance of . + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// is null. + public ImageConversationMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = CommunicationMessageKind.Image; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// The type discriminator describing a message type. + /// Keeps track of any properties unknown to the library. + /// Optional text content. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + internal ImageConversationMessageContent(CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, string caption, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + Caption = caption; + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal ImageConversationMessageContent() + { + } + + /// Optional text content. + public string Caption { get; set; } + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + public Uri MediaUri { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ImageNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageNotificationContent.cs index 491a9660efe2..355f1614f007 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/ImageNotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageNotificationContent.cs @@ -30,7 +30,7 @@ public ImageNotificationContent(Guid channelRegistrationId, IEnumerable /// 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. + /// The type discriminator describing a message type. /// Keeps track of any properties unknown to the library. /// Optional text content. /// A media url for the file. Required if the type is one of the supported media types, e.g. image. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InternalParticipant.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InternalParticipant.Serialization.cs new file mode 100644 index 000000000000..2d04c686b335 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InternalParticipant.Serialization.cs @@ -0,0 +1,146 @@ +// 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 InternalParticipant : 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(InternalParticipant)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("contact"u8); + writer.WriteObjectValue(Contact, options); + } + + InternalParticipant 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(InternalParticipant)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalParticipant(document.RootElement, options); + } + + internal static InternalParticipant DeserializeInternalParticipant(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConversationContact contact = default; + string id = default; + string displayName = default; + ParticipantKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("contact"u8)) + { + contact = ConversationContact.DeserializeConversationContact(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new ParticipantKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalParticipant(id, displayName, kind, serializedAdditionalRawData, contact); + } + + 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(InternalParticipant)} does not support writing '{options.Format}' format."); + } + } + + InternalParticipant 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 DeserializeInternalParticipant(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalParticipant)} 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 InternalParticipant FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInternalParticipant(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/InternalParticipant.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InternalParticipant.cs new file mode 100644 index 000000000000..f08ea7e6f0bc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InternalParticipant.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Internal conversation participant. + public partial class InternalParticipant : Participant + { + /// Initializes a new instance of . + /// + /// The internal platform identifiers for the participant. + /// 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 . + /// + /// is null. + public InternalParticipant(ConversationContact contact) + { + Argument.AssertNotNull(contact, nameof(contact)); + + Kind = ParticipantKind.Internal; + Contact = contact; + } + + /// Initializes a new instance of . + /// Participant Identifier. + /// Participant display name. + /// The type discriminator describing a participant type. + /// Keeps track of any properties unknown to the library. + /// + /// The internal platform identifiers for the participant. + /// 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 . + /// + internal InternalParticipant(string id, string displayName, ParticipantKind kind, IDictionary serializedAdditionalRawData, ConversationContact contact) : base(id, displayName, kind, serializedAdditionalRawData) + { + Contact = contact; + } + + /// Initializes a new instance of for deserialization. + internal InternalParticipant() + { + } + + /// + /// The internal platform identifiers for the participant. + /// 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 ConversationContact Contact { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MediaNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MediaNotificationContent.cs index 36dbed204ede..c4e432f014c3 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/MediaNotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MediaNotificationContent.cs @@ -31,7 +31,7 @@ public MediaNotificationContent(Guid channelRegistrationId, IEnumerable /// 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. + /// The type discriminator describing a message type. /// Keeps track of any properties unknown to the library. /// Optional text content. /// A media url for the file. Required if the type is one of the supported media types, e.g. image. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessagePlatformKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessagePlatformKind.cs new file mode 100644 index 000000000000..f3420c269b3d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessagePlatformKind.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 +{ + /// Defines the type of message platform. + internal readonly partial struct MessagePlatformKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MessagePlatformKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CommunicationValue = "communication"; + private const string BotValue = "bot"; + private const string WhatsAppValue = "whatsApp"; + + /// Azure Communication platform. + public static MessagePlatformKind Communication { get; } = new MessagePlatformKind(CommunicationValue); + /// Bot platform. + public static MessagePlatformKind Bot { get; } = new MessagePlatformKind(BotValue); + /// WhatsApp platform. + public static MessagePlatformKind WhatsApp { get; } = new MessagePlatformKind(WhatsAppValue); + /// Determines if two values are the same. + public static bool operator ==(MessagePlatformKind left, MessagePlatformKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MessagePlatformKind left, MessagePlatformKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MessagePlatformKind(string value) => new MessagePlatformKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MessagePlatformKind other && Equals(other); + /// + public bool Equals(MessagePlatformKind 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/MessageTemplate.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplate.cs index 8094cd04eb22..9d65f902cfcb 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplate.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplate.cs @@ -89,9 +89,9 @@ internal MessageTemplate() } /// Name of the template. - public string Name { get; } + public string Name { get; set; } /// 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'. - public string Language { get; } + public string Language { get; set; } /// /// The template values. /// 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. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateClient.cs index f37504e31358..082b36195070 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateClient.cs @@ -19,6 +19,7 @@ public partial class MessageTemplateClient { private const string AuthorizationHeader = "Authorization"; private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "Bearer"; private static readonly string[] AuthorizationScopes = new string[] { "https://communication.azure.com/.default" }; private readonly TokenCredential _tokenCredential; private readonly HttpPipeline _pipeline; diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateDocument.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateDocument.cs index 772ad6515b5c..b12ebac1a04b 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateDocument.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateDocument.cs @@ -46,7 +46,7 @@ internal MessageTemplateDocument() } /// The (public) URL of the media. - public Uri Uri { get; } + public Uri Uri { get; set; } /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateImage.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateImage.cs index e8367535db19..96fa1d2ccb71 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateImage.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateImage.cs @@ -46,7 +46,7 @@ internal MessageTemplateImage() } /// The (public) URL of the media. - public Uri Uri { get; } + public Uri Uri { get; set; } /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateText.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateText.cs index f6e15f72526f..f6549c2fdaca 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateText.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateText.cs @@ -42,6 +42,6 @@ internal MessageTemplateText() } /// The text value. - public string Text { get; } + public string Text { get; set; } } } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateValue.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateValue.cs index 73b63aa77d13..1f0cc4bfa705 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateValue.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateValue.cs @@ -76,7 +76,7 @@ internal MessageTemplateValue() } /// Template binding reference name. - public string Name { get; } + public string Name { get; set; } /// The type discriminator describing a template parameter type. internal MessageTemplateValueKind Kind { get; set; } } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateVideo.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateVideo.cs index 312f68f6d7e2..3d5da2a05d3a 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateVideo.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageTemplateVideo.cs @@ -46,7 +46,7 @@ internal MessageTemplateVideo() } /// The (public) URL of the media. - public Uri Uri { get; } + public Uri Uri { get; set; } /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs index 68f1f22e3469..d144401936f9 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs @@ -65,7 +65,7 @@ protected NotificationContent(Guid channelRegistrationId, IEnumerable to /// 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. + /// The type discriminator describing a message type. /// Keeps track of any properties unknown to the library. internal NotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData) { @@ -84,7 +84,7 @@ internal NotificationContent() public Guid ChannelRegistrationId { get; } /// The native external platform user identifiers of the recipient. public IList To { get; } - /// The type discriminator describing a notification type. + /// The type discriminator describing a message type. internal CommunicationMessageKind Kind { get; set; } } } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesClient.cs index 696c5609b70f..d5eead072111 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesClient.cs @@ -19,6 +19,7 @@ public partial class NotificationMessagesClient { private const string AuthorizationHeader = "Authorization"; private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "Bearer"; private static readonly string[] AuthorizationScopes = new string[] { "https://communication.azure.com/.default" }; private readonly TokenCredential _tokenCredential; private readonly HttpPipeline _pipeline; diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/OutboundDeliveryStrategyKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/OutboundDeliveryStrategyKind.cs new file mode 100644 index 000000000000..243fe0d3400d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/OutboundDeliveryStrategyKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The options of the outbound delivery strategy for messages sent by emplyees in a conversation. + public readonly partial struct OutboundDeliveryStrategyKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OutboundDeliveryStrategyKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InternalOnlyValue = "internalOnly"; + private const string AllParticipantsValue = "allParticipants"; + + /// Delivery strategy for internal only. + public static OutboundDeliveryStrategyKind InternalOnly { get; } = new OutboundDeliveryStrategyKind(InternalOnlyValue); + /// Delivery strategy for all participants. + public static OutboundDeliveryStrategyKind AllParticipants { get; } = new OutboundDeliveryStrategyKind(AllParticipantsValue); + /// Determines if two values are the same. + public static bool operator ==(OutboundDeliveryStrategyKind left, OutboundDeliveryStrategyKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OutboundDeliveryStrategyKind left, OutboundDeliveryStrategyKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OutboundDeliveryStrategyKind(string value) => new OutboundDeliveryStrategyKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OutboundDeliveryStrategyKind other && Equals(other); + /// + public bool Equals(OutboundDeliveryStrategyKind 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/Participant.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Participant.Serialization.cs new file mode 100644 index 000000000000..043dcf4fe127 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Participant.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.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [PersistableModelProxy(typeof(UnknownParticipant))] + public partial class Participant : 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(Participant)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + 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 + } + } + } + + Participant 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(Participant)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeParticipant(document.RootElement, options); + } + + internal static Participant DeserializeParticipant(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 "External": return ExternalParticipant.DeserializeExternalParticipant(element, options); + case "internal": return InternalParticipant.DeserializeInternalParticipant(element, options); + } + } + return UnknownParticipant.DeserializeUnknownParticipant(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(Participant)} does not support writing '{options.Format}' format."); + } + } + + Participant 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 DeserializeParticipant(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Participant)} 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 Participant FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeParticipant(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/Participant.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Participant.cs new file mode 100644 index 000000000000..a0912823bbc8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Participant.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// + /// Advanced Messaging conversation participant. + /// 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 Participant + { + /// + /// 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 Participant() + { + } + + /// Initializes a new instance of . + /// Participant Identifier. + /// Participant display name. + /// The type discriminator describing a participant type. + /// Keeps track of any properties unknown to the library. + internal Participant(string id, string displayName, ParticipantKind kind, IDictionary serializedAdditionalRawData) + { + Id = id; + DisplayName = displayName; + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Participant Identifier. + public string Id { get; } + /// Participant display name. + public string DisplayName { get; set; } + /// The type discriminator describing a participant type. + internal ParticipantKind Kind { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ParticipantKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ParticipantKind.cs new file mode 100644 index 000000000000..2888f2a17f72 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ParticipantKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The type of a participant in a threaded conversation. + internal readonly partial struct ParticipantKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ParticipantKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InternalValue = "internal"; + private const string ExternalValue = "External"; + + /// A participant internal to Azure Communication Services. + public static ParticipantKind Internal { get; } = new ParticipantKind(InternalValue); + /// A participant on other platforms. + public static ParticipantKind External { get; } = new ParticipantKind(ExternalValue); + /// Determines if two values are the same. + public static bool operator ==(ParticipantKind left, ParticipantKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ParticipantKind left, ParticipantKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ParticipantKind(string value) => new ParticipantKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ParticipantKind other && Equals(other); + /// + public bool Equals(ParticipantKind 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/ParticipantsResult.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ParticipantsResult.Serialization.cs new file mode 100644 index 000000000000..c855b5d5e0a2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ParticipantsResult.Serialization.cs @@ -0,0 +1,157 @@ +// 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 ParticipantsResult : 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(ParticipantsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + 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 + } + } + } + + ParticipantsResult 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(ParticipantsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeParticipantsResult(document.RootElement, options); + } + + internal static ParticipantsResult DeserializeParticipantsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + ResponseError error = 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("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ParticipantsResult(id, error, 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(ParticipantsResult)} does not support writing '{options.Format}' format."); + } + } + + ParticipantsResult 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 DeserializeParticipantsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ParticipantsResult)} 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 ParticipantsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeParticipantsResult(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/ParticipantsResult.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ParticipantsResult.cs new file mode 100644 index 000000000000..39ff6a90eead --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ParticipantsResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Response for the remove participants operation. + public partial class ParticipantsResult + { + /// + /// 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 . + /// Participant User Id. + /// is null. + internal ParticipantsResult(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + } + + /// Initializes a new instance of . + /// Participant User Id. + /// Error of the participant operation. + /// Keeps track of any properties unknown to the library. + internal ParticipantsResult(string id, ResponseError error, IDictionary serializedAdditionalRawData) + { + Id = id; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ParticipantsResult() + { + } + + /// Participant User Id. + public string Id { get; } + /// Error of the participant operation. + public ResponseError Error { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsRequest.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsRequest.Serialization.cs new file mode 100644 index 000000000000..a373379bab0e --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsRequest.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 RemoveParticipantsRequest : 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(RemoveParticipantsRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("participantIds"u8); + writer.WriteStartArray(); + foreach (var item in ParticipantIds) + { + writer.WriteStringValue(item); + } + 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 + } + } + } + + RemoveParticipantsRequest 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(RemoveParticipantsRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemoveParticipantsRequest(document.RootElement, options); + } + + internal static RemoveParticipantsRequest DeserializeRemoveParticipantsRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList participantIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("participantIds"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + participantIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemoveParticipantsRequest(participantIds, 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(RemoveParticipantsRequest)} does not support writing '{options.Format}' format."); + } + } + + RemoveParticipantsRequest 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 DeserializeRemoveParticipantsRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemoveParticipantsRequest)} 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 RemoveParticipantsRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRemoveParticipantsRequest(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/RemoveParticipantsRequest.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsRequest.cs new file mode 100644 index 000000000000..e310c961b4a2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsRequest.cs @@ -0,0 +1,76 @@ +// 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 +{ + /// Request payload for removing participants from a conversation. + public partial class RemoveParticipantsRequest + { + /// + /// 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 . + /// The participant IDs to remove. + /// is null. + public RemoveParticipantsRequest(IEnumerable participantIds) + { + Argument.AssertNotNull(participantIds, nameof(participantIds)); + + ParticipantIds = participantIds.ToList(); + } + + /// Initializes a new instance of . + /// The participant IDs to remove. + /// Keeps track of any properties unknown to the library. + internal RemoveParticipantsRequest(IList participantIds, IDictionary serializedAdditionalRawData) + { + ParticipantIds = participantIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RemoveParticipantsRequest() + { + } + + /// The participant IDs to remove. + public IList ParticipantIds { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsResult.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsResult.Serialization.cs new file mode 100644 index 000000000000..d3aa402e42ff --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsResult.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 RemoveParticipantsResult : 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(RemoveParticipantsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("invalidParticipants"u8); + writer.WriteStartArray(); + foreach (var item in InvalidParticipants) + { + 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 + } + } + } + + RemoveParticipantsResult 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(RemoveParticipantsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemoveParticipantsResult(document.RootElement, options); + } + + internal static RemoveParticipantsResult DeserializeRemoveParticipantsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList invalidParticipants = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("invalidParticipants"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ParticipantsResult.DeserializeParticipantsResult(item, options)); + } + invalidParticipants = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemoveParticipantsResult(invalidParticipants, 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(RemoveParticipantsResult)} does not support writing '{options.Format}' format."); + } + } + + RemoveParticipantsResult 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 DeserializeRemoveParticipantsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemoveParticipantsResult)} 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 RemoveParticipantsResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRemoveParticipantsResult(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/RemoveParticipantsResult.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsResult.cs new file mode 100644 index 000000000000..0b344fd2e4b2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/RemoveParticipantsResult.cs @@ -0,0 +1,76 @@ +// 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 +{ + /// Response for the remove participants operation. + public partial class RemoveParticipantsResult + { + /// + /// 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 . + /// List of Ids with Errors if failed to be added. + /// is null. + internal RemoveParticipantsResult(IEnumerable invalidParticipants) + { + Argument.AssertNotNull(invalidParticipants, nameof(invalidParticipants)); + + InvalidParticipants = invalidParticipants.ToList(); + } + + /// Initializes a new instance of . + /// List of Ids with Errors if failed to be added. + /// Keeps track of any properties unknown to the library. + internal RemoveParticipantsResult(IReadOnlyList invalidParticipants, IDictionary serializedAdditionalRawData) + { + InvalidParticipants = invalidParticipants; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RemoveParticipantsResult() + { + } + + /// List of Ids with Errors if failed to be added. + public IReadOnlyList InvalidParticipants { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageRequest.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageRequest.Serialization.cs new file mode 100644 index 000000000000..ef528c9f12a8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageRequest.Serialization.cs @@ -0,0 +1,157 @@ +// 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 SendConversationMessageRequest : 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(SendConversationMessageRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("request"u8); + writer.WriteObjectValue(Request, options); + if (Optional.IsDefined(OutboundDeliveryStrategy)) + { + writer.WritePropertyName("outboundDeliveryStrategy"u8); + writer.WriteStringValue(OutboundDeliveryStrategy.Value.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 + } + } + } + + SendConversationMessageRequest 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(SendConversationMessageRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSendConversationMessageRequest(document.RootElement, options); + } + + internal static SendConversationMessageRequest DeserializeSendConversationMessageRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConversationMessageContent request = default; + OutboundDeliveryStrategyKind? outboundDeliveryStrategy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("request"u8)) + { + request = ConversationMessageContent.DeserializeConversationMessageContent(property.Value, options); + continue; + } + if (property.NameEquals("outboundDeliveryStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outboundDeliveryStrategy = new OutboundDeliveryStrategyKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SendConversationMessageRequest(request, outboundDeliveryStrategy, 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(SendConversationMessageRequest)} does not support writing '{options.Format}' format."); + } + } + + SendConversationMessageRequest 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 DeserializeSendConversationMessageRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SendConversationMessageRequest)} 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 SendConversationMessageRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSendConversationMessageRequest(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/SendConversationMessageRequest.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageRequest.cs new file mode 100644 index 000000000000..ce983bcb723e --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageRequest.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Request payload for sending a conversation message. + public partial class SendConversationMessageRequest + { + /// + /// 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 . + /// + /// Details of a send conversation message request. + /// 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 . + /// + /// is null. + public SendConversationMessageRequest(ConversationMessageContent request) + { + Argument.AssertNotNull(request, nameof(request)); + + Request = request; + } + + /// Initializes a new instance of . + /// + /// Details of a send conversation message request. + /// 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 options of the outbound delivery strategy for messages sent by emplyees in a conversation. + /// Supports internalOnly, allChannels. + /// + /// Keeps track of any properties unknown to the library. + internal SendConversationMessageRequest(ConversationMessageContent request, OutboundDeliveryStrategyKind? outboundDeliveryStrategy, IDictionary serializedAdditionalRawData) + { + Request = request; + OutboundDeliveryStrategy = outboundDeliveryStrategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SendConversationMessageRequest() + { + } + + /// + /// Details of a send conversation message request. + /// 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 ConversationMessageContent Request { get; } + /// + /// The options of the outbound delivery strategy for messages sent by emplyees in a conversation. + /// Supports internalOnly, allChannels. + /// + public OutboundDeliveryStrategyKind? OutboundDeliveryStrategy { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageResult.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageResult.Serialization.cs new file mode 100644 index 000000000000..9f9510c9ff68 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageResult.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 SendConversationMessageResult : 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(SendConversationMessageResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("messageId"u8); + writer.WriteStringValue(MessageId); + 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 + } + } + } + + SendConversationMessageResult 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(SendConversationMessageResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSendConversationMessageResult(document.RootElement, options); + } + + internal static SendConversationMessageResult DeserializeSendConversationMessageResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string messageId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messageId"u8)) + { + messageId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SendConversationMessageResult(messageId, 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(SendConversationMessageResult)} does not support writing '{options.Format}' format."); + } + } + + SendConversationMessageResult 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 DeserializeSendConversationMessageResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SendConversationMessageResult)} 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 SendConversationMessageResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSendConversationMessageResult(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/SendConversationMessageResult.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageResult.cs new file mode 100644 index 000000000000..9cedbe0633e2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/SendConversationMessageResult.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Result of the send conversation message operation. + public partial class SendConversationMessageResult + { + /// + /// 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 . + /// A server-generated Advanced Messaging conversation message id. + /// is null. + internal SendConversationMessageResult(string messageId) + { + Argument.AssertNotNull(messageId, nameof(messageId)); + + MessageId = messageId; + } + + /// Initializes a new instance of . + /// A server-generated Advanced Messaging conversation message id. + /// Keeps track of any properties unknown to the library. + internal SendConversationMessageResult(string messageId, IDictionary serializedAdditionalRawData) + { + MessageId = messageId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SendConversationMessageResult() + { + } + + /// A server-generated Advanced Messaging conversation message id. + public string MessageId { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateConversationMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateConversationMessageContent.Serialization.cs new file mode 100644 index 000000000000..1015f793585c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateConversationMessageContent.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 TemplateConversationMessageContent : 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(TemplateConversationMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("template"u8); + writer.WriteObjectValue(Template, options); + } + + TemplateConversationMessageContent 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(TemplateConversationMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTemplateConversationMessageContent(document.RootElement, options); + } + + internal static TemplateConversationMessageContent DeserializeTemplateConversationMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageTemplate template = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("template"u8)) + { + template = MessageTemplate.DeserializeMessageTemplate(property.Value, options); + 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 TemplateConversationMessageContent(kind, serializedAdditionalRawData, template); + } + + 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(TemplateConversationMessageContent)} does not support writing '{options.Format}' format."); + } + } + + TemplateConversationMessageContent 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 DeserializeTemplateConversationMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TemplateConversationMessageContent)} 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 TemplateConversationMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTemplateConversationMessageContent(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/TemplateConversationMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateConversationMessageContent.cs new file mode 100644 index 000000000000..6bbe26b57162 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateConversationMessageContent.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 +{ + /// A request to send a template conversation message. + public partial class TemplateConversationMessageContent : ConversationMessageContent + { + /// Initializes a new instance of . + /// The template object used to create templates. + /// is null. + public TemplateConversationMessageContent(MessageTemplate template) + { + Argument.AssertNotNull(template, nameof(template)); + + Kind = CommunicationMessageKind.Template; + Template = template; + } + + /// Initializes a new instance of . + /// The type discriminator describing a message type. + /// Keeps track of any properties unknown to the library. + /// The template object used to create templates. + internal TemplateConversationMessageContent(CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, MessageTemplate template) : base(kind, serializedAdditionalRawData) + { + Template = template; + } + + /// Initializes a new instance of for deserialization. + internal TemplateConversationMessageContent() + { + } + + /// The template object used to create templates. + public MessageTemplate Template { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateNotificationContent.cs index a967d3b11f34..0162f0ed190e 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateNotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateNotificationContent.cs @@ -30,7 +30,7 @@ public TemplateNotificationContent(Guid channelRegistrationId, IEnumerable 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. + /// The type discriminator describing a message type. /// Keeps track of any properties unknown to the library. /// The template object used to create templates. internal TemplateNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, MessageTemplate template) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TextConversationMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TextConversationMessageContent.Serialization.cs new file mode 100644 index 000000000000..6559a1fe9acc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TextConversationMessageContent.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 TextConversationMessageContent : 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(TextConversationMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + + TextConversationMessageContent 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(TextConversationMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextConversationMessageContent(document.RootElement, options); + } + + internal static TextConversationMessageContent DeserializeTextConversationMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string content = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = property.Value.GetString(); + 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 TextConversationMessageContent(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(TextConversationMessageContent)} does not support writing '{options.Format}' format."); + } + } + + TextConversationMessageContent 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 DeserializeTextConversationMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextConversationMessageContent)} 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 TextConversationMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextConversationMessageContent(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/TextConversationMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TextConversationMessageContent.cs new file mode 100644 index 000000000000..ba6a69d080b8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TextConversationMessageContent.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 +{ + /// A request to send a text conversation message. + public partial class TextConversationMessageContent : ConversationMessageContent + { + /// Initializes a new instance of . + /// Message content. + /// is null. + public TextConversationMessageContent(string content) + { + Argument.AssertNotNull(content, nameof(content)); + + Kind = CommunicationMessageKind.Text; + Content = content; + } + + /// Initializes a new instance of . + /// The type discriminator describing a message type. + /// Keeps track of any properties unknown to the library. + /// Message content. + internal TextConversationMessageContent(CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, string content) : base(kind, serializedAdditionalRawData) + { + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal TextConversationMessageContent() + { + } + + /// Message content. + public string Content { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TextNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TextNotificationContent.cs index 02466c654309..78ae6bd5ecb4 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/TextNotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TextNotificationContent.cs @@ -30,7 +30,7 @@ public TextNotificationContent(Guid channelRegistrationId, IEnumerable t /// 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. + /// The type discriminator describing a message type. /// Keeps track of any properties unknown to the library. /// Message content. internal TextNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, string content) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationContact.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationContact.Serialization.cs new file mode 100644 index 000000000000..c2f68cc85b02 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationContact.Serialization.cs @@ -0,0 +1,132 @@ +// 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 UnknownConversationContact : 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(ConversationContact)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ConversationContact 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(ConversationContact)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationContact(document.RootElement, options); + } + + internal static UnknownConversationContact DeserializeUnknownConversationContact(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + MessagePlatformKind kind = "Unknown"; + 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("kind"u8)) + { + kind = new MessagePlatformKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownConversationContact(id, 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(ConversationContact)} does not support writing '{options.Format}' format."); + } + } + + ConversationContact 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 DeserializeConversationContact(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationContact)} 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 UnknownConversationContact FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownConversationContact(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/UnknownConversationContact.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationContact.cs new file mode 100644 index 000000000000..3f274ce2c363 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationContact.cs @@ -0,0 +1,29 @@ +// 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 ConversationContact. + internal partial class UnknownConversationContact : ConversationContact + { + /// Initializes a new instance of . + /// External platform identifier. + /// Type of message platform (e.g., WhatsApp). + /// Keeps track of any properties unknown to the library. + internal UnknownConversationContact(string id, MessagePlatformKind kind, IDictionary serializedAdditionalRawData) : base(id, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownConversationContact() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationMessageContent.Serialization.cs new file mode 100644 index 000000000000..d978b21f78f3 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationMessageContent.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 UnknownConversationMessageContent : 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(ConversationMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ConversationMessageContent 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(ConversationMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationMessageContent(document.RootElement, options); + } + + internal static UnknownConversationMessageContent DeserializeUnknownConversationMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CommunicationMessageKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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 UnknownConversationMessageContent(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(ConversationMessageContent)} does not support writing '{options.Format}' format."); + } + } + + ConversationMessageContent 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 DeserializeConversationMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationMessageContent)} 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 UnknownConversationMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownConversationMessageContent(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/UnknownConversationMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationMessageContent.cs new file mode 100644 index 000000000000..a7d200aef4b5 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownConversationMessageContent.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 ConversationMessageContent. + internal partial class UnknownConversationMessageContent : ConversationMessageContent + { + /// Initializes a new instance of . + /// The type discriminator describing a message type. + /// Keeps track of any properties unknown to the library. + internal UnknownConversationMessageContent(CommunicationMessageKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownConversationMessageContent() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownNotificationContent.cs index 05589e6e5967..2a6437f28c13 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownNotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownNotificationContent.cs @@ -16,7 +16,7 @@ internal partial class UnknownNotificationContent : NotificationContent /// 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. + /// The type discriminator describing a message type. /// Keeps track of any properties unknown to the library. internal UnknownNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) { diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownParticipant.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownParticipant.Serialization.cs new file mode 100644 index 000000000000..9365a0cb457c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownParticipant.Serialization.cs @@ -0,0 +1,138 @@ +// 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 UnknownParticipant : 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(Participant)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + Participant 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(Participant)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeParticipant(document.RootElement, options); + } + + internal static UnknownParticipant DeserializeUnknownParticipant(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string displayName = default; + ParticipantKind kind = "Unknown"; + 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("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new ParticipantKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownParticipant(id, displayName, 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(Participant)} does not support writing '{options.Format}' format."); + } + } + + Participant 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 DeserializeParticipant(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Participant)} 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 UnknownParticipant FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownParticipant(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/UnknownParticipant.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownParticipant.cs new file mode 100644 index 000000000000..d3a3987a5c6e --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownParticipant.cs @@ -0,0 +1,30 @@ +// 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 Participant. + internal partial class UnknownParticipant : Participant + { + /// Initializes a new instance of . + /// Participant Identifier. + /// Participant display name. + /// The type discriminator describing a participant type. + /// Keeps track of any properties unknown to the library. + internal UnknownParticipant(string id, string displayName, ParticipantKind kind, IDictionary serializedAdditionalRawData) : base(id, displayName, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownParticipant() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/VideoConversationMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoConversationMessageContent.Serialization.cs new file mode 100644 index 000000000000..deb966ea50ce --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoConversationMessageContent.Serialization.cs @@ -0,0 +1,145 @@ +// 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 VideoConversationMessageContent : 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(VideoConversationMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Caption)) + { + writer.WritePropertyName("caption"u8); + writer.WriteStringValue(Caption); + } + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + VideoConversationMessageContent 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(VideoConversationMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVideoConversationMessageContent(document.RootElement, options); + } + + internal static VideoConversationMessageContent DeserializeVideoConversationMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string caption = default; + Uri mediaUri = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("caption"u8)) + { + caption = property.Value.GetString(); + continue; + } + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + 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 VideoConversationMessageContent(kind, serializedAdditionalRawData, caption, 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(VideoConversationMessageContent)} does not support writing '{options.Format}' format."); + } + } + + VideoConversationMessageContent 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 DeserializeVideoConversationMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VideoConversationMessageContent)} 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 VideoConversationMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeVideoConversationMessageContent(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/VideoConversationMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoConversationMessageContent.cs new file mode 100644 index 000000000000..4f80349d654d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoConversationMessageContent.cs @@ -0,0 +1,48 @@ +// 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 video conversation message. + public partial class VideoConversationMessageContent : ConversationMessageContent + { + /// Initializes a new instance of . + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// is null. + public VideoConversationMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = CommunicationMessageKind.Video; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// The type discriminator describing a message type. + /// Keeps track of any properties unknown to the library. + /// Optional text content. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + internal VideoConversationMessageContent(CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, string caption, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + Caption = caption; + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal VideoConversationMessageContent() + { + } + + /// Optional text content. + public string Caption { get; set; } + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + public Uri MediaUri { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/VideoNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoNotificationContent.cs index d78ee546a59a..f392d38b8d15 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/VideoNotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoNotificationContent.cs @@ -30,7 +30,7 @@ public VideoNotificationContent(Guid channelRegistrationId, IEnumerable /// 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. + /// The type discriminator describing a message type. /// Keeps track of any properties unknown to the library. /// Optional text content. /// A media url for the file. Required if the type is one of the supported media types, e.g. image. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppContact.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppContact.Serialization.cs new file mode 100644 index 000000000000..71ae0b559fb1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppContact.Serialization.cs @@ -0,0 +1,132 @@ +// 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 WhatsAppContact : 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(WhatsAppContact)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + WhatsAppContact 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(WhatsAppContact)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWhatsAppContact(document.RootElement, options); + } + + internal static WhatsAppContact DeserializeWhatsAppContact(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + MessagePlatformKind kind = 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("kind"u8)) + { + kind = new MessagePlatformKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WhatsAppContact(id, 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(WhatsAppContact)} does not support writing '{options.Format}' format."); + } + } + + WhatsAppContact 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 DeserializeWhatsAppContact(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WhatsAppContact)} 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 WhatsAppContact FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWhatsAppContact(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/WhatsAppContact.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppContact.cs new file mode 100644 index 000000000000..9cc52ecf48dc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppContact.cs @@ -0,0 +1,39 @@ +// 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 Contact. + public partial class WhatsAppContact : ConversationContact + { + /// Initializes a new instance of . + /// External platform identifier. + /// is null. + public WhatsAppContact(string id) : base(id) + { + Argument.AssertNotNull(id, nameof(id)); + + Kind = MessagePlatformKind.WhatsApp; + } + + /// Initializes a new instance of . + /// External platform identifier. + /// Type of message platform (e.g., WhatsApp). + /// Keeps track of any properties unknown to the library. + internal WhatsAppContact(string id, MessagePlatformKind kind, IDictionary serializedAdditionalRawData) : base(id, kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal WhatsAppContact() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppMessageTemplateBindingsButton.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppMessageTemplateBindingsButton.cs index 699bc967f77e..e144fd0d77ee 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppMessageTemplateBindingsButton.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppMessageTemplateBindingsButton.cs @@ -74,6 +74,6 @@ internal WhatsAppMessageTemplateBindingsButton() { } /// The name of the referenced item in the template values. - public string RefValue { get; } + public string RefValue { get; set; } } } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppMessageTemplateBindingsComponent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppMessageTemplateBindingsComponent.cs index 3aa7bfa31af9..4be0a179c677 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppMessageTemplateBindingsComponent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppMessageTemplateBindingsComponent.cs @@ -70,6 +70,6 @@ internal WhatsAppMessageTemplateBindingsComponent() } /// The name of the referenced item in the template values. - public string RefValue { get; } + public string RefValue { get; set; } } } diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/CommunicationMessagesModelFactory.cs b/sdk/communication/Azure.Communication.Messages/src/Models/CommunicationMessagesModelFactory.cs index 6bd0e4ec9f43..45c59756c108 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/CommunicationMessagesModelFactory.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/CommunicationMessagesModelFactory.cs @@ -13,6 +13,106 @@ namespace Azure.Communication.Messages /// Model factory for models. public static partial class CommunicationMessagesModelFactory { + /// Initializes a new instance of . + /// Name of the template. + /// 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'. + /// + /// The template values. + /// 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 binding object to link values to the template specific locations + /// 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 . + /// + /// A new instance for mocking. + public static MessageTemplate MessageTemplate(string name = null, string language = null, IEnumerable values = null, MessageTemplateBindings bindings = null) + { + values ??= new List(); + + return new MessageTemplate(name, language, values?.ToList(), bindings, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Template binding reference name. + /// The type discriminator describing a template parameter type. + /// A new instance for mocking. + public static MessageTemplateValue MessageTemplateValue(string name = null, string kind = null) + { + return new UnknownMessageTemplateValue(name, kind == null ? default : new MessageTemplateValueKind(kind), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Template binding reference name. + /// The text value. + /// A new instance for mocking. + public static MessageTemplateText MessageTemplateText(string name = null, string text = null) + { + return new MessageTemplateText(name, MessageTemplateValueKind.Text, serializedAdditionalRawData: null, text); + } + + /// Initializes a new instance of . + /// Template binding reference name. + /// The (public) URL of the media. + /// The [optional] caption of the media object. + /// The [optional] filename of the media file. + /// A new instance for mocking. + public static MessageTemplateImage MessageTemplateImage(string name = null, Uri uri = null, string caption = null, string fileName = null) + { + return new MessageTemplateImage( + name, + MessageTemplateValueKind.Image, + serializedAdditionalRawData: null, + uri, + caption, + fileName); + } + + /// Initializes a new instance of . + /// Template binding reference name. + /// The (public) URL of the media. + /// The [optional] caption of the media object. + /// The [optional] filename of the media file. + /// A new instance for mocking. + public static MessageTemplateDocument MessageTemplateDocument(string name = null, Uri uri = null, string caption = null, string fileName = null) + { + return new MessageTemplateDocument( + name, + MessageTemplateValueKind.Document, + serializedAdditionalRawData: null, + uri, + caption, + fileName); + } + + /// Initializes a new instance of . + /// Template binding reference name. + /// The (public) URL of the media. + /// The [optional] caption of the media object. + /// The [optional] filename of the media file. + /// A new instance for mocking. + public static MessageTemplateVideo MessageTemplateVideo(string name = null, Uri uri = null, string caption = null, string fileName = null) + { + return new MessageTemplateVideo( + name, + MessageTemplateValueKind.Video, + serializedAdditionalRawData: null, + uri, + caption, + fileName); + } + + /// Initializes a new instance of . + /// Template binding reference name. + /// The [Optional] quick action text. + /// The [Optional] quick action payload. + /// A new instance for mocking. + public static MessageTemplateQuickAction MessageTemplateQuickAction(string name = null, string text = null, string payload = null) + { + return new MessageTemplateQuickAction(name, MessageTemplateValueKind.QuickAction, serializedAdditionalRawData: null, text, payload); + } + #pragma warning disable CS0618 // Type or member is obsolete - Need to manually add this custom code due to the defect here: https://github.com/Azure/autorest.csharp/issues/5114 /// Initializes a new instance of . /// The Channel Registration ID for the Business Identifier. diff --git a/sdk/communication/Azure.Communication.Messages/tests/Generated/Samples/Samples_ConversationManagementClient.cs b/sdk/communication/Azure.Communication.Messages/tests/Generated/Samples/Samples_ConversationManagementClient.cs new file mode 100644 index 000000000000..4b484fd960b1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/Generated/Samples/Samples_ConversationManagementClient.cs @@ -0,0 +1,993 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Communication.Messages.Samples +{ + public partial class Samples_ConversationManagementClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_CreateConversation_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + conversation = new object(), + }); + Response response = client.CreateConversation(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_CreateConversation_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + conversation = new object(), + }); + Response response = await client.CreateConversationAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_CreateConversation_ShortVersion_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Conversation conversation = new Conversation(); + Response response = client.CreateConversation(conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_CreateConversation_ShortVersion_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Conversation conversation = new Conversation(); + Response response = await client.CreateConversationAsync(conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_CreateConversation_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + conversation = new + { + topic = "", + deliveryChannelIds = new object[] + { +"" + }, + outboundDeliveryStrategy = "internalOnly", + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +displayName = "", +} + }, + }, + initialMessage = new + { + content = "", + }, + }); + Response response = client.CreateConversation(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_CreateConversation_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + conversation = new + { + topic = "", + deliveryChannelIds = new object[] + { +"" + }, + outboundDeliveryStrategy = "internalOnly", + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +displayName = "", +} + }, + }, + initialMessage = new + { + content = "", + }, + }); + Response response = await client.CreateConversationAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_CreateConversation_AllParameters_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Conversation conversation = new Conversation + { + Topic = "", + DeliveryChannelIds = { "" }, + OutboundDeliveryStrategy = OutboundDeliveryStrategyKind.InternalOnly, + Participants = {new InternalParticipant(new CommunicationContact("")) +{ +DisplayName = "", +}}, + }; + ConversationMessage initialMessage = new ConversationMessage(""); + Response response = client.CreateConversation(conversation, initialMessage: initialMessage); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_CreateConversation_AllParameters_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Conversation conversation = new Conversation + { + Topic = "", + DeliveryChannelIds = { "" }, + OutboundDeliveryStrategy = OutboundDeliveryStrategyKind.InternalOnly, + Participants = {new InternalParticipant(new CommunicationContact("")) +{ +DisplayName = "", +}}, + }; + ConversationMessage initialMessage = new ConversationMessage(""); + Response response = await client.CreateConversationAsync(conversation, initialMessage: initialMessage); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversation_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.GetConversation("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversation_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.GetConversationAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversation_ShortVersion_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.GetConversation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversation_ShortVersion_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.GetConversationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversation_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.GetConversation("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversation_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.GetConversationAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversation_AllParameters_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.GetConversation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversation_AllParameters_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.GetConversationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_DeleteConversation_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.DeleteConversation(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_DeleteConversation_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.DeleteConversationAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_DeleteConversation_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.DeleteConversation(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_DeleteConversation_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.DeleteConversationAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_TerminateConversation_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.TerminateConversation(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_TerminateConversation_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.TerminateConversationAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_TerminateConversation_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.TerminateConversation(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_TerminateConversation_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.TerminateConversationAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_AddParticipants_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +} + }, + }); + Response response = client.AddParticipants("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_AddParticipants_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +} + }, + }); + Response response = await client.AddParticipantsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_AddParticipants_ShortVersion_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + AddParticipantsRequest body = new AddParticipantsRequest(new Participant[] + { +new InternalParticipant(new CommunicationContact("")) + }); + Response response = client.AddParticipants("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_AddParticipants_ShortVersion_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + AddParticipantsRequest body = new AddParticipantsRequest(new Participant[] + { +new InternalParticipant(new CommunicationContact("")) + }); + Response response = await client.AddParticipantsAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_AddParticipants_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +displayName = "", +} + }, + }); + Response response = client.AddParticipants("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_AddParticipants_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +displayName = "", +} + }, + }); + Response response = await client.AddParticipantsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_AddParticipants_AllParameters_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + AddParticipantsRequest body = new AddParticipantsRequest(new Participant[] + { +new InternalParticipant(new CommunicationContact("")) +{ +DisplayName = "", +} + }); + Response response = client.AddParticipants("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_AddParticipants_AllParameters_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + AddParticipantsRequest body = new AddParticipantsRequest(new Participant[] + { +new InternalParticipant(new CommunicationContact("")) +{ +DisplayName = "", +} + }); + Response response = await client.AddParticipantsAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_RemoveParticipants_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participantIds = new object[] + { +"" + }, + }); + Response response = client.RemoveParticipants("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_RemoveParticipants_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participantIds = new object[] + { +"" + }, + }); + Response response = await client.RemoveParticipantsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_RemoveParticipants_ShortVersion_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + RemoveParticipantsRequest body = new RemoveParticipantsRequest(new string[] { "" }); + Response response = client.RemoveParticipants("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_RemoveParticipants_ShortVersion_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + RemoveParticipantsRequest body = new RemoveParticipantsRequest(new string[] { "" }); + Response response = await client.RemoveParticipantsAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_RemoveParticipants_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participantIds = new object[] + { +"" + }, + }); + Response response = client.RemoveParticipants("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_RemoveParticipants_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participantIds = new object[] + { +"" + }, + }); + Response response = await client.RemoveParticipantsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_RemoveParticipants_AllParameters_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + RemoveParticipantsRequest body = new RemoveParticipantsRequest(new string[] { "" }); + Response response = client.RemoveParticipants("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_RemoveParticipants_AllParameters_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + RemoveParticipantsRequest body = new RemoveParticipantsRequest(new string[] { "" }); + Response response = await client.RemoveParticipantsAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_AnalyzeConversation_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.AnalyzeConversation("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_AnalyzeConversation_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.AnalyzeConversationAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_AnalyzeConversation_ShortVersion_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.AnalyzeConversation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_AnalyzeConversation_ShortVersion_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.AnalyzeConversationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_AnalyzeConversation_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.AnalyzeConversation("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_AnalyzeConversation_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.AnalyzeConversationAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationManagementClient_AnalyzeConversation_AllParameters_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = client.AnalyzeConversation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationManagementClient_AnalyzeConversation_AllParameters_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + Response response = await client.AnalyzeConversationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversations_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + foreach (BinaryData item in client.GetConversations(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversations_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + await foreach (BinaryData item in client.GetConversationsAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversations_ShortVersion_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + foreach (Conversation item in client.GetConversations()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversations_ShortVersion_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + await foreach (Conversation item in client.GetConversationsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversations_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + foreach (BinaryData item in client.GetConversations(1234, "", Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversations_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + await foreach (BinaryData item in client.GetConversationsAsync(1234, "", Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversations_AllParameters_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + foreach (Conversation item in client.GetConversations(maxpagesize: 1234, participantId: "", channelId: Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"))) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversations_AllParameters_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + await foreach (Conversation item in client.GetConversationsAsync(maxpagesize: 1234, participantId: "", channelId: Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"))) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessageItem_GetMessages_ShortVersion() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + foreach (BinaryData item in client.GetMessages("", null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessageItem_GetMessages_ShortVersion_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + await foreach (BinaryData item in client.GetMessagesAsync("", null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessageItem_GetMessages_ShortVersion_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + foreach (ConversationMessageItem item in client.GetMessages("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessageItem_GetMessages_ShortVersion_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + await foreach (ConversationMessageItem item in client.GetMessagesAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessageItem_GetMessages_AllParameters() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + foreach (BinaryData item in client.GetMessages("", 1234, "", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("sequenceId").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderDisplayName").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessageItem_GetMessages_AllParameters_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + await foreach (BinaryData item in client.GetMessagesAsync("", 1234, "", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("sequenceId").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderDisplayName").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessageItem_GetMessages_AllParameters_Convenience() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + foreach (ConversationMessageItem item in client.GetMessages("", maxpagesize: 1234, participantId: "")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessageItem_GetMessages_AllParameters_Convenience_Async() + { + ConversationManagementClient client = new ConversationManagementClient((string)null); + + await foreach (ConversationMessageItem item in client.GetMessagesAsync("", maxpagesize: 1234, participantId: "")) + { + } + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/Generated/Samples/Samples_ConversationMessagesClient.cs b/sdk/communication/Azure.Communication.Messages/tests/Generated/Samples/Samples_ConversationMessagesClient.cs new file mode 100644 index 000000000000..8b493fe52616 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/Generated/Samples/Samples_ConversationMessagesClient.cs @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Communication.Messages.Samples +{ + public partial class Samples_ConversationMessagesClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_AddParticipants_ShortVersion() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +} + }, + }); + Response response = client.AddParticipants("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_AddParticipants_ShortVersion_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +} + }, + }); + Response response = await client.AddParticipantsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_AddParticipants_ShortVersion_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + AddParticipantsRequest body = new AddParticipantsRequest(new Participant[] + { +new InternalParticipant(new CommunicationContact("")) + }); + Response response = client.AddParticipants("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_AddParticipants_ShortVersion_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + AddParticipantsRequest body = new AddParticipantsRequest(new Participant[] + { +new InternalParticipant(new CommunicationContact("")) + }); + Response response = await client.AddParticipantsAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_AddParticipants_AllParameters() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +displayName = "", +} + }, + }); + Response response = client.AddParticipants("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_AddParticipants_AllParameters_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participants = new object[] + { +new +{ +kind = "internal", +contact = new +{ +kind = "communication", +id = "", +}, +displayName = "", +} + }, + }); + Response response = await client.AddParticipantsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_AddParticipants_AllParameters_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + AddParticipantsRequest body = new AddParticipantsRequest(new Participant[] + { +new InternalParticipant(new CommunicationContact("")) +{ +DisplayName = "", +} + }); + Response response = client.AddParticipants("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_AddParticipants_AllParameters_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + AddParticipantsRequest body = new AddParticipantsRequest(new Participant[] + { +new InternalParticipant(new CommunicationContact("")) +{ +DisplayName = "", +} + }); + Response response = await client.AddParticipantsAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_RemoveParticipants_ShortVersion() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participantIds = new object[] + { +"" + }, + }); + Response response = client.RemoveParticipants("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_RemoveParticipants_ShortVersion_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participantIds = new object[] + { +"" + }, + }); + Response response = await client.RemoveParticipantsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_RemoveParticipants_ShortVersion_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + RemoveParticipantsRequest body = new RemoveParticipantsRequest(new string[] { "" }); + Response response = client.RemoveParticipants("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_RemoveParticipants_ShortVersion_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + RemoveParticipantsRequest body = new RemoveParticipantsRequest(new string[] { "" }); + Response response = await client.RemoveParticipantsAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_RemoveParticipants_AllParameters() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participantIds = new object[] + { +"" + }, + }); + Response response = client.RemoveParticipants("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_RemoveParticipants_AllParameters_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + participantIds = new object[] + { +"" + }, + }); + Response response = await client.RemoveParticipantsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("invalidParticipants")[0].GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_RemoveParticipants_AllParameters_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + RemoveParticipantsRequest body = new RemoveParticipantsRequest(new string[] { "" }); + Response response = client.RemoveParticipants("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_RemoveParticipants_AllParameters_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + RemoveParticipantsRequest body = new RemoveParticipantsRequest(new string[] { "" }); + Response response = await client.RemoveParticipantsAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_SendMessage_ShortVersion() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + request = new + { + kind = "text", + content = "", + }, + }); + Response response = client.SendMessage("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("messageId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_SendMessage_ShortVersion_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + request = new + { + kind = "text", + content = "", + }, + }); + Response response = await client.SendMessageAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("messageId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_SendMessage_ShortVersion_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + SendConversationMessageRequest body = new SendConversationMessageRequest(new TextConversationMessageContent("")); + Response response = client.SendMessage("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_SendMessage_ShortVersion_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + SendConversationMessageRequest body = new SendConversationMessageRequest(new TextConversationMessageContent("")); + Response response = await client.SendMessageAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_SendMessage_AllParameters() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + request = new + { + kind = "text", + content = "", + }, + outboundDeliveryStrategy = "internalOnly", + }); + Response response = client.SendMessage("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("messageId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_SendMessage_AllParameters_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + using RequestContent content = RequestContent.Create(new + { + request = new + { + kind = "text", + content = "", + }, + outboundDeliveryStrategy = "internalOnly", + }); + Response response = await client.SendMessageAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("messageId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_SendMessage_AllParameters_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + SendConversationMessageRequest body = new SendConversationMessageRequest(new TextConversationMessageContent("")) + { + OutboundDeliveryStrategy = OutboundDeliveryStrategyKind.InternalOnly, + }; + Response response = client.SendMessage("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_SendMessage_AllParameters_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + SendConversationMessageRequest body = new SendConversationMessageRequest(new TextConversationMessageContent("")) + { + OutboundDeliveryStrategy = OutboundDeliveryStrategyKind.InternalOnly, + }; + Response response = await client.SendMessageAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_AnalyzeConversation_ShortVersion() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + Response response = client.AnalyzeConversation("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_AnalyzeConversation_ShortVersion_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + Response response = await client.AnalyzeConversationAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_AnalyzeConversation_ShortVersion_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + Response response = client.AnalyzeConversation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_AnalyzeConversation_ShortVersion_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + Response response = await client.AnalyzeConversationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_AnalyzeConversation_AllParameters() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + Response response = client.AnalyzeConversation("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_AnalyzeConversation_AllParameters_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + Response response = await client.AnalyzeConversationAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessagesClient_AnalyzeConversation_AllParameters_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + Response response = client.AnalyzeConversation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessagesClient_AnalyzeConversation_AllParameters_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + Response response = await client.AnalyzeConversationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversations_ShortVersion() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + foreach (BinaryData item in client.GetConversations(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversations_ShortVersion_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + await foreach (BinaryData item in client.GetConversationsAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversations_ShortVersion_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + foreach (Conversation item in client.GetConversations()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversations_ShortVersion_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + await foreach (Conversation item in client.GetConversationsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversations_AllParameters() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + foreach (BinaryData item in client.GetConversations(1234, "", Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversations_AllParameters_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + await foreach (BinaryData item in client.GetConversationsAsync(1234, "", Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("topic").ToString()); + Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString()); + Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversation_GetConversations_AllParameters_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + foreach (Conversation item in client.GetConversations(maxpagesize: 1234, participantId: "", channelId: Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"))) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversation_GetConversations_AllParameters_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + await foreach (Conversation item in client.GetConversationsAsync(maxpagesize: 1234, participantId: "", channelId: Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"))) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessageItem_GetMessages_ShortVersion() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + foreach (BinaryData item in client.GetMessages("", null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessageItem_GetMessages_ShortVersion_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + await foreach (BinaryData item in client.GetMessagesAsync("", null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessageItem_GetMessages_ShortVersion_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + foreach (ConversationMessageItem item in client.GetMessages("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessageItem_GetMessages_ShortVersion_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + await foreach (ConversationMessageItem item in client.GetMessagesAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessageItem_GetMessages_AllParameters() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + foreach (BinaryData item in client.GetMessages("", 1234, "", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("sequenceId").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderDisplayName").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessageItem_GetMessages_AllParameters_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + await foreach (BinaryData item in client.GetMessagesAsync("", 1234, "", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("sequenceId").ToString()); + Console.WriteLine(result.GetProperty("message").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("senderDisplayName").ToString()); + Console.WriteLine(result.GetProperty("senderCommunicationIdentifier").ToString()); + Console.WriteLine(result.GetProperty("createdOn").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationMessageItem_GetMessages_AllParameters_Convenience() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + foreach (ConversationMessageItem item in client.GetMessages("", maxpagesize: 1234, participantId: "")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationMessageItem_GetMessages_AllParameters_Convenience_Async() + { + ConversationMessagesClient client = new ConversationMessagesClient((string)null); + + await foreach (ConversationMessageItem item in client.GetMessagesAsync("", maxpagesize: 1234, participantId: "")) + { + } + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml index 9c9e66f49dcd..a86451f38fa2 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 +commit: d71f45e0cc2bb21a89ba200d6bd7ffdb46b5cc52 directory: specification/communication/Communication.Messages additionalDirectories: [] repo: Azure/azure-rest-api-specs diff --git a/sdk/communication/Azure.Communication.Messages/tspCodeModel.json b/sdk/communication/Azure.Communication.Messages/tspCodeModel.json index 17188dcef382..6d15038a1a96 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-03-01-preview" ], "Enums": [ { @@ -149,7 +150,7 @@ "doc": "The type of message.", "isFixed": false, "isFlags": false, - "usage": "Input,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -277,7 +278,7 @@ "doc": "The type of the template parameter.", "isFixed": false, "isFlags": false, - "usage": "Input,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -315,7 +316,7 @@ "doc": "The type of the message template.", "isFixed": false, "isFlags": false, - "usage": "Input,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -371,7 +372,7 @@ "doc": "The WhatsApp button sub type.", "isFixed": false, "isFlags": false, - "usage": "Input,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -422,6 +423,24 @@ }, "doc": "Azure Communication Messages 2024-08-30 api version", "decorators": [] + }, + { + "$id": "48", + "kind": "enumvalue", + "name": "c2025_03_01_Preview", + "value": "2025-03-01-preview", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "Azure Communication Messages 2025-03-01-preview api version", + "decorators": [] } ], "doc": "Azure Communication Messages Versions", @@ -431,12 +450,12 @@ "decorators": [] }, { - "$id": "48", + "$id": "50", "kind": "enum", "name": "MessageTemplateStatus", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateStatus", "valueType": { - "$id": "49", + "$id": "51", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -444,73 +463,73 @@ }, "values": [ { - "$id": "50", + "$id": "52", "kind": "enumvalue", "name": "approved", "value": "approved", "valueType": { - "$id": "51", + "$id": "53", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "48" + "$ref": "50" }, "doc": "Message template is approved.", "decorators": [] }, { - "$id": "52", + "$id": "54", "kind": "enumvalue", "name": "rejected", "value": "rejected", "valueType": { - "$id": "53", + "$id": "55", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "48" + "$ref": "50" }, "doc": "Message template is rejected.", "decorators": [] }, { - "$id": "54", + "$id": "56", "kind": "enumvalue", "name": "pending", "value": "pending", "valueType": { - "$id": "55", + "$id": "57", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "48" + "$ref": "50" }, "doc": "Message template is pending.", "decorators": [] }, { - "$id": "56", + "$id": "58", "kind": "enumvalue", "name": "paused", "value": "paused", "valueType": { - "$id": "57", + "$id": "59", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "48" + "$ref": "50" }, "doc": "Message template is paused.", "decorators": [] @@ -523,12 +542,12 @@ "decorators": [] }, { - "$id": "58", + "$id": "60", "kind": "enum", "name": "CommunicationMessagesChannel", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.CommunicationMessagesChannel", "valueType": { - "$id": "59", + "$id": "61", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -536,19 +555,19 @@ }, "values": [ { - "$id": "60", + "$id": "62", "kind": "enumvalue", "name": "whatsApp", "value": "whatsApp", "valueType": { - "$id": "61", + "$id": "63", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "58" + "$ref": "60" }, "doc": "The WhatsApp communication messages channel type.", "decorators": [] @@ -561,12 +580,198 @@ "decorators": [] }, { - "$id": "62", + "$id": "64", + "kind": "enum", + "name": "OutboundDeliveryStrategyKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.OutboundDeliveryStrategyKind", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "66", + "kind": "enumvalue", + "name": "internalOnly", + "value": "internalOnly", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "doc": "Delivery strategy for internal only.", + "decorators": [] + }, + { + "$id": "68", + "kind": "enumvalue", + "name": "allParticipants", + "value": "allParticipants", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "doc": "Delivery strategy for all participants.", + "decorators": [] + } + ], + "doc": "The options of the outbound delivery strategy for messages sent by emplyees in a conversation.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "70", + "kind": "enum", + "name": "ParticipantKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ParticipantKind", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "72", + "kind": "enumvalue", + "name": "internal", + "value": "internal", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "70" + }, + "doc": "A participant internal to Azure Communication Services.", + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "external", + "value": "External", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "70" + }, + "doc": "A participant on other platforms", + "decorators": [] + } + ], + "doc": "The type of a participant in a threaded conversation.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "76", + "kind": "enum", + "name": "MessagePlatformKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessagePlatformKind", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "78", + "kind": "enumvalue", + "name": "communication", + "value": "communication", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Azure Communication platform.", + "decorators": [] + }, + { + "$id": "80", + "kind": "enumvalue", + "name": "bot", + "value": "bot", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Bot platform.", + "decorators": [] + }, + { + "$id": "82", + "kind": "enumvalue", + "name": "whatsApp", + "value": "whatsApp", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "WhatsApp platform.", + "decorators": [] + } + ], + "doc": "Defines the type of message platform.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "84", "kind": "enum", "name": "RepeatabilityResult", "crossLanguageDefinitionId": "Azure.Core.RepeatabilityResult", "valueType": { - "$id": "63", + "$id": "85", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -574,37 +779,37 @@ }, "values": [ { - "$id": "64", + "$id": "86", "kind": "enumvalue", "name": "accepted", "value": "accepted", "valueType": { - "$id": "65", + "$id": "87", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "62" + "$ref": "84" }, "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": "88", "kind": "enumvalue", "name": "rejected", "value": "rejected", "valueType": { - "$id": "67", + "$id": "89", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "62" + "$ref": "84" }, "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": [] @@ -619,7 +824,7 @@ ], "Models": [ { - "$id": "68", + "$id": "90", "kind": "model", "name": "NotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent", @@ -627,11 +832,11 @@ "doc": "Details of the message to send.", "decorators": [], "discriminatorProperty": { - "$id": "69", + "$id": "91", "kind": "property", "name": "kind", "serializedName": "kind", - "doc": "The type discriminator describing a notification type.", + "doc": "The type discriminator describing a message type.", "type": { "$ref": "2" }, @@ -644,18 +849,18 @@ }, "properties": [ { - "$id": "70", + "$id": "92", "kind": "property", "name": "channelRegistrationId", "serializedName": "channelRegistrationId", "doc": "The Channel Registration ID for the Business Identifier.", "type": { - "$id": "71", + "$id": "93", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "72", + "$id": "94", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -671,17 +876,17 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.channelRegistrationId" }, { - "$id": "73", + "$id": "95", "kind": "property", "name": "to", "serializedName": "to", "doc": "The native external platform user identifiers of the recipient.", "type": { - "$id": "74", + "$id": "96", "kind": "array", "name": "Array", "valueType": { - "$id": "75", + "$id": "97", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -698,13 +903,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.to" }, { - "$ref": "69" + "$ref": "91" } ], "discriminatedSubtypes": { - "$id": "76", + "$id": "98", "text": { - "$id": "77", + "$id": "99", "kind": "model", "name": "TextNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent", @@ -713,20 +918,20 @@ "discriminatorValue": "text", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "90" }, "properties": [ { - "$id": "78", + "$id": "100", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is text.", "type": { - "$id": "79", + "$id": "101", "kind": "constant", "valueType": { - "$id": "80", + "$id": "102", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -743,13 +948,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent.kind" }, { - "$id": "81", + "$id": "103", "kind": "property", "name": "content", "serializedName": "content", "doc": "Message content.", "type": { - "$id": "82", + "$id": "104", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -765,7 +970,7 @@ ] }, "image_v0": { - "$id": "83", + "$id": "105", "kind": "model", "name": "MediaNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent", @@ -775,20 +980,20 @@ "discriminatorValue": "image_v0", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "90" }, "properties": [ { - "$id": "84", + "$id": "106", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "85", + "$id": "107", "kind": "constant", "valueType": { - "$id": "86", + "$id": "108", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -805,13 +1010,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.kind" }, { - "$id": "87", + "$id": "109", "kind": "property", "name": "content", "serializedName": "content", "doc": "Optional text content.", "type": { - "$id": "88", + "$id": "110", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -825,13 +1030,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.content" }, { - "$id": "89", + "$id": "111", "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": "90", + "$id": "112", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -847,7 +1052,7 @@ ] }, "image": { - "$id": "91", + "$id": "113", "kind": "model", "name": "ImageNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent", @@ -856,20 +1061,20 @@ "discriminatorValue": "image", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "90" }, "properties": [ { - "$id": "92", + "$id": "114", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "93", + "$id": "115", "kind": "constant", "valueType": { - "$id": "94", + "$id": "116", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -886,13 +1091,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.kind" }, { - "$id": "95", + "$id": "117", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "96", + "$id": "118", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -906,13 +1111,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.caption" }, { - "$id": "97", + "$id": "119", "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": "98", + "$id": "120", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -928,7 +1133,7 @@ ] }, "document": { - "$id": "99", + "$id": "121", "kind": "model", "name": "DocumentNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent", @@ -937,20 +1142,20 @@ "discriminatorValue": "document", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "90" }, "properties": [ { - "$id": "100", + "$id": "122", "kind": "property", "name": "kind", "serializedName": "kind", - "doc": "Message notification type is image.", + "doc": "Message notification type is document.", "type": { - "$id": "101", + "$id": "123", "kind": "constant", "valueType": { - "$id": "102", + "$id": "124", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -967,13 +1172,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.kind" }, { - "$id": "103", + "$id": "125", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "104", + "$id": "126", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -987,13 +1192,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.caption" }, { - "$id": "105", + "$id": "127", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "Optional name for the file.", "type": { - "$id": "106", + "$id": "128", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1007,13 +1212,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.fileName" }, { - "$id": "107", + "$id": "129", "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": "108", + "$id": "130", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1029,7 +1234,7 @@ ] }, "video": { - "$id": "109", + "$id": "131", "kind": "model", "name": "VideoNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent", @@ -1038,20 +1243,20 @@ "discriminatorValue": "video", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "90" }, "properties": [ { - "$id": "110", + "$id": "132", "kind": "property", "name": "kind", "serializedName": "kind", - "doc": "Message notification type is image.", + "doc": "Message notification type is video.", "type": { - "$id": "111", + "$id": "133", "kind": "constant", "valueType": { - "$id": "112", + "$id": "134", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1068,13 +1273,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.kind" }, { - "$id": "113", + "$id": "135", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "114", + "$id": "136", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1088,13 +1293,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.caption" }, { - "$id": "115", + "$id": "137", "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": "116", + "$id": "138", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1110,7 +1315,7 @@ ] }, "audio": { - "$id": "117", + "$id": "139", "kind": "model", "name": "AudioNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent", @@ -1119,20 +1324,20 @@ "discriminatorValue": "audio", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "90" }, "properties": [ { - "$id": "118", + "$id": "140", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is audio.", "type": { - "$id": "119", + "$id": "141", "kind": "constant", "valueType": { - "$id": "120", + "$id": "142", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1149,13 +1354,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent.kind" }, { - "$id": "121", + "$id": "143", "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": "122", + "$id": "144", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1171,7 +1376,7 @@ ] }, "template": { - "$id": "123", + "$id": "145", "kind": "model", "name": "TemplateNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent", @@ -1180,20 +1385,20 @@ "discriminatorValue": "template", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "90" }, "properties": [ { - "$id": "124", + "$id": "146", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is template.", "type": { - "$id": "125", + "$id": "147", "kind": "constant", "valueType": { - "$id": "126", + "$id": "148", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1210,28 +1415,28 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent.kind" }, { - "$id": "127", + "$id": "149", "kind": "property", "name": "template", "serializedName": "template", "doc": "The template object used to create templates.", "type": { - "$id": "128", + "$id": "150", "kind": "model", "name": "MessageTemplate", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The template object used to create templates.", "decorators": [], "properties": [ { - "$id": "129", + "$id": "151", "kind": "property", "name": "name", "serializedName": "name", "doc": "Name of the template.", "type": { - "$id": "130", + "$id": "152", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1245,13 +1450,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.name" }, { - "$id": "131", + "$id": "153", "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": "132", + "$id": "154", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1265,25 +1470,25 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.language" }, { - "$id": "133", + "$id": "155", "kind": "property", "name": "values", "serializedName": "values", "doc": "The template values.", "type": { - "$id": "134", + "$id": "156", "kind": "array", "name": "ArrayMessageTemplateValue", "valueType": { - "$id": "135", + "$id": "157", "kind": "model", "name": "MessageTemplateValue", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The class describes a parameter of a template.", "decorators": [], "discriminatorProperty": { - "$id": "136", + "$id": "158", "kind": "property", "name": "kind", "serializedName": "kind", @@ -1300,13 +1505,13 @@ }, "properties": [ { - "$id": "137", + "$id": "159", "kind": "property", "name": "name", "serializedName": "name", "doc": "Template binding reference name", "type": { - "$id": "138", + "$id": "160", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1320,35 +1525,35 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue.name" }, { - "$ref": "136" + "$ref": "158" } ], "discriminatedSubtypes": { - "$id": "139", + "$id": "161", "text": { - "$id": "140", + "$id": "162", "kind": "model", "name": "MessageTemplateText", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The message template's text value information.", "discriminatorValue": "text", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "157" }, "properties": [ { - "$id": "141", + "$id": "163", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is text.", "type": { - "$id": "142", + "$id": "164", "kind": "constant", "valueType": { - "$id": "143", + "$id": "165", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1365,13 +1570,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText.kind" }, { - "$id": "144", + "$id": "166", "kind": "property", "name": "text", "serializedName": "text", "doc": "The text value.", "type": { - "$id": "145", + "$id": "167", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1387,29 +1592,29 @@ ] }, "image": { - "$id": "146", + "$id": "168", "kind": "model", "name": "MessageTemplateImage", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The message template's image value information.", "discriminatorValue": "image", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "157" }, "properties": [ { - "$id": "147", + "$id": "169", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is image.", "type": { - "$id": "148", + "$id": "170", "kind": "constant", "valueType": { - "$id": "149", + "$id": "171", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1426,13 +1631,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.kind" }, { - "$id": "150", + "$id": "172", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "151", + "$id": "173", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1446,13 +1651,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.url" }, { - "$id": "152", + "$id": "174", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "153", + "$id": "175", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1466,13 +1671,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.caption" }, { - "$id": "154", + "$id": "176", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "155", + "$id": "177", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1488,29 +1693,29 @@ ] }, "document": { - "$id": "156", + "$id": "178", "kind": "model", "name": "MessageTemplateDocument", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The message template's document value information.", "discriminatorValue": "document", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "157" }, "properties": [ { - "$id": "157", + "$id": "179", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is document.", "type": { - "$id": "158", + "$id": "180", "kind": "constant", "valueType": { - "$id": "159", + "$id": "181", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1527,13 +1732,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.kind" }, { - "$id": "160", + "$id": "182", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "161", + "$id": "183", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1547,13 +1752,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.url" }, { - "$id": "162", + "$id": "184", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "163", + "$id": "185", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1567,13 +1772,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.caption" }, { - "$id": "164", + "$id": "186", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "165", + "$id": "187", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1589,29 +1794,29 @@ ] }, "video": { - "$id": "166", + "$id": "188", "kind": "model", "name": "MessageTemplateVideo", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The message template's video value information.", "discriminatorValue": "video", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "157" }, "properties": [ { - "$id": "167", + "$id": "189", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is video.", "type": { - "$id": "168", + "$id": "190", "kind": "constant", "valueType": { - "$id": "169", + "$id": "191", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1628,13 +1833,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.kind" }, { - "$id": "170", + "$id": "192", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "171", + "$id": "193", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1648,13 +1853,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.url" }, { - "$id": "172", + "$id": "194", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "173", + "$id": "195", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1668,13 +1873,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.caption" }, { - "$id": "174", + "$id": "196", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "175", + "$id": "197", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1690,29 +1895,29 @@ ] }, "location": { - "$id": "176", + "$id": "198", "kind": "model", "name": "MessageTemplateLocation", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The message template's location value information.", "discriminatorValue": "location", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "157" }, "properties": [ { - "$id": "177", + "$id": "199", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is location.", "type": { - "$id": "178", + "$id": "200", "kind": "constant", "valueType": { - "$id": "179", + "$id": "201", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1729,13 +1934,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.kind" }, { - "$id": "180", + "$id": "202", "kind": "property", "name": "locationName", "serializedName": "locationName", "doc": "The [Optional] name of the location.", "type": { - "$id": "181", + "$id": "203", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1749,13 +1954,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.locationName" }, { - "$id": "182", + "$id": "204", "kind": "property", "name": "address", "serializedName": "address", "doc": "The [Optional] address of the location.", "type": { - "$id": "183", + "$id": "205", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1769,13 +1974,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.address" }, { - "$id": "184", + "$id": "206", "kind": "property", "name": "latitude", "serializedName": "latitude", "doc": "The latitude of the location.", "type": { - "$id": "185", + "$id": "207", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -1789,13 +1994,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.latitude" }, { - "$id": "186", + "$id": "208", "kind": "property", "name": "longitude", "serializedName": "longitude", "doc": "The longitude of the location.", "type": { - "$id": "187", + "$id": "209", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -1811,29 +2016,29 @@ ] }, "quickAction": { - "$id": "188", + "$id": "210", "kind": "model", "name": "MessageTemplateQuickAction", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The message template's quick action value information.", "discriminatorValue": "quickAction", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "157" }, "properties": [ { - "$id": "189", + "$id": "211", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is quick action.", "type": { - "$id": "190", + "$id": "212", "kind": "constant", "valueType": { - "$id": "191", + "$id": "213", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1850,13 +2055,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.kind" }, { - "$id": "192", + "$id": "214", "kind": "property", "name": "text", "serializedName": "text", "doc": "The [Optional] quick action text", "type": { - "$id": "193", + "$id": "215", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1870,13 +2075,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.text" }, { - "$id": "194", + "$id": "216", "kind": "property", "name": "payload", "serializedName": "payload", "doc": "The [Optional] quick action payload", "type": { - "$id": "195", + "$id": "217", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1904,21 +2109,21 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.values" }, { - "$id": "196", + "$id": "218", "kind": "property", "name": "bindings", "serializedName": "bindings", "doc": "The binding object to link values to the template specific locations", "type": { - "$id": "197", + "$id": "219", "kind": "model", "name": "MessageTemplateBindings", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindings", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The binding object to link values to the template specific locations", "decorators": [], "discriminatorProperty": { - "$id": "198", + "$id": "220", "kind": "property", "name": "kind", "serializedName": "kind", @@ -1935,35 +2140,35 @@ }, "properties": [ { - "$ref": "198" + "$ref": "220" } ], "discriminatedSubtypes": { - "$id": "199", + "$id": "221", "whatsApp": { - "$id": "200", + "$id": "222", "kind": "model", "name": "WhatsAppMessageTemplateBindings", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The template bindings for WhatsApp", "discriminatorValue": "whatsApp", "decorators": [], "baseModel": { - "$ref": "197" + "$ref": "219" }, "properties": [ { - "$id": "201", + "$id": "223", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "MessageTemplateBindings is whatsApp", "type": { - "$id": "202", + "$id": "224", "kind": "constant", "valueType": { - "$id": "203", + "$id": "225", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1980,32 +2185,32 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.kind" }, { - "$id": "204", + "$id": "226", "kind": "property", "name": "header", "serializedName": "header", "doc": "The header template bindings", "type": { - "$id": "205", + "$id": "227", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$id": "206", + "$id": "228", "kind": "model", "name": "WhatsAppMessageTemplateBindingsComponent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsComponent", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The template bindings component for WhatsApp", "decorators": [], "properties": [ { - "$id": "207", + "$id": "229", "kind": "property", "name": "refValue", "serializedName": "refValue", "doc": "The name of the referenced item in the template values.", "type": { - "$id": "208", + "$id": "230", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2031,17 +2236,17 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.header" }, { - "$id": "209", + "$id": "231", "kind": "property", "name": "body", "serializedName": "body", "doc": "The body template bindings", "type": { - "$id": "210", + "$id": "232", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$ref": "206" + "$ref": "228" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -2054,17 +2259,17 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.body" }, { - "$id": "211", + "$id": "233", "kind": "property", "name": "footer", "serializedName": "footer", "doc": "The footer template bindings", "type": { - "$id": "212", + "$id": "234", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$ref": "206" + "$ref": "228" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -2077,26 +2282,26 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.footer" }, { - "$id": "213", + "$id": "235", "kind": "property", "name": "buttons", "serializedName": "buttons", "doc": "The button template bindings", "type": { - "$id": "214", + "$id": "236", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsButton", "valueType": { - "$id": "215", + "$id": "237", "kind": "model", "name": "WhatsAppMessageTemplateBindingsButton", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton", - "usage": "Input,Json", + "usage": "Input,Output,Json", "doc": "The template bindings component button for WhatsApp", "decorators": [], "properties": [ { - "$id": "216", + "$id": "238", "kind": "property", "name": "subType", "serializedName": "subType", @@ -2112,13 +2317,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton.subType" }, { - "$id": "217", + "$id": "239", "kind": "property", "name": "refValue", "serializedName": "refValue", "doc": "The name of the referenced item in the template values.", "type": { - "$id": "218", + "$id": "240", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2168,64 +2373,64 @@ } }, { - "$ref": "77" + "$ref": "99" }, { - "$ref": "83" + "$ref": "105" }, { - "$ref": "91" + "$ref": "113" }, { - "$ref": "99" + "$ref": "121" }, { - "$ref": "109" + "$ref": "131" }, { - "$ref": "117" + "$ref": "139" }, { - "$ref": "123" + "$ref": "145" }, { - "$ref": "128" + "$ref": "150" }, { - "$ref": "135" + "$ref": "157" }, { - "$ref": "140" + "$ref": "162" }, { - "$ref": "146" + "$ref": "168" }, { - "$ref": "156" + "$ref": "178" }, { - "$ref": "166" + "$ref": "188" }, { - "$ref": "176" + "$ref": "198" }, { - "$ref": "188" + "$ref": "210" }, { - "$ref": "197" + "$ref": "219" }, { - "$ref": "200" + "$ref": "222" }, { - "$ref": "206" + "$ref": "228" }, { - "$ref": "215" + "$ref": "237" }, { - "$id": "219", + "$id": "241", "kind": "model", "name": "SendMessageResult", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendMessageResult", @@ -2234,17 +2439,17 @@ "decorators": [], "properties": [ { - "$id": "220", + "$id": "242", "kind": "property", "name": "receipts", "serializedName": "receipts", "doc": "Receipts of the send message operation.", "type": { - "$id": "221", + "$id": "243", "kind": "array", "name": "ArrayMessageReceipt", "valueType": { - "$id": "222", + "$id": "244", "kind": "model", "name": "MessageReceipt", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt", @@ -2253,13 +2458,13 @@ "decorators": [], "properties": [ { - "$id": "223", + "$id": "245", "kind": "property", "name": "messageId", "serializedName": "messageId", "doc": "The message id.", "type": { - "$id": "224", + "$id": "246", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2273,13 +2478,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt.messageId" }, { - "$id": "225", + "$id": "247", "kind": "property", "name": "to", "serializedName": "to", "doc": "The native external platform user identifier of the recipient.", "type": { - "$id": "226", + "$id": "248", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2307,10 +2512,10 @@ ] }, { - "$ref": "222" + "$ref": "244" }, { - "$id": "227", + "$id": "249", "kind": "model", "name": "MessageTemplateItem", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem", @@ -2318,13 +2523,13 @@ "doc": "The message template as returned from the service.", "decorators": [], "discriminatorProperty": { - "$id": "228", + "$id": "250", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "The type discriminator describing a template type.", "type": { - "$ref": "58" + "$ref": "60" }, "optional": false, "readOnly": false, @@ -2335,13 +2540,13 @@ }, "properties": [ { - "$id": "229", + "$id": "251", "kind": "property", "name": "name", "serializedName": "name", "doc": "The template's name.", "type": { - "$id": "230", + "$id": "252", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2355,13 +2560,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.name" }, { - "$id": "231", + "$id": "253", "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": "232", + "$id": "254", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2375,13 +2580,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.language" }, { - "$id": "233", + "$id": "255", "kind": "property", "name": "status", "serializedName": "status", "doc": "The aggregated template status.", "type": { - "$ref": "48" + "$ref": "50" }, "optional": false, "readOnly": false, @@ -2391,13 +2596,13 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.status" }, { - "$ref": "228" + "$ref": "250" } ], "discriminatedSubtypes": { - "$id": "234", + "$id": "256", "whatsApp": { - "$id": "235", + "$id": "257", "kind": "model", "name": "WhatsAppMessageTemplateItem", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem", @@ -2406,17 +2611,17 @@ "discriminatorValue": "whatsApp", "decorators": [], "baseModel": { - "$ref": "227" + "$ref": "249" }, "properties": [ { - "$id": "236", + "$id": "258", "kind": "property", "name": "content", "serializedName": "content", "doc": "WhatsApp platform's template content. This is the payload returned from WhatsApp API.", "type": { - "$id": "237", + "$id": "259", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -2430,16 +2635,16 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem.content" }, { - "$id": "238", + "$id": "260", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message template response type is whatsApp.", "type": { - "$id": "239", + "$id": "261", "kind": "constant", "valueType": { - "$id": "240", + "$id": "262", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2460,89 +2665,5305 @@ } }, { - "$ref": "235" + "$ref": "257" }, { - "$id": "241", + "$id": "263", "kind": "model", - "name": "PagedMessageTemplateItem", - "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", - "usage": "Output,Json", - "doc": "Paged collection of MessageTemplateItem items", + "name": "Conversation", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Conversation", + "usage": "Input,Output,Json", + "doc": "A conversation.", "decorators": [], "properties": [ { - "$id": "242", + "$id": "264", "kind": "property", - "name": "value", - "serializedName": "value", - "doc": "The MessageTemplateItem items on this page", + "name": "id", + "serializedName": "id", + "doc": "The conversation ID.", "type": { - "$id": "243", - "kind": "array", - "name": "ArrayMessageTemplateItem", - "valueType": { - "$ref": "227" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", + "$id": "265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Conversation.id" }, { - "$id": "244", + "$id": "266", "kind": "property", - "name": "nextLink", - "serializedName": "nextLink", - "doc": "The link to the next page of items", + "name": "topic", + "serializedName": "topic", + "doc": "The conversation topic.", "type": { - "$id": "245", - "kind": "url", - "name": "ResourceLocation", - "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", - "baseType": { - "$id": "246", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Conversation.topic" + }, + { + "$id": "268", + "kind": "property", + "name": "deliveryChannelIds", + "serializedName": "deliveryChannelIds", + "doc": "List of delivery channel IDs.", + "type": { + "$id": "269", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "270", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "decorators": [] + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Conversation.deliveryChannelIds" + }, + { + "$id": "271", + "kind": "property", + "name": "outboundDeliveryStrategy", + "serializedName": "outboundDeliveryStrategy", + "doc": "Outbound delivery strategy for the conversation.", + "type": { + "$ref": "64" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Conversation.outboundDeliveryStrategy" + }, + { + "$id": "272", + "kind": "property", + "name": "participants", + "serializedName": "participants", + "doc": "List of participants involved in the conversation.", + "type": { + "$id": "273", + "kind": "array", + "name": "ArrayParticipant", + "valueType": { + "$id": "274", + "kind": "model", + "name": "Participant", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Participant", + "usage": "Input,Output,Json", + "doc": "Advanced Messaging conversation participant.", + "decorators": [], + "discriminatorProperty": { + "$id": "275", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The type discriminator describing a participant type.", + "type": { + "$ref": "70" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Participant.kind" + }, + "properties": [ + { + "$id": "276", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Participant Identifier.", + "type": { + "$id": "277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Participant.id" + }, + { + "$id": "278", + "kind": "property", + "name": "displayName", + "serializedName": "displayName", + "doc": "Participant display name.", + "type": { + "$id": "279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Participant.displayName" + }, + { + "$ref": "275" + } + ], + "discriminatedSubtypes": { + "$id": "280", + "internal": { + "$id": "281", + "kind": "model", + "name": "InternalParticipant", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InternalParticipant", + "usage": "Input,Output,Json", + "doc": "Internal conversation participant.", + "discriminatorValue": "internal", + "decorators": [], + "baseModel": { + "$ref": "274" + }, + "properties": [ + { + "$id": "282", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Participant type is internal.", + "type": { + "$id": "283", + "kind": "constant", + "valueType": { + "$id": "284", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "internal", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InternalParticipant.kind" + }, + { + "$id": "285", + "kind": "property", + "name": "contact", + "serializedName": "contact", + "doc": "The internal platform identifiers for the participant.", + "type": { + "$id": "286", + "kind": "model", + "name": "ConversationContact", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Contact", + "usage": "Input,Output,Json", + "doc": "Details of an external platform contact.", + "decorators": [], + "discriminatorProperty": { + "$id": "287", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Type of message platform (e.g., WhatsApp).", + "type": { + "$ref": "76" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Contact.kind" + }, + "properties": [ + { + "$id": "288", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "External platform identifier.", + "type": { + "$id": "289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Contact.id" + }, + { + "$ref": "287" + } + ], + "discriminatedSubtypes": { + "$id": "290", + "communication": { + "$id": "291", + "kind": "model", + "name": "CommunicationContact", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.CommunicationContact", + "usage": "Input,Output,Json", + "doc": "Communication Contact.", + "discriminatorValue": "communication", + "decorators": [], + "baseModel": { + "$ref": "286" + }, + "properties": [ + { + "$id": "292", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Contact type is communication.", + "type": { + "$id": "293", + "kind": "constant", + "valueType": { + "$id": "294", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "communication", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.CommunicationContact.kind" + } + ] + }, + "bot": { + "$id": "295", + "kind": "model", + "name": "BotContact", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.BotContact", + "usage": "Input,Output,Json", + "doc": "Bot Contact.", + "discriminatorValue": "bot", + "decorators": [], + "baseModel": { + "$ref": "286" + }, + "properties": [ + { + "$id": "296", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Contact type is bot.", + "type": { + "$id": "297", + "kind": "constant", + "valueType": { + "$id": "298", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "bot", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.BotContact.kind" + }, + { + "$id": "299", + "kind": "property", + "name": "botAppId", + "serializedName": "botAppId", + "doc": "Bot App Id of the Bot Contact.", + "type": { + "$id": "300", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.BotContact.botAppId" + } + ] + }, + "whatsApp": { + "$id": "301", + "kind": "model", + "name": "WhatsAppContact", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppContact", + "usage": "Input,Output,Json", + "doc": "WhatsApp Contact.", + "discriminatorValue": "whatsApp", + "decorators": [], + "baseModel": { + "$ref": "286" + }, + "properties": [ + { + "$id": "302", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Contact type is whatsApp.", + "type": { + "$id": "303", + "kind": "constant", + "valueType": { + "$id": "304", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "whatsApp", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppContact.kind" + } + ] + } + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InternalParticipant.contact" + } + ] + }, + "External": { + "$id": "305", + "kind": "model", + "name": "ExternalParticipant", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ExternalParticipant", + "usage": "Input,Output,Json", + "doc": "External conversation participant.", + "discriminatorValue": "External", + "decorators": [], + "baseModel": { + "$ref": "274" + }, + "properties": [ + { + "$id": "306", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Participant type is external.", + "type": { + "$id": "307", + "kind": "constant", + "valueType": { + "$id": "308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "External", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ExternalParticipant.kind" + }, + { + "$id": "309", + "kind": "property", + "name": "contacts", + "serializedName": "contacts", + "doc": "List of external platform identifiers for the participant.", + "type": { + "$id": "310", + "kind": "array", + "name": "ArrayContact", + "valueType": { + "$ref": "286" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ExternalParticipant.contacts" + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Conversation.participants" + } + ] + }, + { + "$ref": "274" + }, + { + "$ref": "281" + }, + { + "$ref": "286" + }, + { + "$ref": "291" + }, + { + "$ref": "295" + }, + { + "$ref": "301" + }, + { + "$ref": "305" + }, + { + "$id": "311", + "kind": "model", + "name": "ConversationMessage", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Message", + "usage": "Input,Json", + "doc": "Details of a message.", + "decorators": [], + "properties": [ + { + "$id": "312", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Content of the message.", + "type": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Message.content" + } + ] + }, + { + "$id": "314", + "kind": "model", + "name": "CreateConversationRequest", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.createConversation.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "315", + "kind": "property", + "name": "conversation", + "serializedName": "conversation", + "doc": "The conversation details.", + "type": { + "$ref": "263" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "createConversation.Request.anonymous.conversation" + }, + { + "$id": "316", + "kind": "property", + "name": "initialMessage", + "serializedName": "initialMessage", + "doc": "An intial message within the conversation.", + "type": { + "$ref": "311" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "createConversation.Request.anonymous.initialMessage" + } + ] + }, + { + "$id": "317", + "kind": "model", + "name": "ConversationMessageItem", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageItem", + "usage": "Output,Json", + "doc": "The conversation message as returned from the service.", + "decorators": [], + "properties": [ + { + "$id": "318", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Message ID.", + "type": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageItem.id" + }, + { + "$id": "320", + "kind": "property", + "name": "sequenceId", + "serializedName": "sequenceId", + "doc": "Message sequence ID.", + "type": { + "$id": "321", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageItem.sequenceId" + }, + { + "$id": "322", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "Payload of a threaded conversation message.", + "type": { + "$id": "323", + "kind": "model", + "name": "ConversationMessageContent", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageContent", + "usage": "Input,Output,Json", + "doc": "Details of the conversation message content.", + "decorators": [], + "discriminatorProperty": { + "$id": "324", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "The type discriminator describing a message type.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageContent.kind" + }, + "properties": [ + { + "$ref": "324" + } + ], + "discriminatedSubtypes": { + "$id": "325", + "text": { + "$id": "326", + "kind": "model", + "name": "TextConversationMessageContent", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextConversationMessageContent", + "usage": "Input,Output,Json", + "doc": "A request to send a text conversation message.", + "discriminatorValue": "text", + "decorators": [], + "baseModel": { + "$ref": "323" + }, + "properties": [ + { + "$id": "327", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is text.", + "type": { + "$ref": "101" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextConversationMessageContent.kind" + }, + { + "$id": "328", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Message content.", + "type": { + "$id": "329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextConversationMessageContent.content" + } + ] + }, + "image": { + "$id": "330", + "kind": "model", + "name": "ImageConversationMessageContent", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageConversationMessageContent", + "usage": "Input,Output,Json", + "doc": "A request to send an image conversation message.", + "discriminatorValue": "image", + "decorators": [], + "baseModel": { + "$ref": "323" + }, + "properties": [ + { + "$id": "331", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is image.", + "type": { + "$ref": "115" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageConversationMessageContent.kind" + }, + { + "$id": "332", + "kind": "property", + "name": "caption", + "serializedName": "caption", + "doc": "Optional text content.", + "type": { + "$id": "333", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageConversationMessageContent.caption" + }, + { + "$id": "334", + "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": "335", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageConversationMessageContent.mediaUri" + } + ] + }, + "document": { + "$id": "336", + "kind": "model", + "name": "DocumentConversationMessageContent", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentConversationMessageContent", + "usage": "Input,Output,Json", + "doc": "A request to send a document conversation message.", + "discriminatorValue": "document", + "decorators": [], + "baseModel": { + "$ref": "323" + }, + "properties": [ + { + "$id": "337", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is document.", + "type": { + "$ref": "123" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentConversationMessageContent.kind" + }, + { + "$id": "338", + "kind": "property", + "name": "caption", + "serializedName": "caption", + "doc": "Optional text content.", + "type": { + "$id": "339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentConversationMessageContent.caption" + }, + { + "$id": "340", + "kind": "property", + "name": "fileName", + "serializedName": "fileName", + "doc": "Optional name for the file.", + "type": { + "$id": "341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentConversationMessageContent.fileName" + }, + { + "$id": "342", + "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": "343", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentConversationMessageContent.mediaUri" + } + ] + }, + "video": { + "$id": "344", + "kind": "model", + "name": "VideoConversationMessageContent", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoConversationMessageContent", + "usage": "Input,Output,Json", + "doc": "A request to send a video conversation message.", + "discriminatorValue": "video", + "decorators": [], + "baseModel": { + "$ref": "323" + }, + "properties": [ + { + "$id": "345", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is video.", + "type": { + "$ref": "133" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoConversationMessageContent.kind" + }, + { + "$id": "346", + "kind": "property", + "name": "caption", + "serializedName": "caption", + "doc": "Optional text content.", + "type": { + "$id": "347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoConversationMessageContent.caption" + }, + { + "$id": "348", + "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": "349", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoConversationMessageContent.mediaUri" + } + ] + }, + "audio": { + "$id": "350", + "kind": "model", + "name": "AudioConversationMessageContent", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioConversationMessageContent", + "usage": "Input,Output,Json", + "doc": "A request to send an audio conversation message.", + "discriminatorValue": "audio", + "decorators": [], + "baseModel": { + "$ref": "323" + }, + "properties": [ + { + "$id": "351", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is audio.", + "type": { + "$ref": "141" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioConversationMessageContent.kind" + }, + { + "$id": "352", + "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": "353", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioConversationMessageContent.mediaUri" + } + ] + }, + "template": { + "$id": "354", + "kind": "model", + "name": "TemplateConversationMessageContent", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateConversationMessageContent", + "usage": "Input,Output,Json", + "doc": "A request to send a template conversation message.", + "discriminatorValue": "template", + "decorators": [], + "baseModel": { + "$ref": "323" + }, + "properties": [ + { + "$id": "355", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is template.", + "type": { + "$ref": "147" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateConversationMessageContent.kind" + }, + { + "$id": "356", + "kind": "property", + "name": "template", + "serializedName": "template", + "doc": "The template object used to create templates.", + "type": { + "$ref": "150" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateConversationMessageContent.template" + } + ] + } + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageItem.message" + }, + { + "$id": "357", + "kind": "property", + "name": "senderDisplayName", + "serializedName": "senderDisplayName", + "doc": "The display name of the message sender.", + "type": { + "$id": "358", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageItem.senderDisplayName" + }, + { + "$id": "359", + "kind": "property", + "name": "senderCommunicationIdentifier", + "serializedName": "senderCommunicationIdentifier", + "doc": "The communication identifier of the message sender.", + "type": { + "$id": "360", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageItem.senderCommunicationIdentifier" + }, + { + "$id": "361", + "kind": "property", + "name": "createdOn", + "serializedName": "createdOn", + "doc": "Timestamp when the message is sent.", + "type": { + "$id": "362", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "363", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessageItem.createdOn" + } + ] + }, + { + "$ref": "323" + }, + { + "$ref": "326" + }, + { + "$ref": "330" + }, + { + "$ref": "336" + }, + { + "$ref": "344" + }, + { + "$ref": "350" + }, + { + "$ref": "354" + }, + { + "$id": "364", + "kind": "model", + "name": "AddParticipantsRequest", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AddParticipantsRequest", + "usage": "Input,Json", + "doc": "Request payload for adding participants to a conversation.", + "decorators": [], + "properties": [ + { + "$id": "365", + "kind": "property", + "name": "participants", + "serializedName": "participants", + "doc": "List of participants to add.", + "type": { + "$id": "366", + "kind": "array", + "name": "ArrayParticipant", + "valueType": { + "$ref": "274" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AddParticipantsRequest.participants" + } + ] + }, + { + "$id": "367", + "kind": "model", + "name": "AddParticipantsResult", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AddParticipantsResult", + "usage": "Output,Json", + "doc": "Response for the add participants operation.", + "decorators": [], + "properties": [ + { + "$id": "368", + "kind": "property", + "name": "invalidParticipants", + "serializedName": "invalidParticipants", + "doc": "List of Ids with Errors if failed to be added", + "type": { + "$id": "369", + "kind": "array", + "name": "ArrayParticipantsResult", + "valueType": { + "$id": "370", + "kind": "model", + "name": "ParticipantsResult", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ParticipantsResult", + "usage": "Output,Json", + "doc": "Response for the remove participants operation.", + "decorators": [], + "properties": [ + { + "$id": "371", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Participant User Id.", + "type": { + "$id": "372", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ParticipantsResult.id" + }, + { + "$id": "373", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Error of the participant operation.", + "type": { + "$id": "374", + "kind": "model", + "name": "Error", + "crossLanguageDefinitionId": "Azure.Core.Foundations.Error", + "usage": "Output,Json,Exception", + "doc": "The error object.", + "decorators": [], + "properties": [ + { + "$id": "375", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "One of a server-defined set of error codes.", + "type": { + "$id": "376", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.Error.code" + }, + { + "$id": "377", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "A human-readable representation of the error.", + "type": { + "$id": "378", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.Error.message" + }, + { + "$id": "379", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The target of the error.", + "type": { + "$id": "380", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.Error.target" + }, + { + "$id": "381", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "An array of details about specific errors that led to this reported error.", + "type": { + "$id": "382", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "374" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.Error.details" + }, + { + "$id": "383", + "kind": "property", + "name": "innererror", + "serializedName": "innererror", + "doc": "An object containing more specific information than the current object about the error.", + "type": { + "$id": "384", + "kind": "model", + "name": "InnerError", + "crossLanguageDefinitionId": "Azure.Core.Foundations.InnerError", + "usage": "Output,Json,Exception", + "doc": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "decorators": [], + "properties": [ + { + "$id": "385", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "One of a server-defined set of error codes.", + "type": { + "$id": "386", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.InnerError.code" + }, + { + "$id": "387", + "kind": "property", + "name": "innererror", + "serializedName": "innererror", + "doc": "Inner error.", + "type": { + "$ref": "384" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.InnerError.innererror" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.Error.innererror" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ParticipantsResult.error" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AddParticipantsResult.invalidParticipants" + } + ] + }, + { + "$ref": "370" + }, + { + "$ref": "374" + }, + { + "$ref": "384" + }, + { + "$id": "388", + "kind": "model", + "name": "RemoveParticipantsRequest", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.RemoveParticipantsRequest", + "usage": "Input,Json", + "doc": "Request payload for removing participants from a conversation.", + "decorators": [], + "properties": [ + { + "$id": "389", + "kind": "property", + "name": "participantIds", + "serializedName": "participantIds", + "doc": "The participant IDs to remove.", + "type": { + "$id": "390", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "391", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.RemoveParticipantsRequest.participantIds" + } + ] + }, + { + "$id": "392", + "kind": "model", + "name": "RemoveParticipantsResult", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.RemoveParticipantsResult", + "usage": "Output,Json", + "doc": "Response for the remove participants operation.", + "decorators": [], + "properties": [ + { + "$id": "393", + "kind": "property", + "name": "invalidParticipants", + "serializedName": "invalidParticipants", + "doc": "List of Ids with Errors if failed to be added", + "type": { + "$id": "394", + "kind": "array", + "name": "ArrayParticipantsResult", + "valueType": { + "$ref": "370" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.RemoveParticipantsResult.invalidParticipants" + } + ] + }, + { + "$id": "395", + "kind": "model", + "name": "GetConversationMessagesAnalysisResult", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.GetConversationMessagesAnalysisResult", + "usage": "Output,Json", + "doc": "Result of the get conversation messages AI Analysis operation.", + "decorators": [], + "properties": [ + { + "$id": "396", + "kind": "property", + "name": "summary", + "serializedName": "summary", + "doc": "The AI summary of the conversation messages.", + "type": { + "$id": "397", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.GetConversationMessagesAnalysisResult.summary" + } + ] + }, + { + "$id": "398", + "kind": "model", + "name": "SendConversationMessageRequest", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendConversationMessageRequest", + "usage": "Input,Json", + "doc": "Request payload for sending a conversation message.", + "decorators": [], + "properties": [ + { + "$id": "399", + "kind": "property", + "name": "request", + "serializedName": "request", + "doc": "Details of a send conversation message request.", + "type": { + "$ref": "323" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendConversationMessageRequest.request" + }, + { + "$id": "400", + "kind": "property", + "name": "outboundDeliveryStrategy", + "serializedName": "outboundDeliveryStrategy", + "doc": "The options of the outbound delivery strategy for messages sent by emplyees in a conversation.\r\nSupports internalOnly, allChannels.", + "type": { + "$ref": "64" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendConversationMessageRequest.outboundDeliveryStrategy" + } + ] + }, + { + "$id": "401", + "kind": "model", + "name": "SendConversationMessageResult", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendConversationMessageResult", + "usage": "Output,Json", + "doc": "Result of the send conversation message operation.", + "decorators": [], + "properties": [ + { + "$id": "402", + "kind": "property", + "name": "messageId", + "serializedName": "messageId", + "doc": "A server-generated Advanced Messaging conversation message id.", + "type": { + "$id": "403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendConversationMessageResult.messageId" + } + ] + }, + { + "$id": "404", + "kind": "model", + "name": "PagedMessageTemplateItem", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "doc": "Paged collection of MessageTemplateItem items", + "decorators": [], + "properties": [ + { + "$id": "405", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The MessageTemplateItem items on this page", + "type": { + "$id": "406", + "kind": "array", + "name": "ArrayMessageTemplateItem", + "valueType": { + "$ref": "249" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "407", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "408", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "409", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + }, + { + "$id": "410", + "kind": "model", + "name": "PagedConversation", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "doc": "Paged collection of Conversation items", + "decorators": [], + "properties": [ + { + "$id": "411", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Conversation items on this page", + "type": { + "$id": "412", + "kind": "array", + "name": "ArrayConversation", + "valueType": { + "$ref": "263" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "413", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "414", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "415", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + }, + { + "$id": "416", + "kind": "model", + "name": "PagedConversationMessageItem", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "doc": "Paged collection of ConversationMessageItem items", + "decorators": [], + "properties": [ + { + "$id": "417", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The ConversationMessageItem items on this page", + "type": { + "$id": "418", + "kind": "array", + "name": "ArrayConversationMessageItem", + "valueType": { + "$ref": "317" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "419", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "420", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "421", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + } + ], + "Clients": [ + { + "$id": "422", + "Name": "NotificationMessagesClient", + "Operations": [ + { + "$id": "423", + "Name": "send", + "ResourceName": "NotificationMessagesClient", + "Doc": "Sends a notification message from Business to User.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "424", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "425", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "426", + "Type": { + "$id": "427", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "428", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "430", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "431", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "432", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "433", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "434", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "435", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "436", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "437", + "kind": "constant", + "valueType": { + "$id": "438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "439", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "440", + "kind": "constant", + "valueType": { + "$id": "441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "442", + "Name": "notificationContent", + "NameInRequest": "notificationContent", + "Doc": "Details of the message to send.", + "Type": { + "$ref": "90" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "443", + "StatusCodes": [ + 202 + ], + "BodyType": { + "$ref": "241" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "444", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "445", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "446", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "447", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/messages/notifications:send", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationMessagesClient.send", + "Decorators": [] + }, + { + "$id": "448", + "Name": "downloadMediaInternal", + "ResourceName": "MessageDataStream", + "Doc": "Download the Media payload from a User to Business message.", + "Accessibility": "internal", + "Parameters": [ + { + "$id": "449", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "450", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "451", + "Type": { + "$id": "452", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "453", + "Name": "id", + "NameInRequest": "id", + "Doc": "The stream ID.", + "Type": { + "$id": "454", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "455", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "456", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "457", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "458", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "459", + "kind": "constant", + "valueType": { + "$id": "460", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/octet-stream", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "461", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "462", + "kind": "bytes", + "name": "bytes", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "463", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "464", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + }, + { + "$id": "466", + "Name": "contentType", + "NameInResponse": "content-type", + "Doc": "The stream content type.", + "Type": { + "$id": "467", + "kind": "constant", + "valueType": { + "$id": "468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/octet-stream", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/octet-stream" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/streams/{id}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "ClientForAcsMessages.NotificationMessagesClient.downloadMedia", + "Decorators": [] + } + ], + "Protocol": { + "$id": "469" + }, + "Parameters": [ + { + "$id": "470", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "The communication resource, for example https://my-resource.communication.azure.com", + "Type": { + "$id": "471", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "472", + "Name": "MessageTemplateClient", + "Operations": [ + { + "$id": "473", + "Name": "getTemplates", + "ResourceName": "MessageTemplateItem", + "Doc": "List all templates for given Azure Communication Services channel", + "Accessibility": "public", + "Parameters": [ + { + "$id": "474", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "475", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "476", + "Type": { + "$id": "477", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "478", + "Name": "channelId", + "NameInRequest": "channelId", + "Doc": "The registration ID of the channel.", + "Type": { + "$id": "479", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "480", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "481", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Doc": "Number of objects to return per page.", + "Type": { + "$id": "482", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "483", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "484", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "486", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "487", + "kind": "constant", + "valueType": { + "$id": "488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "489", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "404" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "490", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "491", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/channels/{channelId}/templates", + "BufferResponse": true, + "Paging": { + "$id": "493", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateClient.listTemplates", + "Decorators": [] + } + ], + "Protocol": { + "$id": "494" + }, + "Parameters": [ + { + "$id": "495", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "The communication resource, for example https://my-resource.communication.azure.com", + "Type": { + "$id": "496", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "497", + "Name": "ConversationManagementClient", + "Operations": [ + { + "$id": "498", + "Name": "createConversation", + "ResourceName": "Conversation", + "Doc": "Creates a new conversation. This is only for create operation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "499", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "500", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "501", + "Type": { + "$id": "502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "503", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "504", + "kind": "constant", + "valueType": { + "$id": "505", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "506", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "507", + "kind": "constant", + "valueType": { + "$id": "508", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "509", + "Name": "createConversationRequest", + "NameInRequest": "createConversationRequest", + "Type": { + "$ref": "314" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "510", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "263" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/messages/conversations", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationManagementClient.createConversation", + "Decorators": [] + }, + { + "$id": "511", + "Name": "getConversation", + "ResourceName": "Conversation", + "Doc": "Gets the details of a specific conversation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "512", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "513", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "514", + "Type": { + "$id": "515", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "516", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "517", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "518", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "519", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "520", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "521", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "522", + "kind": "constant", + "valueType": { + "$id": "523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "524", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "263" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "525", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "526", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "527", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationManagementClient.getConversation", + "Decorators": [] + }, + { + "$id": "528", + "Name": "deleteConversation", + "ResourceName": "Conversation", + "Doc": "Deletes a specific conversation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "529", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "530", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "531", + "Type": { + "$id": "532", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "533", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "535", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "536", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "537", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "538", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "539", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "540", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "541", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "543", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "544", + "kind": "constant", + "valueType": { + "$id": "545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "546", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "547", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "548", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "549", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "550", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationManagementClient.deleteConversation", + "Decorators": [] + }, + { + "$id": "551", + "Name": "terminateConversation", + "ResourceName": "ConversationManagementClient", + "Doc": "Terminates a specific conversation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "552", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "553", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "554", + "Type": { + "$id": "555", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "556", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "557", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "558", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "559", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "560", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "561", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "562", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "563", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "564", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "566", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "567", + "kind": "constant", + "valueType": { + "$id": "568", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "569", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "570", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "571", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "572", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "573", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}:terminate", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationManagementClient.terminateConversation", + "Decorators": [] + }, + { + "$id": "574", + "Name": "listConversations", + "ResourceName": "Conversation", + "Doc": "Retrieves list of conversations.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "575", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "576", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "577", + "Type": { + "$id": "578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "579", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Doc": "Number of objects to return per page.", + "Type": { + "$id": "580", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "581", + "Name": "participantId", + "NameInRequest": "participantId", + "Doc": "The participant user ID", + "Type": { + "$id": "582", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "583", + "Name": "channelId", + "NameInRequest": "channelId", + "Doc": "The id of channel", + "Type": { + "$id": "584", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "586", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "587", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "588", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "589", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "590", + "kind": "constant", + "valueType": { + "$id": "591", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "592", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "410" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "593", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "594", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/conversations", + "BufferResponse": true, + "Paging": { + "$id": "596", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "ClientForAcsMessages.ConversationManagementClient.listConversations", + "Decorators": [] + }, + { + "$id": "597", + "Name": "listMessages", + "ResourceName": "ConversationMessageItem", + "Doc": "Retrieves list of conversation messages.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "598", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "599", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "600", + "Type": { + "$id": "601", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "602", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "603", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "604", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Doc": "Number of objects to return per page.", + "Type": { + "$id": "605", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "606", + "Name": "participantId", + "NameInRequest": "participantId", + "Doc": "The participant user ID", + "Type": { + "$id": "607", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "608", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "609", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "610", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "611", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "612", + "kind": "constant", + "valueType": { + "$id": "613", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "614", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "416" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "615", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "616", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}/messages", + "BufferResponse": true, + "Paging": { + "$id": "618", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "ClientForAcsMessages.ConversationManagementClient.listMessages", + "Decorators": [] + }, + { + "$id": "619", + "Name": "addParticipants", + "ResourceName": "ConversationManagementClient", + "Doc": "Adds participants to a specific conversation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "620", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "621", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "622", + "Type": { + "$id": "623", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "624", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "625", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "626", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "627", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "628", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "629", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "630", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "631", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "632", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "633", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "634", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "635", + "kind": "constant", + "valueType": { + "$id": "636", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "637", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "638", + "kind": "constant", + "valueType": { + "$id": "639", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "640", + "Name": "body", + "NameInRequest": "body", + "Doc": "Details of the payload for adding participants to a conversation.", + "Type": { + "$ref": "364" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "641", + "StatusCodes": [ + 207 + ], + "BodyType": { + "$ref": "367" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "642", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "643", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "644", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "645", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}/participants:add", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "ClientForAcsMessages.ConversationManagementClient.addParticipants", + "Decorators": [] + }, + { + "$id": "646", + "Name": "removeParticipants", + "ResourceName": "ConversationManagementClient", + "Doc": "remove a participant from a conversation", + "Accessibility": "public", + "Parameters": [ + { + "$id": "647", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "648", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "649", + "Type": { + "$id": "650", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "651", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "652", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "653", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "654", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "655", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "656", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "657", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "658", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "659", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "660", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "661", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "662", + "kind": "constant", + "valueType": { + "$id": "663", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "664", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "665", + "kind": "constant", + "valueType": { + "$id": "666", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "667", + "Name": "body", + "NameInRequest": "body", + "Doc": "Details of the request body for removing participants from a conversation.", + "Type": { + "$ref": "388" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "668", + "StatusCodes": [ + 207 + ], + "BodyType": { + "$ref": "392" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "669", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "670", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "671", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "672", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}/participants:remove", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "ClientForAcsMessages.ConversationManagementClient.removeParticipants", + "Decorators": [] + }, + { + "$id": "673", + "Name": "analyzeConversation", + "ResourceName": "ConversationManagementClient", + "Doc": "Get AI Analysis of a conversation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "674", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "675", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "676", + "Type": { + "$id": "677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "678", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "680", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "681", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "682", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "683", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "684", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "685", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "686", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "688", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "689", + "kind": "constant", + "valueType": { + "$id": "690", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "691", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "395" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "692", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "693", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "694", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "695", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}:analyze", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "ClientForAcsMessages.ConversationManagementClient.analyzeConversation", + "Decorators": [] + } + ], + "Protocol": { + "$id": "696" + }, + "Parameters": [ + { + "$id": "697", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "The communication resource, for example https://my-resource.communication.azure.com", + "Type": { + "$id": "698", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "699", + "Name": "ConversationMessagesClient", + "Operations": [ + { + "$id": "700", + "Name": "addParticipants", + "ResourceName": "ConversationMessagesClient", + "Doc": "Adds participants to a specific conversation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "701", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "702", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "703", + "Type": { + "$id": "704", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "705", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "706", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "707", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "708", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "709", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "710", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "711", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "712", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "713", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "714", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "715", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "716", + "kind": "constant", + "valueType": { + "$id": "717", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "718", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "719", + "kind": "constant", + "valueType": { + "$id": "720", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "721", + "Name": "body", + "NameInRequest": "body", + "Doc": "Details of the payload for adding participants to a conversation.", + "Type": { + "$ref": "364" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "722", + "StatusCodes": [ + 207 + ], + "BodyType": { + "$ref": "367" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "723", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "724", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "725", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "726", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}/participants:add", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessagesClient.addParticipants", + "Decorators": [] + }, + { + "$id": "727", + "Name": "removeParticipants", + "ResourceName": "ConversationMessagesClient", + "Doc": "remove a participant from a conversation", + "Accessibility": "public", + "Parameters": [ + { + "$id": "728", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "729", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "730", + "Type": { + "$id": "731", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "732", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "733", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "734", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "735", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "736", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "737", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "738", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "739", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "740", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "741", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "742", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "743", + "kind": "constant", + "valueType": { + "$id": "744", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "745", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "746", + "kind": "constant", + "valueType": { + "$id": "747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "748", + "Name": "body", + "NameInRequest": "body", + "Doc": "Details of the request body for removing participants from a conversation.", + "Type": { + "$ref": "388" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "749", + "StatusCodes": [ + 207 + ], + "BodyType": { + "$ref": "392" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "750", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "751", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "752", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "753", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/messages/conversations/{conversationId}/participants:remove", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessagesClient.removeParticipants", + "Decorators": [] + }, + { + "$id": "754", + "Name": "listConversations", + "ResourceName": "Conversation", + "Doc": "Retrieves list of conversations.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "755", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "756", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "757", + "Type": { + "$id": "758", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "759", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Doc": "Number of objects to return per page.", + "Type": { + "$id": "760", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "761", + "Name": "participantId", + "NameInRequest": "participantId", + "Doc": "The participant user ID", + "Type": { + "$id": "762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "763", + "Name": "channelId", + "NameInRequest": "channelId", + "Doc": "The id of channel", + "Type": { + "$id": "764", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "765", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "766", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "767", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "768", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "769", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "770", + "kind": "constant", + "valueType": { + "$id": "771", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "772", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "410" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "773", + "Name": "clientRequestId", + "NameInResponse": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "Type": { + "$id": "774", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "775", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/messages/conversations", + "BufferResponse": true, + "Paging": { + "$id": "776", + "ItemName": "value", + "NextLinkName": "nextLink" }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" - } - ] - } - ], - "Clients": [ - { - "$id": "247", - "Name": "NotificationMessagesClient", - "Operations": [ + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessagesClient.listConversations", + "Decorators": [] + }, { - "$id": "248", - "Name": "send", - "ResourceName": "NotificationMessagesClient", - "Doc": "Sends a notification message from Business to User.", + "$id": "777", + "Name": "listMessages", + "ResourceName": "ConversationMessageItem", + "Doc": "Retrieves list of conversation messages.", "Accessibility": "public", "Parameters": [ { - "$id": "249", + "$id": "778", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "250", + "$id": "779", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2556,61 +7977,53 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "251", + "$id": "780", "Type": { - "$id": "252", + "$id": "781", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "2024-08-30" + "Value": "2025-03-01-preview" }, "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "253", - "Name": "repeatabilityRequestId", - "NameInRequest": "Repeatability-Request-ID", - "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "$id": "782", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", "Type": { - "$id": "254", + "$id": "783", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "Location": "Header", + "Location": "Path", "IsApiVersion": false, "IsContentType": false, "IsEndpoint": false, "Explode": false, - "IsRequired": false, + "IsRequired": true, "Kind": "Method", "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "255", - "Name": "repeatabilityFirstSent", - "NameInRequest": "Repeatability-First-Sent", - "Doc": "Specifies the date and time at which the request was first created.", + "$id": "784", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Doc": "Number of objects to return per page.", "Type": { - "$id": "256", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc7231", - "wireType": { - "$id": "257", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "$id": "785", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] }, - "Location": "Header", + "Location": "Query", "IsApiVersion": false, "IsContentType": false, "IsEndpoint": false, @@ -2621,25 +8034,18 @@ "SkipUrlEncoding": false }, { - "$id": "258", - "Name": "clientRequestId", - "NameInRequest": "x-ms-client-request-id", - "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "$id": "786", + "Name": "participantId", + "NameInRequest": "participantId", + "Doc": "The participant user ID", "Type": { - "$id": "259", + "$id": "787", "kind": "string", - "name": "uuid", - "crossLanguageDefinitionId": "Azure.Core.uuid", - "baseType": { - "$id": "260", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "Location": "Header", + "Location": "Query", "IsApiVersion": false, "IsContentType": false, "IsEndpoint": false, @@ -2650,42 +8056,43 @@ "SkipUrlEncoding": false }, { - "$id": "261", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Doc": "Body parameter's content type. Known values are application/json", + "$id": "788", + "Name": "clientRequestId", + "NameInRequest": "x-ms-client-request-id", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "262", - "kind": "constant", - "valueType": { - "$id": "263", + "$id": "789", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "790", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", "decorators": [] }, "Location": "Header", "IsApiVersion": false, - "IsContentType": true, + "IsContentType": false, "IsEndpoint": false, "Explode": false, - "IsRequired": true, - "Kind": "Constant", + "IsRequired": false, + "Kind": "Method", "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "264", + "$id": "791", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "265", + "$id": "792", "kind": "constant", "valueType": { - "$id": "266", + "$id": "793", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2703,58 +8110,31 @@ "Kind": "Constant", "Decorators": [], "SkipUrlEncoding": false - }, - { - "$id": "267", - "Name": "notificationContent", - "NameInRequest": "notificationContent", - "Doc": "Details of the message to send.", - "Type": { - "$ref": "68" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false } ], "Responses": [ { - "$id": "268", + "$id": "794", "StatusCodes": [ - 202 + 200 ], "BodyType": { - "$ref": "219" + "$ref": "416" }, "BodyMediaType": "Json", "Headers": [ { - "$id": "269", - "Name": "repeatabilityResult", - "NameInResponse": "Repeatability-Result", - "Doc": "Indicates whether the repeatable request was accepted or rejected.", - "Type": { - "$ref": "62" - } - }, - { - "$id": "270", + "$id": "795", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "271", + "$id": "796", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "272", + "$id": "797", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2770,92 +8150,146 @@ ] } ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", + "HttpMethod": "GET", + "RequestBodyMediaType": "None", "Uri": "{endpoint}", - "Path": "/messages/notifications:send", - "RequestMediaTypes": [ - "application/json" - ], + "Path": "/messages/conversations/{conversationId}/messages", "BufferResponse": true, + "Paging": { + "$id": "798", + "ItemName": "value", + "NextLinkName": "nextLink" + }, "GenerateProtocolMethod": true, "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationMessagesClient.send", + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessagesClient.listMessages", "Decorators": [] }, { - "$id": "273", - "Name": "downloadMediaInternal", - "ResourceName": "MessageDataStream", - "Doc": "Download the Media payload from a User to Business message.", - "Accessibility": "internal", + "$id": "799", + "Name": "sendMessage", + "ResourceName": "ConversationMessagesClient", + "Doc": "Sends a conversation message from Business to User.", + "Accessibility": "public", "Parameters": [ { - "$id": "274", - "Name": "apiVersion", - "NameInRequest": "api-version", - "Doc": "The API version to use for this operation.", + "$id": "800", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "801", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "802", + "Type": { + "$id": "803", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2025-03-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "804", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", + "Type": { + "$id": "805", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "806", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "275", + "$id": "807", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "Location": "Query", - "IsApiVersion": true, + "Location": "Header", + "IsApiVersion": false, "IsContentType": false, "IsEndpoint": false, "Explode": false, - "IsRequired": true, - "Kind": "Client", - "DefaultValue": { - "$id": "276", - "Type": { - "$id": "277", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "2024-08-30" - }, + "IsRequired": false, + "Kind": "Method", "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "278", - "Name": "id", - "NameInRequest": "id", - "Doc": "The stream ID.", + "$id": "808", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", "Type": { - "$id": "279", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "$id": "809", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", "decorators": [] }, - "Location": "Path", + "Location": "Header", "IsApiVersion": false, "IsContentType": false, "IsEndpoint": false, "Explode": false, - "IsRequired": true, + "IsRequired": false, "Kind": "Method", "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "280", + "$id": "811", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "281", + "$id": "812", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "282", + "$id": "813", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2874,20 +8308,48 @@ "SkipUrlEncoding": false }, { - "$id": "283", + "$id": "814", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "815", + "kind": "constant", + "valueType": { + "$id": "816", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "817", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "284", + "$id": "818", "kind": "constant", "valueType": { - "$id": "285", + "$id": "819", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/octet-stream", + "value": "application/json", "decorators": [] }, "Location": "Header", @@ -2899,182 +8361,100 @@ "Kind": "Constant", "Decorators": [], "SkipUrlEncoding": false + }, + { + "$id": "820", + "Name": "body", + "NameInRequest": "body", + "Doc": "Details of the conversation message to send.", + "Type": { + "$ref": "398" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false } ], "Responses": [ { - "$id": "286", + "$id": "821", "StatusCodes": [ 200 ], "BodyType": { - "$id": "287", - "kind": "bytes", - "name": "bytes", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] + "$ref": "401" }, "BodyMediaType": "Json", "Headers": [ { - "$id": "288", + "$id": "822", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "823", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "289", + "$id": "824", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "290", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "decorators": [] - } - }, - { - "$id": "291", - "Name": "contentType", - "NameInResponse": "content-type", - "Doc": "The stream content type.", - "Type": { - "$id": "292", - "kind": "constant", - "valueType": { - "$id": "293", + "$id": "825", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/octet-stream", "decorators": [] } } ], "IsErrorResponse": false, "ContentTypes": [ - "application/octet-stream" + "application/json" ] } ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", "Uri": "{endpoint}", - "Path": "/messages/streams/{id}", + "Path": "/messages/conversations/{conversationId}/messages:send", + "RequestMediaTypes": [ + "application/json" + ], "BufferResponse": true, "GenerateProtocolMethod": true, "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "ClientForAcsMessages.NotificationMessagesClient.downloadMedia", - "Decorators": [], - "Examples": [ - { - "$id": "294", - "kind": "http", - "name": "Download media", - "description": "Download media", - "filePath": "2024-08-30/Stream_GetMedia.json", - "parameters": [ - { - "$id": "295", - "parameter": { - "$ref": "274" - }, - "value": { - "$id": "296", - "kind": "string", - "type": { - "$ref": "275" - }, - "value": "2024-08-30" - } - }, - { - "$id": "297", - "parameter": { - "$ref": "278" - }, - "value": { - "$id": "298", - "kind": "string", - "type": { - "$ref": "279" - }, - "value": "d19e68ec-bdd6-4a50-8dfb-cbb1642df6ab" - } - } - ], - "responses": [ - { - "$id": "299", - "response": { - "$ref": "286" - }, - "statusCode": 200, - "bodyValue": { - "$id": "300", - "kind": "string", - "type": { - "$ref": "287" - }, - "value": "" - } - } - ] - } - ] - } - ], - "Protocol": { - "$id": "301" - }, - "Parameters": [ - { - "$id": "302", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Doc": "The communication resource, for example https://my-resource.communication.azure.com", - "Type": { - "$id": "303", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - }, - { - "$id": "304", - "Name": "MessageTemplateClient", - "Operations": [ + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessagesClient.sendMessage", + "Decorators": [] + }, { - "$id": "305", - "Name": "getTemplates", - "ResourceName": "MessageTemplateItem", - "Doc": "List all templates for given Azure Communication Services channel", + "$id": "826", + "Name": "analyzeConversation", + "ResourceName": "ConversationMessagesClient", + "Doc": "Get AI Analysis of a conversation.", "Accessibility": "public", "Parameters": [ { - "$id": "306", + "$id": "827", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "307", + "$id": "828", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3088,35 +8468,28 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "308", + "$id": "829", "Type": { - "$id": "309", + "$id": "830", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "2024-08-30" + "Value": "2025-03-01-preview" }, "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "310", - "Name": "channelId", - "NameInRequest": "channelId", - "Doc": "The registration ID of the channel.", + "$id": "831", + "Name": "conversationId", + "NameInRequest": "conversationId", + "Doc": "The conversation ID.", "Type": { - "$id": "311", + "$id": "832", "kind": "string", - "name": "uuid", - "crossLanguageDefinitionId": "Azure.Core.uuid", - "baseType": { - "$id": "312", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "Location": "Path", @@ -3130,18 +8503,48 @@ "SkipUrlEncoding": false }, { - "$id": "313", - "Name": "maxpagesize", - "NameInRequest": "maxpagesize", - "Doc": "Number of objects to return per page.", + "$id": "833", + "Name": "repeatabilityRequestId", + "NameInRequest": "Repeatability-Request-ID", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "314", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", + "$id": "834", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "Location": "Query", + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "835", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Doc": "Specifies the date and time at which the request was first created.", + "Type": { + "$id": "836", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "837", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", "IsApiVersion": false, "IsContentType": false, "IsEndpoint": false, @@ -3152,17 +8555,17 @@ "SkipUrlEncoding": false }, { - "$id": "315", + "$id": "838", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "316", + "$id": "839", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "317", + "$id": "840", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3181,14 +8584,14 @@ "SkipUrlEncoding": false }, { - "$id": "318", + "$id": "841", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "319", + "$id": "842", "kind": "constant", "valueType": { - "$id": "320", + "$id": "843", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3210,27 +8613,36 @@ ], "Responses": [ { - "$id": "321", + "$id": "844", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "241" + "$ref": "395" }, "BodyMediaType": "Json", "Headers": [ { - "$id": "322", + "$id": "845", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "84" + } + }, + { + "$id": "846", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "323", + "$id": "847", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "324", + "$id": "848", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3246,33 +8658,28 @@ ] } ], - "HttpMethod": "GET", + "HttpMethod": "POST", "RequestBodyMediaType": "None", "Uri": "{endpoint}", - "Path": "/messages/channels/{channelId}/templates", + "Path": "/messages/conversations/{conversationId}:analyze", "BufferResponse": true, - "Paging": { - "$id": "325", - "ItemName": "value", - "NextLinkName": "nextLink" - }, "GenerateProtocolMethod": true, "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateClient.listTemplates", + "CrossLanguageDefinitionId": "Azure.Communication.MessagesService.ConversationMessagesClient.analyzeConversation", "Decorators": [] } ], "Protocol": { - "$id": "326" + "$id": "849" }, "Parameters": [ { - "$id": "327", + "$id": "850", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "The communication resource, for example https://my-resource.communication.azure.com", "Type": { - "$id": "328", + "$id": "851", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3292,17 +8699,18 @@ } ], "Auth": { - "$id": "329", + "$id": "852", "OAuth2": { - "$id": "330", + "$id": "853", "Scopes": [ "https://communication.azure.com/.default" ] }, "ApiKey": { - "$id": "331", + "$id": "854", "Name": "Authorization", - "In": "header" + "In": "header", + "Prefix": "Bearer" } } }