diff --git a/sdk/communication/Azure.Communication.Email/README.md b/sdk/communication/Azure.Communication.Email/README.md index de8fcccde31c9..817da2b7ba8f4 100644 --- a/sdk/communication/Azure.Communication.Email/README.md +++ b/sdk/communication/Azure.Communication.Email/README.md @@ -23,7 +23,6 @@ To create these resource, you can use the [Azure Portal][communication_resource_ ### Using statements ```C# Snippet:Azure_Communication_Email_UsingStatements using Azure.Communication.Email; -using Azure.Communication.Email.Models; ``` ### Authenticate the client @@ -31,7 +30,7 @@ Email clients can be authenticated using the connection string acquired from an ```C# Snippet:Azure_Communication_Email_CreateEmailClient var connectionString = ""; // Find your Communication Services resource in the Azure portal -EmailClient client = new EmailClient(connectionString); +EmailClient emailClient = new EmailClient(connectionString); ``` Alternatively, Email clients can also be authenticated using a valid token credential. With this option, @@ -41,52 +40,103 @@ Alternatively, Email clients can also be authenticated using a valid token crede string endpoint = ""; TokenCredential tokenCredential = new DefaultAzureCredential(); tokenCredential = new DefaultAzureCredential(); -EmailClient client = new EmailClient(new Uri(endpoint), tokenCredential); +EmailClient emailClient = new EmailClient(new Uri(endpoint), tokenCredential); ``` ## Examples -### Send an Email Message -To send an email message, call the `Send` or `SendAsync` function from the `EmailClient`. -```C# Snippet:Azure_Communication_Email_Send -// Create the email content -var emailContent = new EmailContent("This is the subject"); -emailContent.PlainText = "This is the body"; +### Send a simple email message with automatic polling for status +To send an email message, call the simple overload of `Send` or `SendAsync` function from the `EmailClient`. +```C# Snippet:Azure_Communication_Email_Send_Simple_AutoPolling +var emailSendOperation = emailClient.Send( + wait: WaitUntil.Completed, + from: "" // The email address of the domain registered with the Communication Services resource + to: "" + subject: "This is the subject", + htmlContent: "This is the html body"); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` -// Create the recipient list -var emailRecipients = new EmailRecipients( - new List +### Send a simple email message with manual polling for status +To send an email message, call the simple overload of `Send` or `SendAsync` function from the `EmailClient`. +```C# Snippet:Azure_Communication_Email_Send_Simple_ManualPolling_Async +/// Send the email message with WaitUntil.Started +var emailSendOperation = await emailClient.SendAsync( + wait: WaitUntil.Started, + from: "" // The email address of the domain registered with the Communication Services resource + to: "" + subject: "This is the subject", + htmlContent: "This is the html body"); + +/// Call UpdateStatus on the email send operation to poll for the status +/// manually. +while (true) +{ + await emailSendOperation.UpdateStatusAsync(); + if (emailSendOperation.HasCompleted) { - new EmailAddress( - email: "" - displayName: "" - }); + break; + } + await Task.Delay(100); +} -// Create the EmailMessage -var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); +if (emailSendOperation.HasValue) +{ + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); +} -SendEmailResult sendResult = client.Send(emailMessage); +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` -Console.WriteLine($"Email id: {sendResult.MessageId}"); +### Send an email message with more options +To send an email message, call the overload of `Send` or `SendAsync` function from the `EmailClient` that takes an `EmailMessage` parameter. +```C# Snippet:Azure_Communication_Email_Send_With_MoreOptions +// Create the email content +var emailContent = new EmailContent("This is the subject") +{ + PlainText = "This is the body", + Html = "This is the html body" +}; + +// Create the EmailMessage +var emailMessage = new EmailMessage( + fromAddress: "" // The email address of the domain registered with the Communication Services resource + toAddress: "" + content: emailContent); + +var emailSendOperation = emailClient.Send( + wait: WaitUntil.Completed, + message: emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); ``` -### Send an Email Message to Multiple Recipients +### Send an email message to multiple recipients To send an email message to multiple recipients, add an `EmailAddress` object for each recipent type to the `EmailRecipient` object. ```C# Snippet:Azure_Communication_Email_Send_Multiple_Recipients // Create the email content -var emailContent = new EmailContent("This is the subject"); -emailContent.PlainText = "This is the body"; +var emailContent = new EmailContent("This is the subject") +{ + PlainText = "This is the body", + Html = "This is the html body" +}; // Create the To list var toRecipients = new List { new EmailAddress( - email: "" + address: "" displayName: "" new EmailAddress( - email: "" + address: "" displayName: "" }; @@ -94,10 +144,10 @@ var toRecipients = new List var ccRecipients = new List { new EmailAddress( - email: "" + address: "" displayName: "" new EmailAddress( - email: "" + address: "" displayName: "" }; @@ -105,10 +155,10 @@ var ccRecipients = new List var bccRecipients = new List { new EmailAddress( - email: "" + address: "" displayName: "" new EmailAddress( - email: "" + address: "" displayName: "" }; @@ -116,44 +166,42 @@ var emailRecipients = new EmailRecipients(toRecipients, ccRecipients, bccRecipie // Create the EmailMessage var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); + senderAddress: "" // The email address of the domain registered with the Communication Services resource + emailRecipients, + emailContent); -SendEmailResult sendResult = client.Send(emailMessage); +EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); -Console.WriteLine($"Email id: {sendResult.MessageId}"); +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); ``` -### Send Email with Attachments -Azure Communication Services support sending email swith attachments. See [EmailAttachmentType][email_attachmentTypes] for a list of supported attachments +### Send email with attachments +Azure Communication Services support sending emails with attachments. ```C# Snippet:Azure_Communication_Email_Send_With_Attachments // Create the EmailMessage var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); + fromAddress: "" // The email address of the domain registered with the Communication Services resource + toAddress: "" + content: emailContent); var filePath = ""; var attachmentName = ""; -EmailAttachmentType attachmentType = EmailAttachmentType.Txt; +var contentType = MediaTypeNames.Text.Plain; -// Convert the file content into a Base64 string -byte[] bytes = File.ReadAllBytes(filePath); -string attachmentFileInBytes = Convert.ToBase64String(bytes); -var emailAttachment = new EmailAttachment(attachmentName, attachmentType, attachmentFileInBytes); +string content = new BinaryData(File.ReadAllBytes(filePath)); +var emailAttachment = new EmailAttachment(attachmentName, contentType, content); emailMessage.Attachments.Add(emailAttachment); -SendEmailResult sendResult = client.Send(emailMessage); -``` - -### Get Email Message Status -The `EmailSendResult` from the `Send` call contains a `MessageId` which can be used to query the status of the email. -```C# Snippet:Azure_Communication_Email_GetSendStatus -SendEmailResult sendResult = client.Send(emailMessage); +EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); -SendStatusResult status = client.GetSendStatus(sendResult.MessageId); +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); ``` ## Troubleshooting @@ -184,5 +232,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [nextsteps]:https://aka.ms/acsemail/qs-sendmail?pivots=programming-language-csharp [nuget]: https://www.nuget.org/ [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Email/src -[email_attachmentTypes]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachmentType.cs [domain_overview]: https://aka.ms/acsemail/domainsoverview diff --git a/sdk/communication/Azure.Communication.Email/api/Azure.Communication.Email.netstandard2.0.cs b/sdk/communication/Azure.Communication.Email/api/Azure.Communication.Email.netstandard2.0.cs index 6e6017c4f66e3..3b5bd7ea31cf1 100644 --- a/sdk/communication/Azure.Communication.Email/api/Azure.Communication.Email.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.Email/api/Azure.Communication.Email.netstandard2.0.cs @@ -1,91 +1,45 @@ namespace Azure.Communication.Email { - public static partial class CommunicationEmailModelFactory + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EmailAddress { - public static Azure.Communication.Email.Models.SendEmailResult SendEmailResult(string messageId = null) { throw null; } - public static Azure.Communication.Email.Models.SendStatusResult SendStatusResult(string messageId = null, Azure.Communication.Email.Models.SendStatus status = default(Azure.Communication.Email.Models.SendStatus)) { throw null; } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EmailAddress(string address) { throw null; } + public EmailAddress(string address, string displayName) { throw null; } + public string Address { get { throw null; } } + public string DisplayName { get { throw null; } } + } + public partial class EmailAttachment + { + public EmailAttachment(string name, string contentType, System.BinaryData content) { } + public System.BinaryData Content { get { throw null; } } + public string ContentType { get { throw null; } } + public string Name { get { throw null; } } } public partial class EmailClient { protected EmailClient() { } public EmailClient(string connectionString) { } public EmailClient(string connectionString, Azure.Communication.Email.EmailClientOptions options) { } - public EmailClient(System.Uri endpoint, Azure.AzureKeyCredential keyCredential, Azure.Communication.Email.EmailClientOptions options = null) { } - public EmailClient(System.Uri endpoint, Azure.Core.TokenCredential tokenCredential, Azure.Communication.Email.EmailClientOptions options = null) { } - public virtual Azure.Response GetSendStatus(string messageId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetSendStatusAsync(string messageId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Send(Azure.Communication.Email.Models.EmailMessage emailMessage, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SendAsync(Azure.Communication.Email.Models.EmailMessage emailMessage, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public EmailClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Communication.Email.EmailClientOptions options = null) { } + public EmailClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.Email.EmailClientOptions options = null) { } + public virtual Azure.Response GetSendResult(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSendResultAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Communication.Email.EmailSendOperation Send(Azure.WaitUntil wait, Azure.Communication.Email.EmailMessage message, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Communication.Email.EmailSendOperation Send(Azure.WaitUntil wait, string from, string to, string subject, string htmlContent, string plainTextContent = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SendAsync(Azure.WaitUntil wait, Azure.Communication.Email.EmailMessage message, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SendAsync(Azure.WaitUntil wait, string from, string to, string subject, string htmlContent, string plainTextContent = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class EmailClientOptions : Azure.Core.ClientOptions { - public EmailClientOptions(Azure.Communication.Email.EmailClientOptions.ServiceVersion version = Azure.Communication.Email.EmailClientOptions.ServiceVersion.V2021_10_01_Preview) { } + public EmailClientOptions(Azure.Communication.Email.EmailClientOptions.ServiceVersion version = Azure.Communication.Email.EmailClientOptions.ServiceVersion.V2023_01_15_Preview) { } public enum ServiceVersion { V2021_10_01_Preview = 1, + V2023_01_15_Preview = 2, } } -} -namespace Azure.Communication.Email.Models -{ - public partial class EmailAddress - { - public EmailAddress(string email) { } - public EmailAddress(string email, string displayName = null) { } - public string DisplayName { get { throw null; } set { } } - public string Email { get { throw null; } } - } - public partial class EmailAttachment - { - public EmailAttachment(string name, Azure.Communication.Email.Models.EmailAttachmentType attachmentType, string contentBytesBase64) { } - public Azure.Communication.Email.Models.EmailAttachmentType AttachmentType { get { throw null; } } - public string ContentBytesBase64 { get { throw null; } } - public string Name { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EmailAttachmentType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public EmailAttachmentType(string value) { throw null; } - public static Azure.Communication.Email.Models.EmailAttachmentType Avi { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Bmp { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Doc { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Docm { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Docx { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Gif { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Jpeg { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Mp3 { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType One { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Pdf { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Png { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Ppsm { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Ppsx { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Ppt { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Pptm { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Pptx { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Pub { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Rpmsg { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Rtf { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Tif { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Txt { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Vsd { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Wav { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Wma { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Xls { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Xlsb { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Xlsm { get { throw null; } } - public static Azure.Communication.Email.Models.EmailAttachmentType Xlsx { get { throw null; } } - public bool Equals(Azure.Communication.Email.Models.EmailAttachmentType 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.Email.Models.EmailAttachmentType left, Azure.Communication.Email.Models.EmailAttachmentType right) { throw null; } - public static implicit operator Azure.Communication.Email.Models.EmailAttachmentType (string value) { throw null; } - public static bool operator !=(Azure.Communication.Email.Models.EmailAttachmentType left, Azure.Communication.Email.Models.EmailAttachmentType right) { throw null; } - public override string ToString() { throw null; } - } public partial class EmailContent { public EmailContent(string subject) { } @@ -93,79 +47,96 @@ public EmailContent(string subject) { } public string PlainText { get { throw null; } set { } } public string Subject { get { throw null; } } } - public partial class EmailCustomHeader + public partial class EmailMessage { - public EmailCustomHeader(string name, string value) { } - public string Name { get { throw null; } } - public string Value { get { throw null; } } + public EmailMessage(string senderAddress, Azure.Communication.Email.EmailRecipients recipients, Azure.Communication.Email.EmailContent content) { } + public EmailMessage(string fromAddress, string toAddress, Azure.Communication.Email.EmailContent content) { } + public System.Collections.Generic.IList Attachments { get { throw null; } } + public Azure.Communication.Email.EmailContent Content { get { throw null; } } + public System.Collections.Generic.IDictionary Headers { get { throw null; } } + public Azure.Communication.Email.EmailRecipients Recipients { get { throw null; } } + public System.Collections.Generic.IList ReplyTo { get { throw null; } } + public string SenderAddress { get { throw null; } } + public bool? UserEngagementTrackingDisabled { get { throw null; } set { } } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EmailImportance : System.IEquatable + public static partial class EmailModelFactory { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public EmailImportance(string value) { throw null; } - public static Azure.Communication.Email.Models.EmailImportance High { get { throw null; } } - public static Azure.Communication.Email.Models.EmailImportance Low { get { throw null; } } - public static Azure.Communication.Email.Models.EmailImportance Normal { get { throw null; } } - public bool Equals(Azure.Communication.Email.Models.EmailImportance 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.Email.Models.EmailImportance left, Azure.Communication.Email.Models.EmailImportance right) { throw null; } - public static implicit operator Azure.Communication.Email.Models.EmailImportance (string value) { throw null; } - public static bool operator !=(Azure.Communication.Email.Models.EmailImportance left, Azure.Communication.Email.Models.EmailImportance right) { throw null; } - public override string ToString() { throw null; } + public static Azure.Communication.Email.EmailSendResult EmailSendResult(string id = null, Azure.Communication.Email.EmailSendStatus status = default(Azure.Communication.Email.EmailSendStatus), Azure.Communication.Email.ErrorDetail error = null) { throw null; } + public static Azure.Communication.Email.ErrorAdditionalInfo ErrorAdditionalInfo(string type = null, object info = null) { throw null; } + public static Azure.Communication.Email.ErrorDetail ErrorDetail(string code = null, string message = null, string target = null, System.Collections.Generic.IEnumerable details = null, System.Collections.Generic.IEnumerable additionalInfo = null) { throw null; } } - public partial class EmailMessage + public partial class EmailRecipients { - public EmailMessage(string sender, Azure.Communication.Email.Models.EmailContent content, Azure.Communication.Email.Models.EmailRecipients recipients) { } - public System.Collections.Generic.IList Attachments { get { throw null; } } - public Azure.Communication.Email.Models.EmailContent Content { get { throw null; } } - public System.Collections.Generic.IList CustomHeaders { get { throw null; } } - public bool? DisableUserEngagementTracking { get { throw null; } set { } } - public Azure.Communication.Email.Models.EmailImportance? Importance { get { throw null; } set { } } - public Azure.Communication.Email.Models.EmailRecipients Recipients { get { throw null; } } - public System.Collections.Generic.IList ReplyTo { get { throw null; } } - public string Sender { get { throw null; } } + public EmailRecipients(System.Collections.Generic.IEnumerable to) { } + public EmailRecipients(System.Collections.Generic.IEnumerable to = null, System.Collections.Generic.IEnumerable cc = null, System.Collections.Generic.IEnumerable bcc = null) { } + public System.Collections.Generic.IList BCC { get { throw null; } } + public System.Collections.Generic.IList CC { get { throw null; } } + public System.Collections.Generic.IList To { get { throw null; } } } - public partial class EmailRecipients + public partial class EmailSendOperation : Azure.Operation { - public EmailRecipients(System.Collections.Generic.IEnumerable to) { } - public EmailRecipients(System.Collections.Generic.IEnumerable to = null, System.Collections.Generic.IEnumerable cc = null, System.Collections.Generic.IEnumerable bcc = null) { } - public System.Collections.Generic.IList BCC { get { throw null; } } - public System.Collections.Generic.IList CC { get { throw null; } } - public System.Collections.Generic.IList To { get { throw null; } } + protected EmailSendOperation() { } + public EmailSendOperation(string id, Azure.Communication.Email.EmailClient client) { } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public override Azure.Communication.Email.EmailSendResult Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; } } - public partial class SendEmailResult + public partial class EmailSendResult { - internal SendEmailResult() { } - public string MessageId { get { throw null; } } + internal EmailSendResult() { } + public Azure.Communication.Email.ErrorDetail Error { get { throw null; } } + public Azure.Communication.Email.EmailSendStatus Status { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct SendStatus : System.IEquatable + public readonly partial struct EmailSendStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public SendStatus(string value) { throw null; } - public static Azure.Communication.Email.Models.SendStatus Dropped { get { throw null; } } - public static Azure.Communication.Email.Models.SendStatus OutForDelivery { get { throw null; } } - public static Azure.Communication.Email.Models.SendStatus Queued { get { throw null; } } - public bool Equals(Azure.Communication.Email.Models.SendStatus other) { throw null; } + public EmailSendStatus(string value) { throw null; } + public static Azure.Communication.Email.EmailSendStatus Canceled { get { throw null; } } + public static Azure.Communication.Email.EmailSendStatus Failed { get { throw null; } } + public static Azure.Communication.Email.EmailSendStatus NotStarted { get { throw null; } } + public static Azure.Communication.Email.EmailSendStatus Running { get { throw null; } } + public static Azure.Communication.Email.EmailSendStatus Succeeded { get { throw null; } } + public bool Equals(Azure.Communication.Email.EmailSendStatus 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.Email.Models.SendStatus left, Azure.Communication.Email.Models.SendStatus right) { throw null; } - public static implicit operator Azure.Communication.Email.Models.SendStatus (string value) { throw null; } - public static bool operator !=(Azure.Communication.Email.Models.SendStatus left, Azure.Communication.Email.Models.SendStatus right) { throw null; } + public static bool operator ==(Azure.Communication.Email.EmailSendStatus left, Azure.Communication.Email.EmailSendStatus right) { throw null; } + public static implicit operator Azure.Communication.Email.EmailSendStatus (string value) { throw null; } + public static bool operator !=(Azure.Communication.Email.EmailSendStatus left, Azure.Communication.Email.EmailSendStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class SendStatusResult + public partial class ErrorAdditionalInfo + { + internal ErrorAdditionalInfo() { } + public object Info { get { throw null; } } + public string Type { get { throw null; } } + } + public partial class ErrorDetail + { + internal ErrorDetail() { } + public System.Collections.Generic.IReadOnlyList AdditionalInfo { get { throw null; } } + public string Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + } +} +namespace Microsoft.Extensions.Azure +{ + public static partial class EmailClientBuilderExtensions { - internal SendStatusResult() { } - public string MessageId { get { throw null; } } - public Azure.Communication.Email.Models.SendStatus Status { get { throw null; } } + public static Azure.Core.Extensions.IAzureClientBuilder AddEmailClient(this TBuilder builder, string connectionString) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEmailClient(this TBuilder builder, System.Uri serviceUri) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEmailClient(this TBuilder builder, System.Uri serviceUri, Azure.AzureKeyCredential azureKeyCredential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEmailClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } } } diff --git a/sdk/communication/Azure.Communication.Email/samples/README.md b/sdk/communication/Azure.Communication.Email/samples/README.md index a43a47e59324b..895a1a36880a2 100644 --- a/sdk/communication/Azure.Communication.Email/samples/README.md +++ b/sdk/communication/Azure.Communication.Email/samples/README.md @@ -15,13 +15,26 @@ Azure Communication Email is a client library that provides the functionality to To get started you will need to have an Azure Subscription. Once you have this you can go into the Azure portal and create an Azure Communication Services resource, an Azure Communication Email resource with a domain. The page will give you necessary information to be able to use the sample codes here such as connections string, shared access key, etc. This client library allows to do following operations: - - Send an Email to one or more recipients + - Send a simple email message with automatic polling for status + - Send a simple email message with manual polling for status - Specify optional paramters while sending Emails - - Get the status of a sent email + - Send an email message to multiple recipients + - Send an email message with attachments #### You can find samples for each of these functions below. - - Send Email Messages [synchronously][sample_email] or [asynchronously][sample_email_async] - + - Send simple email message with automatic polling for status [synchronously][sample_simpleemail_autopolling] or [asynchronously][sample_simpleemail_autopolling_async] + - Send simple email message with manual polling for status [asynchronously][sample_simpleemail_manualpolling_async] + - Specify optional paramters while sending Emails [synchronously][sample_emailwithoptions] or [asynchronously][sample_emailwithoptions_async] + - Send an email message to multiple recipients [synchronously][sample_email_multiplerecipients] or [asynchronously][sample_email_multiplerecipients_async] + - Send an email message with attachments [synchronously][sample_email_attachments] or [asynchronously][sample_email_attachments_async] + -[sample_email]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample1_SendEmail.md -[sample_email_async]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample1_SendEmailAsync.md \ No newline at end of file +[sample_simpleemail_autopolling]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample1_SendSimpleEmailWithAutomaticPollingForStatus.md +[sample_simpleemail_autopolling_async]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample1_SendSimpleEmailWithAutomaticPollingForStatusAsync.md +[sample_simpleemail_manualpolling_async]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample2_SendSimpleEmailWithManualPollingForStatusAsync.md +[sample_emailwithoptions]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample3_SendEmailWithMoreOptions.md +[sample_emailwithoptions_async]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample3_SendEmailWithMoreOptionsAsync.md +[sample_email_multiplerecipients]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample4_SendEmailToMultipleRecipients.md +[sample_email_multiplerecipients_async]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample4_SendEmailToMultipleRecipientsAsync.md +[sample_email_attachments]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample5_SendEmailWithAttachment.md +[sample_email_attachments_async]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Email/samples/Sample5_SendEmailWithAttachmentAsync.md diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample1_SendEmail.md b/sdk/communication/Azure.Communication.Email/samples/Sample1_SendEmail.md deleted file mode 100644 index 3f9584bda072e..0000000000000 --- a/sdk/communication/Azure.Communication.Email/samples/Sample1_SendEmail.md +++ /dev/null @@ -1,131 +0,0 @@ -# Send Email Message - -This sample demonstrates how to send an email message to an individual or a group of recipients. - -To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. - -## Creating an `EmailClient` - -Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. - -```C# Snippet:Azure_Communication_Email_CreateEmailClient -var connectionString = ""; // Find your Communication Services resource in the Azure portal -EmailClient client = new EmailClient(connectionString); -``` - -## Send Email to a single recipient - -To send a email message, call the `Send` or `SendAsync` function from the `EmailClient`. `Send` expects an `EmailMessage` with the details of the email. The returned value is `EmailSendResult` objects that contains the ID of the send operation. - -```C# Snippet:Azure_Communication_Email_Send -// Create the email content -var emailContent = new EmailContent("This is the subject"); -emailContent.PlainText = "This is the body"; - -// Create the recipient list -var emailRecipients = new EmailRecipients( - new List - { - new EmailAddress( - email: "" - displayName: "" - }); - -// Create the EmailMessage -var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); - -SendEmailResult sendResult = client.Send(emailMessage); - -Console.WriteLine($"Email id: {sendResult.MessageId}"); -``` - -## Send Email to multiple recipients - -To send a Email message to a list of recipients, call the `Send` or `SendAsync` function from the `EmailClient` with an `EmailMessage` object that has a list of recipient. - -```C# Snippet:Azure_Communication_Email_Send_Multiple_Recipients -// Create the email content -var emailContent = new EmailContent("This is the subject"); -emailContent.PlainText = "This is the body"; - -// Create the To list -var toRecipients = new List -{ - new EmailAddress( - email: "" - displayName: "" - new EmailAddress( - email: "" - displayName: "" -}; - -// Create the CC list -var ccRecipients = new List -{ - new EmailAddress( - email: "" - displayName: "" - new EmailAddress( - email: "" - displayName: "" -}; - -// Create the BCC list -var bccRecipients = new List -{ - new EmailAddress( - email: "" - displayName: "" - new EmailAddress( - email: "" - displayName: "" -}; - -var emailRecipients = new EmailRecipients(toRecipients, ccRecipients, bccRecipients); - -// Create the EmailMessage -var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); - -SendEmailResult sendResult = client.Send(emailMessage); - -Console.WriteLine($"Email id: {sendResult.MessageId}"); -``` - -## Send Email with Attachments -To send a Email message with attachments, call the `Send` or `SendAsync` function from the `EmailClient` with an `EmailMessage` object which has `EmailAttachment` objects added to the `Attachments` list. -```C# Snippet:Azure_Communication_Email_Send_With_Attachments -// Create the EmailMessage -var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); - -var filePath = ""; -var attachmentName = ""; -EmailAttachmentType attachmentType = EmailAttachmentType.Txt; - -// Convert the file content into a Base64 string -byte[] bytes = File.ReadAllBytes(filePath); -string attachmentFileInBytes = Convert.ToBase64String(bytes); -var emailAttachment = new EmailAttachment(attachmentName, attachmentType, attachmentFileInBytes); - -emailMessage.Attachments.Add(emailAttachment); - -SendEmailResult sendResult = client.Send(emailMessage); -``` - -## Get the status of a call to `Send` -When `Send` or `SendAsync` is called, the Azure Communication Service has accepted the email that you want to send. The actual sending opration is an asynchronous process. You can get the status of the email throughout this process by calling `GetSendStatus` or `GetSendStatusAsync` using the `SendEmailResult.MessageId` returned from a previous call to `Send` or `SendAsync` -```C# Snippet:Azure_Communication_Email_GetSendStatus -SendEmailResult sendResult = client.Send(emailMessage); - -SendStatusResult status = client.GetSendStatus(sendResult.MessageId); -``` - -[README]: https://www.bing.com \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample1_SendEmailAsync.md b/sdk/communication/Azure.Communication.Email/samples/Sample1_SendEmailAsync.md deleted file mode 100644 index 82ed870c4c01a..0000000000000 --- a/sdk/communication/Azure.Communication.Email/samples/Sample1_SendEmailAsync.md +++ /dev/null @@ -1,132 +0,0 @@ -# Send Email Message - -This sample demonstrates how to send an email message to an individual or a group of recipients. - -To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. - -## Creating an `EmailClient` - -Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. - -```C# Snippet:Azure_Communication_Email_CreateEmailClient -var connectionString = ""; // Find your Communication Services resource in the Azure portal -EmailClient client = new EmailClient(connectionString); -``` - -## Send Email to a single recipient - -To send a email message, call the `Send` or `SendAsync` function from the `EmailClient`. `Send` expects an `EmailMessage` with the details of the email. The returned value is `EmailSendResult` objects that contains the ID of the send operation. - -```C# Snippet:Azure_Communication_Email_SendAsync -// Create the email content -var emailContent = new EmailContent("This is the subject"); -emailContent.PlainText = "This is the body"; - -// Create the recipient list -var emailRecipients = new EmailRecipients( - new List - { - new EmailAddress( - email: "" - displayName: "" - }); - -// Create the EmailMessage -var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); - -SendEmailResult sendResult = await client.SendAsync(emailMessage); - -Console.WriteLine($"Email id: {sendResult.MessageId}"); -``` - -## Send Email to multiple recipients - -To send a Email message to a list of recipients, call the `Send` or `SendAsync` function from the `EmailClient` with an `EmailMessage` object that has a list of recipient. - -```C# Snippet:Azure_Communication_Email_Send_Multiple_RecipientsAsync -// Create the email content -var emailContent = new EmailContent("This is the subject"); -emailContent.PlainText = "This is the body"; - -// Create the To list -var toRecipients = new List -{ - new EmailAddress( - email: "" - displayName: "" - new EmailAddress( - email: "" - displayName: "" -}; - -// Create the CC list -var ccRecipients = new List -{ - new EmailAddress( - email: "" - displayName: "" - new EmailAddress( - email: "" - displayName: "" -}; - -// Create the BCC list -var bccRecipients = new List -{ - new EmailAddress( - email: "" - displayName: "" - new EmailAddress( - email: "" - displayName: "" -}; - -var emailRecipients = new EmailRecipients(toRecipients, ccRecipients, bccRecipients); - -// Create the EmailMessage -var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); - -SendEmailResult sendResult = await client.SendAsync(emailMessage); - -Console.WriteLine($"Email id: {sendResult.MessageId}"); -``` - -## Send Email with Attachments -To send a Email message with attachments, call the `Send` or `SendAsync` function from the `EmailClient` with an `EmailMessage` object which has `EmailAttachment` objects added to the `Attachments` list. - -```C# Snippet:Azure_Communication_Email_Send_With_AttachmentsAsync -// Create the EmailMessage -var emailMessage = new EmailMessage( - sender: "" // The email address of the domain registered with the Communication Services resource - emailContent, - emailRecipients); - -var filePath = ""; -var attachmentName = ""; -EmailAttachmentType attachmentType = EmailAttachmentType.Txt; - -// Convert the file content into a Base64 string -byte[] bytes = File.ReadAllBytes(filePath); -string attachmentFileInBytes = Convert.ToBase64String(bytes); -var emailAttachment = new EmailAttachment(attachmentName, attachmentType, attachmentFileInBytes); - -emailMessage.Attachments.Add(emailAttachment); - -SendEmailResult sendResult = await client.SendAsync(emailMessage); -``` - -## Get the status of a call to `Send` -When `Send` or `SendAsync` is called, the Azure Communication Service has accepted the email that you want to send. The actual sending opration is an asynchronous process. You can get the status of the email throughout this process by calling `GetSendStatus` or `GetSendStatusAsync` using the `SendEmailResult.MessageId` returned from a previous call to `Send` or `SendAsync` -```C# Snippet:Azure_Communication_Email_GetSendStatusAsync -SendEmailResult sendResult = await client.SendAsync(emailMessage); - -SendStatusResult status = await client.GetSendStatusAsync(sendResult.MessageId); -``` - -[README]: https://www.bing.com \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample1_SendSimpleEmailWithAutomaticPollingForStatus.md b/sdk/communication/Azure.Communication.Email/samples/Sample1_SendSimpleEmailWithAutomaticPollingForStatus.md new file mode 100644 index 0000000000000..6a7ed8d79dcb3 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample1_SendSimpleEmailWithAutomaticPollingForStatus.md @@ -0,0 +1,32 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +## Send a simple email message with automatic polling for status +To send an email message, call the simple overload of `Send` or `SendAsync` function from the `EmailClient`. +```C# Snippet:Azure_Communication_Email_Send_Simple_AutoPolling +var emailSendOperation = emailClient.Send( + wait: WaitUntil.Completed, + from: "" // The email address of the domain registered with the Communication Services resource + to: "" + subject: "This is the subject", + htmlContent: "This is the html body"); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample1_SendSimpleEmailWithAutomaticPollingForStatusAsync.md b/sdk/communication/Azure.Communication.Email/samples/Sample1_SendSimpleEmailWithAutomaticPollingForStatusAsync.md new file mode 100644 index 0000000000000..2f758f15d02a9 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample1_SendSimpleEmailWithAutomaticPollingForStatusAsync.md @@ -0,0 +1,33 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +### Send a simple email message with automatic polling for status +To send an email message, call the simple overload of `Send` or `SendAsync` function from the `EmailClient`. +```C# Snippet:Azure_Communication_Email_Send_Simple_AutoPolling_Async +var emailSendOperation = await emailClient.SendAsync( + wait: WaitUntil.Completed, + from: "" // The email address of the domain registered with the Communication Services resource + to: "" + subject: "This is the subject", + htmlContent: "This is the html body"); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites + diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample2_SendSimpleEmailWithManualPollingForStatusAsync.md b/sdk/communication/Azure.Communication.Email/samples/Sample2_SendSimpleEmailWithManualPollingForStatusAsync.md new file mode 100644 index 0000000000000..2c17a3b55c09a --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample2_SendSimpleEmailWithManualPollingForStatusAsync.md @@ -0,0 +1,49 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +### Send a simple email message with manual polling for status +To send an email message, call the simple overload of `Send` or `SendAsync` function from the `EmailClient`. +```C# Snippet:Azure_Communication_Email_Send_Simple_ManualPolling_Async +/// Send the email message with WaitUntil.Started +var emailSendOperation = await emailClient.SendAsync( + wait: WaitUntil.Started, + from: "" // The email address of the domain registered with the Communication Services resource + to: "" + subject: "This is the subject", + htmlContent: "This is the html body"); + +/// Call UpdateStatus on the email send operation to poll for the status +/// manually. +while (true) +{ + await emailSendOperation.UpdateStatusAsync(); + if (emailSendOperation.HasCompleted) + { + break; + } + await Task.Delay(100); +} + +if (emailSendOperation.HasValue) +{ + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); +} + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample3_SendEmailWithMoreOptions.md b/sdk/communication/Azure.Communication.Email/samples/Sample3_SendEmailWithMoreOptions.md new file mode 100644 index 0000000000000..12af0e9e1554b --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample3_SendEmailWithMoreOptions.md @@ -0,0 +1,42 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +### Send an email message with more options +To send an email message, call the overload of `Send` or `SendAsync` function from the `EmailClient` that takes an `EmailMessage` parameter. +```C# Snippet:Azure_Communication_Email_Send_With_MoreOptions +// Create the email content +var emailContent = new EmailContent("This is the subject") +{ + PlainText = "This is the body", + Html = "This is the html body" +}; + +// Create the EmailMessage +var emailMessage = new EmailMessage( + fromAddress: "" // The email address of the domain registered with the Communication Services resource + toAddress: "" + content: emailContent); + +var emailSendOperation = emailClient.Send( + wait: WaitUntil.Completed, + message: emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample3_SendEmailWithMoreOptionsAsync.md b/sdk/communication/Azure.Communication.Email/samples/Sample3_SendEmailWithMoreOptionsAsync.md new file mode 100644 index 0000000000000..b7d443527b03e --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample3_SendEmailWithMoreOptionsAsync.md @@ -0,0 +1,42 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +### Send an email message with more options +To send an email message, call the overload of `Send` or `SendAsync` function from the `EmailClient` that takes an `EmailMessage` parameter. +```C# Snippet:Azure_Communication_Email_Send_With_MoreOptions_Async +// Create the email content +var emailContent = new EmailContent("This is the subject") +{ + PlainText = "This is the body", + Html = "This is the html body" +}; + +// Create the EmailMessage +var emailMessage = new EmailMessage( + fromAddress: "" // The email address of the domain registered with the Communication Services resource + toAddress: "" + content: emailContent); + +var emailSendOperation = await emailClient.SendAsync( + wait: WaitUntil.Completed, + message: emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample4_SendEmailToMultipleRecipients.md b/sdk/communication/Azure.Communication.Email/samples/Sample4_SendEmailToMultipleRecipients.md new file mode 100644 index 0000000000000..bc5f032a36cb0 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample4_SendEmailToMultipleRecipients.md @@ -0,0 +1,76 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +### Send an email message to multiple recipients +To send an email message to multiple recipients, add an `EmailAddress` object for each recipent type to the `EmailRecipient` object. + +```C# Snippet:Azure_Communication_Email_Send_Multiple_Recipients +// Create the email content +var emailContent = new EmailContent("This is the subject") +{ + PlainText = "This is the body", + Html = "This is the html body" +}; + +// Create the To list +var toRecipients = new List +{ + new EmailAddress( + address: "" + displayName: "" + new EmailAddress( + address: "" + displayName: "" +}; + +// Create the CC list +var ccRecipients = new List +{ + new EmailAddress( + address: "" + displayName: "" + new EmailAddress( + address: "" + displayName: "" +}; + +// Create the BCC list +var bccRecipients = new List +{ + new EmailAddress( + address: "" + displayName: "" + new EmailAddress( + address: "" + displayName: "" +}; + +var emailRecipients = new EmailRecipients(toRecipients, ccRecipients, bccRecipients); + +// Create the EmailMessage +var emailMessage = new EmailMessage( + senderAddress: "" // The email address of the domain registered with the Communication Services resource + emailRecipients, + emailContent); + +EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample4_SendEmailToMultipleRecipientsAsync.md b/sdk/communication/Azure.Communication.Email/samples/Sample4_SendEmailToMultipleRecipientsAsync.md new file mode 100644 index 0000000000000..1f04e8f6f9376 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample4_SendEmailToMultipleRecipientsAsync.md @@ -0,0 +1,76 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +### Send an email message to multiple recipients +To send an email message to multiple recipients, add an `EmailAddress` object for each recipent type to the `EmailRecipient` object. + +```C# Snippet:Azure_Communication_Email_Send_Multiple_Recipients_Async +// Create the email content +var emailContent = new EmailContent("This is the subject") +{ + PlainText = "This is the body", + Html = "This is the html body" +}; + +// Create the To list +var toRecipients = new List +{ + new EmailAddress( + address: "" + displayName: "" + new EmailAddress( + address: "" + displayName: "" +}; + +// Create the CC list +var ccRecipients = new List +{ + new EmailAddress( + address: "" + displayName: "" + new EmailAddress( + address: "" + displayName: "" +}; + +// Create the BCC list +var bccRecipients = new List +{ + new EmailAddress( + address: "" + displayName: "" + new EmailAddress( + address: "" + displayName: "" +}; + +var emailRecipients = new EmailRecipients(toRecipients, ccRecipients, bccRecipients); + +// Create the EmailMessage +var emailMessage = new EmailMessage( + senderAddress: "" // The email address of the domain registered with the Communication Services resource + emailRecipients, + emailContent); + +EmailSendOperation emailSendOperation = await emailClient.SendAsync(WaitUntil.Completed, emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample5_SendEmailWithAttachment.md b/sdk/communication/Azure.Communication.Email/samples/Sample5_SendEmailWithAttachment.md new file mode 100644 index 0000000000000..3c6e6f2c353b9 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample5_SendEmailWithAttachment.md @@ -0,0 +1,42 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +### Send email with attachments +Azure Communication Services support sending emails with attachments. See [EmailAttachmentType][email_attachmentTypes] for a list of supported attachments +```C# Snippet:Azure_Communication_Email_Send_With_Attachments +// Create the EmailMessage +var emailMessage = new EmailMessage( + fromAddress: "" // The email address of the domain registered with the Communication Services resource + toAddress: "" + content: emailContent); + +var filePath = ""; +var attachmentName = ""; +var contentType = MediaTypeNames.Text.Plain; + +string content = new BinaryData(File.ReadAllBytes(filePath)); +var emailAttachment = new EmailAttachment(attachmentName, contentType, content); + +emailMessage.Attachments.Add(emailAttachment); + +EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites diff --git a/sdk/communication/Azure.Communication.Email/samples/Sample5_SendEmailWithAttachmentAsync.md b/sdk/communication/Azure.Communication.Email/samples/Sample5_SendEmailWithAttachmentAsync.md new file mode 100644 index 0000000000000..ed20bffb34df9 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/samples/Sample5_SendEmailWithAttachmentAsync.md @@ -0,0 +1,42 @@ +# Send Email Message + +This sample demonstrates how to send an email message to an individual or a group of recipients. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `EmailClient` + +Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Email_CreateEmailClient +var connectionString = ""; // Find your Communication Services resource in the Azure portal +EmailClient emailClient = new EmailClient(connectionString); +``` + +### Send email with attachments +Azure Communication Services support sending emails with attachments. See [EmailAttachmentType][email_attachmentTypes] for a list of supported attachments +```C# Snippet:Azure_Communication_Email_Send_With_Attachments_Async +// Create the EmailMessage +var emailMessage = new EmailMessage( + fromAddress: "" // The email address of the domain registered with the Communication Services resource + toAddress: "" + content: emailContent); + +var filePath = ""; +var attachmentName = ""; +var contentType = MediaTypeNames.Text.Plain; + +string content = new BinaryData(File.ReadAllBytes(filePath)); +var emailAttachment = new EmailAttachment(attachmentName, contentType, content); + +emailMessage.Attachments.Add(emailAttachment); + +EmailSendOperation emailSendOperation = await emailClient.SendAsync(WaitUntil.Completed, emailMessage); +Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + +/// Get the OperationId so that it can be used for tracking the message for troubleshooting +string operationId = emailSendOperation.Id; +Console.WriteLine($"Email operation id = {operationId}"); +``` + +[README]: https://learn.microsoft.com/azure/communication-services/quickstarts/email/send-email?tabs=windows&pivots=platform-azcli#prerequisites diff --git a/sdk/communication/Azure.Communication.Email/src/CommunicationEmailModelFactory.cs b/sdk/communication/Azure.Communication.Email/src/CommunicationEmailModelFactory.cs deleted file mode 100644 index ae2646e3a879b..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/CommunicationEmailModelFactory.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using Azure.Communication.Email.Models; -using Azure.Core; - -namespace Azure.Communication.Email -{ - /// Model factory for read-only models. - [CodeGenModel("CommunicationEmailModelFactory")] - public static partial class CommunicationEmailModelFactory - { - /// Initializes a new instance of SendEmailResult. - /// System generated id of an email message sent. - /// A new instance for mocking. - public static SendEmailResult SendEmailResult(string messageId = null) - { - return new SendEmailResult(messageId); - } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/EmailClient.cs b/sdk/communication/Azure.Communication.Email/src/EmailClient.cs index bdb51415933ef..4943c2ebf80d8 100644 --- a/sdk/communication/Azure.Communication.Email/src/EmailClient.cs +++ b/sdk/communication/Azure.Communication.Email/src/EmailClient.cs @@ -5,12 +5,10 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.Linq; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Azure.Communication.Email.Extensions; -using Azure.Communication.Email.Models; using Azure.Communication.Pipeline; using Azure.Core; using Azure.Core.Pipeline; @@ -22,7 +20,7 @@ public partial class EmailClient { private readonly ClientDiagnostics _clientDiagnostics; - internal EmailRestClient RestClient { get; } + private readonly EmailRestClient _restClient; /// Initializes a new instance of EmailClient for mocking. protected EmailClient() @@ -34,8 +32,8 @@ protected EmailClient() /// /// Connection string acquired from the Azure Communication Services resource. public EmailClient(string connectionString) - : this(ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), - new EmailClientOptions()) + : this(ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + new EmailClientOptions()) { } @@ -51,62 +49,64 @@ public EmailClient(string connectionString, EmailClientOptions options) /// Initializes a new instance of . /// The URI of the Azure Communication Services resource. - /// The used to authenticate requests. + /// The used to authenticate requests. /// Client option exposing , , , etc. - public EmailClient(Uri endpoint, AzureKeyCredential keyCredential, EmailClientOptions options = default) + public EmailClient(Uri endpoint, AzureKeyCredential credential, EmailClientOptions options = default) : this( Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, - Argument.CheckNotNull(keyCredential, nameof(keyCredential)), + Argument.CheckNotNull(credential, nameof(credential)), options ?? new EmailClientOptions()) { } /// Initializes a new instance of . /// The URI of the Azure Communication Services resource. - /// The TokenCredential used to authenticate requests, such as DefaultAzureCredential. + /// The TokenCredential used to authenticate requests, such as DefaultAzureCredential. /// Client option exposing , , , etc. - public EmailClient(Uri endpoint, TokenCredential tokenCredential, EmailClientOptions options = default) + public EmailClient(Uri endpoint, TokenCredential credential, EmailClientOptions options = default) : this( Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, - Argument.CheckNotNull(tokenCredential, nameof(tokenCredential)), + Argument.CheckNotNull(credential, nameof(credential)), options ?? new EmailClientOptions()) { } private EmailClient(ConnectionString connectionString, EmailClientOptions options) - : this(connectionString.GetRequired("endpoint"), options.BuildHttpPipeline(connectionString), options) + : this(new Uri(connectionString.GetRequired("endpoint")), options.BuildHttpPipeline(connectionString), options) { } - private EmailClient(string endpoint, HttpPipeline httpPipeline, EmailClientOptions options) + private EmailClient(Uri endpoint, HttpPipeline httpPipeline, EmailClientOptions options) { _clientDiagnostics = new ClientDiagnostics(options); - RestClient = new EmailRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); + _restClient = new EmailRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); } - private EmailClient(string endpoint, AzureKeyCredential keyCredential, EmailClientOptions options) - : this(endpoint, options.BuildHttpPipeline(keyCredential), options) + private EmailClient(string endpoint, AzureKeyCredential credential, EmailClientOptions options) + : this(new Uri(endpoint), options.BuildHttpPipeline(credential), options) { } - private EmailClient(string endpoint, TokenCredential tokenCredential, EmailClientOptions options) - : this(endpoint, options.BuildHttpPipeline(tokenCredential), options) + private EmailClient(string endpoint, TokenCredential credential, EmailClientOptions options) + : this(new Uri(endpoint), options.BuildHttpPipeline(credential), options) { } - /// Gets the status of a message sent previously. - /// System generated message id (GUID) returned from a previous call to send email. + /// Queues an email message to be sent to one or more recipients. + /// + /// if the method should wait to return until the long-running operation has completed on the service; + /// if it should return after starting the operation. + /// For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Message payload for sending an email. /// The cancellation token to use. - public virtual async Task> GetSendStatusAsync(string messageId, CancellationToken cancellationToken = default) + public virtual async Task SendAsync( + WaitUntil wait, + EmailMessage message, + CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope("EmailClient.GetSendStatus"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope("EmailClient.Send"); scope.Start(); try { - if (string.IsNullOrWhiteSpace(messageId)) - { - throw new ArgumentException("MessageId cannot be null or empty"); - } - - return await RestClient.GetSendStatusAsync(messageId, cancellationToken).ConfigureAwait(false); + return await SendEmailInternalAsync(wait, message, cancellationToken).ConfigureAwait(false); } catch (Exception e) { @@ -115,21 +115,42 @@ public virtual async Task> GetSendStatusAsync(string } } - /// Gets the status of a message sent previously. - /// System generated message id (GUID) returned from a previous call to send email. + /// Queues an email message to be sent to a single recipient. + /// + /// if the method should wait to return until the long-running operation has completed on the service; + /// if it should return after starting the operation. + /// For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// From address of the email. + /// Email address of the TO recipient. + /// Subject for the email. + /// Email body in HTML format. + /// Email body in plain text format. /// The cancellation token to use. - public virtual Response GetSendStatus(string messageId, CancellationToken cancellationToken = default) + public virtual async Task SendAsync( + WaitUntil wait, + string from, + string to, + string subject, + string htmlContent, + string plainTextContent = default, + CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope("EmailClient.GetSendStatus"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope("EmailClient.Send"); scope.Start(); try { - if (string.IsNullOrWhiteSpace(messageId)) - { - throw new ArgumentException("MessageId cannot be null or empty"); - } - - return RestClient.GetSendStatus(messageId, cancellationToken); + EmailMessage message = new EmailMessage( + from, + new EmailRecipients(new List() + { + new EmailAddress(to) + }), + new EmailContent(subject) + { + PlainText = plainTextContent, + Html = htmlContent + }); + return await SendEmailInternalAsync(wait, message, cancellationToken).ConfigureAwait(false); } catch (Exception e) { @@ -139,30 +160,22 @@ public virtual Response GetSendStatus(string messageId, Cancel } /// Queues an email message to be sent to one or more recipients. - /// Message payload for sending an email. + /// + /// if the method should wait to return until the long-running operation has completed on the service; + /// if it should return after starting the operation. + /// For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Message payload for sending an email. /// The cancellation token to use. - public virtual async Task> SendAsync( - EmailMessage emailMessage, + public virtual EmailSendOperation Send( + WaitUntil wait, + EmailMessage message, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope("EmailClient.Send"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(EmailClient)}.{nameof(Send)}"); scope.Start(); try { - ValidateEmailMessage(emailMessage); - ResponseWithHeaders response = (await RestClient.SendAsync( - Guid.NewGuid().ToString(), - DateTimeOffset.UtcNow.ToString("r", CultureInfo.InvariantCulture), - emailMessage, - cancellationToken).ConfigureAwait(false)); - - Response rawResponse = response.GetRawResponse(); - if (!rawResponse.Headers.TryGetValue("x-ms-request-id", out var messageId)) - { - messageId = null; - } - - return Response.FromValue(new SendEmailResult(messageId), response); + return SendEmailInternal(wait, message, cancellationToken); } catch (Exception e) { @@ -171,31 +184,92 @@ public virtual async Task> SendAsync( } } - /// Queues an email message to be sent to one or more recipients. - /// Message payload for sending an email. + /// Queues an email message to be sent to a single recipient. + /// + /// if the method should wait to return until the long-running operation has completed on the service; + /// if it should return after starting the operation. + /// For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// From address of the email. + /// Email address of the TO recipient. + /// Subject for the email. + /// Email body in HTML format. + /// Email body in plain text format. /// The cancellation token to use. - public virtual Response Send( - EmailMessage emailMessage, + public virtual EmailSendOperation Send( + WaitUntil wait, + string from, + string to, + string subject, + string htmlContent, + string plainTextContent = default, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope("EmailClient.Send"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(EmailClient)}.{nameof(Send)}"); scope.Start(); try { - ValidateEmailMessage(emailMessage); - ResponseWithHeaders response = RestClient.Send( - Guid.NewGuid().ToString(), - DateTimeOffset.UtcNow.ToString("r", CultureInfo.InvariantCulture), - emailMessage, - cancellationToken); - - Response rawResponse = response.GetRawResponse(); - if (!rawResponse.Headers.TryGetValue("x-ms-request-id", out var messageId)) - { - messageId = null; - } + EmailMessage message = new EmailMessage( + from, + new EmailRecipients(new List() + { + new EmailAddress(to) + }), + new EmailContent(subject) + { + PlainText = plainTextContent, + Html = htmlContent + }); + return SendEmailInternal(wait, message, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the status result of an existing email send operation. + /// + /// ID of the existing email send operation. + /// Optional to propagate + /// notification that the operation should be cancelled. + /// + public virtual async Task> GetSendResultAsync( + string id, + CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(EmailClient)}.{nameof(GetSendResult)}"); + scope.Start(); + try + { + var originalResponse = await _restClient.GetSendResultAsync(id, cancellationToken).ConfigureAwait(false); + return Response.FromValue(originalResponse.Value, originalResponse.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } - return Response.FromValue(new SendEmailResult(messageId), response); + /// + /// Gets the status result of an existing email send operation. + /// + /// ID of the existing email send operation. + /// Optional to propagate + /// notification that the operation should be cancelled. + /// + public virtual Response GetSendResult( + string id, + CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(EmailClient)}.{nameof(GetSendResult)}"); + scope.Start(); + try + { + var originalResponse = _restClient.GetSendResult(id, cancellationToken); + return Response.FromValue(originalResponse.Value, originalResponse.GetRawResponse()); } catch (Exception e) { @@ -204,6 +278,52 @@ public virtual Response Send( } } + private async Task SendEmailInternalAsync( + WaitUntil wait, + EmailMessage message, + CancellationToken cancellationToken) + { + ValidateEmailMessage(message); + + var operationId = Guid.NewGuid(); + ResponseWithHeaders originalResponse = await _restClient.SendAsync(message, operationId, cancellationToken).ConfigureAwait(false); + + Response rawResponse = originalResponse.GetRawResponse(); + using JsonDocument document = await JsonDocument.ParseAsync(rawResponse.ContentStream, default, cancellationToken).ConfigureAwait(false); + var emailSendResult = EmailSendResult.DeserializeEmailSendResult(document.RootElement); + + var operation = new EmailSendOperation(this, emailSendResult.Id, originalResponse.GetRawResponse(), cancellationToken); + if (wait == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + + return operation; + } + + private EmailSendOperation SendEmailInternal( + WaitUntil wait, + EmailMessage message, + CancellationToken cancellationToken) + { + ValidateEmailMessage(message); + + var operationId = Guid.NewGuid(); + var originalResponse = _restClient.Send(message, operationId, cancellationToken); + + Response rawResponse = originalResponse.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(rawResponse.ContentStream, default); + var emailSendResult = EmailSendResult.DeserializeEmailSendResult(document.RootElement); + + var operation = new EmailSendOperation(this, emailSendResult.Id, originalResponse.GetRawResponse(), cancellationToken); + if (wait == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + + return operation; + } + private static void ValidateEmailMessage(EmailMessage emailMessage) { if (emailMessage == null) @@ -211,28 +331,23 @@ private static void ValidateEmailMessage(EmailMessage emailMessage) throw new ArgumentNullException(nameof(emailMessage)); } - ValidateEmailCustomHeaders(emailMessage); + ValidateEmailHeaders(emailMessage); ValidateEmailContent(emailMessage); ValidateSenderEmailAddress(emailMessage); ValidateRecipients(emailMessage); - ValidateReplyToEmailAddresses(emailMessage); ValidateAttachmentContent(emailMessage); } - private static void ValidateEmailCustomHeaders(EmailMessage emailMessage) + private static void ValidateEmailHeaders(EmailMessage emailMessage) { // Do not allow empty/null header names and values (for custom headers only) - emailMessage.CustomHeaders?.ToList().ForEach(header => header.Validate()); - - // Validate header names are all unique - var messageHeaders = new HashSet(StringComparer.InvariantCultureIgnoreCase); - foreach (EmailCustomHeader header in emailMessage.CustomHeaders ?? Enumerable.Empty()) + emailMessage.Headers?.ToList().ForEach(header => { - if (!messageHeaders.Add(header.Name)) + if (string.IsNullOrWhiteSpace(header.Value)) { - throw new ArgumentException($"{header.Name}" + ErrorMessages.DuplicateHeaderName); + throw new ArgumentException(ErrorMessages.EmptyHeaderValue); } - } + }); } private static void ValidateEmailContent(EmailMessage emailMessage) @@ -252,7 +367,7 @@ private static void ValidateEmailContent(EmailMessage emailMessage) private static void ValidateSenderEmailAddress(EmailMessage emailMessage) { - if (string.IsNullOrEmpty(emailMessage.Sender) || !ValidEmailAddress(emailMessage.Sender)) + if (string.IsNullOrWhiteSpace(emailMessage.SenderAddress)) { throw new ArgumentException(ErrorMessages.InvalidSenderEmail); } @@ -263,11 +378,6 @@ private static void ValidateRecipients(EmailMessage emailMessage) emailMessage.Recipients.Validate(); } - private static void ValidateReplyToEmailAddresses(EmailMessage emailMessage) - { - emailMessage.ReplyTo?.Validate(); - } - private static void ValidateAttachmentContent(EmailMessage emailMessage) { foreach (EmailAttachment attachment in emailMessage.Attachments ?? Enumerable.Empty()) @@ -275,20 +385,5 @@ private static void ValidateAttachmentContent(EmailMessage emailMessage) attachment.ValidateAttachmentContent(); } } - - private static bool ValidEmailAddress(string sender) - { - try - { - var emailAddress = new EmailAddress(sender); - emailAddress.ValidateEmailAddress(); - } - catch - { - return false; - } - - return true; - } } } diff --git a/sdk/communication/Azure.Communication.Email/src/EmailClientBuilderExtensions.cs b/sdk/communication/Azure.Communication.Email/src/EmailClientBuilderExtensions.cs new file mode 100644 index 0000000000000..1f6b73e5e1763 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/EmailClientBuilderExtensions.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.Communication.Email; +using Azure.Core.Extensions; + +namespace Microsoft.Extensions.Azure +{ + /// + /// Extension methods to add client to clients builder. + /// + public static class EmailClientBuilderExtensions + { + /// + /// Registers a instance with the provided + /// + public static IAzureClientBuilder AddEmailClient(this TBuilder builder, string connectionString) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory(options => new EmailClient(connectionString, options)); + } + + /// + /// Registers a instance with the provided and + /// + public static IAzureClientBuilder AddEmailClient(this TBuilder builder, Uri serviceUri, AzureKeyCredential azureKeyCredential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory(options => new EmailClient(serviceUri, azureKeyCredential, options)); + } + + /// + /// Registers a instance with the provided + /// + public static IAzureClientBuilder AddEmailClient(this TBuilder builder, Uri serviceUri) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new EmailClient(serviceUri, cred, options)); + } + + /// + /// Registers a instance with the provided + /// + public static IAzureClientBuilder AddEmailClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/EmailClientOptions.cs b/sdk/communication/Azure.Communication.Email/src/EmailClientOptions.cs index c788db42f2c41..cae0216118419 100644 --- a/sdk/communication/Azure.Communication.Email/src/EmailClientOptions.cs +++ b/sdk/communication/Azure.Communication.Email/src/EmailClientOptions.cs @@ -17,7 +17,7 @@ public class EmailClientOptions : ClientOptions /// The latest version of the Email service. /// /// - private const ServiceVersion LatestVersion = ServiceVersion.V2021_10_01_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2023_01_15_Preview; internal string ApiVersion { get; } @@ -29,6 +29,7 @@ public EmailClientOptions(ServiceVersion version = LatestVersion) ApiVersion = version switch { ServiceVersion.V2021_10_01_Preview => "2021-10-01-preview", + ServiceVersion.V2023_01_15_Preview => "2023-01-15-preview", _ => throw new ArgumentOutOfRangeException(nameof(version)), }; } @@ -38,11 +39,15 @@ public EmailClientOptions(ServiceVersion version = LatestVersion) /// public enum ServiceVersion { +#pragma warning disable CA1707 // Identifiers should not contain underscores /// /// The V1 of the Email service. /// -#pragma warning disable CA1707 // Identifiers should not contain underscores - V2021_10_01_Preview = 1 + V2021_10_01_Preview = 1, + /// + /// The V1 of the Email service. + /// + V2023_01_15_Preview = 2 #pragma warning restore CA1707 // Identifiers should not contain underscores } } diff --git a/sdk/communication/Azure.Communication.Email/src/EmailSendOperation.cs b/sdk/communication/Azure.Communication.Email/src/EmailSendOperation.cs new file mode 100644 index 0000000000000..da4ff1adf2130 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/EmailSendOperation.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Email +{ + /// An for tracking the status of a + /// request. + /// Its upon successful completion will + /// be an object which contains the OperationId = , operation status + /// = and error if any for terminal failed status. + /// + public class EmailSendOperation : Operation + { + /// + /// The client used to check for completion. + /// + private readonly EmailClient _client; + + /// + /// The CancellationToken to use for all status checking. + /// + private readonly CancellationToken _cancellationToken; + + /// + /// Whether the operation has completed. + /// + private bool _hasCompleted; + + /// + /// Gets the status of the email send operation. + /// + private EmailSendResult _value; + + private Response _rawResponse; + + /// + /// Gets a value indicating whether the operation has completed. + /// + public override bool HasCompleted => _hasCompleted; + + /// + /// Gets a value indicating whether the operation completed and + /// successfully produced a value. The + /// property is the status of the email send operation. + /// + public override bool HasValue => (_value != null); + + /// + public override string Id { get; } + + /// + /// Gets the status of the email send operation. + /// + public override EmailSendResult Value => OperationHelpers.GetValue(ref _value); + + /// + public override Response GetRawResponse() => _rawResponse; + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => + this.DefaultWaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) => + this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); + + /// + /// Initializes a new instance for + /// mocking. + /// + protected EmailSendOperation() + { + } + + /// + /// Initializes a new instance + /// + /// + /// The client used to check for completion. + /// + /// The ID of this operation. + public EmailSendOperation(string id, EmailClient client) : + this(client, id, null, CancellationToken.None) + { + } + + /// + /// Initializes a new instance + /// + /// + /// The client used to check for completion. + /// + /// The ID of this operation. + /// + /// Either the response from initiating the operation or getting the + /// status if we're creating an operation from an existing ID. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + internal EmailSendOperation( + EmailClient client, + string copyId, + Response initialResponse, + CancellationToken cancellationToken) + { + Id = copyId; + _value = null; + _rawResponse = initialResponse; + _client = client; + _cancellationToken = cancellationToken; + } + + /// + /// Check for the latest status of the email send operation. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// The with the status update. + public override Response UpdateStatus( + CancellationToken cancellationToken = default) => + UpdateStatusAsync(false, cancellationToken).EnsureCompleted(); + + /// + /// Check for the latest status of the email send operation. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// The with the status update. + public override async ValueTask UpdateStatusAsync( + CancellationToken cancellationToken = default) => + await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); + + /// + /// Check for the latest status of the email send operation. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// The with the status update. + private async Task UpdateStatusAsync(bool async, CancellationToken cancellationToken) + { + // Short-circuit when already completed (which improves mocking + // scenarios that won't have a client). + if (HasCompleted) + { + return GetRawResponse(); + } + + // Use our original CancellationToken if the user didn't provide one + if (cancellationToken == default) + { + cancellationToken = _cancellationToken; + } + + // Get the latest status + Response update = async + ? await _client.GetSendResultAsync(Id, cancellationToken: cancellationToken).ConfigureAwait(false) + : _client.GetSendResult(Id, cancellationToken: cancellationToken); + + // Check if the operation is no longer running + if (update.Value.Status != EmailSendStatus.NotStarted && + update.Value.Status != EmailSendStatus.Running) + { + _hasCompleted = true; + } + + // Check if the operation succeeded + if (Id == update.Value.Id && + update.Value.Status == EmailSendStatus.Succeeded) + { + _value = update.Value; + } + // Check if the operation aborted or failed + if (Id == update.Value.Id && + (update.Value.Status == EmailSendStatus.Failed || + update.Value.Status == EmailSendStatus.Canceled)) + { + _value = default; + } + + // Save this update as the latest raw response indicating the state + // of the copy operation + Response response = update.GetRawResponse(); + _rawResponse = response; + return response; + } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Extensions/EmailAddressListExtensions.cs b/sdk/communication/Azure.Communication.Email/src/Extensions/EmailAddressListExtensions.cs deleted file mode 100644 index 3626adf17f76f..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Extensions/EmailAddressListExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Collections.Generic; -using Azure.Communication.Email.Models; - -namespace Azure.Communication.Email.Extensions -{ - internal static class EmailAddressListExtensions - { - internal static void Validate(this IList emailAddresses) - { - foreach (EmailAddress email in emailAddresses) - { - email.ValidateEmailAddress(); - } - } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/CommunicationEmailModelFactory.cs b/sdk/communication/Azure.Communication.Email/src/Generated/CommunicationEmailModelFactory.cs deleted file mode 100644 index a2ddf67617799..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/CommunicationEmailModelFactory.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Communication.Email.Models; - -namespace Azure.Communication.Email -{ - /// Model factory for models. - public static partial class CommunicationEmailModelFactory - { - /// Initializes a new instance of SendStatusResult. - /// System generated id of an email message sent. - /// The type indicating the status of a request. - /// is null. - /// A new instance for mocking. - public static SendStatusResult SendStatusResult(string messageId = null, SendStatus status = default) - { - if (messageId == null) - { - throw new ArgumentNullException(nameof(messageId)); - } - - return new SendStatusResult(messageId, status); - } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/EmailGetSendStatusHeaders.cs b/sdk/communication/Azure.Communication.Email/src/Generated/EmailGetSendResultHeaders.cs similarity index 50% rename from sdk/communication/Azure.Communication.Email/src/Generated/EmailGetSendStatusHeaders.cs rename to sdk/communication/Azure.Communication.Email/src/Generated/EmailGetSendResultHeaders.cs index 7a91f19db87ed..dcba78acc26b8 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/EmailGetSendStatusHeaders.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/EmailGetSendResultHeaders.cs @@ -10,14 +10,14 @@ namespace Azure.Communication.Email { - internal partial class EmailGetSendStatusHeaders + internal partial class EmailGetSendResultHeaders { private readonly Response _response; - public EmailGetSendStatusHeaders(Response response) + public EmailGetSendResultHeaders(Response response) { _response = response; } - /// Amount of time client should wait before retrying the request, specified in seconds. - public int? RetryAfter => _response.Headers.TryGetValue("Retry-After", out int? value) ? value : null; + /// This header will only be present when the status is a non-terminal status. It indicates the minimum amount of time in seconds to wait before polling for operation status again. + public int? RetryAfter => _response.Headers.TryGetValue("retry-after", out int? value) ? value : null; } } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/EmailModelFactory.cs b/sdk/communication/Azure.Communication.Email/src/Generated/EmailModelFactory.cs new file mode 100644 index 0000000000000..bd8930faf478d --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/EmailModelFactory.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.Email +{ + /// Model factory for models. + public static partial class EmailModelFactory + { + /// Initializes a new instance of ErrorDetail. + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + /// A new instance for mocking. + public static ErrorDetail ErrorDetail(string code = null, string message = null, string target = null, IEnumerable details = null, IEnumerable additionalInfo = null) + { + details ??= new List(); + additionalInfo ??= new List(); + + return new ErrorDetail(code, message, target, details?.ToList(), additionalInfo?.ToList()); + } + + /// Initializes a new instance of ErrorAdditionalInfo. + /// The additional info type. + /// The additional info. + /// A new instance for mocking. + public static ErrorAdditionalInfo ErrorAdditionalInfo(string type = null, object info = null) + { + return new ErrorAdditionalInfo(type, info); + } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/EmailRestClient.cs b/sdk/communication/Azure.Communication.Email/src/Generated/EmailRestClient.cs index bb46a1a0f1c76..f1acff2a973e3 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/EmailRestClient.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/EmailRestClient.cs @@ -9,7 +9,6 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Azure.Communication.Email.Models; using Azure.Core; using Azure.Core.Pipeline; @@ -18,7 +17,7 @@ namespace Azure.Communication.Email internal partial class EmailRestClient { private readonly HttpPipeline _pipeline; - private readonly string _endpoint; + private readonly Uri _endpoint; private readonly string _apiVersion; /// The ClientDiagnostics is used to provide tracing support for the client library. @@ -30,7 +29,7 @@ internal partial class EmailRestClient /// The communication resource, for example https://my-resource.communication.azure.com. /// Api Version. /// , , or is null. - public EmailRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2021-10-01-preview") + public EmailRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-01-15-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -38,43 +37,42 @@ public EmailRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipelin _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion)); } - internal HttpMessage CreateGetSendStatusRequest(string messageId) + internal HttpMessage CreateGetSendResultRequest(string operationId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw(_endpoint, false); - uri.AppendPath("/emails/", false); - uri.AppendPath(messageId, true); - uri.AppendPath("/status", false); + uri.Reset(_endpoint); + uri.AppendPath("/emails/operations/", false); + uri.AppendPath(operationId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } - /// Gets the status of a message sent previously. - /// System generated message id (GUID) returned from a previous call to send email. + /// Gets the status of the email send operation. + /// ID of the long running operation (GUID) returned from a previous call to send email. /// The cancellation token to use. - /// is null. - public async Task> GetSendStatusAsync(string messageId, CancellationToken cancellationToken = default) + /// is null. + public async Task> GetSendResultAsync(string operationId, CancellationToken cancellationToken = default) { - if (messageId == null) + if (operationId == null) { - throw new ArgumentNullException(nameof(messageId)); + throw new ArgumentNullException(nameof(operationId)); } - using var message = CreateGetSendStatusRequest(messageId); + using var message = CreateGetSendResultRequest(operationId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - var headers = new EmailGetSendStatusHeaders(message.Response); + var headers = new EmailGetSendResultHeaders(message.Response); switch (message.Response.Status) { case 200: { - SendStatusResult value = default; + EmailSendResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SendStatusResult.DeserializeSendStatusResult(document.RootElement); + value = EmailSendResult.DeserializeEmailSendResult(document.RootElement); return ResponseWithHeaders.FromValue(value, headers, message.Response); } default: @@ -82,27 +80,27 @@ public async Task Gets the status of a message sent previously. - /// System generated message id (GUID) returned from a previous call to send email. + /// Gets the status of the email send operation. + /// ID of the long running operation (GUID) returned from a previous call to send email. /// The cancellation token to use. - /// is null. - public ResponseWithHeaders GetSendStatus(string messageId, CancellationToken cancellationToken = default) + /// is null. + public ResponseWithHeaders GetSendResult(string operationId, CancellationToken cancellationToken = default) { - if (messageId == null) + if (operationId == null) { - throw new ArgumentNullException(nameof(messageId)); + throw new ArgumentNullException(nameof(operationId)); } - using var message = CreateGetSendStatusRequest(messageId); + using var message = CreateGetSendResultRequest(operationId); _pipeline.Send(message, cancellationToken); - var headers = new EmailGetSendStatusHeaders(message.Response); + var headers = new EmailGetSendResultHeaders(message.Response); switch (message.Response.Status) { case 200: { - SendStatusResult value = default; + EmailSendResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SendStatusResult.DeserializeSendStatusResult(document.RootElement); + value = EmailSendResult.DeserializeEmailSendResult(document.RootElement); return ResponseWithHeaders.FromValue(value, headers, message.Response); } default: @@ -110,89 +108,73 @@ public ResponseWithHeaders GetSendS } } - internal HttpMessage CreateSendRequest(string repeatabilityRequestId, string repeatabilityFirstSent, EmailMessage emailMessage) + internal HttpMessage CreateSendRequest(EmailMessage message, Guid? operationId) { - var message = _pipeline.CreateMessage(); - var request = message.Request; + var message0 = _pipeline.CreateMessage(); + var request = message0.Request; request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); - uri.AppendRaw(_endpoint, false); + uri.Reset(_endpoint); uri.AppendPath("/emails:send", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("repeatability-request-id", repeatabilityRequestId); - request.Headers.Add("repeatability-first-sent", repeatabilityFirstSent); + if (operationId != null) + { + request.Headers.Add("Operation-Id", operationId.Value); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(emailMessage); + content.JsonWriter.WriteObjectValue(message); request.Content = content; - return message; + return message0; } /// Queues an email message to be sent to one or more recipients. - /// If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. - /// Must be sent by clients to specify that a request is repeatable. Repeatability-First-Sent is used to specify the date and time at which the request was first created in the IMF-fix date form of HTTP-date as defined in RFC7231. eg- Tue, 26 Mar 2019 16:06:51 GMT. - /// Message payload for sending an email. + /// Message payload for sending an email. + /// This is the ID used by the status monitor for this long running operation. /// The cancellation token to use. - /// , or is null. - public async Task> SendAsync(string repeatabilityRequestId, string repeatabilityFirstSent, EmailMessage emailMessage, CancellationToken cancellationToken = default) + /// is null. + public async Task> SendAsync(EmailMessage message, Guid? operationId = null, CancellationToken cancellationToken = default) { - if (repeatabilityRequestId == null) + if (message == null) { - throw new ArgumentNullException(nameof(repeatabilityRequestId)); - } - if (repeatabilityFirstSent == null) - { - throw new ArgumentNullException(nameof(repeatabilityFirstSent)); - } - if (emailMessage == null) - { - throw new ArgumentNullException(nameof(emailMessage)); + throw new ArgumentNullException(nameof(message)); } - using var message = CreateSendRequest(repeatabilityRequestId, repeatabilityFirstSent, emailMessage); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - var headers = new EmailSendHeaders(message.Response); - switch (message.Response.Status) + using var message0 = CreateSendRequest(message, operationId); + await _pipeline.SendAsync(message0, cancellationToken).ConfigureAwait(false); + var headers = new EmailSendHeaders(message0.Response); + switch (message0.Response.Status) { case 202: - return ResponseWithHeaders.FromValue(headers, message.Response); + return ResponseWithHeaders.FromValue(headers, message0.Response); default: - throw await ClientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + throw await ClientDiagnostics.CreateRequestFailedExceptionAsync(message0.Response).ConfigureAwait(false); } } /// Queues an email message to be sent to one or more recipients. - /// If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. - /// Must be sent by clients to specify that a request is repeatable. Repeatability-First-Sent is used to specify the date and time at which the request was first created in the IMF-fix date form of HTTP-date as defined in RFC7231. eg- Tue, 26 Mar 2019 16:06:51 GMT. - /// Message payload for sending an email. + /// Message payload for sending an email. + /// This is the ID used by the status monitor for this long running operation. /// The cancellation token to use. - /// , or is null. - public ResponseWithHeaders Send(string repeatabilityRequestId, string repeatabilityFirstSent, EmailMessage emailMessage, CancellationToken cancellationToken = default) + /// is null. + public ResponseWithHeaders Send(EmailMessage message, Guid? operationId = null, CancellationToken cancellationToken = default) { - if (repeatabilityRequestId == null) + if (message == null) { - throw new ArgumentNullException(nameof(repeatabilityRequestId)); - } - if (repeatabilityFirstSent == null) - { - throw new ArgumentNullException(nameof(repeatabilityFirstSent)); - } - if (emailMessage == null) - { - throw new ArgumentNullException(nameof(emailMessage)); + throw new ArgumentNullException(nameof(message)); } - using var message = CreateSendRequest(repeatabilityRequestId, repeatabilityFirstSent, emailMessage); - _pipeline.Send(message, cancellationToken); - var headers = new EmailSendHeaders(message.Response); - switch (message.Response.Status) + using var message0 = CreateSendRequest(message, operationId); + _pipeline.Send(message0, cancellationToken); + var headers = new EmailSendHeaders(message0.Response); + switch (message0.Response.Status) { case 202: - return ResponseWithHeaders.FromValue(headers, message.Response); + return ResponseWithHeaders.FromValue(headers, message0.Response); default: - throw ClientDiagnostics.CreateRequestFailedException(message.Response); + throw ClientDiagnostics.CreateRequestFailedException(message0.Response); } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/EmailSendHeaders.cs b/sdk/communication/Azure.Communication.Email/src/Generated/EmailSendHeaders.cs index 33742c1a22d49..6bd8ef442f31f 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/EmailSendHeaders.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/EmailSendHeaders.cs @@ -17,11 +17,9 @@ public EmailSendHeaders(Response response) { _response = response; } - /// Status of a repeatable request. - public string RepeatabilityResult => _response.Headers.TryGetValue("Repeatability-Result", out string value) ? value : null; - /// Location url of where to poll the status of this message from. + /// Location url of where to poll the status of this operation from. public string OperationLocation => _response.Headers.TryGetValue("Operation-Location", out string value) ? value : null; - /// Amount of time client should wait before retrying the request, specified in seconds. - public int? RetryAfter => _response.Headers.TryGetValue("Retry-After", out int? value) ? value : null; + /// This header will only be present when the operation status is a non-terminal status. It indicates the minimum amount of time in seconds to wait before polling for operation status again. + public int? RetryAfter => _response.Headers.TryGetValue("retry-after", out int? value) ? value : null; } } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationError.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationError.cs deleted file mode 100644 index bf8a9abe69266..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationError.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.Communication.Email.Models -{ - /// The Communication Services error. - internal partial class CommunicationError - { - /// Initializes a new instance of CommunicationError. - /// The error code. - /// The error message. - /// or is null. - internal CommunicationError(string code, string message) - { - Argument.AssertNotNull(code, nameof(code)); - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - Details = new ChangeTrackingList(); - } - - /// Initializes a new instance of CommunicationError. - /// The error code. - /// The error message. - /// The error target. - /// Further details about specific errors that led to this error. - /// The inner error if any. - internal CommunicationError(string code, string message, string target, IReadOnlyList details, CommunicationError innerError) - { - Code = code; - Message = message; - Target = target; - Details = details; - InnerError = innerError; - } - - /// The error code. - public string Code { get; } - /// The error message. - public string Message { get; } - /// The error target. - public string Target { get; } - /// Further details about specific errors that led to this error. - public IReadOnlyList Details { get; } - /// The inner error if any. - public CommunicationError InnerError { get; } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationErrorResponse.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationErrorResponse.Serialization.cs deleted file mode 100644 index 77de481f2e2b1..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationErrorResponse.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Communication.Email.Models -{ - internal partial class CommunicationErrorResponse - { - internal static CommunicationErrorResponse DeserializeCommunicationErrorResponse(JsonElement element) - { - CommunicationError error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error"u8)) - { - error = CommunicationError.DeserializeCommunicationError(property.Value); - continue; - } - } - return new CommunicationErrorResponse(error); - } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationErrorResponse.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationErrorResponse.cs deleted file mode 100644 index dde5acfde9a1f..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationErrorResponse.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.Communication.Email.Models -{ - /// The Communication Services error. - internal partial class CommunicationErrorResponse - { - /// Initializes a new instance of CommunicationErrorResponse. - /// The Communication Services error. - /// is null. - internal CommunicationErrorResponse(CommunicationError error) - { - Argument.AssertNotNull(error, nameof(error)); - - Error = error; - } - - /// The Communication Services error. - public CommunicationError Error { get; } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAddress.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAddress.Serialization.cs index bfd3c070561c2..2f89d7eecbbb8 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAddress.Serialization.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAddress.Serialization.cs @@ -8,15 +8,15 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { - public partial class EmailAddress : IUtf8JsonSerializable + public partial struct EmailAddress : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("email"u8); - writer.WriteStringValue(Email); + writer.WritePropertyName("address"u8); + writer.WriteStringValue(Address); if (Optional.IsDefined(DisplayName)) { writer.WritePropertyName("displayName"u8); diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAddress.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAddress.cs index d964de947342b..5dacff4d83ba1 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAddress.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAddress.cs @@ -8,24 +8,15 @@ using System; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { /// An object representing the email address and its display name. - public partial class EmailAddress + public readonly partial struct EmailAddress { - /// Initializes a new instance of EmailAddress. - /// Email address. - /// is null. - public EmailAddress(string email) - { - Argument.AssertNotNull(email, nameof(email)); - - Email = email; - } /// Email address. - public string Email { get; } + public string Address { get; } /// Email display name. - public string DisplayName { get; set; } + public string DisplayName { get; } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachment.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachment.Serialization.cs index b57c5f5854eea..34fae7c63f762 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachment.Serialization.cs @@ -8,7 +8,7 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { public partial class EmailAttachment : IUtf8JsonSerializable { @@ -17,10 +17,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); - writer.WritePropertyName("attachmentType"u8); - writer.WriteStringValue(AttachmentType.ToString()); - writer.WritePropertyName("contentBytesBase64"u8); - writer.WriteStringValue(ContentBytesBase64); + writer.WritePropertyName("contentType"u8); + writer.WriteStringValue(ContentType); + writer.WritePropertyName("contentInBase64"u8); + writer.WriteStringValue(ContentInBase64); writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachment.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachment.cs index 4d9f213a5a6c4..6f39b00617c70 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachment.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachment.cs @@ -8,31 +8,15 @@ using System; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { /// Attachment to the email. public partial class EmailAttachment { - /// Initializes a new instance of EmailAttachment. - /// Name of the attachment. - /// The type of attachment file. - /// Base64 encoded contents of the attachment. - /// or is null. - public EmailAttachment(string name, EmailAttachmentType attachmentType, string contentBytesBase64) - { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(contentBytesBase64, nameof(contentBytesBase64)); - - Name = name; - AttachmentType = attachmentType; - ContentBytesBase64 = contentBytesBase64; - } /// Name of the attachment. public string Name { get; } - /// The type of attachment file. - public EmailAttachmentType AttachmentType { get; } - /// Base64 encoded contents of the attachment. - public string ContentBytesBase64 { get; } + /// MIME type of the content being attached. + public string ContentType { get; } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachmentType.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachmentType.cs deleted file mode 100644 index e91ec21aa710f..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailAttachmentType.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Communication.Email.Models -{ - /// The type of attachment file. - public readonly partial struct EmailAttachmentType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EmailAttachmentType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AviValue = "avi"; - private const string BmpValue = "bmp"; - private const string DocValue = "doc"; - private const string DocmValue = "docm"; - private const string DocxValue = "docx"; - private const string GifValue = "gif"; - private const string JpegValue = "jpeg"; - private const string Mp3Value = "mp3"; - private const string OneValue = "one"; - private const string PdfValue = "pdf"; - private const string PngValue = "png"; - private const string PpsmValue = "ppsm"; - private const string PpsxValue = "ppsx"; - private const string PptValue = "ppt"; - private const string PptmValue = "pptm"; - private const string PptxValue = "pptx"; - private const string PubValue = "pub"; - private const string RpmsgValue = "rpmsg"; - private const string RtfValue = "rtf"; - private const string TifValue = "tif"; - private const string TxtValue = "txt"; - private const string VsdValue = "vsd"; - private const string WavValue = "wav"; - private const string WmaValue = "wma"; - private const string XlsValue = "xls"; - private const string XlsbValue = "xlsb"; - private const string XlsmValue = "xlsm"; - private const string XlsxValue = "xlsx"; - - /// avi. - public static EmailAttachmentType Avi { get; } = new EmailAttachmentType(AviValue); - /// bmp. - public static EmailAttachmentType Bmp { get; } = new EmailAttachmentType(BmpValue); - /// doc. - public static EmailAttachmentType Doc { get; } = new EmailAttachmentType(DocValue); - /// docm. - public static EmailAttachmentType Docm { get; } = new EmailAttachmentType(DocmValue); - /// docx. - public static EmailAttachmentType Docx { get; } = new EmailAttachmentType(DocxValue); - /// gif. - public static EmailAttachmentType Gif { get; } = new EmailAttachmentType(GifValue); - /// jpeg. - public static EmailAttachmentType Jpeg { get; } = new EmailAttachmentType(JpegValue); - /// mp3. - public static EmailAttachmentType Mp3 { get; } = new EmailAttachmentType(Mp3Value); - /// one. - public static EmailAttachmentType One { get; } = new EmailAttachmentType(OneValue); - /// pdf. - public static EmailAttachmentType Pdf { get; } = new EmailAttachmentType(PdfValue); - /// png. - public static EmailAttachmentType Png { get; } = new EmailAttachmentType(PngValue); - /// ppsm. - public static EmailAttachmentType Ppsm { get; } = new EmailAttachmentType(PpsmValue); - /// ppsx. - public static EmailAttachmentType Ppsx { get; } = new EmailAttachmentType(PpsxValue); - /// ppt. - public static EmailAttachmentType Ppt { get; } = new EmailAttachmentType(PptValue); - /// pptm. - public static EmailAttachmentType Pptm { get; } = new EmailAttachmentType(PptmValue); - /// pptx. - public static EmailAttachmentType Pptx { get; } = new EmailAttachmentType(PptxValue); - /// pub. - public static EmailAttachmentType Pub { get; } = new EmailAttachmentType(PubValue); - /// rpmsg. - public static EmailAttachmentType Rpmsg { get; } = new EmailAttachmentType(RpmsgValue); - /// rtf. - public static EmailAttachmentType Rtf { get; } = new EmailAttachmentType(RtfValue); - /// tif. - public static EmailAttachmentType Tif { get; } = new EmailAttachmentType(TifValue); - /// txt. - public static EmailAttachmentType Txt { get; } = new EmailAttachmentType(TxtValue); - /// vsd. - public static EmailAttachmentType Vsd { get; } = new EmailAttachmentType(VsdValue); - /// wav. - public static EmailAttachmentType Wav { get; } = new EmailAttachmentType(WavValue); - /// wma. - public static EmailAttachmentType Wma { get; } = new EmailAttachmentType(WmaValue); - /// xls. - public static EmailAttachmentType Xls { get; } = new EmailAttachmentType(XlsValue); - /// xlsb. - public static EmailAttachmentType Xlsb { get; } = new EmailAttachmentType(XlsbValue); - /// xlsm. - public static EmailAttachmentType Xlsm { get; } = new EmailAttachmentType(XlsmValue); - /// xlsx. - public static EmailAttachmentType Xlsx { get; } = new EmailAttachmentType(XlsxValue); - /// Determines if two values are the same. - public static bool operator ==(EmailAttachmentType left, EmailAttachmentType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EmailAttachmentType left, EmailAttachmentType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator EmailAttachmentType(string value) => new EmailAttachmentType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EmailAttachmentType other && Equals(other); - /// - public bool Equals(EmailAttachmentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailContent.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailContent.Serialization.cs index 6140007e771f3..d6f39bc3929be 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailContent.Serialization.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailContent.Serialization.cs @@ -8,7 +8,7 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { public partial class EmailContent : IUtf8JsonSerializable { diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailContent.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailContent.cs index 1cdcec0079563..c159d2b8dbb71 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailContent.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailContent.cs @@ -8,7 +8,7 @@ using System; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { /// Content of the email. public partial class EmailContent diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailCustomHeader.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailCustomHeader.Serialization.cs deleted file mode 100644 index b29c8d9a6b4b3..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailCustomHeader.Serialization.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Communication.Email.Models -{ - public partial class EmailCustomHeader : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("value"u8); - writer.WriteStringValue(Value); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailCustomHeader.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailCustomHeader.cs deleted file mode 100644 index 96ff41fb6c4ba..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailCustomHeader.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.Communication.Email.Models -{ - /// Custom header for email. - public partial class EmailCustomHeader - { - /// Initializes a new instance of EmailCustomHeader. - /// Header name. - /// Header value. - /// or is null. - public EmailCustomHeader(string name, string value) - { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(value, nameof(value)); - - Name = name; - Value = value; - } - - /// Header name. - public string Name { get; } - /// Header value. - public string Value { get; } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailImportance.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailImportance.cs deleted file mode 100644 index be394f2bfa0ea..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailImportance.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Communication.Email.Models -{ - /// The importance type for the email. - public readonly partial struct EmailImportance : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EmailImportance(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HighValue = "high"; - private const string NormalValue = "normal"; - private const string LowValue = "low"; - - /// high. - public static EmailImportance High { get; } = new EmailImportance(HighValue); - /// normal. - public static EmailImportance Normal { get; } = new EmailImportance(NormalValue); - /// low. - public static EmailImportance Low { get; } = new EmailImportance(LowValue); - /// Determines if two values are the same. - public static bool operator ==(EmailImportance left, EmailImportance right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EmailImportance left, EmailImportance right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator EmailImportance(string value) => new EmailImportance(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EmailImportance other && Equals(other); - /// - public bool Equals(EmailImportance other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailMessage.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailMessage.Serialization.cs index 197be73e2a6bb..e7ec2b0218088 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailMessage.Serialization.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailMessage.Serialization.cs @@ -8,32 +8,28 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { public partial class EmailMessage : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsCollectionDefined(CustomHeaders)) + if (Optional.IsCollectionDefined(Headers)) { writer.WritePropertyName("headers"u8); - writer.WriteStartArray(); - foreach (var item in CustomHeaders) + writer.WriteStartObject(); + foreach (var item in Headers) { - writer.WriteObjectValue(item); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } - writer.WriteEndArray(); + writer.WriteEndObject(); } - writer.WritePropertyName("sender"u8); - writer.WriteStringValue(Sender); + writer.WritePropertyName("senderAddress"u8); + writer.WriteStringValue(SenderAddress); writer.WritePropertyName("content"u8); writer.WriteObjectValue(Content); - if (Optional.IsDefined(Importance)) - { - writer.WritePropertyName("importance"u8); - writer.WriteStringValue(Importance.Value.ToString()); - } writer.WritePropertyName("recipients"u8); writer.WriteObjectValue(Recipients); if (Optional.IsCollectionDefined(Attachments)) @@ -56,10 +52,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } - if (Optional.IsDefined(DisableUserEngagementTracking)) + if (Optional.IsDefined(UserEngagementTrackingDisabled)) { - writer.WritePropertyName("disableUserEngagementTracking"u8); - writer.WriteBooleanValue(DisableUserEngagementTracking.Value); + writer.WritePropertyName("userEngagementTrackingDisabled"u8); + writer.WriteBooleanValue(UserEngagementTrackingDisabled.Value); } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailMessage.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailMessage.cs index c2b59f378869b..89d950b5d0fa4 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailMessage.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailMessage.cs @@ -9,45 +9,25 @@ using System.Collections.Generic; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { /// Message payload for sending an email. public partial class EmailMessage { - /// Initializes a new instance of EmailMessage. - /// Sender email address from a verified domain. - /// Email content to be sent. - /// Recipients for the email. - /// , or is null. - public EmailMessage(string sender, EmailContent content, EmailRecipients recipients) - { - Argument.AssertNotNull(sender, nameof(sender)); - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(recipients, nameof(recipients)); - - CustomHeaders = new ChangeTrackingList(); - Sender = sender; - Content = content; - Recipients = recipients; - Attachments = new ChangeTrackingList(); - ReplyTo = new ChangeTrackingList(); - } /// Custom email headers to be passed. - public IList CustomHeaders { get; } + public IDictionary Headers { get; } /// Sender email address from a verified domain. - public string Sender { get; } + public string SenderAddress { get; } /// Email content to be sent. public EmailContent Content { get; } - /// The importance type for the email. - public EmailImportance? Importance { get; set; } /// Recipients for the email. public EmailRecipients Recipients { get; } - /// list of attachments. + /// List of attachments. Please note that we limit the total size of an email request (which includes attachments) to 10MB. public IList Attachments { get; } /// Email addresses where recipients' replies will be sent to. public IList ReplyTo { get; } /// Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane. - public bool? DisableUserEngagementTracking { get; set; } + public bool? UserEngagementTrackingDisabled { get; set; } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailRecipients.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailRecipients.Serialization.cs index 985128494babd..bcfbf69769057 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailRecipients.Serialization.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailRecipients.Serialization.cs @@ -8,7 +8,7 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { public partial class EmailRecipients : IUtf8JsonSerializable { @@ -24,7 +24,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteEndArray(); if (Optional.IsCollectionDefined(CC)) { - writer.WritePropertyName("CC"u8); + writer.WritePropertyName("cc"u8); writer.WriteStartArray(); foreach (var item in CC) { @@ -34,7 +34,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } if (Optional.IsCollectionDefined(BCC)) { - writer.WritePropertyName("bCC"u8); + writer.WritePropertyName("bcc"u8); writer.WriteStartArray(); foreach (var item in BCC) { diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailRecipients.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailRecipients.cs index 290d9de816ca9..d350ae4dfb6f9 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailRecipients.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailRecipients.cs @@ -10,7 +10,7 @@ using System.Linq; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { /// Recipients of the email. public partial class EmailRecipients diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendResult.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendResult.Serialization.cs new file mode 100644 index 0000000000000..1f6427a76f6d2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendResult.Serialization.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Email +{ + public partial class EmailSendResult + { + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendResult.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendResult.cs new file mode 100644 index 0000000000000..c12bc383b3bbc --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendResult.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.Email +{ + /// Status of the long running operation. + public partial class EmailSendResult + { + /// Initializes a new instance of EmailSendResult. + /// The unique id of the operation. Use a UUID. + /// Status of operation. + /// is null. + internal EmailSendResult(string id, EmailSendStatus status) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Status = status; + } + + /// Initializes a new instance of EmailSendResult. + /// The unique id of the operation. Use a UUID. + /// Status of operation. + /// Error details when status is a non-success terminal state. + internal EmailSendResult(string id, EmailSendStatus status, ErrorDetail error) + { + Id = id; + Status = status; + Error = error; + } + /// Status of operation. + public EmailSendStatus Status { get; } + /// Error details when status is a non-success terminal state. + public ErrorDetail Error { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendStatus.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendStatus.cs new file mode 100644 index 0000000000000..f537c304776dc --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/EmailSendStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Email +{ + /// Status of operation. + public readonly partial struct EmailSendStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EmailSendStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string RunningValue = "Running"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// NotStarted. + public static EmailSendStatus NotStarted { get; } = new EmailSendStatus(NotStartedValue); + /// Running. + public static EmailSendStatus Running { get; } = new EmailSendStatus(RunningValue); + /// Succeeded. + public static EmailSendStatus Succeeded { get; } = new EmailSendStatus(SucceededValue); + /// Failed. + public static EmailSendStatus Failed { get; } = new EmailSendStatus(FailedValue); + /// Canceled. + public static EmailSendStatus Canceled { get; } = new EmailSendStatus(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(EmailSendStatus left, EmailSendStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EmailSendStatus left, EmailSendStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EmailSendStatus(string value) => new EmailSendStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EmailSendStatus other && Equals(other); + /// + public bool Equals(EmailSendStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs new file mode 100644 index 0000000000000..478fc3abe77ee --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Email +{ + public partial class ErrorAdditionalInfo + { + internal static ErrorAdditionalInfo DeserializeErrorAdditionalInfo(JsonElement element) + { + Optional type = default; + Optional info = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("info"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + info = property.Value.GetObject(); + continue; + } + } + return new ErrorAdditionalInfo(type.Value, info.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 0000000000000..456b7b564d828 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.Email +{ + /// The resource management error additional info. + public partial class ErrorAdditionalInfo + { + /// Initializes a new instance of ErrorAdditionalInfo. + internal ErrorAdditionalInfo() + { + } + + /// Initializes a new instance of ErrorAdditionalInfo. + /// The additional info type. + /// The additional info. + internal ErrorAdditionalInfo(string type, object info) + { + Type = type; + Info = info; + } + + /// The additional info type. + public string Type { get; } + /// The additional info. + public object Info { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationError.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorDetail.Serialization.cs similarity index 61% rename from sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationError.Serialization.cs rename to sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorDetail.Serialization.cs index 8b557fa85c185..2672024e87a14 100644 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/CommunicationError.Serialization.cs +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorDetail.Serialization.cs @@ -9,17 +9,17 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { - internal partial class CommunicationError + public partial class ErrorDetail { - internal static CommunicationError DeserializeCommunicationError(JsonElement element) + internal static ErrorDetail DeserializeErrorDetail(JsonElement element) { - string code = default; - string message = default; + Optional code = default; + Optional message = default; Optional target = default; - Optional> details = default; - Optional innererror = default; + Optional> details = default; + Optional> additionalInfo = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("code"u8)) @@ -44,26 +44,31 @@ internal static CommunicationError DeserializeCommunicationError(JsonElement ele property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeserializeCommunicationError(item)); + array.Add(DeserializeErrorDetail(item)); } details = array; continue; } - if (property.NameEquals("innererror"u8)) + if (property.NameEquals("additionalInfo"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - innererror = DeserializeCommunicationError(property.Value); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ErrorAdditionalInfo.DeserializeErrorAdditionalInfo(item)); + } + additionalInfo = array; continue; } } - return new CommunicationError(code, message, target.Value, Optional.ToList(details), innererror.Value); + return new ErrorDetail(code.Value, message.Value, target.Value, Optional.ToList(details), Optional.ToList(additionalInfo)); } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorDetail.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 0000000000000..741ce1f76d30c --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Communication.Email +{ + /// The error detail. + public partial class ErrorDetail + { + /// Initializes a new instance of ErrorDetail. + internal ErrorDetail() + { + Details = new ChangeTrackingList(); + AdditionalInfo = new ChangeTrackingList(); + } + + /// Initializes a new instance of ErrorDetail. + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + internal ErrorDetail(string code, string message, string target, IReadOnlyList details, IReadOnlyList additionalInfo) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + } + + /// The error code. + public string Code { get; } + /// The error message. + public string Message { get; } + /// The error target. + public string Target { get; } + /// The error details. + public IReadOnlyList Details { get; } + /// The error additional info. + public IReadOnlyList AdditionalInfo { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorResponse.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorResponse.Serialization.cs new file mode 100644 index 0000000000000..104c6b895d5e6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorResponse.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Email +{ + internal partial class ErrorResponse + { + internal static ErrorResponse DeserializeErrorResponse(JsonElement element) + { + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + error = ErrorDetail.DeserializeErrorDetail(property.Value); + continue; + } + } + return new ErrorResponse(error.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorResponse.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 0000000000000..c2df226182ca6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.Email +{ + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + internal partial class ErrorResponse + { + /// Initializes a new instance of ErrorResponse. + internal ErrorResponse() + { + } + + /// Initializes a new instance of ErrorResponse. + /// The error object. + internal ErrorResponse(ErrorDetail error) + { + Error = error; + } + + /// The error object. + public ErrorDetail Error { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatus.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatus.cs deleted file mode 100644 index 1b922be340d29..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatus.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Communication.Email.Models -{ - /// The type indicating the status of a request. - public readonly partial struct SendStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SendStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string QueuedValue = "queued"; - private const string OutForDeliveryValue = "outForDelivery"; - private const string DroppedValue = "dropped"; - - /// The message has passed basic validations and has been queued to be processed further. - public static SendStatus Queued { get; } = new SendStatus(QueuedValue); - /// The message has been processed and is now out for delivery. - public static SendStatus OutForDelivery { get; } = new SendStatus(OutForDeliveryValue); - /// The message could not be processed and was dropped. - public static SendStatus Dropped { get; } = new SendStatus(DroppedValue); - /// Determines if two values are the same. - public static bool operator ==(SendStatus left, SendStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SendStatus left, SendStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SendStatus(string value) => new SendStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SendStatus other && Equals(other); - /// - public bool Equals(SendStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatusResult.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatusResult.Serialization.cs deleted file mode 100644 index 7c0adfbcbb126..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatusResult.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Communication.Email.Models -{ - public partial class SendStatusResult - { - internal static SendStatusResult DeserializeSendStatusResult(JsonElement element) - { - string messageId = default; - SendStatus status = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("messageId"u8)) - { - messageId = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new SendStatus(property.Value.GetString()); - continue; - } - } - return new SendStatusResult(messageId, status); - } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatusResult.cs b/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatusResult.cs deleted file mode 100644 index 4be5ff67845b5..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Generated/Models/SendStatusResult.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.Communication.Email.Models -{ - /// Status of an email message that was sent previously. - public partial class SendStatusResult - { - /// Initializes a new instance of SendStatusResult. - /// System generated id of an email message sent. - /// The type indicating the status of a request. - /// is null. - internal SendStatusResult(string messageId, SendStatus status) - { - Argument.AssertNotNull(messageId, nameof(messageId)); - - MessageId = messageId; - Status = status; - } - - /// System generated id of an email message sent. - public string MessageId { get; } - /// The type indicating the status of a request. - public SendStatus Status { get; } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Models/EmailAddress.cs b/sdk/communication/Azure.Communication.Email/src/Models/EmailAddress.cs index 56e4c9a370b89..90658bc1710a8 100644 --- a/sdk/communication/Azure.Communication.Email/src/Models/EmailAddress.cs +++ b/sdk/communication/Azure.Communication.Email/src/Models/EmailAddress.cs @@ -4,45 +4,31 @@ #nullable disable using System; -using System.Net.Mail; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { [CodeGenModel("EmailAddress")] - public partial class EmailAddress + public partial struct EmailAddress { /// Initializes a new instance of EmailAddress. - /// Email address of the receipient + /// Email address of the receipient /// The display name of the recepient - /// is null. - public EmailAddress(string email, string displayName = null) - :this(email) + /// is null. + public EmailAddress(string address, string displayName) + : this(address) { DisplayName = displayName; } - internal void ValidateEmailAddress() - { - MailAddress mailAddress = ToMailAddress(); - - var hostParts = mailAddress.Host.Trim().Split('.'); - if (hostParts.Length < 2) - { - throw new ArgumentException($"{Email}" + ErrorMessages.InvalidEmailAddress); - } - } - - private MailAddress ToMailAddress() + /// Initializes a new instance of EmailAddress. + /// Email address of the receipient + /// is null. + public EmailAddress(string address) { - try - { - return new MailAddress(Email); - } - catch - { - throw new ArgumentException($"{Email}" + ErrorMessages.InvalidEmailAddress); - } + Argument.AssertNotNullOrWhiteSpace(address, nameof(address)); + Address = address; + DisplayName = string.Empty; } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Models/EmailAttachment.cs b/sdk/communication/Azure.Communication.Email/src/Models/EmailAttachment.cs index 56d26bcb74cd2..1d29f9e252905 100644 --- a/sdk/communication/Azure.Communication.Email/src/Models/EmailAttachment.cs +++ b/sdk/communication/Azure.Communication.Email/src/Models/EmailAttachment.cs @@ -4,28 +4,56 @@ #nullable disable using System; +using System.Text; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { [CodeGenModel("EmailAttachment")] + [CodeGenSuppress("EmailAttachment", typeof(string), typeof(string), typeof(string))] public partial class EmailAttachment { + /// Initializes a new instance of EmailAttachment. + /// Name of the attachment. + /// MIME type of the content being attached. + /// BinaryData representing the contents of the attachment. + /// , or is null. + public EmailAttachment(string name, string contentType, BinaryData content) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(contentType, nameof(contentType)); + Argument.AssertNotNull(content, nameof(content)); + + Name = name; + ContentType = contentType; + Content = content; + } + internal void ValidateAttachmentContent() { - if (string.IsNullOrWhiteSpace(ContentBytesBase64)) + if (string.IsNullOrWhiteSpace(ContentInBase64)) { throw new ArgumentException(ErrorMessages.InvalidAttachmentContent); } + } - try - { - Convert.FromBase64String(ContentBytesBase64); - } - catch (FormatException) + internal string ContentInBase64 + { + get { - throw new ArgumentException(ErrorMessages.InvalidAttachmentContent); + string valueToReturn = Convert.ToBase64String(Encoding.UTF8.GetBytes(Content.ToString())); + if (string.IsNullOrWhiteSpace(valueToReturn)) + { + throw new ArgumentException(ErrorMessages.InvalidAttachmentContent); + } + + return valueToReturn; } } + + /// + /// Contents of the attachment as BinaryData. + /// + public BinaryData Content { get; } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Models/EmailCustomHeader.cs b/sdk/communication/Azure.Communication.Email/src/Models/EmailCustomHeader.cs deleted file mode 100644 index 138c3742c876d..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Models/EmailCustomHeader.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.Communication.Email.Models -{ - [CodeGenModel("EmailCustomHeader")] - public partial class EmailCustomHeader - { - internal void Validate() - { - if (string.IsNullOrWhiteSpace(Name) || string.IsNullOrWhiteSpace(Value)) - { - throw new ArgumentException(ErrorMessages.EmptyHeaderNameOrValue); - } - } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/Models/EmailMessage.cs b/sdk/communication/Azure.Communication.Email/src/Models/EmailMessage.cs index 1301eb2e560e6..f801e415187af 100644 --- a/sdk/communication/Azure.Communication.Email/src/Models/EmailMessage.cs +++ b/sdk/communication/Azure.Communication.Email/src/Models/EmailMessage.cs @@ -3,12 +3,54 @@ #nullable disable +using System; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { [CodeGenModel("EmailMessage")] + [CodeGenSuppress("EmailMessage", typeof(string), typeof(EmailContent), typeof(EmailRecipients))] public partial class EmailMessage { + /// Initializes a new instance of EmailMessage. + /// Sender email address from a verified domain. + /// Email content to be sent. + /// Recipients for the email. + /// , or is null. + public EmailMessage(string fromAddress, string toAddress, EmailContent content) + { + Argument.AssertNotNull(fromAddress, nameof(fromAddress)); + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(toAddress, nameof(toAddress)); + + Headers = new ChangeTrackingDictionary(); + SenderAddress = fromAddress; + Content = content; + Recipients = new EmailRecipients(new ChangeTrackingList + { + new EmailAddress(toAddress) + }); + Attachments = new ChangeTrackingList(); + ReplyTo = new ChangeTrackingList(); + } + + /// Initializes a new instance of EmailMessage. + /// Sender email address from a verified domain. + /// Recipients for the email. + /// Email content to be sent. + /// , or is null. + public EmailMessage(string senderAddress, EmailRecipients recipients, EmailContent content) + { + Argument.AssertNotNull(senderAddress, nameof(senderAddress)); + Argument.AssertNotNull(recipients, nameof(recipients)); + Argument.AssertNotNull(content, nameof(content)); + + Headers = new ChangeTrackingDictionary(); + SenderAddress = senderAddress; + Content = content; + Recipients = recipients; + Attachments = new ChangeTrackingList(); + ReplyTo = new ChangeTrackingList(); + } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Models/EmailModelFactory.cs b/sdk/communication/Azure.Communication.Email/src/Models/EmailModelFactory.cs new file mode 100644 index 0000000000000..474d58518fb09 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Models/EmailModelFactory.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Communication.Email +{ + /// Model factory for models. + [CodeGenModel("EmailModelFactory")] + public static partial class EmailModelFactory + { + /// + /// Initializes a new instance of EmailSendResult + /// + /// OperationId of an email send operation. + /// Status of the email send operation. + /// Error details when status is a non-success terminal state. + /// + public static EmailSendResult EmailSendResult(string id = default, EmailSendStatus status = default, ErrorDetail error = default ) + { + return new EmailSendResult(id, status, error); + } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Models/EmailRecipients.cs b/sdk/communication/Azure.Communication.Email/src/Models/EmailRecipients.cs index 7f0df4d9f337a..5af8343580384 100644 --- a/sdk/communication/Azure.Communication.Email/src/Models/EmailRecipients.cs +++ b/sdk/communication/Azure.Communication.Email/src/Models/EmailRecipients.cs @@ -6,10 +6,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Azure.Communication.Email.Extensions; using Azure.Core; -namespace Azure.Communication.Email.Models +namespace Azure.Communication.Email { [CodeGenModel("EmailRecipients")] public partial class EmailRecipients @@ -44,12 +43,6 @@ internal void Validate() { throw new ArgumentException(ErrorMessages.EmptyToRecipients); } - - To.Validate(); - - CC.Validate(); - - BCC.Validate(); } } } diff --git a/sdk/communication/Azure.Communication.Email/src/Models/EmailSendResult.Serialization.cs b/sdk/communication/Azure.Communication.Email/src/Models/EmailSendResult.Serialization.cs new file mode 100644 index 0000000000000..5c6ef6cc5f5c8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Models/EmailSendResult.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Email +{ + public partial class EmailSendResult + { + internal static EmailSendResult DeserializeEmailSendResult(JsonElement element) + { + string id = default; + EmailSendStatus status = default; + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new EmailSendStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ErrorDetail.DeserializeErrorDetail(property.Value); + continue; + } + } + return new EmailSendResult(id, status, error.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Models/EmailSendResult.cs b/sdk/communication/Azure.Communication.Email/src/Models/EmailSendResult.cs new file mode 100644 index 0000000000000..8467090e8e7b5 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/src/Models/EmailSendResult.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; + +namespace Azure.Communication.Email +{ + /// Status of the long running operation. + public partial class EmailSendResult + { + /// The unique id of the operation. Use a UUID. + internal string Id { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Email/src/Models/ErrorMessages.cs b/sdk/communication/Azure.Communication.Email/src/Models/ErrorMessages.cs index 2c4e0a41d3dc4..fdd414d2c7981 100644 --- a/sdk/communication/Azure.Communication.Email/src/Models/ErrorMessages.cs +++ b/sdk/communication/Azure.Communication.Email/src/Models/ErrorMessages.cs @@ -5,9 +5,8 @@ namespace Azure.Communication.Email { internal static class ErrorMessages { - internal const string DuplicateHeaderName = " is duplicate. Header names must be unique"; internal const string EmptyContent = "Email content must have either HTML or PlainText"; - internal const string EmptyHeaderNameOrValue = "Empty Name/Value is not allowed in CustomHeader"; + internal const string EmptyHeaderValue = "Empty Value is not allowed in Email Header"; internal const string EmptySubject = "Email subject can not be empty"; internal const string EmptyToRecipients = "ToRecipients cannot be empty"; internal const string InvalidAttachmentContent = "Attachment ContentBytes must be a base64 string."; diff --git a/sdk/communication/Azure.Communication.Email/src/Models/SendEmailResult.cs b/sdk/communication/Azure.Communication.Email/src/Models/SendEmailResult.cs deleted file mode 100644 index ea0744576a980..0000000000000 --- a/sdk/communication/Azure.Communication.Email/src/Models/SendEmailResult.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -namespace Azure.Communication.Email.Models -{ - /// - /// The type containing the results of a sent email. - /// - public class SendEmailResult - { - /// MessageId of the sent email - public string MessageId { get; private set; } - - /// - /// Initializes a new instance of - /// - /// - internal SendEmailResult(string messageId) - { - MessageId = messageId; - } - } -} diff --git a/sdk/communication/Azure.Communication.Email/src/autorest.md b/sdk/communication/Azure.Communication.Email/src/autorest.md index b02ca414d79b6..925784188453f 100644 --- a/sdk/communication/Azure.Communication.Email/src/autorest.md +++ b/sdk/communication/Azure.Communication.Email/src/autorest.md @@ -4,7 +4,8 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml input-file: - - https://github.com/apattath/azure-rest-api-specs-apattath/blob/fd6518a294e6968a77bbad6ce412e736c803337f/specification/communication/data-plane/Email/preview/2021-10-01-preview/CommunicationServicesEmail.json + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/ac7f9d6f1003acf6e54682534f30a9f5ec7fc5d2/specification/communication/data-plane/Email/preview/2023-01-15-preview/CommunicationServicesEmail.json generation1-convenience-client: true payload-flattening-threshold: 3 +model-namespace: false ``` diff --git a/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTestBase.cs b/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTestBase.cs index 924ddb4540b04..586d83850665f 100644 --- a/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTestBase.cs +++ b/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTestBase.cs @@ -4,30 +4,36 @@ using System; using Azure.Core; using Azure.Core.TestFramework; +using Azure.Core.TestFramework.Models; using Azure.Identity; namespace Azure.Communication.Email.Tests { internal class EmailClientLiveTestBase : RecordedTestBase { + private const string URIDomainNameReplacerRegEx = @"https://([^/?]+)"; + private const string URIRoomsIdReplacerRegEx = @"emails/operations/.*?api"; + public EmailClientLiveTestBase(bool isAsync) : base(isAsync) { SanitizedHeaders.Add("x-ms-content-sha256"); - SanitizedHeaders.Add("repeatability-first-sent"); - SanitizedHeaders.Add("repeatability-request-id"); + SanitizedHeaders.Add("Operation-Id"); + UriRegexSanitizers.Add(new UriRegexSanitizer(URIDomainNameReplacerRegEx, "https://sanitized.communication.azure.com")); + UriRegexSanitizers.Add(new UriRegexSanitizer(URIRoomsIdReplacerRegEx, "emails/operations/sanitizedId?api")); + HeaderRegexSanitizers.Add(new HeaderRegexSanitizer("Operation-Location", "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview")); } protected EmailClient CreateEmailClient() { #region Snippet:Azure_Communication_Email_CreateEmailClient //@@var connectionString = ""; // Find your Communication Services resource in the Azure portal - //@@EmailClient client = new EmailClient(connectionString); + //@@EmailClient emailClient = new EmailClient(connectionString); #endregion Snippet:Azure_Communication_Email_CreateEmailClient var connectionString = TestEnvironment.CommunicationConnectionStringEmail; - var client = new EmailClient(connectionString, CreateEmailClientOptionsWithCorrelationVectorLogs()); + var emailClient = new EmailClient(connectionString, CreateEmailClientOptionsWithCorrelationVectorLogs()); - return InstrumentClient(client); + return InstrumentClient(emailClient); } public EmailClient CreateSmsClientWithToken() @@ -45,12 +51,12 @@ public EmailClient CreateSmsClientWithToken() //@@ TokenCredential tokenCredential = new DefaultAzureCredential(); /*@@*/ tokenCredential = new DefaultAzureCredential(); - //@@ EmailClient client = new EmailClient(new Uri(endpoint), tokenCredential); + //@@ EmailClient emailClient = new EmailClient(new Uri(endpoint), tokenCredential); #endregion Snippet:Azure_Communication_Email_CreateEmailClientWithToken } - EmailClient client = new EmailClient(endpoint, tokenCredential, CreateEmailClientOptionsWithCorrelationVectorLogs()); - return InstrumentClient(client); + EmailClient emailClient = new EmailClient(endpoint, tokenCredential, CreateEmailClientOptionsWithCorrelationVectorLogs()); + return InstrumentClient(emailClient); } protected EmailClientOptions CreateEmailClientOptionsWithCorrelationVectorLogs() diff --git a/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTests.cs b/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTests.cs index b3089f9c0a449..df9047513fa53 100644 --- a/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTests.cs +++ b/sdk/communication/Azure.Communication.Email/tests/EmailClientLiveTests.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Azure.Communication.Email.Models; using Azure.Core.TestFramework; using NUnit.Framework; @@ -18,106 +17,181 @@ public EmailClientLiveTests(bool isAsync) : base(isAsync) { } + [Test] + [AsyncOnly] + public async Task SendEmailAndWaitForExistingOperationAsync() + { + EmailClient emailClient = CreateEmailClient(); + EmailRecipients emailRecipients = GetRecipients(setTo: true, setCc: true, setBcc: true); + + EmailSendOperation emailSendOperation = await SendEmailAndWaitForExistingOperationAsync(emailClient, emailRecipients); + EmailSendResult statusMonitor = emailSendOperation.Value; + + Assert.IsFalse(string.IsNullOrWhiteSpace(emailSendOperation.Id)); + Console.WriteLine($"OperationId={emailSendOperation.Id}"); + Console.WriteLine($"Email send status = {statusMonitor.Status}"); + } + [Test] [SyncOnly] - [TestCaseSource(nameof(SetRecipientAddressState))] - public void SendEmail( - bool setTo, bool setCc, bool setBcc) + public void SendEmailAndWaitForExistingOperation() { EmailClient emailClient = CreateEmailClient(); - EmailRecipients emailRecipients = GetRecipients(setTo, setCc, setBcc); + EmailRecipients emailRecipients = GetRecipients(setTo: true, setCc: true, setBcc: true); - SendEmailResult response = SendEmail(emailClient, emailRecipients); + EmailSendOperation emailSendOperation = SendEmailAndWaitForExistingOperation(emailClient, emailRecipients); + EmailSendResult statusMonitor = emailSendOperation.Value; - Assert.IsNotNull(response); - Assert.IsFalse(string.IsNullOrWhiteSpace(response.MessageId)); - Console.WriteLine($"MessageId={response.MessageId}"); + Assert.IsFalse(string.IsNullOrWhiteSpace(emailSendOperation.Id)); + Console.WriteLine($"OperationId={emailSendOperation.Id}"); + Console.WriteLine($"Email send status = {statusMonitor.Status}"); + } + + [RecordedTest] + [AsyncOnly] + public async Task SendEmailAndWaitForStatusWithManualPollingAsync() + { + EmailClient emailClient = CreateEmailClient(); + EmailRecipients emailRecipients = GetRecipients(setTo: true, setCc: true, setBcc: true); + + EmailSendOperation emailSendOperation = await SendEmailAndWaitForStatusWithManualPollingAsync(emailClient, emailRecipients); + EmailSendResult statusMonitor = emailSendOperation.Value; + + Assert.IsFalse(string.IsNullOrWhiteSpace(emailSendOperation.Id)); + Console.WriteLine($"OperationId={emailSendOperation.Id}"); + Console.WriteLine($"Email send status = {statusMonitor.Status}"); } [Test] [AsyncOnly] [TestCaseSource(nameof(SetRecipientAddressState))] - public async Task SendEmailAsync( + public async Task SendEmailAndWaitForStatusWithAutomaticPollingAsync( bool setTo, bool setCc, bool setBcc) { EmailClient emailClient = CreateEmailClient(); EmailRecipients emailRecipients = GetRecipients(setTo, setCc, setBcc); - SendEmailResult response = await SendEmailAsync(emailClient, emailRecipients); + EmailSendOperation emailSendOperation = await SendEmailAndWaitForStatusWithAutomaticPollingAsync(emailClient, emailRecipients); + EmailSendResult statusMonitor = emailSendOperation.Value; - Assert.IsNotNull(response); - Assert.IsFalse(string.IsNullOrWhiteSpace(response.MessageId)); - Console.WriteLine($"MessageId={response.MessageId}"); + Assert.IsFalse(string.IsNullOrWhiteSpace(emailSendOperation.Id)); + Console.WriteLine($"OperationId={emailSendOperation.Id}"); + Console.WriteLine($"Email send status = {statusMonitor.Status}"); } [Test] [SyncOnly] - [TestCaseSource(nameof(SetRecipientAddressState) )] - public void GetSendStatus( + [TestCaseSource(nameof(SetRecipientAddressState))] + public void SendEmailAndWaitForStatusWithAutomaticPolling( bool setTo, bool setCc, bool setBcc) { EmailClient emailClient = CreateEmailClient(); EmailRecipients emailRecipients = GetRecipients(setTo, setCc, setBcc); - SendEmailResult response = SendEmail(emailClient, emailRecipients); + EmailSendOperation emailSendOperation = SendEmailAndWaitForStatusWithAutomaticPolling(emailClient, emailRecipients); + EmailSendResult statusMonitor = emailSendOperation.Value; + + Assert.IsFalse(string.IsNullOrWhiteSpace(emailSendOperation.Id)); + Console.WriteLine($"OperationId={emailSendOperation.Id}"); + Console.WriteLine($"Email send status = {statusMonitor.Status}"); + } + + private async Task SendEmailAndWaitForStatusWithManualPollingAsync(EmailClient emailClient, EmailRecipients emailRecipients) + { + var emailContent = new EmailContent("subject"); + emailContent.PlainText = "Test"; + + var emailMessage = new EmailMessage( + TestEnvironment.SenderAddress, + emailRecipients, + emailContent); + + EmailSendOperation emailSendOperation = await emailClient.SendAsync(WaitUntil.Started, emailMessage); - Assert.IsNotNull(response); - Assert.IsFalse(string.IsNullOrWhiteSpace(response.MessageId)); - Console.WriteLine($"MessageId={response.MessageId}"); + while (true) + { + await emailSendOperation.UpdateStatusAsync(); + if (emailSendOperation.HasCompleted) + { + break; + } + await Task.Delay(100); + } - SendStatusResult messageStatusResponse = emailClient.GetSendStatus(response.MessageId); + if (emailSendOperation.HasValue) + { + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + } - Assert.IsNotNull(messageStatusResponse); - Console.WriteLine(messageStatusResponse.Status); + return emailSendOperation; } - [Test] - [AsyncOnly] - [TestCaseSource(nameof(SetRecipientAddressState))] - public async Task GetSendStatusAsync( - bool setTo, bool setCc, bool setBcc) + private EmailSendOperation SendEmailAndWaitForStatusWithAutomaticPolling(EmailClient emailClient, EmailRecipients emailRecipients) { - EmailClient emailClient = CreateEmailClient(); - EmailRecipients emailRecipients = GetRecipients(setTo, setCc, setBcc); + var emailContent = new EmailContent("subject"); + emailContent.PlainText = "Test"; - SendEmailResult response = await SendEmailAsync(emailClient, emailRecipients); + var emailMessage = new EmailMessage( + TestEnvironment.SenderAddress, + emailRecipients, + emailContent); - Assert.IsNotNull(response); - Assert.IsFalse(string.IsNullOrWhiteSpace(response.MessageId)); - Console.WriteLine($"MessageId={response.MessageId}"); + EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage); + return emailSendOperation; + } - SendStatusResult messageStatusResponse = await emailClient.GetSendStatusAsync(response.MessageId); + private async Task SendEmailAndWaitForStatusWithAutomaticPollingAsync(EmailClient emailClient, EmailRecipients emailRecipients) + { + var emailContent = new EmailContent("subject"); + emailContent.PlainText = "Test"; - Assert.IsNotNull(messageStatusResponse); - Console.WriteLine(messageStatusResponse.Status); + var emailMessage = new EmailMessage( + TestEnvironment.SenderAddress, + emailRecipients, + emailContent); + + EmailSendOperation emailSendOperation = await emailClient.SendAsync(WaitUntil.Completed, emailMessage); + return emailSendOperation; } - private Response SendEmail(EmailClient emailClient, EmailRecipients emailRecipients) + private async Task SendEmailAndWaitForExistingOperationAsync(EmailClient emailClient, EmailRecipients emailRecipients) { var emailContent = new EmailContent("subject"); emailContent.PlainText = "Test"; var emailMessage = new EmailMessage( TestEnvironment.SenderAddress, - emailContent, - emailRecipients); + emailRecipients, + emailContent); + + EmailSendOperation emailSendOperation = await emailClient.SendAsync(WaitUntil.Started, emailMessage); + string operationId = emailSendOperation.Id; - Response? response = emailClient.Send(emailMessage); - return response; + // Rehydrate operation with above existing operation id + var existingOperation = new EmailSendOperation(operationId, emailClient); + _ = await existingOperation.WaitForCompletionAsync().ConfigureAwait(false); + + return existingOperation; } - private async Task> SendEmailAsync(EmailClient emailClient, EmailRecipients emailRecipients) + private EmailSendOperation SendEmailAndWaitForExistingOperation(EmailClient emailClient, EmailRecipients emailRecipients) { var emailContent = new EmailContent("subject"); emailContent.PlainText = "Test"; var emailMessage = new EmailMessage( TestEnvironment.SenderAddress, - emailContent, - emailRecipients); + emailRecipients, + emailContent); + + EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Started, emailMessage); + string operationId = emailSendOperation.Id; + + // Rehydrate operation with above existing operation id + var existingOperation = new EmailSendOperation(operationId, emailClient); + _ = existingOperation.WaitForCompletion(); - Response? response = await emailClient.SendAsync(emailMessage); - return response; + return existingOperation; } private static IEnumerable SetRecipientAddressState() @@ -139,17 +213,17 @@ private EmailRecipients GetRecipients(bool setTo, bool setCc, bool setBcc) if (setTo) { - toEmailAddressList = new List { new EmailAddress(TestEnvironment.RecipientAddress) { DisplayName = "ToAddress" } }; + toEmailAddressList = new List { new EmailAddress(TestEnvironment.RecipientAddress, "ToAddress") }; } if (setCc) { - ccEmailAddressList = new List { new EmailAddress(TestEnvironment.RecipientAddress) { DisplayName = "CcAddress" } }; + ccEmailAddressList = new List { new EmailAddress(TestEnvironment.RecipientAddress, "CcAddress") }; } if (setBcc) { - bccEmailAddressList = new List { new EmailAddress(TestEnvironment.RecipientAddress) { DisplayName = "BccAddress" } }; + bccEmailAddressList = new List { new EmailAddress(TestEnvironment.RecipientAddress, "BccAddress") }; } return new EmailRecipients(toEmailAddressList, ccEmailAddressList, bccEmailAddressList); diff --git a/sdk/communication/Azure.Communication.Email/tests/EmailClientTests.cs b/sdk/communication/Azure.Communication.Email/tests/EmailClientTests.cs index d3863077c36e8..a181da2787495 100644 --- a/sdk/communication/Azure.Communication.Email/tests/EmailClientTests.cs +++ b/sdk/communication/Azure.Communication.Email/tests/EmailClientTests.cs @@ -3,8 +3,8 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Net; -using Azure.Communication.Email.Models; using Azure.Core.TestFramework; using NUnit.Framework; @@ -36,11 +36,138 @@ public void SendEmail_InvalidParams_Throws() if (IsAsync) { - Assert.ThrowsAsync(async () => await emailClient.SendAsync(null)); + Assert.ThrowsAsync(async () => await emailClient.SendAsync(WaitUntil.Started, null)); } else { - Assert.Throws(() => emailClient.Send(null)); + Assert.Throws(() => emailClient.Send(WaitUntil.Started, null)); + } + } + + [Test] + [TestCaseSource(nameof(InvalidStringValues))] + public void SendEmailOverload_InvalidSenderEmail_Throws(string invalidStringValue) + { + EmailClient emailClient = CreateEmailClient(); + EmailMessage emailMessage = DefaultEmailMessage(); + AsyncTestDelegate asyncCode = async () => await emailClient.SendAsync( + WaitUntil.Started, + invalidStringValue, + emailMessage.Recipients.To.First().Address, + emailMessage.Content.Subject, + emailMessage.Content.Html, + emailMessage.Content.PlainText); + TestDelegate code = () => emailClient.Send( + WaitUntil.Started, + invalidStringValue, + emailMessage.Recipients.To.First().Address, + emailMessage.Content.Subject, + emailMessage.Content.Html, + emailMessage.Content.PlainText); + + SendEmailOverload_ExecuteTest(invalidStringValue, asyncCode, code); + } + + private void SendEmailOverload_ExecuteTest(string invalidStringValue, AsyncTestDelegate asyncCode, TestDelegate code) + { + if (IsAsync) + { + if (invalidStringValue == null) + { + Assert.ThrowsAsync(asyncCode); + } + else + { + Assert.ThrowsAsync(asyncCode); + } + } + else + { + if (invalidStringValue == null) + { + Assert.Throws(code); + } + else + { + Assert.Throws(code); + } + } + } + + [Test] + [TestCaseSource(nameof(InvalidStringValues))] + public void SendEmailOverload_InvalidToRecipient_Throws(string invalidStringValue) + { + EmailClient emailClient = CreateEmailClient(); + EmailMessage emailMessage = DefaultEmailMessage(); + AsyncTestDelegate asyncCode = async () => await emailClient.SendAsync( + WaitUntil.Started, + emailMessage.SenderAddress, + invalidStringValue, + emailMessage.Content.Subject, + emailMessage.Content.Html, + emailMessage.Content.PlainText); + TestDelegate code = () => emailClient.Send( + WaitUntil.Started, + emailMessage.SenderAddress, + invalidStringValue, + emailMessage.Content.Subject, + emailMessage.Content.Html, + emailMessage.Content.PlainText); + + SendEmailOverload_ExecuteTest(invalidStringValue, asyncCode, code); + } + + [Test] + [TestCaseSource(nameof(InvalidStringValues))] + public void SendEmailOverload_InvalidSubject_Throws(string invalidStringValue) + { + EmailClient emailClient = CreateEmailClient(); + EmailMessage emailMessage = DefaultEmailMessage(); + AsyncTestDelegate asyncCode = async () => await emailClient.SendAsync( + WaitUntil.Started, + emailMessage.SenderAddress, + emailMessage.Recipients.To.First().Address, + invalidStringValue, + emailMessage.Content.Html, + emailMessage.Content.PlainText); + TestDelegate code = () => emailClient.Send( + WaitUntil.Started, + emailMessage.SenderAddress, + emailMessage.Recipients.To.First().Address, + invalidStringValue, + emailMessage.Content.Html, + emailMessage.Content.PlainText); + + SendEmailOverload_ExecuteTest(invalidStringValue, asyncCode, code); + } + + [Test] + [TestCaseSource(nameof(InvalidStringValues))] + public void SendEmailOverload_InvalidContent_Throws(string invalidStringValue) + { + EmailClient emailClient = CreateEmailClient(); + EmailMessage emailMessage = DefaultEmailMessage(); + + if (IsAsync) + { + Assert.ThrowsAsync(async () => await emailClient.SendAsync( + WaitUntil.Started, + emailMessage.SenderAddress, + emailMessage.Recipients.To.First().Address, + emailMessage.Content.Subject, + invalidStringValue, + invalidStringValue)); + } + else + { + Assert.Throws(() => emailClient.Send( + WaitUntil.Started, + emailMessage.SenderAddress, + emailMessage.Recipients.To.First().Address, + emailMessage.Content.Subject, + invalidStringValue, + invalidStringValue)); } } @@ -54,17 +181,17 @@ public void BadRequest_ThrowsException() RequestFailedException? exception = null; if (IsAsync) { - exception = Assert.ThrowsAsync(async () => await emailClient.SendAsync(emailMessage)); + exception = Assert.ThrowsAsync(async () => await emailClient.SendAsync(WaitUntil.Started, emailMessage)); } else { - exception = Assert.Throws(() => emailClient.Send(emailMessage)); + exception = Assert.Throws(() => emailClient.Send(WaitUntil.Started, emailMessage)); } Assert.AreEqual((int)HttpStatusCode.BadRequest, exception?.Status); } [Test] - [TestCaseSource(nameof(InvalidEmailMessages))] + [TestCaseSource(nameof(InvalidEmailMessagesForArgumentException))] public void InvalidEmailMessage_Throws_ArgumentException(EmailMessage emailMessage, string errorMessage) { EmailClient emailClient = CreateEmailClient(HttpStatusCode.BadRequest); @@ -72,30 +199,31 @@ public void InvalidEmailMessage_Throws_ArgumentException(EmailMessage emailMessa ArgumentException? exception = null; if (IsAsync) { - exception = Assert.ThrowsAsync(async () => await emailClient.SendAsync(emailMessage)); + exception = Assert.ThrowsAsync(async () => await emailClient.SendAsync(WaitUntil.Started, emailMessage)); } else { - exception = Assert.Throws(() => emailClient.Send(emailMessage)); + exception = Assert.Throws(() => emailClient.Send(WaitUntil.Started, emailMessage)); } Assert.IsTrue(exception?.Message.Contains(errorMessage)); } [Test] - public void GetMessageStatus_InvalidMessageId() + [TestCaseSource(nameof(InvalidEmailMessagesForRequestFailedException))] + public void InvalidEmailMessage_Throws_RequestFailedException(EmailMessage emailMessage, string errorMessage) { - EmailClient emailClient = CreateEmailClient(); + EmailClient emailClient = CreateEmailClient(HttpStatusCode.BadRequest); + RequestFailedException? exception = null; if (IsAsync) { - Assert.ThrowsAsync(async () => await emailClient.GetSendStatusAsync(string.Empty)); - Assert.ThrowsAsync(async () => await emailClient.GetSendStatusAsync(null)); + exception = Assert.ThrowsAsync(async () => await emailClient.SendAsync(WaitUntil.Started, emailMessage)); } else { - Assert.Throws(() => emailClient.GetSendStatus(string.Empty)); - Assert.Throws(() => emailClient.GetSendStatus(null)); + exception = Assert.Throws(() => emailClient.Send(WaitUntil.Started, emailMessage)); } + Assert.AreEqual((int)HttpStatusCode.BadRequest, exception?.Status); } private EmailClient CreateEmailClient(HttpStatusCode statusCode = HttpStatusCode.OK) @@ -109,7 +237,52 @@ private EmailClient CreateEmailClient(HttpStatusCode statusCode = HttpStatusCode return new EmailClient(ConnectionString, emailClientOptions); } - private static IEnumerable InvalidEmailMessages() + private static IEnumerable InvalidParamsForSendEmailOverload() + { + EmailMessage emailMessage = DefaultEmailMessage(); + + yield return new object[] + { + new object?[] { + null, + emailMessage.Recipients.To.First(), + emailMessage.Content.Subject, + emailMessage.Content.Html, + } + }; + + yield return new object[] + { + new object?[] { + string.Empty, + emailMessage.Recipients.To.First(), + emailMessage.Content.Subject, + emailMessage.Content.Html, + } + }; + + yield return new object[] + { + new object?[] { + null, + emailMessage.Recipients.To.First(), + emailMessage.Content.Subject, + emailMessage.Content.Html, + } + }; + + yield return new object[] + { + new object?[] { + null, + emailMessage.Recipients.To.First(), + emailMessage.Content.Subject, + emailMessage.Content.Html, + } + }; + } + + private static IEnumerable InvalidEmailMessagesForArgumentException() { return new[] { @@ -119,11 +292,6 @@ private EmailClient CreateEmailClient(HttpStatusCode statusCode = HttpStatusCode ErrorMessages.InvalidSenderEmail }, new object[] - { - EmailMessageInvalidSender(), - ErrorMessages.InvalidSenderEmail - }, - new object[] { EmailMessageEmptyContent(), ErrorMessages.EmptyContent @@ -134,33 +302,35 @@ private EmailClient CreateEmailClient(HttpStatusCode statusCode = HttpStatusCode ErrorMessages.EmptyToRecipients }, new object[] - { - EmailMessageInvalidToRecipients(), - ErrorMessages.InvalidEmailAddress - }, - new object[] { EmailMessageEmptySubject(), ErrorMessages.EmptySubject }, new object[] { - EmailMessageDuplicateCustomHeader(), - ErrorMessages.DuplicateHeaderName + EmailMessageEmptyCustomHeaderValue(), + ErrorMessages.EmptyHeaderValue }, new object[] { - EmailMessageEmptyCustomHeaderName(), - ErrorMessages.EmptyHeaderNameOrValue - }, + EmailMessageInvalidAttachment(), + ErrorMessages.InvalidAttachmentContent + } + }; + } + + private static IEnumerable InvalidEmailMessagesForRequestFailedException() + { + return new[] + { new object[] { - EmailMessageEmptyCustomHeaderValue(), - ErrorMessages.EmptyHeaderNameOrValue + EmailMessageInvalidSender(), + ErrorMessages.InvalidSenderEmail }, new object[] { - EmailMessageEmptyCcEmailAddress(), + EmailMessageInvalidToRecipients(), ErrorMessages.InvalidEmailAddress }, new object[] @@ -169,99 +339,74 @@ private EmailClient CreateEmailClient(HttpStatusCode statusCode = HttpStatusCode ErrorMessages.InvalidEmailAddress }, new object[] - { - EmailMessageEmptyBccEmailAddress(), - ErrorMessages.InvalidEmailAddress - }, - new object[] { EmailMessageInvalidBccEmailAddress(), ErrorMessages.InvalidEmailAddress }, - new object[] - { - EmailMessageEmptyAttachment(), - ErrorMessages.InvalidAttachmentContent - }, - new object[] - { - EmailMessageInvalidAttachment(), - ErrorMessages.InvalidAttachmentContent - } }; } + private static IEnumerable InvalidStringValues() + { + yield return null; + yield return string.Empty; + yield return " "; + } + private static EmailMessage EmailMessageEmptySender() { return new EmailMessage( string.Empty, - GetDefaultContent(DefaultSubject()), - new EmailRecipients(DefaultRecipients())); + new EmailRecipients(DefaultRecipients()), + GetDefaultContent(DefaultSubject())); } private static EmailMessage EmailMessageInvalidSender() { return new EmailMessage( "this is an invalid email address", - GetDefaultContent(DefaultSubject()), - new EmailRecipients(DefaultRecipients())); + new EmailRecipients(DefaultRecipients()), + GetDefaultContent(DefaultSubject())); } private static EmailMessage EmailMessageEmptyToRecipients() { return new EmailMessage( DefaultSenderEmail(), - GetDefaultContent(DefaultSubject()), - new EmailRecipients(new List())); + new EmailRecipients(new List()), + GetDefaultContent(DefaultSubject())); } private static object EmailMessageInvalidToRecipients() { return new EmailMessage( DefaultSenderEmail(), - GetDefaultContent(DefaultSubject()), - new EmailRecipients(new List { new EmailAddress("this is an invalid email address") })); + new EmailRecipients(new List { new EmailAddress("this is an invalid email address") }), + GetDefaultContent(DefaultSubject())); } private static EmailMessage EmailMessageEmptyContent() { return new EmailMessage( DefaultSenderEmail(), - new EmailContent(DefaultSubject()), - new EmailRecipients(DefaultRecipients())); + new EmailRecipients(DefaultRecipients()), + new EmailContent(DefaultSubject())); } private static EmailMessage EmailMessageEmptySubject() { return new EmailMessage( DefaultSenderEmail(), - GetDefaultContent(string.Empty), - new EmailRecipients(DefaultRecipients())); - } - - private static EmailMessage EmailMessageDuplicateCustomHeader() - { - var emailMessage = DefaultEmailMessage(); - - emailMessage.CustomHeaders.Add(new EmailCustomHeader("Key1", "Value1")); - emailMessage.CustomHeaders.Add(new EmailCustomHeader("Key2", "Value2")); - emailMessage.CustomHeaders.Add(new EmailCustomHeader("Key1", "Value3")); - - return emailMessage; - } - - private static EmailMessage EmailMessageEmptyCustomHeaderName() - { - EmailMessage emailMessage = EmailMessageDuplicateCustomHeader(); - emailMessage.CustomHeaders.Add(new EmailCustomHeader(string.Empty, "Value")); - - return emailMessage; + new EmailRecipients(DefaultRecipients()), + GetDefaultContent(string.Empty)); } private static EmailMessage EmailMessageEmptyCustomHeaderValue() { - EmailMessage emailMessage = EmailMessageDuplicateCustomHeader(); - emailMessage.CustomHeaders.Add(new EmailCustomHeader("Key", string.Empty)); + EmailMessage emailMessage = DefaultEmailMessage(); + + emailMessage.Headers.Add("Key1", "Value1"); + emailMessage.Headers.Add("Key", string.Empty); return emailMessage; } @@ -299,19 +444,11 @@ private static EmailMessage EmailMessageInvalidBccEmailAddress() return emailMessage; } - private static EmailMessage EmailMessageEmptyAttachment() - { - var emailMessage = DefaultEmailMessage(); - - emailMessage.Attachments.Add(new EmailAttachment(Guid.NewGuid().ToString(), EmailAttachmentType.Txt, string.Empty)); - - return emailMessage; - } - private static EmailMessage EmailMessageInvalidAttachment() { var emailMessage = DefaultEmailMessage(); - emailMessage.Attachments.Add(new EmailAttachment(Guid.NewGuid().ToString(), EmailAttachmentType.Txt, "This is invalid attachment content")); //"gobbledygook")); + + emailMessage.Attachments.Add(new EmailAttachment(Guid.NewGuid().ToString(), "text/plain", new BinaryData(""))); return emailMessage; } @@ -320,8 +457,8 @@ private static EmailMessage DefaultEmailMessage() { return new EmailMessage( DefaultSenderEmail(), - GetDefaultContent(DefaultSubject()), - new EmailRecipients(DefaultRecipients())); + new EmailRecipients(DefaultRecipients()), + GetDefaultContent(DefaultSubject())); } private static string DefaultSenderEmail() diff --git a/sdk/communication/Azure.Communication.Email/tests/EmailRecipientsTests.cs b/sdk/communication/Azure.Communication.Email/tests/EmailRecipientsTests.cs index 3b39c814d9b61..7a12967ba2fa6 100644 --- a/sdk/communication/Azure.Communication.Email/tests/EmailRecipientsTests.cs +++ b/sdk/communication/Azure.Communication.Email/tests/EmailRecipientsTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; -using Azure.Communication.Email.Models; using Azure.Core.TestFramework; using NUnit.Framework; diff --git a/sdk/communication/Azure.Communication.Email/tests/Samples/Sample1_EmailClient.cs b/sdk/communication/Azure.Communication.Email/tests/Samples/Sample1_EmailClient.cs index 6f2063a66ae21..c01fc047fac42 100644 --- a/sdk/communication/Azure.Communication.Email/tests/Samples/Sample1_EmailClient.cs +++ b/sdk/communication/Azure.Communication.Email/tests/Samples/Sample1_EmailClient.cs @@ -3,13 +3,14 @@ using System; using System.Collections.Generic; -using System.IO; +using Azure.Communication.Email; +using System.Threading.Tasks; #region Snippet:Azure_Communication_Email_UsingStatements //@@ using Azure.Communication.Email; -using Azure.Communication.Email.Models; #endregion Snippet:Azure_Communication_Email_UsingStatements using Azure.Core.TestFramework; using NUnit.Framework; +using System.Net.Mime; namespace Azure.Communication.Email.Tests.Samples { @@ -21,64 +22,90 @@ public Sample1_EmailClient(bool isAsync) : base(isAsync) [Test] [SyncOnly] - public void SendEmail() + public void SendSimpleEmailWithAutomaticPollingForStatus() { - EmailClient client = CreateEmailClient(); + EmailClient emailClient = CreateEmailClient(); + + #region Snippet:Azure_Communication_Email_Send_Simple_AutoPolling + var emailSendOperation = emailClient.Send( + wait: WaitUntil.Completed, + //@@ from: "" // The email address of the domain registered with the Communication Services resource + //@@ to: "" + /*@@*/ from: TestEnvironment.SenderAddress, + /*@@*/ to: TestEnvironment.RecipientAddress, + subject: "This is the subject", + htmlContent: "This is the html body"); + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); + #endregion Snippet:Azure_Communication_Email_Send_Simple_AutoPolling + + Assert.False(string.IsNullOrEmpty(operationId)); + } - #region Snippet:Azure_Communication_Email_Send + [Test] + [SyncOnly] + public void SendEmailWithMoreOptions() + { + EmailClient emailClient = CreateEmailClient(); + + #region Snippet:Azure_Communication_Email_Send_With_MoreOptions // Create the email content - var emailContent = new EmailContent("This is the subject"); - emailContent.PlainText = "This is the body"; - - // Create the recipient list - var emailRecipients = new EmailRecipients( - new List - { - new EmailAddress( - //@@ email: "" - //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, - /*@@*/ displayName: "Customer Name") - }); + var emailContent = new EmailContent("This is the subject") + { + PlainText = "This is the body", + Html = "This is the html body" + }; // Create the EmailMessage var emailMessage = new EmailMessage( - //@@ sender: "" // The email address of the domain registered with the Communication Services resource - /*@@*/ sender: TestEnvironment.SenderAddress, - emailContent, - emailRecipients); - - SendEmailResult sendResult = client.Send(emailMessage); - - Console.WriteLine($"Email id: {sendResult.MessageId}"); - #endregion Snippet:Azure_Communication_Email_Send - - Assert.False(string.IsNullOrEmpty(sendResult.MessageId)); + //@@ fromAddress: "" // The email address of the domain registered with the Communication Services resource + //@@ toAddress: "" + /*@@*/ fromAddress: TestEnvironment.SenderAddress, + /*@@*/ toAddress: TestEnvironment.RecipientAddress, + content: emailContent); + + var emailSendOperation = emailClient.Send( + wait: WaitUntil.Completed, + message: emailMessage); + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); + #endregion Snippet:Azure_Communication_Email_Send_With_MoreOptions + + Assert.False(string.IsNullOrEmpty(operationId)); } [Test] [SyncOnly] public void SendEmailToMultipleRecipients() { - EmailClient client = CreateEmailClient(); + EmailClient emailClient = CreateEmailClient(); #region Snippet:Azure_Communication_Email_Send_Multiple_Recipients // Create the email content - var emailContent = new EmailContent("This is the subject"); - emailContent.PlainText = "This is the body"; + var emailContent = new EmailContent("This is the subject") + { + PlainText = "This is the body", + Html = "This is the html body" + }; // Create the To list var toRecipients = new List { new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name"), new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name") }; @@ -86,14 +113,14 @@ public void SendEmailToMultipleRecipients() var ccRecipients = new List { new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name"), new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name") }; @@ -101,14 +128,14 @@ public void SendEmailToMultipleRecipients() var bccRecipients = new List { new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name"), new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name") }; @@ -116,105 +143,68 @@ public void SendEmailToMultipleRecipients() // Create the EmailMessage var emailMessage = new EmailMessage( - //@@ sender: "" // The email address of the domain registered with the Communication Services resource - /*@@*/ sender: TestEnvironment.SenderAddress, - emailContent, - emailRecipients); + //@@ senderAddress: "" // The email address of the domain registered with the Communication Services resource + /*@@*/ senderAddress: TestEnvironment.SenderAddress, + emailRecipients, + emailContent); - SendEmailResult sendResult = client.Send(emailMessage); + EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage); + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); - Console.WriteLine($"Email id: {sendResult.MessageId}"); + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); #endregion Snippet:Azure_Communication_Email_Send_Multiple_Recipients - Console.WriteLine(sendResult.MessageId); - Assert.False(string.IsNullOrEmpty(sendResult.MessageId)); + Assert.False(string.IsNullOrEmpty(operationId)); } [Test] [SyncOnly] public void SendEmailWithAttachment() { - EmailClient client = CreateEmailClient(); - - var emailContent = new EmailContent("This is the subject"); - emailContent.PlainText = "This is the body"; + EmailClient emailClient = CreateEmailClient(); - var emailRecipients = new EmailRecipients( - new List - { - new EmailAddress( - //@@ email: "" - //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, - /*@@*/ displayName: "Customer Name") - }); + // Create the email content + var emailContent = new EmailContent("This is the subject") + { + PlainText = "This is the body", + Html = "This is the html body" + }; #region Snippet:Azure_Communication_Email_Send_With_Attachments // Create the EmailMessage var emailMessage = new EmailMessage( - //@@ sender: "" // The email address of the domain registered with the Communication Services resource - /*@@*/ sender: TestEnvironment.SenderAddress, - emailContent, - emailRecipients); + //@@ fromAddress: "" // The email address of the domain registered with the Communication Services resource + //@@ toAddress: "" + /*@@*/ fromAddress: TestEnvironment.SenderAddress, + /*@@*/ toAddress: TestEnvironment.RecipientAddress, + content: emailContent); #if SNIPPET var filePath = ""; var attachmentName = ""; - EmailAttachmentType attachmentType = EmailAttachmentType.Txt; + var contentType = MediaTypeNames.Text.Plain; #endif - // Convert the file content into a Base64 string #if SNIPPET - byte[] bytes = File.ReadAllBytes(filePath); - string attachmentFileInBytes = Convert.ToBase64String(bytes); + string content = new BinaryData(File.ReadAllBytes(filePath)); #else string attachmentName = "Attachment.txt"; - EmailAttachmentType attachmentType = EmailAttachmentType.Txt; - var attachmentFileInBytes = "VGhpcyBpcyBhIHRlc3Q="; + string contentType = MediaTypeNames.Text.Plain; + var content = new BinaryData("This is attachment file content."); #endif - var emailAttachment = new EmailAttachment(attachmentName, attachmentType, attachmentFileInBytes); + var emailAttachment = new EmailAttachment(attachmentName, contentType, content); emailMessage.Attachments.Add(emailAttachment); - SendEmailResult sendResult = client.Send(emailMessage); -#endregion Snippet:Azure_Communication_Email_Send_With_Attachments - } - - [Test] - [SyncOnly] - public void GetSendEmailStatus() - { - EmailClient client = CreateEmailClient(); - - // Create the email content - var emailContent = new EmailContent("This is the subject"); - emailContent.PlainText = "This is the body"; - - // Create the recipient list - var emailRecipients = new EmailRecipients( - new List - { - new EmailAddress( - //@@ email: "" - //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, - /*@@*/ displayName: "Customer Name") - }); - - // Create the EmailMessage - var emailMessage = new EmailMessage( - //@@ sender: "" // The email address of the domain registered with the Communication Services resource - /*@@*/ sender: TestEnvironment.SenderAddress, - emailContent, - emailRecipients); - -#region Snippet:Azure_Communication_Email_GetSendStatus - SendEmailResult sendResult = client.Send(emailMessage); - - SendStatusResult status = client.GetSendStatus(sendResult.MessageId); -#endregion Snippet:Azure_Communication_Email_GetSendStatus + EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage); + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); - Assert.False(string.IsNullOrEmpty(sendResult.MessageId)); + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); + #endregion Snippet:Azure_Communication_Email_Send_With_Attachments } } } diff --git a/sdk/communication/Azure.Communication.Email/tests/Samples/Sample1_EmailClientAsync.cs b/sdk/communication/Azure.Communication.Email/tests/Samples/Sample1_EmailClientAsync.cs index 53eb33cc6c18b..a7d3283b27b21 100644 --- a/sdk/communication/Azure.Communication.Email/tests/Samples/Sample1_EmailClientAsync.cs +++ b/sdk/communication/Azure.Communication.Email/tests/Samples/Sample1_EmailClientAsync.cs @@ -3,9 +3,8 @@ using System; using System.Collections.Generic; -using System.IO; +using System.Net.Mime; using System.Threading.Tasks; -using Azure.Communication.Email.Models; using Azure.Core.TestFramework; using NUnit.Framework; @@ -19,64 +18,130 @@ public Sample1_EmailClientAsync(bool isAsync) : base(isAsync) [Test] [AsyncOnly] - public async Task SendEmailAsync() + public async Task SendSimpleEmailWithAutomaticPollingForStatusAsync() { - EmailClient client = CreateEmailClient(); - - #region Snippet:Azure_Communication_Email_SendAsync - // Create the email content - var emailContent = new EmailContent("This is the subject"); - emailContent.PlainText = "This is the body"; + EmailClient emailClient = CreateEmailClient(); + + #region Snippet:Azure_Communication_Email_Send_Simple_AutoPolling_Async + var emailSendOperation = await emailClient.SendAsync( + wait: WaitUntil.Completed, + //@@ from: "" // The email address of the domain registered with the Communication Services resource + //@@ to: "" + /*@@*/ from: TestEnvironment.SenderAddress, + /*@@*/ to: TestEnvironment.RecipientAddress, + subject: "This is the subject", + htmlContent: "This is the html body"); + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); + #endregion Snippet:Azure_Communication_Email_Send_Simple_AutoPolling_Async + + Assert.False(string.IsNullOrEmpty(operationId)); + } - // Create the recipient list - var emailRecipients = new EmailRecipients( - new List + [RecordedTest] + [AsyncOnly] + public async Task SendSimpleEmailWithManualPollingForStatusAsync() + { + EmailClient emailClient = CreateEmailClient(); + + #region Snippet:Azure_Communication_Email_Send_Simple_ManualPolling_Async + /// Send the email message with WaitUntil.Started + var emailSendOperation = await emailClient.SendAsync( + wait: WaitUntil.Started, + //@@ from: "" // The email address of the domain registered with the Communication Services resource + //@@ to: "" + /*@@*/ from: TestEnvironment.SenderAddress, + /*@@*/ to: TestEnvironment.RecipientAddress, + subject: "This is the subject", + htmlContent: "This is the html body"); + + /// Call UpdateStatus on the email send operation to poll for the status + /// manually. + while (true) + { + await emailSendOperation.UpdateStatusAsync(); + if (emailSendOperation.HasCompleted) { - new EmailAddress( - //@@ email: "" - //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, - /*@@*/ displayName: "Customer Name") - }); + break; + } + await Task.Delay(100); + } - // Create the EmailMessage - var emailMessage = new EmailMessage( - //@@ sender: "" // The email address of the domain registered with the Communication Services resource - /*@@*/ sender: TestEnvironment.SenderAddress, - emailContent, - emailRecipients); + if (emailSendOperation.HasValue) + { + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + } + + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); + #endregion: Azure_Communication_Email_Send_Simple_ManualPolling_Async + } - SendEmailResult sendResult = await client.SendAsync(emailMessage); + [Test] + [AsyncOnly] + public async Task SendEmailWithMoreOptionsAsync() + { + EmailClient emailClient = CreateEmailClient(); - Console.WriteLine($"Email id: {sendResult.MessageId}"); - #endregion Snippet:Azure_Communication_Email_SendAsync + #region Snippet:Azure_Communication_Email_Send_With_MoreOptions_Async + // Create the email content + var emailContent = new EmailContent("This is the subject") + { + PlainText = "This is the body", + Html = "This is the html body" + }; - Assert.False(string.IsNullOrEmpty(sendResult.MessageId)); + // Create the EmailMessage + var emailMessage = new EmailMessage( + //@@ fromAddress: "" // The email address of the domain registered with the Communication Services resource + //@@ toAddress: "" + /*@@*/ fromAddress: TestEnvironment.SenderAddress, + /*@@*/ toAddress: TestEnvironment.RecipientAddress, + content: emailContent); + + var emailSendOperation = await emailClient.SendAsync( + wait: WaitUntil.Completed, + message: emailMessage); + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); + + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); + #endregion Snippet:Azure_Communication_Email_Send_With_MoreOptions_Async + + Assert.False(string.IsNullOrEmpty(operationId)); } [Test] [AsyncOnly] public async Task SendEmailToMultipleRecipientsAsync() { - EmailClient client = CreateEmailClient(); + EmailClient emailClient = CreateEmailClient(); - #region Snippet:Azure_Communication_Email_Send_Multiple_RecipientsAsync + #region Snippet:Azure_Communication_Email_Send_Multiple_Recipients_Async // Create the email content - var emailContent = new EmailContent("This is the subject"); - emailContent.PlainText = "This is the body"; + var emailContent = new EmailContent("This is the subject") + { + PlainText = "This is the body", + Html = "This is the html body" + }; // Create the To list var toRecipients = new List { new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name"), new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name") }; @@ -84,14 +149,14 @@ public async Task SendEmailToMultipleRecipientsAsync() var ccRecipients = new List { new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name"), new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name") }; @@ -99,14 +164,14 @@ public async Task SendEmailToMultipleRecipientsAsync() var bccRecipients = new List { new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name"), new EmailAddress( - //@@ email: "" + //@@ address: "" //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, + /*@@*/ address: TestEnvironment.RecipientAddress, /*@@*/ displayName: "Customer Name") }; @@ -114,105 +179,68 @@ public async Task SendEmailToMultipleRecipientsAsync() // Create the EmailMessage var emailMessage = new EmailMessage( - //@@ sender: "" // The email address of the domain registered with the Communication Services resource - /*@@*/ sender: TestEnvironment.SenderAddress, - emailContent, - emailRecipients); + //@@ senderAddress: "" // The email address of the domain registered with the Communication Services resource + /*@@*/ senderAddress: TestEnvironment.SenderAddress, + emailRecipients, + emailContent); - SendEmailResult sendResult = await client.SendAsync(emailMessage); + EmailSendOperation emailSendOperation = await emailClient.SendAsync(WaitUntil.Completed, emailMessage); + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); - Console.WriteLine($"Email id: {sendResult.MessageId}"); - #endregion Snippet:Azure_Communication_Email_Send_Multiple_RecipientsAsync + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); + #endregion Snippet:Azure_Communication_Email_Send_Multiple_Recipients_Async - Console.WriteLine(sendResult.MessageId); - Assert.False(string.IsNullOrEmpty(sendResult.MessageId)); + Assert.False(string.IsNullOrEmpty(operationId)); } [Test] [AsyncOnly] public async Task SendEmailWithAttachmentAsync() { - EmailClient client = CreateEmailClient(); - - var emailContent = new EmailContent("This is the subject"); - emailContent.PlainText = "This is the body"; - - var emailRecipients = new EmailRecipients( - new List - { - new EmailAddress( - //@@ email: "" - //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, - /*@@*/ displayName: "Customer Name") - }); - - #region Snippet:Azure_Communication_Email_Send_With_AttachmentsAsync + EmailClient emailClient = CreateEmailClient(); + + // Create the email content + var emailContent = new EmailContent("This is the subject") + { + PlainText = "This is the body", + Html = "This is the html body" + }; + + #region Snippet:Azure_Communication_Email_Send_With_Attachments_Async // Create the EmailMessage var emailMessage = new EmailMessage( - //@@ sender: "" // The email address of the domain registered with the Communication Services resource - /*@@*/ sender: TestEnvironment.SenderAddress, - emailContent, - emailRecipients); + //@@ fromAddress: "" // The email address of the domain registered with the Communication Services resource + //@@ toAddress: "" + /*@@*/ fromAddress: TestEnvironment.SenderAddress, + /*@@*/ toAddress: TestEnvironment.RecipientAddress, + content: emailContent); #if SNIPPET var filePath = ""; var attachmentName = ""; - EmailAttachmentType attachmentType = EmailAttachmentType.Txt; + var contentType = MediaTypeNames.Text.Plain; #endif - // Convert the file content into a Base64 string #if SNIPPET - byte[] bytes = File.ReadAllBytes(filePath); - string attachmentFileInBytes = Convert.ToBase64String(bytes); + string content = new BinaryData(File.ReadAllBytes(filePath)); #else string attachmentName = "Attachment.txt"; - EmailAttachmentType attachmentType = EmailAttachmentType.Txt; - var attachmentFileInBytes = "VGhpcyBpcyBhIHRlc3Q="; + string contentType = MediaTypeNames.Text.Plain; + var content = new BinaryData("This is attachment file content."); #endif - var emailAttachment = new EmailAttachment(attachmentName, attachmentType, attachmentFileInBytes); + var emailAttachment = new EmailAttachment(attachmentName, contentType, content); emailMessage.Attachments.Add(emailAttachment); - SendEmailResult sendResult = await client.SendAsync(emailMessage); - #endregion Snippet:Azure_Communication_Email_Send_With_AttachmentsAsync - } - - [Test] - [AsyncOnly] - public async Task GetSendEmailStatusAsync() - { - EmailClient client = CreateEmailClient(); - - // Create the email content - var emailContent = new EmailContent("This is the subject"); - emailContent.PlainText = "This is the body"; - - // Create the recipient list - var emailRecipients = new EmailRecipients( - new List - { - new EmailAddress( - //@@ email: "" - //@@ displayName: "" - /*@@*/ email: TestEnvironment.RecipientAddress, - /*@@*/ displayName: "Customer Name") - }); - - // Create the EmailMessage - var emailMessage = new EmailMessage( - //@@ sender: "" // The email address of the domain registered with the Communication Services resource - /*@@*/ sender: TestEnvironment.SenderAddress, - emailContent, - emailRecipients); - - #region Snippet:Azure_Communication_Email_GetSendStatusAsync - SendEmailResult sendResult = await client.SendAsync(emailMessage); - - SendStatusResult status = await client.GetSendStatusAsync(sendResult.MessageId); - #endregion Snippet:Azure_Communication_Email_GetSendStatusAsync + EmailSendOperation emailSendOperation = await emailClient.SendAsync(WaitUntil.Completed, emailMessage); + Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}"); - Assert.False(string.IsNullOrEmpty(sendResult.MessageId)); + /// Get the OperationId so that it can be used for tracking the message for troubleshooting + string operationId = emailSendOperation.Id; + Console.WriteLine($"Email operation id = {operationId}"); + #endregion Snippet:Azure_Communication_Email_Send_With_Attachments_Async } } } diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,False,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,False,True).json deleted file mode 100644 index b945541ab9824..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,False,True).json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "220", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "9321402a5e2b2b9219151f7575414d2c", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:36 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:40 GMT", - "mise-correlation-id": "926d9cee-ebfb-4120-92f4-55c3a74c4c39", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/a4c686a5-b834-444e-b212-b15074be4770/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211640Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cpm7", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "a4c686a5-b834-444e-b212-b15074be4770" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/a4c686a5-b834-444e-b212-b15074be4770/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "7766d7558b33b497f5cb149a5493aa45", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:37 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:40 GMT", - "mise-correlation-id": "bb7ac5fc-4ae0-4947-98ca-2fc5ab1a5722", - "Retry-After": "60", - "x-azure-ref": "20221110T211640Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cppg", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "a4c686a5-b834-444e-b212-b15074be4770", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2061892629", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,True,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,True,False).json deleted file mode 100644 index 7c8d891e43a93..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,True,False).json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "218", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "aa1b9f5415114e9e29e8b8f466580b0c", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:36 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:40 GMT", - "mise-correlation-id": "347135d9-482a-4151-aaf4-5b75b458cd02", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/4f93160f-1d87-4304-9122-1f713190814e/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211639Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cpeb", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "4f93160f-1d87-4304-9122-1f713190814e" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/4f93160f-1d87-4304-9122-1f713190814e/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "9129acb37d5e0b2a1d550fb12445b82a", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:36 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:40 GMT", - "mise-correlation-id": "3590dbfc-86c2-4dc6-ac5b-3835f7e2e4ac", - "Retry-After": "60", - "x-azure-ref": "20221110T211640Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cpg8", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "4f93160f-1d87-4304-9122-1f713190814e", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1959525223", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,True,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,True,True).json deleted file mode 100644 index 845d5fd64c1bc..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(False,True,True).json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "290", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "fb19e6aad714305975df594fd563e3ae", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:37 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:41 GMT", - "mise-correlation-id": "e0adace8-1d46-4474-a1cd-f191e7ad84b0", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/88fbd0bf-3798-4e19-b266-deeef7386c11/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211640Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cpu1", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "88fbd0bf-3798-4e19-b266-deeef7386c11" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/88fbd0bf-3798-4e19-b266-deeef7386c11/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "3bb0b83f9c43f685e830f20122c9ad96", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:37 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:41 GMT", - "mise-correlation-id": "7dc12fc6-a11a-4a61-8e3d-a4ad1658bf9c", - "Retry-After": "60", - "x-azure-ref": "20221110T211641Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cpwf", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "88fbd0bf-3798-4e19-b266-deeef7386c11", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2131858874", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,False,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,False,False).json deleted file mode 100644 index f2046d4f032f0..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,False,False).json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "210", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "bb10b93647213b0276f06188b58146e5", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:35 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:39 GMT", - "mise-correlation-id": "e51d7dde-1770-46ed-8b64-839fa57d97b6", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/591863f1-e084-4750-be19-62a909b1b0af/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211639Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cp9r", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "591863f1-e084-4750-be19-62a909b1b0af" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/591863f1-e084-4750-be19-62a909b1b0af/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b567889b3942b3ba681a0231a2568d3c", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:36 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:39 GMT", - "mise-correlation-id": "db5bd00a-eddb-4b83-8468-9be1e6e01f03", - "Retry-After": "60", - "x-azure-ref": "20221110T211639Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cpbr", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "591863f1-e084-4750-be19-62a909b1b0af", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1802788710", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,False,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,False,True).json deleted file mode 100644 index 66e7be6689e74..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,False,True).json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "282", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "597880a58a68657ded14c827b1f4ec70", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:37 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:41 GMT", - "mise-correlation-id": "b08408ca-4c5f-45a6-9f39-d97435063e68", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/ba4ecc2d-719f-4580-8ab1-2ea41d2f51a4/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211641Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cpy0", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "ba4ecc2d-719f-4580-8ab1-2ea41d2f51a4" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/ba4ecc2d-719f-4580-8ab1-2ea41d2f51a4/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "34130f8ae22c3b5909281cb76475f6cd", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:38 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:41 GMT", - "mise-correlation-id": "900f7a79-43f5-46c4-bde5-671cf81d3302", - "Retry-After": "60", - "x-azure-ref": "20221110T211641Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cq05", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "ba4ecc2d-719f-4580-8ab1-2ea41d2f51a4", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "594771075", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,True,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,True,False).json deleted file mode 100644 index 53f62945fc005..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,True,False).json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "280", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "e35ac14dd5b0061fe6d344bf42bf8727", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:38 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:41 GMT", - "mise-correlation-id": "04b8e9cd-b88e-4a2f-be48-900f7685c474", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/0f678a17-7abe-4763-b5d2-0cc473da81f4/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211641Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cq30", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "0f678a17-7abe-4763-b5d2-0cc473da81f4" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/0f678a17-7abe-4763-b5d2-0cc473da81f4/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "5963559411fe75a80fa9317e85933d8b", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:38 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:41 GMT", - "mise-correlation-id": "7d54f4e8-7e35-48fa-942c-7dbdab092269", - "Retry-After": "60", - "x-azure-ref": "20221110T211641Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cq4x", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "0f678a17-7abe-4763-b5d2-0cc473da81f4", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "646521489", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,True,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,True,True).json deleted file mode 100644 index 48139b459d328..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus(True,True,True).json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "352", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "e702c683a3198a341213bc5d4b7f7d9b", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:38 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:42 GMT", - "mise-correlation-id": "3aec9b18-2275-4e5a-b1e9-ce52e23f23b7", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/8587ba2e-47a5-46b8-8d6d-4e155e623173/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211642Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cq6c", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "8587ba2e-47a5-46b8-8d6d-4e155e623173" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/8587ba2e-47a5-46b8-8d6d-4e155e623173/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "4e82e56b0daa5b8d431ed1486feece7f", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:38 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:42 GMT", - "mise-correlation-id": "521a04aa-5bc0-4a79-97c1-42c067a12d37", - "Retry-After": "60", - "x-azure-ref": "20221110T211642Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cq87", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "8587ba2e-47a5-46b8-8d6d-4e155e623173", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1036193939", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus.json deleted file mode 100644 index d651bcb87c7f2..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatus.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "210", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20220912.1 (.NET 6.0.8; Microsoft Windows 10.0.25197)", - "x-ms-client-request-id": "9e5ca30247bb239c6b54d4eafe70b38c", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Mon, 12 Sep 2022 21:52:38 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Content-Length": "0", - "Date": "Mon, 12 Sep 2022 21:52:42 GMT", - "mise-correlation-id": "d4222825-2b9f-46e7-b115-54b133540929", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/215cea57-1835-4637-985c-c4cdd857d039/status", - "Repeatability-Result": "accepted", - "X-Azure-Ref": "0KaofYwAAAAB3IkT364TMT5lqHE1583URQk9TMzIxMDAwMTA5MDA5ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "215cea57-1835-4637-985c-c4cdd857d039" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/215cea57-1835-4637-985c-c4cdd857d039/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20220912.1 (.NET 6.0.8; Microsoft Windows 10.0.25197)", - "x-ms-client-request-id": "ed3b29a14f95c66a5be0c51bfe0ac06d", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Mon, 12 Sep 2022 21:52:39 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 12 Sep 2022 21:52:42 GMT", - "mise-correlation-id": "c5be0829-9792-45d8-ba47-08e13b233dea", - "Retry-After": "60", - "X-Azure-Ref": "0KqofYwAAAABF17z/sTdKQIaAIhDbzzn5Qk9TMzIxMDAwMTA5MDA5ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "215cea57-1835-4637-985c-c4cdd857d039", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "134441766", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,False,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,False,True)Async.json deleted file mode 100644 index a4d9a9a5b022d..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,False,True)Async.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "220", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-1ebb4c9de10b2249ae0c798712190581-e4a39a72fb42b248-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "577870928642724ab6de1aca8da1a9c6", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:41 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:44 GMT", - "mise-correlation-id": "b42d7407-2877-4062-a7cf-aaea267f5c5b", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/1394cb60-013f-422a-9805-798504d06751/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211644Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqzt", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "1394cb60-013f-422a-9805-798504d06751" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/1394cb60-013f-422a-9805-798504d06751/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-e9e5964779558d459f553d937c341268-bad25e2062f2b949-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "1df4fb2a21f4557dcff4301c17882ab4", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:41 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:44 GMT", - "mise-correlation-id": "a33ad31e-4a1f-4b88-ab3d-ca9a4e1dde0a", - "Retry-After": "60", - "x-azure-ref": "20221110T211644Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cr1q", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "1394cb60-013f-422a-9805-798504d06751", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "454183974", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,True,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,True,False)Async.json deleted file mode 100644 index cf9e0f70f6183..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,True,False)Async.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "218", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-25d146120e0c8548ba049c8aaa6a6707-840f374069bd6e4b-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "3acddcecdcbff98f2f087caf81ffe87a", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:40 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:44 GMT", - "mise-correlation-id": "79ae1c66-a6bc-48be-80d3-9f36f496d727", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/9911369b-4160-4d03-abf5-3676395cee24/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211644Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqwd", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "9911369b-4160-4d03-abf5-3676395cee24" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/9911369b-4160-4d03-abf5-3676395cee24/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-127f6de6f1fde140a9097d7471ed8ff1-8b6a43e5c5e09a4a-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "bf1c0a3b4403c8b70839509cec282e97", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:41 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:44 GMT", - "mise-correlation-id": "f3fd1d9c-1b4b-493b-af76-927a3173ea38", - "Retry-After": "60", - "x-azure-ref": "20221110T211644Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqxz", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "9911369b-4160-4d03-abf5-3676395cee24", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1367081325", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,True,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,True,True)Async.json deleted file mode 100644 index ba869534e3e22..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(False,True,True)Async.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "290", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-258ec370029bc1449e0cc9ed8fe1b08c-602624a588d4404b-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b91a800b68776c755056874e5b5fec90", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:41 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:45 GMT", - "mise-correlation-id": "80992ca5-343a-48eb-9f65-578e8408dbcf", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/44d07dbe-4737-474c-ab05-2479474dc043/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211644Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cr31", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "44d07dbe-4737-474c-ab05-2479474dc043" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/44d07dbe-4737-474c-ab05-2479474dc043/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-fb1b1f755f97d04d9b49fe9fe034620c-ac7c8e63392a3f46-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b7efdb72ea8bc498a44c62965154b527", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:41 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:45 GMT", - "mise-correlation-id": "c8356964-3169-4c84-9b95-40a45888d7c9", - "Retry-After": "60", - "x-azure-ref": "20221110T211645Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cr4z", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "44d07dbe-4737-474c-ab05-2479474dc043", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "648938741", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,False,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,False,False)Async.json deleted file mode 100644 index 6b26902e6e48d..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,False,False)Async.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "210", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-623139ea9519fe47b233194f7230f6e1-af169a757c5c1e45-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "e31ed0d049765659bae6cab040d68c1a", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:40 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:44 GMT", - "mise-correlation-id": "a0f2697e-e0cd-49e7-9ab1-07df6763a6fa", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/1eb9b055-1f25-4d6f-9a31-9351052bb9b8/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211643Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqs6", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "1eb9b055-1f25-4d6f-9a31-9351052bb9b8" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/1eb9b055-1f25-4d6f-9a31-9351052bb9b8/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-091b43775f20074499b01606a6047edb-bb26961691b74945-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "bfcb8fbe28f31c7515e525003103b9ee", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:40 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:44 GMT", - "mise-correlation-id": "0325c6aa-4bec-46b1-afe9-1d3409ea14a5", - "Retry-After": "60", - "x-azure-ref": "20221110T211644Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqv8", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "1eb9b055-1f25-4d6f-9a31-9351052bb9b8", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1834970873", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,False,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,False,True)Async.json deleted file mode 100644 index e3909f5243160..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,False,True)Async.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "282", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-169affed527ce54e9f33f9d35bf657fa-b7cc9a7c2ce45d40-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "13665af96538fedc8a1af154c74db8d2", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:41 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:45 GMT", - "mise-correlation-id": "156b6f26-c768-4c11-b117-baa938fc66bb", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/ef4cbf6e-2e0b-4f8f-87c1-29cc69a9d49e/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211645Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cr64", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "ef4cbf6e-2e0b-4f8f-87c1-29cc69a9d49e" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/ef4cbf6e-2e0b-4f8f-87c1-29cc69a9d49e/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-872495a9c1a9d648936a7c929e375796-0bde3c3cfd718d42-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a7c92646d0d492e029b54890c856d181", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:42 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:45 GMT", - "mise-correlation-id": "5aa2bc53-05c9-46c6-9a8d-fa44a8a8b40b", - "Retry-After": "60", - "x-azure-ref": "20221110T211645Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cr8n", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "ef4cbf6e-2e0b-4f8f-87c1-29cc69a9d49e", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "122516948", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,True,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,True,False)Async.json deleted file mode 100644 index 87e8af27cf026..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,True,False)Async.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "280", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-8fe3ab284a20cb4c878ace33deed14f9-f20d580e543ef644-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "fae19a1cd65429683530a76b61ecf3f3", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:42 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:45 GMT", - "mise-correlation-id": "25d6204b-240d-4ad9-91d1-89738790c05a", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/05a62a86-b1e9-4199-94c7-f8fd42363df1/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211645Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cr9z", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "05a62a86-b1e9-4199-94c7-f8fd42363df1" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/05a62a86-b1e9-4199-94c7-f8fd42363df1/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-d0e9b10725fbd542bdcc2a39946a3cd7-f1a5203651d94e4a-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "490a7649685f30ee74b336934c9757d4", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:42 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:45 GMT", - "mise-correlation-id": "0ac28d8c-c805-4cac-bdb9-3d58f2d9557e", - "Retry-After": "60", - "x-azure-ref": "20221110T211645Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crbv", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "05a62a86-b1e9-4199-94c7-f8fd42363df1", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "955573853", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,True,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,True,True)Async.json deleted file mode 100644 index fe2dc518ed6e4..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsync(True,True,True)Async.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "352", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-ae5d474027e5654daeb2d4476a2f438e-2c44c729a2085849-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "34843d46af8b98e187bbacab30a14a76", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:42 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:46 GMT", - "mise-correlation-id": "71267ea8-795c-4b37-8184-e51cfef09cd7", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/a676bef8-0e78-4995-8995-772acb95a3f4/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211645Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crd7", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "a676bef8-0e78-4995-8995-772acb95a3f4" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/a676bef8-0e78-4995-8995-772acb95a3f4/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-50c9b90f0984ea4a8a0a9cb91bf112e2-0786d7308a8b4347-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "93645b31a7c3ff387155adb972ebffd4", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:42 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:46 GMT", - "mise-correlation-id": "4591bd17-c02e-413f-ab46-3dbd2cda4be9", - "Retry-After": "60", - "x-azure-ref": "20221110T211646Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crf0", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "a676bef8-0e78-4995-8995-772acb95a3f4", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1993088664", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsyncAsync.json deleted file mode 100644 index cdd739087d816..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/GetSendStatusAsyncAsync.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "210", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-809c517d658c0444e6f91f2c802f0c9a-995ce00ab2035770-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20220912.1 (.NET 6.0.8; Microsoft Windows 10.0.25197)", - "x-ms-client-request-id": "8a3a93dfa723050d5e73b91a39c4350e", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Mon, 12 Sep 2022 21:52:40 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Content-Length": "0", - "Date": "Mon, 12 Sep 2022 21:52:43 GMT", - "mise-correlation-id": "734d2463-c0a4-4c84-b323-190eed330fdd", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/ed9303ac-a8ec-4630-90fd-dba0b65c9c65/status", - "Repeatability-Result": "accepted", - "X-Azure-Ref": "0K6ofYwAAAADs3aP7e3VpSqR9e4M2iwfwQk9TMzIxMDAwMTA5MDA5ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "ed9303ac-a8ec-4630-90fd-dba0b65c9c65" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/ed9303ac-a8ec-4630-90fd-dba0b65c9c65/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-db83c429057d851e963b234faf0eabe1-23e5199f689aebce-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20220912.1 (.NET 6.0.8; Microsoft Windows 10.0.25197)", - "x-ms-client-request-id": "2c94e9cb013bdfbdd402987e6d7e7618", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Mon, 12 Sep 2022 21:52:41 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 12 Sep 2022 21:52:44 GMT", - "mise-correlation-id": "e2c01992-8c26-4672-8b2a-a2c1ce74acfd", - "Retry-After": "60", - "X-Azure-Ref": "0LKofYwAAAAC0opaX77yyQaEkwCfQ//3zQk9TMzIxMDAwMTA5MDA5ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "ed9303ac-a8ec-4630-90fd-dba0b65c9c65", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "627394223", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,False,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,False,True).json deleted file mode 100644 index 5a3578aa18e83..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,False,True).json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "220", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b0a31e8bbc9bb3037ece0e6ce10899b0", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:39 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:42 GMT", - "mise-correlation-id": "9b08f76b-7a53-41e6-8102-a4a594a27401", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/271ba0f9-becb-4af4-94f5-ddea537d5aea/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211642Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqdc", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "271ba0f9-becb-4af4-94f5-ddea537d5aea" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1200071730", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,True,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,True,False).json deleted file mode 100644 index 2ae52810af10b..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,True,False).json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "218", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "3e42a3ad5a1148e6ad13248a4a72d5a0", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:39 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:42 GMT", - "mise-correlation-id": "1eb42fe0-37e9-4c74-9841-23e424f2b015", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/8c54c0b9-8af2-4dd6-9306-7a5de0bd716f/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211642Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqbh", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "8c54c0b9-8af2-4dd6-9306-7a5de0bd716f" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "985407182", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,True,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,True,True).json deleted file mode 100644 index 063256772ce8a..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(False,True,True).json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "290", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "de4196963abb2dd1cd2a92d2a040d67e", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:39 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:43 GMT", - "mise-correlation-id": "0254c35c-7082-4908-9fe8-7c3ad7f27b5b", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/ae2cdc21-4fd5-42e7-8281-d7cc82d80b79/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211642Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqf7", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "ae2cdc21-4fd5-42e7-8281-d7cc82d80b79" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "536879295", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,False,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,False,False).json deleted file mode 100644 index 0cdd406f65cd6..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,False,False).json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "210", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "28aa02f848dcefe31a0cf5f47ac2e587", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:39 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:42 GMT", - "mise-correlation-id": "eca7bada-bfcc-4ccf-8745-bc2035e4b8fa", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/332d9875-d424-4354-9d53-1c9fdcb2a02e/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211642Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cq9q", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "332d9875-d424-4354-9d53-1c9fdcb2a02e" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "583997842", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,False,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,False,True).json deleted file mode 100644 index e4a572b348335..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,False,True).json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "282", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "0202a1b422b1f08d983fc0d98fb44d4b", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:39 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:43 GMT", - "mise-correlation-id": "e10e6297-6302-48e5-b78e-6c956cb37210", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/25cff0ac-d214-49fa-9c24-11ce0015b8f3/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211643Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqhe", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "25cff0ac-d214-49fa-9c24-11ce0015b8f3" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "706388308", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,True,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,True,False).json deleted file mode 100644 index acddbb0fa4455..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,True,False).json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "280", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "048558b7689e8ecdeb6d7a697b72107f", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:40 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:43 GMT", - "mise-correlation-id": "17330042-9cb8-42c7-8a32-b04a1ff45651", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/d3b0998e-7d02-4c78-ad1f-f93413375aea/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211643Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqm9", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "d3b0998e-7d02-4c78-ad1f-f93413375aea" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1674370746", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,True,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,True,True).json deleted file mode 100644 index 0e5288d92f695..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail(True,True,True).json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "352", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "03a9b22210f35eee758f2a8a9da153c0", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:40 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:43 GMT", - "mise-correlation-id": "911c3038-20e7-492f-9b6e-0a018cb72d03", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/5ef27eef-5d16-4229-9fea-f90580e581d9/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211643Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cqpk", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "5ef27eef-5d16-4229-9fea-f90580e581d9" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1341605146", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail.json deleted file mode 100644 index 2f03b302fa694..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmail.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "210", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20220912.1 (.NET 6.0.8; Microsoft Windows 10.0.25197)", - "x-ms-client-request-id": "520671bf2f3a28ae0c4158615bd872bb", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Mon, 12 Sep 2022 21:52:39 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Content-Length": "0", - "Date": "Mon, 12 Sep 2022 21:52:43 GMT", - "mise-correlation-id": "0ae349e7-8e80-4639-b4da-8660c70668af", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/5d0e9da8-8369-4a6f-8d48-5f24701e7722/status", - "Repeatability-Result": "accepted", - "X-Azure-Ref": "0KqofYwAAAAASq/wqmYd2TqGvLjX9OlvyQk9TMzIxMDAwMTA5MDA5ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "5d0e9da8-8369-4a6f-8d48-5f24701e7722" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1106066170", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForExistingOperation.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForExistingOperation.json new file mode 100644 index 0000000000000..2e688eb1a127a --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForExistingOperation.json @@ -0,0 +1,129 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "4c49d2dd5b85c626a73e2ba957193e28", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:51:04 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:51:04 GMT", + "mise-correlation-id": "a3a3ccf9-8e72-4875-a43e-a7ba40cb3eba", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "06fv3YwAAAACYC2uf7lo7RZBJxwXpZcOdUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "1ed07230-a740-4e5e-adc2-11cc90f5ade6", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "9c2cce68613e2c76b0e89b0921bd1f6b", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:51:04 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:51:04 GMT", + "mise-correlation-id": "702ee6e0-9936-4232-92f1-aea85120a0eb", + "Retry-After": "30", + "X-Azure-Ref": "06fv3YwAAAADPxEQ7/Kr6So3wTUSURXAGUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "1ed07230-a740-4e5e-adc2-11cc90f5ade6", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "e12faa3edb81dee181bb10b28f348172", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:51:35 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:51:34 GMT", + "mise-correlation-id": "b0a65668-b1f4-4992-8aac-085b3152461e", + "X-Azure-Ref": "0B/z3YwAAAABDWk2oAKblTofvv5fg//Z0UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "1ed07230-a740-4e5e-adc2-11cc90f5ade6", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "391650543", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForExistingOperationAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForExistingOperationAsyncAsync.json new file mode 100644 index 0000000000000..71c44a6a95889 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForExistingOperationAsyncAsync.json @@ -0,0 +1,132 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-3c5d83688ebd4c2843d2748585c18459-207d7776ef994732-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "a750f475db56c7c55afbbe74744c977e", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:07 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:07 GMT", + "mise-correlation-id": "26b1f4ab-ada8-4618-94e8-3d90c4c48457", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "02/z3YwAAAAAIQ9fIzHSpQYCZ9ePPItBAUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "48277a7a-0e97-4986-8104-3346deada9de", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-ba0e0fd77ed9550bf183a966cbdf947e-c44c3033b4f21ef8-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "94358c8c0fbc766297643479c45c8f2b", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:07 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:07 GMT", + "mise-correlation-id": "cfc8a83b-4a94-42cb-b9a4-dd4a9be2d9e3", + "Retry-After": "30", + "X-Azure-Ref": "02/z3YwAAAADqKyGoI\u002BvoR6VARcf2xp2tUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "48277a7a-0e97-4986-8104-3346deada9de", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-2027935ccc803fe9d05421a4d64301d5-7c8d6d0ad2eb2f43-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "fa4260448183be06c6a98f89854ac90f", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:37 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:37 GMT", + "mise-correlation-id": "bde1a5c1-9b74-4966-9acf-0d193b4a3a31", + "X-Azure-Ref": "0\u002Bfz3YwAAAACIy1tE\u002BzHaQ5mM4AlJdaMPUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "48277a7a-0e97-4986-8104-3346deada9de", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "455588648", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,False,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,False,True).json new file mode 100644 index 0000000000000..e48d5295b516d --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,False,True).json @@ -0,0 +1,118 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "233", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "1ed80db8c98107992982ce561b7b796c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:48:33 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:48:32 GMT", + "mise-correlation-id": "9447d343-d0d2-4494-8061-c44c83f75ea3", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0Ufv3YwAAAADLcNBHko\u002B\u002BSqawlI3jkawSUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "2047dfa7-2040-4313-90ab-32f4c5df7942", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "864f0fbb1fab6edf1ef614349a151ae0", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:48:33 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:48:32 GMT", + "mise-correlation-id": "fa989b99-37f8-4a07-92ca-45787bf5f384", + "Retry-After": "30", + "X-Azure-Ref": "0Ufv3YwAAAADaigDo\u002BX\u002BaRaedERyIbv0HUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "2047dfa7-2040-4313-90ab-32f4c5df7942", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "c2fae901396f6320ccc60c97e9f29a89", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:49:03 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:49:02 GMT", + "mise-correlation-id": "21214663-45dc-438d-8d7f-2384ae51cc1a", + "X-Azure-Ref": "0b/v3YwAAAADKnPrJGGw6SrndZJAxejrGUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "2047dfa7-2040-4313-90ab-32f4c5df7942", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1780381497", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,True,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,True,False).json new file mode 100644 index 0000000000000..9665b6498aa0b --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,True,False).json @@ -0,0 +1,118 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "231", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "2b31c7ebea1ba4127740285026faa93a", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:48:02 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:48:02 GMT", + "mise-correlation-id": "cd93d8e5-15c5-41d9-b0dd-9bcb4ee165e1", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0M/v3YwAAAABPpNtz\u002Bl5aQ7Z52d4Dw4aeUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "bf969f73-685d-4bd7-a045-d91cba270b07", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "7280f2343e8e7ad43c21594fc63d2424", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:48:03 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:48:02 GMT", + "mise-correlation-id": "d2c6fd56-c90c-4b70-b347-9b01a3c8f79e", + "Retry-After": "30", + "X-Azure-Ref": "0M/v3YwAAAAAbdb/\u002B2WHGQ7BJyYu0i/HiUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "bf969f73-685d-4bd7-a045-d91cba270b07", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "7b1db3abc2a2523a3812f28f4c2f4807", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:48:33 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:48:32 GMT", + "mise-correlation-id": "a6eb8924-e863-4655-975f-67dae7eb77db", + "X-Azure-Ref": "0Ufv3YwAAAAAqwNZC5bjUSapPHhLXoHSsUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "bf969f73-685d-4bd7-a045-d91cba270b07", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "648605900", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,True,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,True,True).json new file mode 100644 index 0000000000000..6a6513b3e998f --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(False,True,True).json @@ -0,0 +1,124 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "305", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "9efca5cc88257fcb0debf7c92786a8f4", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:49:03 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:49:03 GMT", + "mise-correlation-id": "949558bb-232e-4d75-a432-82c891340277", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0b/v3YwAAAABHJSyESJOaSIKJgSGI6BrXUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "5c9f01f5-a75a-4aa3-bacc-a0ca6c846603", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "569af1dfa1e9c425c82dc94066048718", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:49:03 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:49:03 GMT", + "mise-correlation-id": "2bfb9993-ba43-44db-b148-a0698ddde7c5", + "Retry-After": "30", + "X-Azure-Ref": "0b/v3YwAAAADlAchj7wyKQri0P/odjPIpUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "5c9f01f5-a75a-4aa3-bacc-a0ca6c846603", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "cac5ca1e725cc7b45dda953a3cf3729f", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:49:33 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:49:33 GMT", + "mise-correlation-id": "e4bca219-f835-413e-a2be-612f9ed7111b", + "X-Azure-Ref": "0jfv3YwAAAACICQj3VvNbSpcjkzyOY2S8UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "5c9f01f5-a75a-4aa3-bacc-a0ca6c846603", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1202303713", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,False,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,False,False).json new file mode 100644 index 0000000000000..94ffa41c68194 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,False,False).json @@ -0,0 +1,117 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "223", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "3b3c8f18366bb3ea5df2374e67f10ca9", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:47:31 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:47:32 GMT", + "mise-correlation-id": "01e81a4a-5cd9-498b-a9ff-c9dbcd52e8b0", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0FPv3YwAAAADtIKP4/joKS5/6lDkz8/ytUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "9b6f1834-1e73-424c-9d69-74d80f7202ed", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "e1667f256105dc055b1a1eeb423e7763", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:47:32 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:47:32 GMT", + "mise-correlation-id": "fe99ae3a-982d-45e9-ab67-b45bd78eac39", + "Retry-After": "30", + "X-Azure-Ref": "0FPv3YwAAAAB0Bj3jUx/fQaFR3hXcfHq0UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "9b6f1834-1e73-424c-9d69-74d80f7202ed", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "5007deafbd73ad720da9b11cc7cb0e6f", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:48:02 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:48:02 GMT", + "mise-correlation-id": "4328b986-f3a5-4a78-80f6-a3146a3154d4", + "X-Azure-Ref": "0Mvv3YwAAAAAcXZ0/g76NQ5g0O4GN4ibmUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "9b6f1834-1e73-424c-9d69-74d80f7202ed", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1465129956", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,False,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,False,True).json new file mode 100644 index 0000000000000..2d7cbbe3113cf --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,False,True).json @@ -0,0 +1,123 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "297", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "52c4be2b86e9b6f4c7701e6df943fe6d", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:49:33 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:49:33 GMT", + "mise-correlation-id": "e777acd8-667c-45b2-9cbd-0e9adfd669d6", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0jvv3YwAAAABDv2ZZFnGUTpJ6RNanYTyEUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "b76d317b-109e-4ac5-a0bd-a697a05cd2b5", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "513a46778329ab525da537916676fd67", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:49:34 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:49:33 GMT", + "mise-correlation-id": "0b11211e-ac94-4a34-a4ac-be6faba8b8a4", + "Retry-After": "30", + "X-Azure-Ref": "0jvv3YwAAAACJKdZcfchHR4b2iVgiCm51UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "b76d317b-109e-4ac5-a0bd-a697a05cd2b5", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "a2c72d619b7017dc9b3f63e0c7bdce87", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:50:04 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:50:03 GMT", + "mise-correlation-id": "7b553bf2-3d48-40fb-bfe1-e39d1e9a2164", + "X-Azure-Ref": "0rPv3YwAAAADnxau\u002B/jP1TL746X5nHmXHUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "b76d317b-109e-4ac5-a0bd-a697a05cd2b5", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1386245082", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,True,False).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,True,False).json new file mode 100644 index 0000000000000..eac9e491b4a63 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,True,False).json @@ -0,0 +1,123 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "295", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "5414dcaa7b72d76788d11029aa41322c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:50:04 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:50:03 GMT", + "mise-correlation-id": "81a8975d-1bc0-4e53-ad69-d4a4f0737754", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0rPv3YwAAAAAbwTK1M0vORbsBPF80kZD5UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "e77e2db1-2796-4f1c-8648-d3b4bce12840", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "7579c477db7a8e4fe82520ec4fbe77cf", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:50:04 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:50:03 GMT", + "mise-correlation-id": "e0d570b8-736c-423c-912d-539646358fd6", + "Retry-After": "30", + "X-Azure-Ref": "0rPv3YwAAAADu7drybN8UQr4zbuL\u002BSJmnUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "e77e2db1-2796-4f1c-8648-d3b4bce12840", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "d3b1a2db5d7d16b5da6ea159c507ec31", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:50:34 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:50:33 GMT", + "mise-correlation-id": "10e48ba8-2989-44b4-a0a1-caef2a8048fb", + "X-Azure-Ref": "0yvv3YwAAAAAfGVfC4x67SZXdkLqoHI1uUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "e77e2db1-2796-4f1c-8648-d3b4bce12840", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1775159023", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,True,True).json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,True,True).json new file mode 100644 index 0000000000000..009d731411cc8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPolling(True,True,True).json @@ -0,0 +1,129 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "1162f44454bde808bafa33d525288760", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:50:34 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:50:34 GMT", + "mise-correlation-id": "f0ab0456-f96b-4334-b92e-d62add478562", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0yvv3YwAAAADAfJl5HYNETqwquI\u002BqsKq4UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "158bd57a-3f14-4c22-9a09-1afa9e86202b", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "85a0dc5a92d5897f054dc8cae7084d97", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:50:34 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:50:34 GMT", + "mise-correlation-id": "ad01a771-db24-4b7a-a0cd-0688a2a5f1cf", + "Retry-After": "30", + "X-Azure-Ref": "0yvv3YwAAAAA1M2ToSiCPRLGpS7VGslNXUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "158bd57a-3f14-4c22-9a09-1afa9e86202b", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "ac3dc54f6ab59c851f16fa428346efa2", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:51:04 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:51:04 GMT", + "mise-correlation-id": "1064f82b-f64d-4772-adb0-3f0a53251eec", + "X-Azure-Ref": "06Pv3YwAAAAABob1jFgoSRo5g6bAQTckmUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "158bd57a-3f14-4c22-9a09-1afa9e86202b", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1255654472", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,False,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,False,True)Async.json new file mode 100644 index 0000000000000..76cc00cdde335 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,False,True)Async.json @@ -0,0 +1,121 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "233", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-24e96128fa5178ee5a4cc96eb8c501a7-59919d1089cf9f43-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "3c528051b00bbbeb31954d6bbfc0d8af", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:52:35 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:52:36 GMT", + "mise-correlation-id": "c0420757-1fca-4bcd-9303-174b14c2a7ed", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0RPz3YwAAAACiPaLcwFkVQpM2k2CySOqtUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "754ed271-4276-48e9-b803-d38d5a1bed59", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-24e96128fa5178ee5a4cc96eb8c501a7-d50162f8f277e02e-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "02cbf9fdc3eb04481a6f5a3a800258ea", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:52:36 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:52:36 GMT", + "mise-correlation-id": "dba39edd-95df-4d57-b0fb-048de59ce00f", + "Retry-After": "30", + "X-Azure-Ref": "0RPz3YwAAAABX8AVz79fjT5GXAvk6u862UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "754ed271-4276-48e9-b803-d38d5a1bed59", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-24e96128fa5178ee5a4cc96eb8c501a7-b7f70cfbcc5dc1b7-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "c47b386e21809608a1851965671be076", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:53:06 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:53:06 GMT", + "mise-correlation-id": "dd042a75-55f5-439d-94c9-61ef010fa1ed", + "X-Azure-Ref": "0Yvz3YwAAAACDiO/AcBcmSZe4pDkMC4knUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "754ed271-4276-48e9-b803-d38d5a1bed59", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1597283122", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,True,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,True,False)Async.json new file mode 100644 index 0000000000000..2772cd6b36018 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,True,False)Async.json @@ -0,0 +1,121 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "231", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-efa8029d505246f8f51ba0ef00155154-7745747f5f0c126d-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "1694743a66fb864d24d712c6777524bb", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:52:05 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:52:04 GMT", + "mise-correlation-id": "26a7ad38-05d0-4ede-826f-faa3d6273c41", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0Jfz3YwAAAACpPD7NcID2Qbp4uj5yCcgEUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "0794edc6-75ee-446e-a392-0a1419a22134", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-efa8029d505246f8f51ba0ef00155154-0d10be0e7ff4cb22-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "1eda39a79022fedbac8fc4cc37cc5ca7", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:52:05 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:52:05 GMT", + "mise-correlation-id": "c24f8624-3b24-4132-a26d-ec4740135eba", + "Retry-After": "30", + "X-Azure-Ref": "0Jfz3YwAAAABKBeC8t6fGT492g6sr9PBBUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "0794edc6-75ee-446e-a392-0a1419a22134", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-efa8029d505246f8f51ba0ef00155154-ca0f61d4c8dada71-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "556df12893effa89bc58f4428d993adf", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:52:35 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:52:36 GMT", + "mise-correlation-id": "06abdd55-2fee-4189-bba4-29bb9ceca964", + "X-Azure-Ref": "0RPz3YwAAAACZ9YawfMQsSKygY1T7wqvRUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "0794edc6-75ee-446e-a392-0a1419a22134", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "227576577", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,True,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,True,True)Async.json new file mode 100644 index 0000000000000..9e6baac565874 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(False,True,True)Async.json @@ -0,0 +1,127 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "305", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-9ded47e93b3ce5ad35ffa49ee362ad6e-7dff471590fa3019-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "045b405c5325319b615f0e33545a2947", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:53:06 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:53:06 GMT", + "mise-correlation-id": "880db9ac-2b2d-4c90-b9d4-9392c445909c", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0Yvz3YwAAAABxvKc5hakoR6CIJVqvRzlnUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "0831d526-bd82-460e-96dd-4cfaac44f4bb", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9ded47e93b3ce5ad35ffa49ee362ad6e-73d5ab685981ace4-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "263a260b9737e5ab295e995dbcc23fd4", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:53:06 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:53:06 GMT", + "mise-correlation-id": "90b8d1fb-798e-460a-9b48-9b052c99193b", + "Retry-After": "30", + "X-Azure-Ref": "0Yvz3YwAAAABQVj5Wpy1VTqOLsnVx0DF\u002BUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "0831d526-bd82-460e-96dd-4cfaac44f4bb", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9ded47e93b3ce5ad35ffa49ee362ad6e-bf619cd98be2163d-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "735533225575d43eb7d3bc0205a14a11", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:53:36 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:53:36 GMT", + "mise-correlation-id": "3c7c129e-335d-4ae2-a56e-9472bef6e6e1", + "X-Azure-Ref": "0gPz3YwAAAAB/CLEiNHHtRbegOGbT5tMGUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "0831d526-bd82-460e-96dd-4cfaac44f4bb", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "872907879", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,False,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,False,False)Async.json new file mode 100644 index 0000000000000..29b4597e5a25c --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,False,False)Async.json @@ -0,0 +1,120 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "223", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-d78ab6056b85111c8898bf23609ba144-d4d803f6529ff08c-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "941f9229e55cd5bd637b05a27bc909ed", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:51:35 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:51:34 GMT", + "mise-correlation-id": "0df9150d-528e-4dd7-ab1a-f22ecf1459ef", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0B/z3YwAAAACdZ7KViof0S58FAlKqv53IUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "7cef8edc-77cd-4ddc-a010-400449848e5b", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-d78ab6056b85111c8898bf23609ba144-beebb5ec18238fd0-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "7eda0f2aeafd9dd724e005ba143446ad", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:51:35 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:51:34 GMT", + "mise-correlation-id": "9b6812e2-d8eb-442d-b488-f68138002c24", + "Retry-After": "30", + "X-Azure-Ref": "0B/z3YwAAAAAM0x3LShNsT46xZpWD1GfcUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "7cef8edc-77cd-4ddc-a010-400449848e5b", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-d78ab6056b85111c8898bf23609ba144-3e56b8a0c8ef3c24-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "dcf8c9c844b7d05335983a22b3ef8ced", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:52:05 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:52:04 GMT", + "mise-correlation-id": "9356e90c-fb16-4baa-817b-23dba94254a1", + "X-Azure-Ref": "0Jfz3YwAAAABXXVre9rJNQ7c8MCDumJ2zUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "7cef8edc-77cd-4ddc-a010-400449848e5b", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1187071564", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,False,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,False,True)Async.json new file mode 100644 index 0000000000000..a9a9cfe37effa --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,False,True)Async.json @@ -0,0 +1,126 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "297", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-9a01fbfa8431a7339687d8136943cfce-3400791c63b1ffbe-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "1536a1b0ebcd9c6c22468d3d7342b28c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:53:36 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:53:36 GMT", + "mise-correlation-id": "f719e000-aff9-4b62-850e-2e625b8206f6", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0gPz3YwAAAACJWK24mPjBRbSJk7feZJ71UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "7d6fb6b6-0ce5-430e-9375-1910336f30bc", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9a01fbfa8431a7339687d8136943cfce-bfc4bcd6c392d959-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "99febaf046a986ad6685cf01df1ff8a3", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:53:36 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:53:36 GMT", + "mise-correlation-id": "1fcf7400-5359-4edf-bf8b-1e1786c05c1a", + "Retry-After": "30", + "X-Azure-Ref": "0gPz3YwAAAAAPNO/3IHdiQpYHM7GDibwzUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "7d6fb6b6-0ce5-430e-9375-1910336f30bc", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9a01fbfa8431a7339687d8136943cfce-25cf41168f2c0eeb-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "25e8365d142c90f648e25ad6c04e6f08", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:54:06 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:54:06 GMT", + "mise-correlation-id": "32319ceb-fa72-49c5-a67f-64c89c97613c", + "X-Azure-Ref": "0nvz3YwAAAABMKTVutUsPQIBM8E8b9WN2UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "7d6fb6b6-0ce5-430e-9375-1910336f30bc", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "80464831", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,True,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,True,False)Async.json new file mode 100644 index 0000000000000..6221979c2f0b7 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,True,False)Async.json @@ -0,0 +1,126 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "295", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-4f90afe3397843e802ea5822c8caa912-2d3a5b8c456df59a-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "e04079745a58351940dba181d91babe2", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:54:06 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:54:06 GMT", + "mise-correlation-id": "7b213b6e-cbe5-4c06-af6e-914cbe748caf", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0nvz3YwAAAAABjHl66w8wTpTCFDIz/9ZkUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "83ebda3f-cb45-4827-af15-6ed5da909169", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-4f90afe3397843e802ea5822c8caa912-97d672891c4f4abc-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "562be6dc528e279029bb1db7c9c98460", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:54:06 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:54:07 GMT", + "mise-correlation-id": "2836f4a6-77f6-4782-8159-6f1ca7aecff5", + "Retry-After": "30", + "X-Azure-Ref": "0n/z3YwAAAADNjH2XIh26SaBx5HjmpgPRUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "83ebda3f-cb45-4827-af15-6ed5da909169", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-4f90afe3397843e802ea5822c8caa912-6afd9be794ddc752-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "ab66eb26577556d819f73926d8893916", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:54:37 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:54:37 GMT", + "mise-correlation-id": "17c813fc-ffe1-4b43-8f18-25d1317cf37b", + "X-Azure-Ref": "0vfz3YwAAAABjbzj\u002BFgcrS4YnImWQ3681UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "83ebda3f-cb45-4827-af15-6ed5da909169", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "649446321", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,True,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,True,True)Async.json new file mode 100644 index 0000000000000..bea0677e9b7a5 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithAutomaticPollingAsync(True,True,True)Async.json @@ -0,0 +1,132 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-48c59a1b5fd564aa3f25d85b58b69bc0-099d40b2659f00a4-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "b80a27a380461d79d85aa55b0011aec2", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:54:37 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:54:37 GMT", + "mise-correlation-id": "9a79ca66-ce0e-4ce6-bc19-274f3fc2ce39", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0vfz3YwAAAAABNqKrBD7kQoSF8rxq85AZUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "81b3becb-391d-4bd6-a8e0-446a47b95d2e", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-48c59a1b5fd564aa3f25d85b58b69bc0-6b7f033fdfc81aa2-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "1c3dae07d329c0d8a924b92ec3db9c6a", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:54:37 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:54:37 GMT", + "mise-correlation-id": "93273d30-a4db-48e5-8278-3d6081279a96", + "Retry-After": "30", + "X-Azure-Ref": "0vfz3YwAAAAD73DdJ0jANT4qZ4s284NKeUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "81b3becb-391d-4bd6-a8e0-446a47b95d2e", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-48c59a1b5fd564aa3f25d85b58b69bc0-888656bcba1116ba-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "d9f36f72d46481c496715f314e3ce486", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:07 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:07 GMT", + "mise-correlation-id": "9805b15c-422c-4d64-aa02-3ca9a572de69", + "X-Azure-Ref": "02/z3YwAAAAAg0iUWqzZVToTTLt5B/eMzUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "81b3becb-391d-4bd6-a8e0-446a47b95d2e", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1161333160", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithManualPollingAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithManualPollingAsyncAsync.json new file mode 100644 index 0000000000000..f8e63dad4d07a --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAndWaitForStatusWithManualPollingAsyncAsync.json @@ -0,0 +1,610 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-1ce60f61c0d2b3aa1e59d117b09bca40-451214c87cca5278-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "420354050f7e1ce97d194a4f55c55616", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:37 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "subject", + "plainText": "Test" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "ToAddress" + } + ], + "cc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "CcAddress" + } + ], + "bcc": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "BccAddress" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:37 GMT", + "mise-correlation-id": "aa873403-ed47-476c-b36f-f424a031fb48", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0\u002Bvz3YwAAAACwl0C6LhgWR7qpCFp\u002Bt5vfUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "b563990d21e7d549b7a7f2627132e0e7", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:37 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:37 GMT", + "mise-correlation-id": "e2c9dc14-2dfa-45dc-99c0-1fcc91a8bfd7", + "Retry-After": "30", + "X-Azure-Ref": "0\u002Bvz3YwAAAABbet1zIYPTSIPOA5Weun0tUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "1c451e4e165fcea97dfaf76a0fbfe93c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:38 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:38 GMT", + "mise-correlation-id": "0705c1fd-76f2-4dc1-8d2a-1f41d500c617", + "Retry-After": "30", + "X-Azure-Ref": "0\u002Bvz3YwAAAADRzgfjEkKQTIwoh9emSdFkUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "03bfa07ea760e31f0a2e8bd61d87aa4a", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:38 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:38 GMT", + "mise-correlation-id": "2b0ba3cf-a7c4-4bac-926d-6e8f7d8d975d", + "Retry-After": "30", + "X-Azure-Ref": "0\u002Bvz3YwAAAAAXDx92jK45SpnajJXxD1XZUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "370063383a80f7b7ef9537ed2adec5f7", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:38 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:38 GMT", + "mise-correlation-id": "13af5023-7d1b-4b8e-a49a-a53877bed207", + "Retry-After": "30", + "X-Azure-Ref": "0\u002Bvz3YwAAAABcf\u002Brros6IQJ\u002B4ohtxu6yzUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "d1e4b5bddd73a786ff6111308ad2b1f6", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:38 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:38 GMT", + "mise-correlation-id": "41924256-0914-4344-a023-515054fa8563", + "Retry-After": "30", + "X-Azure-Ref": "0\u002Bvz3YwAAAAB4L3kT7KNzQZIbQPGzT5eUUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "ac31ac4fb2be44bbe9c813cb6f32b92b", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:38 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:38 GMT", + "mise-correlation-id": "2f1d75a7-deb5-4a6a-90ff-be4423ecf3e5", + "Retry-After": "30", + "X-Azure-Ref": "0\u002Bvz3YwAAAADnH8UhpTKDTLtlz/cU8UnlUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "67199368d9a35bd7dc59381f28866c1c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:38 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:38 GMT", + "mise-correlation-id": "da2fbdc2-1579-44e9-bec7-e65b5f99a7a4", + "Retry-After": "30", + "X-Azure-Ref": "0\u002B/z3YwAAAACnSGQHqMaYToOg7p\u002BTGLHzUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "7d9d41e319ad0b39f99fe7abc9ba38cc", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:39 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:39 GMT", + "mise-correlation-id": "1f1873ba-4ff2-4d1a-b7ff-6701e66b77ca", + "Retry-After": "30", + "X-Azure-Ref": "0\u002B/z3YwAAAAC3X\u002BxeLANvTYWRHOLQ2UL\u002BUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "f7c8e5a849b97553d5d6cf657a9c1b62", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:39 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:39 GMT", + "mise-correlation-id": "571f0d6a-088d-4ca5-bf53-30b38aeded34", + "Retry-After": "30", + "X-Azure-Ref": "0\u002B/z3YwAAAAASNYrAQhPvQ6QW2SY4tidNUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "2de8f65b3b944f7e5a0d6e03f12c9222", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:39 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:39 GMT", + "mise-correlation-id": "ca750c16-7e6a-412d-a6f9-6e6cb8614d19", + "Retry-After": "30", + "X-Azure-Ref": "0\u002B/z3YwAAAACuMnAGb1EARpFZ75WnyqSoUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "42776b2174be9962ed27a8d749d3905d", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:39 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:39 GMT", + "mise-correlation-id": "4f1bccf8-6635-4baf-ade5-e93362ed7bb4", + "Retry-After": "30", + "X-Azure-Ref": "0\u002B/z3YwAAAAD1KC3d7ZMvSYpoc0Hm8Zv1UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "d24f84830ad26c3767789dabdb5083a8", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:39 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:39 GMT", + "mise-correlation-id": "1fc7593d-cc84-4ef9-bc8a-284ca42eae10", + "Retry-After": "30", + "X-Azure-Ref": "0\u002B/z3YwAAAADu42\u002BQImKFTp6x0rw0J01TUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "0e43ad44d925e6a4934f406d92a70586", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:40 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:39 GMT", + "mise-correlation-id": "e1a7d0a8-7693-4924-8472-81adc80949be", + "Retry-After": "30", + "X-Azure-Ref": "0/Pz3YwAAAADMwtZlUPZZRLmDwoEhlAxOUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "6d7f107dbfdc1650330adb45d7b7bd9d", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:40 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:40 GMT", + "mise-correlation-id": "16ff8e5e-7e5d-4d1f-ae08-779d63f1f798", + "Retry-After": "30", + "X-Azure-Ref": "0/Pz3YwAAAAAlWF9q\u002BnswRZte0u0sZTojUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "9c92ffa3828faa37e0693e83cacadabf", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:40 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:40 GMT", + "mise-correlation-id": "2d15aea0-387d-4e08-9234-685db220dcec", + "Retry-After": "30", + "X-Azure-Ref": "0/Pz3YwAAAACS/7cYjkJ4S51Cnanp/ms/UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "ca2e177316d184cc5c2cda1bfe5e0fdc", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:40 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:40 GMT", + "mise-correlation-id": "a9559436-c41b-4d30-b9c5-2ad9fcd75229", + "Retry-After": "30", + "X-Azure-Ref": "0/Pz3YwAAAACuW3FdoPrsQI0zVBVvSJY4UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "93c9a2916814fbf6d9d48c7380cd4c69", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:40 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:40 GMT", + "mise-correlation-id": "eaba70b5-5855-4d76-bf5c-09f74680763f", + "Retry-After": "30", + "X-Azure-Ref": "0/Pz3YwAAAABglkgznsDTTL8iZZ5CtLGHUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "c0d21b30f2888ccc330e4062a71cab81", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:40 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:40 GMT", + "mise-correlation-id": "b619999f-ec08-4bee-a9e8-ba501eb9a48c", + "X-Azure-Ref": "0/fz3YwAAAAAuG\u002BZLHK9ETYlcB0U925BIUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "8a98ebb9-f3bc-4690-a8dc-e433026e337c", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1565828532", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,False,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,False,True)Async.json deleted file mode 100644 index a3280872ddd6d..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,False,True)Async.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "220", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-38c41e69aafbba4296e4fd833ee2658f-a2e48b98dd7d574b-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "0f0cdfdd49b4a84419ae500b77a057e1", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:43 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:46 GMT", - "mise-correlation-id": "23880a97-1d1c-4296-902d-8713463dc9ff", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/07fd48f0-4dc9-4bd7-b55c-6d5244fe5a6d/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211646Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crph", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "07fd48f0-4dc9-4bd7-b55c-6d5244fe5a6d" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1320368722", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,True,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,True,False)Async.json deleted file mode 100644 index b186d8f272e8b..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,True,False)Async.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "218", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-4da961528b29e54cb538965748bfccad-cfa4fa5c81a1cf43-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "459b004ba8c362baeb7cb9fe2be3939c", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:43 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:46 GMT", - "mise-correlation-id": "d8bad6be-26ba-45e1-9e78-eadcbe535626", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/37aa7115-13e8-4815-b103-fd1f3ab7f94b/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211646Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crmu", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "37aa7115-13e8-4815-b103-fd1f3ab7f94b" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "920680381", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,True,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,True,True)Async.json deleted file mode 100644 index d2494b32ef2b1..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(False,True,True)Async.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "290", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-96e5c6f6bf5f4b4292beaed1c1f1c99a-07afaad20842c447-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "81c4b5c845978f0c5547c526d7520c34", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:43 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:46 GMT", - "mise-correlation-id": "be9b2ef6-e88e-4315-9163-e49d1cb2e72d", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/38deada7-0f1f-4342-8703-6a3ddacd8786/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211646Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crrn", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "38deada7-0f1f-4342-8703-6a3ddacd8786" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1828015631", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,False,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,False,False)Async.json deleted file mode 100644 index 0a8b80c7b1a55..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,False,False)Async.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "210", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-65f480ed4c15cd40bbd192daf711c100-b5b3c157fb270641-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "64f1f875a173afc139f281f24980272f", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:42 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:46 GMT", - "mise-correlation-id": "a607fdc2-ef77-4565-9abd-ffd118d3fb92", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/c4e27280-8121-43d6-8732-59d242dbde67/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211646Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crgt", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "c4e27280-8121-43d6-8732-59d242dbde67" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1976672427", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,False,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,False,True)Async.json deleted file mode 100644 index 1b110c314bebc..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,False,True)Async.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "282", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-80257b1d77bc8b4d9521aaed974ec56b-a893e66a03242f43-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a23ed4179f35f12af4454e7feaaf2134", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:43 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:47 GMT", - "mise-correlation-id": "242a90e2-7d8f-4937-b44f-2bacd6129c18", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/b5d11691-853a-452b-bc37-032e2a7dec28/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211647Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crtr", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "b5d11691-853a-452b-bc37-032e2a7dec28" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "827248669", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,True,False)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,True,False)Async.json deleted file mode 100644 index e35922b8d3fd8..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,True,False)Async.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "280", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-7e8933d0658ff2438c07bc10a8896584-b36681f16e104448-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a3af23259e7549b823374a829cd3aa38", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:43 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:47 GMT", - "mise-correlation-id": "e370f026-6e56-4726-97e5-81a4c374d24e", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/161d226c-fc6b-40ed-a10c-11b6255753ee/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211647Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crvc", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "161d226c-fc6b-40ed-a10c-11b6255753ee" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1877900559", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,True,True)Async.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,True,True)Async.json deleted file mode 100644 index 3222e7e752387..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync(True,True,True)Async.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "352", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-05c2f71d81387843b94ecaddcad1d704-2650f3887b52834a-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "ad2d016fe49c423deb9dc93960225a1d", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:44 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ], - "CC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "CcAddress" - } - ], - "bCC": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "BccAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:47 GMT", - "mise-correlation-id": "abbc2db4-22d5-411a-b36e-a888ee869beb", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/96d76c02-dfdc-470a-a697-a6dd1e6dbc5b/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211647Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crx8", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "96d76c02-dfdc-470a-a697-a6dd1e6dbc5b" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2128480955", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync.json deleted file mode 100644 index fa701863afe1f..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsync.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://emailsdktestingacs.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "234", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-953a609304dceca3cbebe47414a71bbf-96d61459fb6b9c7d-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.3-alpha.20220510.1 (.NET 6.0.4; Microsoft Windows 10.0.22616)", - "x-ms-client-request-id": "8ba68d6646cc8b4daea0a230a831919d", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 11 May 2022 01:16:11 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@c9d0862a-c699-4a7b-b840-5e091ce5d628.azurecomm.net", - "content": { - "subject": "subject", - "body": { - "plainText": "Test" - } - }, - "recipients": { - "toRecipients": [ - { - "email": "ACSFunctionalTest@outlook.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Content-Length": "0", - "Date": "Wed, 11 May 2022 01:16:10 GMT", - "Operation-Location": "https://emailsdktestingacs.communication.azure.com/emails/8a1005fd-31a6-4faf-8635-e9efa33d8fd5/status", - "Repeatability-Result": "accepted", - "X-Azure-Ref": "0Ww57YgAAAAD87nJw6aFGTYwfCMQVRvG9V1NURURHRTA4MjEAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "8a1005fd-31a6-4faf-8635-e9efa33d8fd5" - }, - "ResponseBody": null - } - ], - "Variables": { - "AZURE_MANAGED_FROM_EMAIL_ADDRESS": "DoNotReply@c9d0862a-c699-4a7b-b840-5e091ce5d628.azurecomm.net", - "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://emailsdktestingacs.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1204507529", - "TO_EMAIL_ADDRESS": "ACSFunctionalTest@outlook.com" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsyncAsync.json deleted file mode 100644 index 00edaf3c44f66..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/EmailClientLiveTests/SendEmailAsyncAsync.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "210", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-33a5c135a738bfb5f1af059f16b8b0e4-9a35c3eb6e1ba236-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20220912.1 (.NET 6.0.8; Microsoft Windows 10.0.25197)", - "x-ms-client-request-id": "7b007851a41a644753195db691f93b47", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Mon, 12 Sep 2022 21:52:41 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "subject", - "plainText": "Test" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "ToAddress" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Content-Length": "0", - "Date": "Mon, 12 Sep 2022 21:52:44 GMT", - "mise-correlation-id": "44f54a0e-84de-45da-b587-5e9bbba4db28", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/e8de615e-e5fa-45c0-90e6-3931616f8380/status", - "Repeatability-Result": "accepted", - "X-Azure-Ref": "0LKofYwAAAABPS64OGP9uSrhzTTJM/e4\u002BQk9TMzIxMDAwMTA5MDA5ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "e8de615e-e5fa-45c0-90e6-3931616f8380" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "427109199", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/GetSendEmailStatus.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/GetSendEmailStatus.json deleted file mode 100644 index 69354874d2637..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/GetSendEmailStatus.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "238", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "d1c4fac69c006d76516a6130b4a070b6", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:44 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "This is the subject", - "plainText": "This is the body" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "Customer Name" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:47 GMT", - "mise-correlation-id": "1dfa0811-c701-4121-850a-dfcc1f87a377", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/1a520033-d58f-41a5-b3fb-ce78a4ef5d4a/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211647Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002crzg", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "1a520033-d58f-41a5-b3fb-ce78a4ef5d4a" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/1a520033-d58f-41a5-b3fb-ce78a4ef5d4a/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b46fb729f6523ae75c8ca67672416cd0", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:44 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:47 GMT", - "mise-correlation-id": "c0ab023d-5618-43ac-b970-17fcff4acba2", - "Retry-After": "60", - "x-azure-ref": "20221110T211647Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cs13", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "1a520033-d58f-41a5-b3fb-ce78a4ef5d4a", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1676804546", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmail.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmail.json deleted file mode 100644 index 63bded3215198..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmail.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "238", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "c0d34d2fee218e4fe0d33380ca3d8984", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:44 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "This is the subject", - "plainText": "This is the body" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "Customer Name" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:48 GMT", - "mise-correlation-id": "4a621b45-1ef8-49c5-ae45-7870f770958c", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/726ad07c-c365-4981-a740-c8982ad78d4c/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211648Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cs2n", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "726ad07c-c365-4981-a740-c8982ad78d4c" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1593755159", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailAsyncAsync.json deleted file mode 100644 index fb301898139ed..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailAsyncAsync.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://emailsdktestingacs.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "262", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-1308113a5e1333b547a457a253fb3a8a-65af3da5f13624cb-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20220512.1 (.NET 6.0.4; Microsoft Windows 10.0.22616)", - "x-ms-client-request-id": "f32456e0d9987bc6764a2047486e5f1f", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 12 May 2022 21:15:26 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@c9d0862a-c699-4a7b-b840-5e091ce5d628.azurecomm.net", - "content": { - "subject": "This is the subject", - "body": { - "plainText": "This is the body" - } - }, - "recipients": { - "toRecipients": [ - { - "email": "ACSFunctionalTest@outlook.com", - "displayName": "Customer Name" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Content-Length": "0", - "Date": "Thu, 12 May 2022 21:15:26 GMT", - "Operation-Location": "https://emailsdktestingacs.communication.azure.com/emails/13c789bd-2e95-40ce-8c53-b91a016bc649/status", - "Repeatability-Result": "accepted", - "X-Azure-Ref": "07nh9YgAAAABmGgAAwcb7SLuTJYaYIF3fV1NURURHRTA4MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "13c789bd-2e95-40ce-8c53-b91a016bc649" - }, - "ResponseBody": null - } - ], - "Variables": { - "AZURE_MANAGED_FROM_EMAIL_ADDRESS": "DoNotReply@c9d0862a-c699-4a7b-b840-5e091ce5d628.azurecomm.net", - "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://emailsdktestingacs.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "246435571", - "TO_EMAIL_ADDRESS": "ACSFunctionalTest@outlook.com" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailToMultipleRecipients.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailToMultipleRecipients.json index ea48d2b4aa629..955619e988937 100644 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailToMultipleRecipients.json +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailToMultipleRecipients.json @@ -1,55 +1,55 @@ { "Entries": [ { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "588", + "Content-Length": "708", "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "2992586e1f85f9afac65cc469208f9a8", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "68247617eafdce18e7ad0c53aeeb15a6", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:44 GMT", + "x-ms-date": "Thu, 23 Feb 2023 23:55:41 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", "content": { "subject": "This is the subject", - "plainText": "This is the body" + "plainText": "This is the body", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" }, "recipients": { "to": [ { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" }, { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" } ], - "CC": [ + "cc": [ { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" }, { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" } ], - "bCC": [ + "bcc": [ { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" }, { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" } ] @@ -57,24 +57,86 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:48 GMT", - "mise-correlation-id": "e6440dce-55ae-4e17-9f97-b348ea1346da", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/ed719bef-c02e-45c8-871b-5eddf0a25549/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211648Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cs45", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "ed719bef-c02e-45c8-871b-5eddf0a25549" + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:40 GMT", + "mise-correlation-id": "c8cb41d7-f3c5-45d6-97b1-dd2be9eb2dbf", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0/fz3YwAAAACaSDLct0GgQpqLkqkvPX6yUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" }, - "ResponseBody": null + "ResponseBody": { + "id": "b6eb5bc4-6bd8-4767-abf7-774b75a3f0cd", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "59a02dc0aef3d64cc91dc397f4b81d0c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:55:41 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:55:41 GMT", + "mise-correlation-id": "1f4dd610-20dc-4972-bdb4-4904a2698f07", + "Retry-After": "30", + "X-Azure-Ref": "0/fz3YwAAAADygJlENBXKS7lQMQILs9ltUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "b6eb5bc4-6bd8-4767-abf7-774b75a3f0cd", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "b0431e031e21a9602bdfd4ac980ac15c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:56:11 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:56:11 GMT", + "mise-correlation-id": "da371d43-b923-41c4-9f24-7b3c2fb4f577", + "X-Azure-Ref": "0G/33YwAAAAC5y1/oFjo9Qoa\u002BdhTZirEDUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "b6eb5bc4-6bd8-4767-abf7-774b75a3f0cd", + "status": "Succeeded", + "error": null + } } ], "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "185082064", + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "2028047750", "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" } } diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailWithAttachment.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailWithAttachment.json index 9d1483ebeae85..03c24aa958333 100644 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailWithAttachment.json +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailWithAttachment.json @@ -1,63 +1,155 @@ { "Entries": [ { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "347", + "Content-Length": "469", "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "88d228a293d2ef0b7208ff32483df355", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "223d2e4639b24e2bb42edf931c7956c5", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:45 GMT", + "x-ms-date": "Thu, 23 Feb 2023 23:56:11 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", "content": { "subject": "This is the subject", - "plainText": "This is the body" + "plainText": "This is the body", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" }, "recipients": { "to": [ { - "email": "acseaastesting@gmail.com", - "displayName": "Customer Name" + "address": "acseaastesting@gmail.com", + "displayName": "" } ] }, "attachments": [ { "name": "Attachment.txt", - "attachmentType": "txt", - "contentBytesBase64": "VGhpcyBpcyBhIHRlc3Q=" + "contentType": "text/plain", + "contentInBase64": "VGhpcyBpcyBhdHRhY2htZW50IGZpbGUgY29udGVudC4=" } ] }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:48 GMT", - "mise-correlation-id": "fefa9981-9744-4673-a137-92d48e5977bc", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/dbfe2d0d-5e7c-46c0-9eb2-d7649b2e39b1/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211648Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cs5q", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "dbfe2d0d-5e7c-46c0-9eb2-d7649b2e39b1" - }, - "ResponseBody": null + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:56:11 GMT", + "mise-correlation-id": "8ed86ed8-bc4e-486b-8765-bf2cc946a179", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0G/33YwAAAABAv/Iaefh2SbBqa2\u002BzCsg6UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "bdaf5e1e-d2ee-45e6-873c-bc8ae37547cf", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "ef84c37f4347ad168de48c0cad02af21", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:56:11 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:56:11 GMT", + "mise-correlation-id": "d01f9842-b7a7-4660-9c80-e99cb2a70971", + "Retry-After": "30", + "X-Azure-Ref": "0G/33YwAAAAAXn5IEqOVXS4SJkqr88OMnUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "bdaf5e1e-d2ee-45e6-873c-bc8ae37547cf", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "54b38cf35164bf01075e21ee83123752", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:56:41 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:56:41 GMT", + "mise-correlation-id": "e6c01e02-debe-48b0-9beb-317d1d49967e", + "Retry-After": "30", + "X-Azure-Ref": "0Of33YwAAAAA\u002BSJ1Ht0fFTIQPLRJsA/ZxUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "bdaf5e1e-d2ee-45e6-873c-bc8ae37547cf", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "1a896b2bcc9502b0189095cdac1fa1b1", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:57:11 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:57:11 GMT", + "mise-correlation-id": "b4fa6ab0-35db-4e30-baaa-969104afb387", + "X-Azure-Ref": "0V/33YwAAAADlpr3MqKAwQZjz5\u002Br\u002BhTBwUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "bdaf5e1e-d2ee-45e6-873c-bc8ae37547cf", + "status": "Succeeded", + "error": null + } } ], "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "843663628", + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "2134361244", "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" } } diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailWithMoreOptions.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailWithMoreOptions.json new file mode 100644 index 0000000000000..30417a3d189f6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendEmailWithMoreOptions.json @@ -0,0 +1,118 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "335", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "65c9be9fe7902a2dbddc0b9f360484bb", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:57:11 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "This is the subject", + "plainText": "This is the body", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:57:11 GMT", + "mise-correlation-id": "6071cc34-b5f4-461e-a60f-f6436fb26f86", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0V/33YwAAAAAZKIIE45zmQ7Sk6o\u002BRAkzMUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "4107e389-5b0a-4e8c-be69-e51bf0b401c9", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "9a1757abeda8c4c12261d9336a7ab2fc", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:57:11 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:57:11 GMT", + "mise-correlation-id": "483b4a7f-6eb8-435c-9dd0-81307ce44972", + "Retry-After": "30", + "X-Azure-Ref": "0V/33YwAAAABFIJTwJqofQZvvoGX6vTwaUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "4107e389-5b0a-4e8c-be69-e51bf0b401c9", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "973555706e594938ccd25d89675962c3", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:57:41 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:57:41 GMT", + "mise-correlation-id": "e526945b-8b54-4658-b517-2778b4cac784", + "X-Azure-Ref": "0df33YwAAAACvuuCIYXebRpZQya4BpqYhUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "4107e389-5b0a-4e8c-be69-e51bf0b401c9", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "750060909", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendSimpleEmailWithAutomaticPollingForStatus.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendSimpleEmailWithAutomaticPollingForStatus.json new file mode 100644 index 0000000000000..5dbb418ecaf45 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClient/SendSimpleEmailWithAutomaticPollingForStatus.json @@ -0,0 +1,117 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "304", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "174a75379541ef8edd74fa8e33d9b535", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:57:41 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "This is the subject", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:57:41 GMT", + "mise-correlation-id": "7875e1ec-ec9e-42c3-a8f2-96d311fb5b1d", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0dv33YwAAAADH65hJXHoeQL2kXcmMpxtMUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "2b14ccae-8a3a-4248-b49f-773caa0b603f", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "c846cbcb515a97fa1656963318a63756", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:57:41 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:57:41 GMT", + "mise-correlation-id": "6161e647-1c5b-4b52-831d-74588fa9183a", + "Retry-After": "30", + "X-Azure-Ref": "0dv33YwAAAAAFwdVzUws8Q7vQxDYYiwPCUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "2b14ccae-8a3a-4248-b49f-773caa0b603f", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "a3b27622847c329f49d50ed296d869e9", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:58:12 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:58:11 GMT", + "mise-correlation-id": "87b345f7-4957-4ec6-9f86-50c55dd738a6", + "X-Azure-Ref": "0lP33YwAAAABqT0FLkSIxS6Cd\u002B5b2dF8DUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "2b14ccae-8a3a-4248-b49f-773caa0b603f", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "736381416", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/GetSendEmailStatusAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/GetSendEmailStatusAsyncAsync.json deleted file mode 100644 index 4e2985f3e0c2f..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/GetSendEmailStatusAsyncAsync.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "238", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-1c647e33da05d0419ac3559633225511-921ef8006b1b4e49-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "5c8b4420dfaf2f4718d4a7cd7b1c8fe5", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:45 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "This is the subject", - "plainText": "This is the body" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "Customer Name" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:48 GMT", - "mise-correlation-id": "d0fc8ce1-b00e-44ef-b1e5-42e81814374a", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/1aa40669-12f9-4776-b423-de70ded6106d/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211648Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cs7e", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "1aa40669-12f9-4776-b423-de70ded6106d" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails/1aa40669-12f9-4776-b423-de70ded6106d/status?api-version=2021-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-0a188e9e9975014683678e5be0a4faa8-a5705fba6b1ac641-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b229f80dff63eaf237871627d7ecba8c", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:45 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Accept-Ranges": "bytes", - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "70", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 10 Nov 2022 21:16:48 GMT", - "mise-correlation-id": "01d8422d-f9ee-46ad-a087-0c2d01d0ea81", - "Retry-After": "60", - "x-azure-ref": "20221110T211648Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cs8w", - "X-Cache": "CONFIG_NOCACHE" - }, - "ResponseBody": { - "messageId": "1aa40669-12f9-4776-b423-de70ded6106d", - "status": "Queued" - } - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1595979170", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailAsyncAsync.json deleted file mode 100644 index 2ed95cd417f4d..0000000000000 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailAsyncAsync.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "238", - "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-34846d23d7bdf446823c837cc343607a-9ec13b013033274a-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "7cf551bb5bc2ed8cfa0192ed7e6b0375", - "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:45 GMT", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", - "content": { - "subject": "This is the subject", - "plainText": "This is the body" - }, - "recipients": { - "to": [ - { - "email": "acseaastesting@gmail.com", - "displayName": "Customer Name" - } - ] - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:49 GMT", - "mise-correlation-id": "96709cc9-275e-48f0-82aa-d705776c9e4d", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/af66c28c-71ef-4059-b072-14078decb246/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211648Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002csae", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "af66c28c-71ef-4059-b072-14078decb246" - }, - "ResponseBody": null - } - ], - "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "63456185", - "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" - } -} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailToMultipleRecipientsAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailToMultipleRecipientsAsyncAsync.json index 8493574fc5f8a..44fd0f4387a31 100644 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailToMultipleRecipientsAsyncAsync.json +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailToMultipleRecipientsAsyncAsync.json @@ -1,56 +1,56 @@ { "Entries": [ { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "588", + "Content-Length": "708", "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-146dd19deda56b4c8a2f67b1ec39fd06-da15525fef56a747-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "0a43ea9c03078a9ffc7d13069d6ff597", + "Operation-Id": "Sanitized", + "traceparent": "00-8420822442f42dea9d31dfc1e4ee90f3-4fb4aae8efb8cb39-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "7b80ca59e80743d43e631c8c6bfc5707", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:45 GMT", + "x-ms-date": "Thu, 23 Feb 2023 23:58:12 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", "content": { "subject": "This is the subject", - "plainText": "This is the body" + "plainText": "This is the body", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" }, "recipients": { "to": [ { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" }, { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" } ], - "CC": [ + "cc": [ { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" }, { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" } ], - "bCC": [ + "bcc": [ { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" }, { - "email": "acseaastesting@gmail.com", + "address": "acseaastesting@gmail.com", "displayName": "Customer Name" } ] @@ -58,24 +58,88 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:49 GMT", - "mise-correlation-id": "92f70a93-fc40-4d9c-828e-59bae34bb0d6", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/643667b4-c2f8-4c56-9893-dc4d66a86bcb/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211649Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cscd", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "643667b4-c2f8-4c56-9893-dc4d66a86bcb" + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:58:12 GMT", + "mise-correlation-id": "db3bdc52-1f21-47a4-8699-d74346932e2a", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0lP33YwAAAAD5eGn0UkHjQqwyRRSvmTouUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" }, - "ResponseBody": null + "ResponseBody": { + "id": "7b6216f8-a9a6-4d85-b489-c84eaa1efaa8", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-8420822442f42dea9d31dfc1e4ee90f3-d92d1438fb5d12ec-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "2ada288878967963c2b6677168ae4f7f", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:58:12 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:58:12 GMT", + "mise-correlation-id": "910088e1-1c66-470c-ae53-3f7f4ea0078a", + "Retry-After": "30", + "X-Azure-Ref": "0lP33YwAAAADow7\u002BHCfz5SIo0dQuwtCxeUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "7b6216f8-a9a6-4d85-b489-c84eaa1efaa8", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-8420822442f42dea9d31dfc1e4ee90f3-e5962712a6ebd175-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "6ad4bfa1a82970bb16557089cd8ea5ef", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:58:42 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:58:42 GMT", + "mise-correlation-id": "08c8b63d-5768-4c6a-9543-c2a3a90b7c43", + "X-Azure-Ref": "0sv33YwAAAAD1j0ZsPa7PSL74xJfEVG5RUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "7b6216f8-a9a6-4d85-b489-c84eaa1efaa8", + "status": "Succeeded", + "error": null + } } ], "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "52133480", + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1247046611", "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" } } diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailWithAttachmentAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailWithAttachmentAsyncAsync.json index 9b27379a63075..bca5c9ac78fa3 100644 --- a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailWithAttachmentAsyncAsync.json +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailWithAttachmentAsyncAsync.json @@ -1,64 +1,128 @@ { "Entries": [ { - "RequestUri": "https://sdk-live-test-comm.communication.azure.com/emails:send?api-version=2021-10-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "347", + "Content-Length": "469", "Content-Type": "application/json", - "repeatability-first-sent": "Sanitized", - "repeatability-request-id": "Sanitized", - "traceparent": "00-4e6b0b1921a5ca478b38447b460356dc-a6c7e19b92d3c245-00", - "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20221110.1 (.NET Core 3.1.31; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "edc7d1b79a20c9a721c2ac82dc0ee9b9", + "Operation-Id": "Sanitized", + "traceparent": "00-3146a034012c6674bf48e00235dd9402-3c15def563b4d41f-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "bdad83c172b7e282399b3b86e48d7f07", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 10 Nov 2022 21:16:45 GMT", + "x-ms-date": "Thu, 23 Feb 2023 23:58:42 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "sender": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net", + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", "content": { "subject": "This is the subject", - "plainText": "This is the body" + "plainText": "This is the body", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" }, "recipients": { "to": [ { - "email": "acseaastesting@gmail.com", - "displayName": "Customer Name" + "address": "acseaastesting@gmail.com", + "displayName": "" } ] }, "attachments": [ { "name": "Attachment.txt", - "attachmentType": "txt", - "contentBytesBase64": "VGhpcyBpcyBhIHRlc3Q=" + "contentType": "text/plain", + "contentInBase64": "VGhpcyBpcyBhdHRhY2htZW50IGZpbGUgY29udGVudC4=" } ] }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2021-10-01-preview", - "Connection": "keep-alive", - "Content-Length": "0", - "Date": "Thu, 10 Nov 2022 21:16:49 GMT", - "mise-correlation-id": "f05a22ed-0302-450e-9ff0-5ec0f5c72ae4", - "Operation-Location": "https://sdk-live-test-comm.communication.azure.com/emails/ee561afc-0fd4-4a7c-8a3d-0c1e070d0c41/status", - "Repeatability-Result": "accepted", - "x-azure-ref": "20221110T211649Z-hvb1cv81ux3d15kk2y0vp09x4g00000005k000000002cse5", - "X-Cache": "CONFIG_NOCACHE", - "x-ms-request-id": "ee561afc-0fd4-4a7c-8a3d-0c1e070d0c41" + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:58:42 GMT", + "mise-correlation-id": "164ff82b-e16d-4e60-adbd-2da0f9d890fa", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "0sv33YwAAAAA2Im5soNF\u002BS4\u002BPyaqMq5nuUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" }, - "ResponseBody": null + "ResponseBody": { + "id": "586ec397-6c85-45e8-b0f8-7689d3ba0faa", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-3146a034012c6674bf48e00235dd9402-fedf70f8c26880ba-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "93376c70a2ab62bd63832b4db33fc842", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:58:42 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:58:42 GMT", + "mise-correlation-id": "8ee82fb0-4c05-4faf-9cc2-5d9fc42873eb", + "Retry-After": "30", + "X-Azure-Ref": "0sv33YwAAAACCEMkJmHVIT49YZt5lEvTPUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "586ec397-6c85-45e8-b0f8-7689d3ba0faa", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-3146a034012c6674bf48e00235dd9402-98ae38eab8985885-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "c107019b2411586eebccc851119cc633", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:59:12 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:59:12 GMT", + "mise-correlation-id": "55d400e9-dc36-47f7-8d26-537056c4a7e9", + "X-Azure-Ref": "00P33YwAAAACq1OqJhE7yTZK3Yl0y\u002BtFiUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "586ec397-6c85-45e8-b0f8-7689d3ba0faa", + "status": "Succeeded", + "error": null + } } ], "Variables": { - "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://sdk-live-test-comm.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1722987519", + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "847843784", "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", - "SENDER_ADDRESS": "DoNotReply@3276b20a-aa29-4ec2-9cf7-b517715b101b.azurecomm.net" + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" } } diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailWithMoreOptionsAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailWithMoreOptionsAsyncAsync.json new file mode 100644 index 0000000000000..4999785ea26e4 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendEmailWithMoreOptionsAsyncAsync.json @@ -0,0 +1,121 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "335", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-a9338b8fbe9702ade5e1aa2f3b0d7110-338fd3c8a201a47c-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "f41994267888c10ccd48b7c527bed7d4", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:59:12 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "This is the subject", + "plainText": "This is the body", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:59:12 GMT", + "mise-correlation-id": "9cbc3fa2-e091-44f8-9b9f-003ec73059dd", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "00P33YwAAAAAUwRojOiO4TZcsbj6LRthfUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "5c6d8c95-c19b-43e4-9609-6003515e3dc8", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-a9338b8fbe9702ade5e1aa2f3b0d7110-dba38e3b74718dae-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "6bdb5bb529c48afe4360275e5387915d", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:59:12 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:59:12 GMT", + "mise-correlation-id": "21f25a49-f2bd-49d8-aee4-1fe2799c0e18", + "Retry-After": "30", + "X-Azure-Ref": "00f33YwAAAACjxJd8gb9HQY30R6Su1Cx9UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "5c6d8c95-c19b-43e4-9609-6003515e3dc8", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-a9338b8fbe9702ade5e1aa2f3b0d7110-2160ec795f401ba2-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "3fa8949da960cbfd9dfddd6622aa8e01", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:59:43 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:59:42 GMT", + "mise-correlation-id": "3d87a581-f0e6-42f6-836b-dd5b8675dede", + "X-Azure-Ref": "07/33YwAAAAA9fAUZI\u002BaUTrvXrEObdzQ9UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "5c6d8c95-c19b-43e4-9609-6003515e3dc8", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1465469408", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendSimpleEmailWithAutomaticPollingForStatusAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendSimpleEmailWithAutomaticPollingForStatusAsyncAsync.json new file mode 100644 index 0000000000000..1fc274338d009 --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendSimpleEmailWithAutomaticPollingForStatusAsyncAsync.json @@ -0,0 +1,120 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "304", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-b2f7489dec39fc95bb2cc6792d851479-48a7c305a02233aa-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "6f63abcd07f441d86b1f78f0f09ef715", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:59:43 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "This is the subject", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:59:42 GMT", + "mise-correlation-id": "b58253b0-ecb4-48ef-bb5d-63f9dc527714", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "07/33YwAAAAC0B00341TpQrEMpBuuy\u002BM3UERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "e576bd62-3110-4c04-a6b8-5f302aa4e717", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-b2f7489dec39fc95bb2cc6792d851479-9f098db42830aa49-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "efb975102e2606869815f49bfca4963d", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 23 Feb 2023 23:59:43 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 23 Feb 2023 23:59:42 GMT", + "mise-correlation-id": "c992822f-e956-482b-b833-f7c60282cc62", + "Retry-After": "30", + "X-Azure-Ref": "07/33YwAAAABVKB7gLvuXQ7txMES2gf4\u002BUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "e576bd62-3110-4c04-a6b8-5f302aa4e717", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-b2f7489dec39fc95bb2cc6792d851479-50f202b9baf550bb-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "4304f5374c37857f480feb1b14b75d8c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Fri, 24 Feb 2023 00:00:13 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 24 Feb 2023 00:00:12 GMT", + "mise-correlation-id": "90d01612-7865-4a29-900f-eec6b83cac50", + "X-Azure-Ref": "0Df73YwAAAAC2S2BDLafCQqpBK8Mu\u002B3xNUERYMzFFREdFMDIxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "e576bd62-3110-4c04-a6b8-5f302aa4e717", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "1230616394", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +} diff --git a/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendSimpleEmailWithManualPollingForStatusAsyncAsync.json b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendSimpleEmailWithManualPollingForStatusAsyncAsync.json new file mode 100644 index 0000000000000..720649dc2645b --- /dev/null +++ b/sdk/communication/Azure.Communication.Email/tests/SessionRecords/Sample1_EmailClientAsync/SendSimpleEmailWithManualPollingForStatusAsyncAsync.json @@ -0,0 +1,238 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/emails:send?api-version=2023-01-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "304", + "Content-Type": "application/json", + "Operation-Id": "Sanitized", + "traceparent": "00-8c1844ad305b446120c72f22f023c2c0-1c95cdcf7ace9188-00", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "e254913d3c8f1ff201b70b588676667e", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Sat, 25 Feb 2023 17:31:17 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "senderAddress": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net", + "content": { + "subject": "This is the subject", + "html": "\u003Chtml\u003E\u003Cbody\u003EThis is the html body\u003C/body\u003E\u003C/html\u003E" + }, + "recipients": { + "to": [ + { + "address": "acseaastesting@gmail.com", + "displayName": "" + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 25 Feb 2023 17:31:18 GMT", + "mise-correlation-id": "e636b4ff-fa27-4c38-ab81-105edf83ee65", + "Operation-Location": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "Retry-After": "30", + "X-Azure-Ref": "05kX6YwAAAACbnqh2p2KXSrs52GzoYmIyUERYMzFFREdFMDIyMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "684bdbb4-2af1-4d99-a25c-2f7a29fd913c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "63a24d047fe7dfc933f8c5eb44b68084", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Sat, 25 Feb 2023 17:31:18 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 25 Feb 2023 17:31:18 GMT", + "mise-correlation-id": "a57d4942-9c79-4aa6-9c23-171f036def76", + "Retry-After": "30", + "X-Azure-Ref": "05kX6YwAAAACYrVyhVuT1RL7rl0zm8w/lUERYMzFFREdFMDIyMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "684bdbb4-2af1-4d99-a25c-2f7a29fd913c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "d5787f8b4347facc67742591d9e292f8", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Sat, 25 Feb 2023 17:31:23 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 25 Feb 2023 17:31:23 GMT", + "mise-correlation-id": "d892ec61-0337-4eed-9797-4884517b4c6a", + "Retry-After": "30", + "X-Azure-Ref": "060X6YwAAAAA/3zwSlZqaSK3SSUxv0PP/UERYMzFFREdFMDIyMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "684bdbb4-2af1-4d99-a25c-2f7a29fd913c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "55d44c69d7c0be9ac775af977606db4a", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Sat, 25 Feb 2023 17:31:28 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 25 Feb 2023 17:31:28 GMT", + "mise-correlation-id": "8a188f4f-c5b3-4024-9b9b-a6b489516de1", + "Retry-After": "30", + "X-Azure-Ref": "08EX6YwAAAADN3U1At\u002BieQ5KqFnJUuRnoUERYMzFFREdFMDIyMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "684bdbb4-2af1-4d99-a25c-2f7a29fd913c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "06cd863791fec13780a7fc735a370550", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Sat, 25 Feb 2023 17:31:34 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 25 Feb 2023 17:31:33 GMT", + "mise-correlation-id": "cb018e71-cb56-45c4-9f75-d5996eb6b641", + "Retry-After": "30", + "X-Azure-Ref": "09UX6YwAAAAC6VLgzMsSuTbVfps8yqAt5UERYMzFFREdFMDIyMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "684bdbb4-2af1-4d99-a25c-2f7a29fd913c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "f882cc652be2b3c4e4ba0dd294358361", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Sat, 25 Feb 2023 17:31:39 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "77", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 25 Feb 2023 17:31:38 GMT", + "mise-correlation-id": "88b06e00-27d5-4e0c-8e96-b58df960635c", + "Retry-After": "30", + "X-Azure-Ref": "0\u002B0X6YwAAAAAw9RyUyyMxT5kmMlNZHAdQUERYMzFFREdFMDIyMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "684bdbb4-2af1-4d99-a25c-2f7a29fd913c", + "status": "Running", + "error": null + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/emails/operations/sanitizedId?api-version=2023-01-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-Communication.Email/1.0.0-alpha.20230223.1 (.NET 6.0.14; Microsoft Windows 10.0.19045)", + "x-ms-client-request-id": "535ada988c14d8fa1412d419db27638f", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Sat, 25 Feb 2023 17:31:44 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-10-01-preview, 2023-01-15-preview", + "Content-Length": "79", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 25 Feb 2023 17:31:43 GMT", + "mise-correlation-id": "de86c177-8a42-4c6d-9c00-56360c57887f", + "X-Azure-Ref": "0AEb6YwAAAAC6H/Ly3V8lS5Zsm/uV4bLYUERYMzFFREdFMDIyMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=", + "X-Cache": "CONFIG_NOCACHE" + }, + "ResponseBody": { + "id": "684bdbb4-2af1-4d99-a25c-2f7a29fd913c", + "status": "Succeeded", + "error": null + } + } + ], + "Variables": { + "COMMUNICATION_CONNECTION_STRING_EMAIL": "endpoint=https://acs-email-functional-test-acs-resource.int.communication.azure.net/;accesskey=Kg==", + "RandomSeed": "2103594129", + "RECIPIENT_ADDRESS": "acseaastesting@gmail.com", + "SENDER_ADDRESS": "donotreply@3773742c-28d1-4e0a-89b2-1678f84745e6.azurecomm-dev.net" + } +}