From ab09c1af4440bb5fbd5b2fe01c98429e9c25c0c7 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Tue, 25 Jul 2023 18:13:48 -0700 Subject: [PATCH 01/24] Add Messages SDK --- .../Azure.Communication.Messages/CHANGELOG.md | 6 + .../Azure.Communication.Messages/README.md | 74 ++++ .../src/Azure.Communication.Messages.csproj | 27 ++ .../src/CommunicationMessagesClientOptions.cs | 48 +++ .../CommunicationMessagesModelFactory.cs | 47 +++ .../CommunicationError.Serialization.cs | 71 ++++ .../Generated/Models/CommunicationError.cs | 57 +++ ...ommunicationErrorResponse.Serialization.cs | 33 ++ .../Models/CommunicationErrorResponse.cs | 29 ++ .../Models/CommunicationMessageType.cs | 54 +++ .../CommunicationMessagesChannelType.cs | 48 +++ .../ListTemplatesResponse.Serialization.cs | 45 +++ .../Generated/Models/ListTemplatesResponse.cs | 42 +++ .../Models/MessageReceipt.Serialization.cs | 39 +++ .../src/Generated/Models/MessageReceipt.cs | 34 ++ ...eTemplateBindingsInternal.Serialization.cs | 26 ++ .../Models/MessageTemplateBindingsInternal.cs | 21 ++ ...eTemplateBindingsWhatsApp.Serialization.cs | 61 ++++ .../Models/MessageTemplateBindingsWhatsApp.cs | 34 ++ ...ateBindingsWhatsAppButton.Serialization.cs | 28 ++ .../MessageTemplateBindingsWhatsAppButton.cs | 31 ++ ...BindingsWhatsAppComponent.Serialization.cs | 23 ++ ...essageTemplateBindingsWhatsAppComponent.cs | 29 ++ .../MessageTemplateInternal.Serialization.cs | 41 +++ .../Models/MessageTemplateInternal.cs | 40 +++ ...TemplateParameterLocation.Serialization.cs | 41 +++ .../MessageTemplateParameterLocation.cs | 27 ++ ...sageTemplateValueInternal.Serialization.cs | 53 +++ .../Models/MessageTemplateValueInternal.cs | 44 +++ .../Models/MessageTemplateValueKind.cs | 63 ++++ ...MessageTemplateValueMedia.Serialization.cs | 36 ++ .../Models/MessageTemplateValueMedia.cs | 30 ++ ...eTemplateValueQuickAction.Serialization.cs | 31 ++ .../Models/MessageTemplateValueQuickAction.cs | 23 ++ .../MessageTemplateValueText.Serialization.cs | 23 ++ .../Models/MessageTemplateValueText.cs | 29 ++ .../MessageTemplateValueWhatsAppSubType.cs | 51 +++ .../Models/SendMessageResult.Serialization.cs | 39 +++ .../src/Generated/Models/SendMessageResult.cs | 38 ++ .../SendNotificationRequest.Serialization.cs | 47 +++ .../Models/SendNotificationRequest.cs | 46 +++ .../TemplateResponseInternal.Serialization.cs | 69 ++++ .../Models/TemplateResponseInternal.cs | 44 +++ ...eResponseWhatsAppInternal.Serialization.cs | 37 ++ .../TemplateResponseWhatsAppInternal.cs | 34 ++ .../src/Generated/Models/TemplateStatus.cs | 57 +++ .../NotificationMessagesRestClient.cs | 137 ++++++++ .../src/Generated/StreamRestClient.cs | 107 ++++++ .../src/Generated/TemplateV2RestClient.cs | 176 ++++++++++ .../src/MessageTemplateClient.cs | 192 ++++++++++ .../CommunicationMessagesChannelType.cs | 13 + .../MessageTemplateBindingsInternal.cs | 12 + .../MessageTemplateBindingsWhatsApp.cs | 12 + .../MessageTemplateBindingsWhatsAppButton.cs | 12 + ...essageTemplateBindingsWhatsAppComponent.cs | 12 + .../InternalModels/MessageTemplateInternal.cs | 12 + .../MessageTemplateParameterLocation.cs | 12 + .../MessageTemplateValueInternal.cs | 12 + .../MessageTemplateValueMedia.cs | 12 + .../MessageTemplateValueQuickAction.cs | 12 + .../MessageTemplateValueText.cs | 12 + .../TemplateResponseInternal.cs | 13 + .../TemplateResponseWhatsAppInternal.cs | 12 + .../src/Models/MessageTemplate.cs | 56 +++ .../src/Models/MessageTemplateBindings.cs | 16 + .../Models/MessageTemplateDocumentValue.cs | 38 ++ .../src/Models/MessageTemplateImageValue.cs | 41 +++ .../src/Models/MessageTemplateItem.cs | 49 +++ .../src/Models/MessageTemplateItemWhatsApp.cs | 27 ++ .../Models/MessageTemplateLocationValue.cs | 42 +++ .../Models/MessageTemplateQuickActionValue.cs | 35 ++ .../src/Models/MessageTemplateTextValue.cs | 26 ++ .../src/Models/MessageTemplateValue.cs | 23 ++ .../src/Models/MessageTemplateVideoValue.cs | 38 ++ .../Models/MessageTemplateWhatsAppBindings.cs | 70 ++++ .../src/Models/SendMessageOptions.cs | 79 +++++ .../src/NotificationMessagesClient.cs | 331 ++++++++++++++++++ .../src/Properties/AssemblyInfo.cs | 6 + .../src/autorest.md | 36 ++ .../Azure.Communication.Messages/tests.yml | 14 + .../Azure.Communication.Messages.Tests.csproj | 33 ++ .../Infrastructure/MessagesLiveTestBase.cs | 32 ++ .../Infrastructure/MessagesTestEnvironment.cs | 16 + .../NotificationMessagesClientLiveTests.cs | 207 +++++++++++ .../NotificationMessagesClientTests.cs | 94 +++++ ...firmationTemplateMessageShouldSucceed.json | 104 ++++++ ...tionTemplateMessageShouldSucceedAsync.json | 104 ++++++ ...nnocementTemplateMessageShouldSucceed.json | 95 +++++ ...mentTemplateMessageShouldSucceedAsync.json | 95 +++++ ...esolutionTemplateMessageShouldSucceed.json | 97 +++++ ...tionTemplateMessageShouldSucceedAsync.json | 97 +++++ .../SendMessageShouldSucceed.json | 55 +++ .../SendMessageShouldSucceedAsync.json | 55 +++ ...firmationTemplateMessageShouldSucceed.json | 113 ++++++ ...tionTemplateMessageShouldSucceedAsync.json | 113 ++++++ ...eFeedbackTemplateMessageShouldSucceed.json | 86 +++++ ...backTemplateMessageShouldSucceedAsync.json | 86 +++++ ...firmationTemplateMessageShouldSucceed.json | 75 ++++ ...tionTemplateMessageShouldSucceedAsync.json | 75 ++++ .../MessageTemplateClientLiveTests.cs | 38 ++ sdk/communication/Azure.Communication.sln | 12 + sdk/communication/ci.yml | 2 + 102 files changed, 5231 insertions(+) create mode 100644 sdk/communication/Azure.Communication.Messages/CHANGELOG.md create mode 100644 sdk/communication/Azure.Communication.Messages/README.md create mode 100644 sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj create mode 100644 sdk/communication/Azure.Communication.Messages/src/CommunicationMessagesClientOptions.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationError.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationError.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationMessageType.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationMessagesChannelType.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/ListTemplatesResponse.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/ListTemplatesResponse.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsApp.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsApp.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppButton.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppButton.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppComponent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppComponent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateParameterLocation.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateParameterLocation.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueKind.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueQuickAction.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueQuickAction.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueText.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueText.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueWhatsAppSubType.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendNotificationRequest.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendNotificationRequest.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseWhatsAppInternal.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseWhatsAppInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateStatus.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/CommunicationMessagesChannelType.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsApp.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsAppButton.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsAppComponent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateParameterLocation.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueMedia.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueQuickAction.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueText.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/TemplateResponseInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/TemplateResponseWhatsAppInternal.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplate.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateBindings.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocumentValue.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImageValue.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateItem.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateItemWhatsApp.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocationValue.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickActionValue.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateTextValue.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateValue.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideoValue.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateWhatsAppBindings.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Models/SendMessageOptions.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Properties/AssemblyInfo.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/autorest.md create mode 100644 sdk/communication/Azure.Communication.Messages/tests.yml create mode 100644 sdk/communication/Azure.Communication.Messages/tests/Azure.Communication.Messages.Tests.csproj create mode 100644 sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs create mode 100644 sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesTestEnvironment.cs create mode 100644 sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs create mode 100644 sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientTests.cs create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs diff --git a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md new file mode 100644 index 000000000000..c57a956d781d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md @@ -0,0 +1,6 @@ +# Release History + +## 1.0.0-beta.1 (2022-10-11) + +### Features Added +Add the SDK - Initial commit diff --git a/sdk/communication/Azure.Communication.Messages/README.md b/sdk/communication/Azure.Communication.Messages/README.md new file mode 100644 index 000000000000..af329ec5a6c0 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/README.md @@ -0,0 +1,74 @@ +# Azure Communication Messages client library for .NET + +This package contains a C# SDK for Azure Communication Messages Services. + +[Source code][source] | [Package (NuGet)][package] | [Product documentation][product_docs] + + +## Getting started + +### Install the package +Install the Azure Communication Messages client library for .NET with [NuGet][nuget]: + +```dotnetcli +dotnet add package Azure.Communication.Messages --prerelease +``` + +### Prerequisites +You need an [Azure subscription][azure_sub] and a [Communication Service Resource][communication_resource_docs] to use this package. + +To create a new Communication Service, you can use the [Azure Portal][communication_resource_create_portal], the [Azure PowerShell][communication_resource_create_power_shell], or the [.NET management client library][communication_resource_create_net]. + +### Key concepts +`NotificationMessagesClient` provides the functionality to send notification messages . + +### Using statements +```C# +using Azure.Communication.Messages; +``` + +### Authenticate the client +#### Connection String +Messages clients can be authenticated using the connection string acquired from an Azure Communication Resource in the [Azure Portal][azure_portal]. + +```C# +var connectionString = ""; // Find your Communication Services resource in the Azure portal +NotificationMessagesClient client = new NotificationMessagesClient(connectionString); +``` + +#### Token Credential + +Alternatively, Messages clients can also be authenticated using a valid token credential. + +```C# +string endpoint = ""; +TokenCredential tokenCredential = new DefaultAzureCredential(); +NotificationMessagesClient client = new NotificationMessagesClient(new Uri(endpoint), tokenCredential); +``` + + +## Examples +### Send an Notification Message +To send a notification message, call the `SendMessage` or `SendMessageAsync` function from the `NotificationMessagesClient`. +```C# +// Create the recipient list, currently only one recipient is supported +var recipient = new List { "" }; +var options = new SendMessageOptions("", recipient, "Come on everyone, let's go for lunch together."); +SendMessageResult result = await notificationMessagesClient.SendMessageAsync(options); +Console.WriteLine($"Message id: {result.Receipts[0].MessageId}"); +``` + +## Troubleshooting +A `RequestFailedException` is thrown as a service response for any unsuccessful requests. The exception contains information about what response code was returned from the service. + +## Next steps +- Read more about Messages in Azure Communication Services (Link to be added). +- Read more about how to set up Event Grid subscription for new message and message delivery status (Link to be added). + + +## Contributing +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla]. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + diff --git a/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj b/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj new file mode 100644 index 000000000000..f7d7c5708ae1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj @@ -0,0 +1,27 @@ + + + + + This client library enables working with the Microsoft Azure Communication Messages service. + + Azure Communication Messages Service + 1.0.0-beta.1 + Microsoft Azure Communication Messages Service;Microsoft;Azure;Azure Communication Service;Azure Communication Messages Service;Messages;Communication + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + + + + + diff --git a/sdk/communication/Azure.Communication.Messages/src/CommunicationMessagesClientOptions.cs b/sdk/communication/Azure.Communication.Messages/src/CommunicationMessagesClientOptions.cs new file mode 100644 index 000000000000..055695d44b88 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/CommunicationMessagesClientOptions.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// + /// The options for communication and . + /// + public class CommunicationMessagesClientOptions : ClientOptions + { + /// + /// The latest version of the Chat service. + /// + internal const ServiceVersion LatestVersion = ServiceVersion.V2023_02_01_Preview; + + internal string ApiVersion { get; } + + /// + /// Initializes a new instance of the . + /// + public CommunicationMessagesClientOptions(ServiceVersion version = LatestVersion) + { + ApiVersion = version switch + { + ServiceVersion.V2023_02_01_Preview => "2023-02-01-preview", + _ => throw new ArgumentOutOfRangeException(nameof(version)), + }; + } + + /// + /// The Messages service version. + /// + public enum ServiceVersion + { + /// + /// The V1 of the Messages service. + /// + #pragma warning disable CA1707 // Identifiers should not contain underscores + #pragma warning disable AZC0016 // Invalid ServiceVersion member name. + V2023_02_01_Preview = 1 + #pragma warning restore AZC0016 // Invalid ServiceVersion member name. + #pragma warning restore CA1707 // Identifiers should not contain underscores + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs new file mode 100644 index 000000000000..94dec5e0bfae --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Communication.Messages; + +namespace Azure.Communication.Messages.Models +{ + /// Model factory for models. + public static partial class CommunicationMessagesModelFactory + { + /// Initializes a new instance of SendMessageResult. + /// Receipts of the send message operation. + /// A new instance for mocking. + public static SendMessageResult SendMessageResult(IEnumerable receipts = null) + { + receipts ??= new List(); + + return new SendMessageResult(receipts?.ToList()); + } + + /// Initializes a new instance of MessageReceipt. + /// The message id. + /// The native external platform user identifier of the recipient. + /// or is null. + /// A new instance for mocking. + public static MessageReceipt MessageReceipt(string messageId = null, string to = null) + { + if (messageId == null) + { + throw new ArgumentNullException(nameof(messageId)); + } + if (to == null) + { + throw new ArgumentNullException(nameof(to)); + } + + return new MessageReceipt(messageId, to); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationError.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationError.Serialization.cs new file mode 100644 index 000000000000..109ebdd2b6d7 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationError.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class CommunicationError + { + internal static CommunicationError DeserializeCommunicationError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + Optional target = default; + Optional> details = default; + Optional innererror = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeCommunicationError(item)); + } + details = array; + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = DeserializeCommunicationError(property.Value); + continue; + } + } + return new CommunicationError(code, message, target.Value, Optional.ToList(details), innererror.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationError.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationError.cs new file mode 100644 index 000000000000..c297fa4129e6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationError.cs @@ -0,0 +1,57 @@ +// 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.Messages +{ + /// 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.Messages/src/Generated/Models/CommunicationErrorResponse.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.Serialization.cs new file mode 100644 index 000000000000..4cc637c6ef5e --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class CommunicationErrorResponse + { + internal static CommunicationErrorResponse DeserializeCommunicationErrorResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + 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.Messages/src/Generated/Models/CommunicationErrorResponse.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.cs new file mode 100644 index 000000000000..c3af707cfcf8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// 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.Messages/src/Generated/Models/CommunicationMessageType.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationMessageType.cs new file mode 100644 index 000000000000..3ed021efa15d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationMessageType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The type of message. Supports text, image, template. + public readonly partial struct CommunicationMessageType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CommunicationMessageType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TextValue = "text"; + private const string ImageValue = "image"; + private const string TemplateValue = "template"; + + /// text. + public static CommunicationMessageType Text { get; } = new CommunicationMessageType(TextValue); + /// image. + public static CommunicationMessageType Image { get; } = new CommunicationMessageType(ImageValue); + /// template. + public static CommunicationMessageType Template { get; } = new CommunicationMessageType(TemplateValue); + /// Determines if two values are the same. + public static bool operator ==(CommunicationMessageType left, CommunicationMessageType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CommunicationMessageType left, CommunicationMessageType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CommunicationMessageType(string value) => new CommunicationMessageType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CommunicationMessageType other && Equals(other); + /// + public bool Equals(CommunicationMessageType 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.Messages/src/Generated/Models/CommunicationMessagesChannelType.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationMessagesChannelType.cs new file mode 100644 index 000000000000..1daf9a3f7c07 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationMessagesChannelType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The ChannelType. + public readonly partial struct CommunicationMessagesChannelType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CommunicationMessagesChannelType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WhatsAppValue = "whatsApp"; + + /// whatsApp. + public static CommunicationMessagesChannelType WhatsApp { get; } = new CommunicationMessagesChannelType(WhatsAppValue); + /// Determines if two values are the same. + public static bool operator ==(CommunicationMessagesChannelType left, CommunicationMessagesChannelType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CommunicationMessagesChannelType left, CommunicationMessagesChannelType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CommunicationMessagesChannelType(string value) => new CommunicationMessagesChannelType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CommunicationMessagesChannelType other && Equals(other); + /// + public bool Equals(CommunicationMessagesChannelType 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.Messages/src/Generated/Models/ListTemplatesResponse.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/ListTemplatesResponse.Serialization.cs new file mode 100644 index 000000000000..8692ecadf804 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/ListTemplatesResponse.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class ListTemplatesResponse + { + internal static ListTemplatesResponse DeserializeListTemplatesResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TemplateResponseInternal.DeserializeTemplateResponseInternal(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ListTemplatesResponse(value, nextLink.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/ListTemplatesResponse.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/ListTemplatesResponse.cs new file mode 100644 index 000000000000..0f3fbe73aa62 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/ListTemplatesResponse.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// The ListTemplatesResponse. + internal partial class ListTemplatesResponse + { + /// Initializes a new instance of ListTemplatesResponse. + /// The collection of elements. + /// is null. + internal ListTemplatesResponse(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of ListTemplatesResponse. + /// The collection of elements. + /// + internal ListTemplatesResponse(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The collection of elements. + public IReadOnlyList Value { get; } + /// Gets the next link. + public string NextLink { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.Serialization.cs new file mode 100644 index 000000000000..d7a092300bc1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class MessageReceipt + { + internal static MessageReceipt DeserializeMessageReceipt(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string messageId = default; + string to = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messageId"u8)) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("to"u8)) + { + to = property.Value.GetString(); + continue; + } + } + return new MessageReceipt(messageId, to); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.cs new file mode 100644 index 000000000000..f7b93911259b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// Receipt of the sending one message. + public partial class MessageReceipt + { + /// Initializes a new instance of MessageReceipt. + /// The message id. + /// The native external platform user identifier of the recipient. + /// or is null. + internal MessageReceipt(string messageId, string to) + { + Argument.AssertNotNull(messageId, nameof(messageId)); + Argument.AssertNotNull(to, nameof(to)); + + MessageId = messageId; + To = to; + } + + /// The message id. + public string MessageId { get; } + /// The native external platform user identifier of the recipient. + public string To { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsInternal.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsInternal.Serialization.cs new file mode 100644 index 000000000000..146ef7888916 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsInternal.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateBindingsInternal : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(WhatsApp)) + { + writer.WritePropertyName("whatsApp"u8); + writer.WriteObjectValue(WhatsApp); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsInternal.cs new file mode 100644 index 000000000000..a4ffd716f099 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsInternal.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.Messages +{ + /// The binding object to link values to the template specific locations. + internal partial class MessageTemplateBindingsInternal + { + /// Initializes a new instance of MessageTemplateBindingsInternal. + public MessageTemplateBindingsInternal() + { + } + + /// The template bindings for WhatsApp. + public MessageTemplateBindingsWhatsApp WhatsApp { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsApp.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsApp.Serialization.cs new file mode 100644 index 000000000000..46131cdcd225 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsApp.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateBindingsWhatsApp : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Header)) + { + writer.WritePropertyName("header"u8); + writer.WriteStartArray(); + foreach (var item in Header) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Body)) + { + writer.WritePropertyName("body"u8); + writer.WriteStartArray(); + foreach (var item in Body) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Footer)) + { + writer.WritePropertyName("footer"u8); + writer.WriteStartArray(); + foreach (var item in Footer) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Button)) + { + writer.WritePropertyName("button"u8); + writer.WriteStartArray(); + foreach (var item in Button) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsApp.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsApp.cs new file mode 100644 index 000000000000..b37c76c23d4a --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsApp.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// The template bindings for WhatsApp. + internal partial class MessageTemplateBindingsWhatsApp + { + /// Initializes a new instance of MessageTemplateBindingsWhatsApp. + public MessageTemplateBindingsWhatsApp() + { + Header = new ChangeTrackingList(); + Body = new ChangeTrackingList(); + Footer = new ChangeTrackingList(); + Button = new ChangeTrackingList(); + } + + /// Gets the header. + public IList Header { get; } + /// Gets the body. + public IList Body { get; } + /// Gets the footer. + public IList Footer { get; } + /// Gets the button. + public IList Button { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppButton.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppButton.Serialization.cs new file mode 100644 index 000000000000..197b0674a095 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppButton.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateBindingsWhatsAppButton : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SubType)) + { + writer.WritePropertyName("subType"u8); + writer.WriteStringValue(SubType.Value.ToString()); + } + writer.WritePropertyName("refValue"u8); + writer.WriteStringValue(RefValue); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppButton.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppButton.cs new file mode 100644 index 000000000000..2b7dc1d93acb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppButton.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// The template bindings component button for WhatsApp. + internal partial class MessageTemplateBindingsWhatsAppButton + { + /// Initializes a new instance of MessageTemplateBindingsWhatsAppButton. + /// The reference to the value in the Microsoft.Azure.Communication.CrossPlatformMessages.Contract.Model.Notifications.V1.Requests.MessageTemplate.Values dictionary. + /// is null. + public MessageTemplateBindingsWhatsAppButton(string refValue) + { + Argument.AssertNotNull(refValue, nameof(refValue)); + + RefValue = refValue; + } + + /// The WhatsApp button sub type. + public MessageTemplateValueWhatsAppSubType? SubType { get; set; } + /// The reference to the value in the Microsoft.Azure.Communication.CrossPlatformMessages.Contract.Model.Notifications.V1.Requests.MessageTemplate.Values dictionary. + public string RefValue { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppComponent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppComponent.Serialization.cs new file mode 100644 index 000000000000..2e7842eaa3ee --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppComponent.Serialization.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateBindingsWhatsAppComponent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("refValue"u8); + writer.WriteStringValue(RefValue); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppComponent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppComponent.cs new file mode 100644 index 000000000000..6a3cb7239d25 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateBindingsWhatsAppComponent.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// The template bindings component for WhatsApp. + internal partial class MessageTemplateBindingsWhatsAppComponent + { + /// Initializes a new instance of MessageTemplateBindingsWhatsAppComponent. + /// The reference to the value in the Microsoft.Azure.Communication.CrossPlatformMessages.Contract.Model.Notifications.V1.Requests.MessageTemplate.Values dictionary. + /// is null. + public MessageTemplateBindingsWhatsAppComponent(string refValue) + { + Argument.AssertNotNull(refValue, nameof(refValue)); + + RefValue = refValue; + } + + /// The reference to the value in the Microsoft.Azure.Communication.CrossPlatformMessages.Contract.Model.Notifications.V1.Requests.MessageTemplate.Values dictionary. + public string RefValue { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateInternal.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateInternal.Serialization.cs new file mode 100644 index 000000000000..d0c8b11608d4 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateInternal.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateInternal : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (Optional.IsCollectionDefined(Values)) + { + writer.WritePropertyName("values"u8); + writer.WriteStartObject(); + foreach (var item in Values) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Bindings)) + { + writer.WritePropertyName("bindings"u8); + writer.WriteObjectValue(Bindings); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateInternal.cs new file mode 100644 index 000000000000..d85831bb3029 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateInternal.cs @@ -0,0 +1,40 @@ +// 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.Messages +{ + /// The template object used to create templates. + internal partial class MessageTemplateInternal + { + /// Initializes a new instance of MessageTemplateInternal. + /// Name of the template. + /// The codes for the supported languages for templates. + /// or is null. + public MessageTemplateInternal(string name, string language) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(language, nameof(language)); + + Name = name; + Language = language; + Values = new ChangeTrackingDictionary(); + } + + /// Name of the template. + public string Name { get; } + /// The codes for the supported languages for templates. + public string Language { get; } + /// The template values. + public IDictionary Values { get; } + /// The binding object to link values to the template specific locations. + public MessageTemplateBindingsInternal Bindings { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateParameterLocation.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateParameterLocation.Serialization.cs new file mode 100644 index 000000000000..4616d5da431d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateParameterLocation.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateParameterLocation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Address)) + { + writer.WritePropertyName("address"u8); + writer.WriteStringValue(Address); + } + if (Optional.IsDefined(Latitude)) + { + writer.WritePropertyName("latitude"u8); + writer.WriteNumberValue(Latitude.Value); + } + if (Optional.IsDefined(Longitude)) + { + writer.WritePropertyName("longitude"u8); + writer.WriteNumberValue(Longitude.Value); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateParameterLocation.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateParameterLocation.cs new file mode 100644 index 000000000000..fd5a0ee21d3f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateParameterLocation.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.Messages +{ + /// The message template's location value information. + internal partial class MessageTemplateParameterLocation + { + /// Initializes a new instance of MessageTemplateParameterLocation. + public MessageTemplateParameterLocation() + { + } + + /// The [Optional] name of the location. + public string Name { get; set; } + /// The [Optional] address of the location. + public string Address { get; set; } + /// The latitude of the location. + public double? Latitude { get; set; } + /// The longitude of the location. + public double? Longitude { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueInternal.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueInternal.Serialization.cs new file mode 100644 index 000000000000..778655c72a2b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueInternal.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateValueInternal : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteObjectValue(Text); + } + if (Optional.IsDefined(Image)) + { + writer.WritePropertyName("image"u8); + writer.WriteObjectValue(Image); + } + if (Optional.IsDefined(Document)) + { + writer.WritePropertyName("document"u8); + writer.WriteObjectValue(Document); + } + if (Optional.IsDefined(Video)) + { + writer.WritePropertyName("video"u8); + writer.WriteObjectValue(Video); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteObjectValue(Location); + } + if (Optional.IsDefined(QuickAction)) + { + writer.WritePropertyName("quickAction"u8); + writer.WriteObjectValue(QuickAction); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueInternal.cs new file mode 100644 index 000000000000..3db50db11688 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueInternal.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.Messages +{ + /// The class describes a parameter of a template. + internal partial class MessageTemplateValueInternal + { + /// Initializes a new instance of MessageTemplateValueInternal. + /// The template value kind. + public MessageTemplateValueInternal(MessageTemplateValueKind kind) + { + Kind = kind; + } + + /// The template value kind. + public MessageTemplateValueKind Kind { get; } + /// The message template's text value information. + public MessageTemplateValueText Text { get; set; } + /// + /// The message template's media value information. + /// Could be an image, document or video. + /// + public MessageTemplateValueMedia Image { get; set; } + /// + /// The message template's media value information. + /// Could be an image, document or video. + /// + public MessageTemplateValueMedia Document { get; set; } + /// + /// The message template's media value information. + /// Could be an image, document or video. + /// + public MessageTemplateValueMedia Video { get; set; } + /// The message template's location value information. + public MessageTemplateParameterLocation Location { get; set; } + /// The message template's quick action value information. + public MessageTemplateValueQuickAction QuickAction { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueKind.cs new file mode 100644 index 000000000000..4cdd00266a3c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueKind.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The template value kind. + public readonly partial struct MessageTemplateValueKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MessageTemplateValueKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TextValue = "text"; + private const string ImageValue = "image"; + private const string DocumentValue = "document"; + private const string VideoValue = "video"; + private const string LocationValue = "location"; + private const string QuickActionValue = "quick_action"; + + /// text. + public static MessageTemplateValueKind Text { get; } = new MessageTemplateValueKind(TextValue); + /// image. + public static MessageTemplateValueKind Image { get; } = new MessageTemplateValueKind(ImageValue); + /// document. + public static MessageTemplateValueKind Document { get; } = new MessageTemplateValueKind(DocumentValue); + /// video. + public static MessageTemplateValueKind Video { get; } = new MessageTemplateValueKind(VideoValue); + /// location. + public static MessageTemplateValueKind Location { get; } = new MessageTemplateValueKind(LocationValue); + /// quick_action. + public static MessageTemplateValueKind QuickAction { get; } = new MessageTemplateValueKind(QuickActionValue); + /// Determines if two values are the same. + public static bool operator ==(MessageTemplateValueKind left, MessageTemplateValueKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MessageTemplateValueKind left, MessageTemplateValueKind right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MessageTemplateValueKind(string value) => new MessageTemplateValueKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MessageTemplateValueKind other && Equals(other); + /// + public bool Equals(MessageTemplateValueKind 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.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs new file mode 100644 index 000000000000..ae66196ea8fb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateValueMedia : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url.AbsoluteUri); + } + if (Optional.IsDefined(Caption)) + { + writer.WritePropertyName("caption"u8); + writer.WriteStringValue(Caption); + } + if (Optional.IsDefined(Filename)) + { + writer.WritePropertyName("filename"u8); + writer.WriteStringValue(Filename); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs new file mode 100644 index 000000000000..ba3317e778a8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Communication.Messages +{ + /// + /// The message template's media value information. + /// Could be an image, document or video. + /// + internal partial class MessageTemplateValueMedia + { + /// Initializes a new instance of MessageTemplateValueMedia. + public MessageTemplateValueMedia() + { + } + + /// The (public) URL of the media. + public Uri Url { get; set; } + /// The [optional] caption of the media object. + public string Caption { get; set; } + /// The [optional] filename of the media file. + public string Filename { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueQuickAction.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueQuickAction.Serialization.cs new file mode 100644 index 000000000000..f4fcf42c2dce --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueQuickAction.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateValueQuickAction : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (Optional.IsDefined(Payload)) + { + writer.WritePropertyName("payload"u8); + writer.WriteStringValue(Payload); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueQuickAction.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueQuickAction.cs new file mode 100644 index 000000000000..8f23763d9c7e --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueQuickAction.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.Messages +{ + /// The message template's quick action value information. + internal partial class MessageTemplateValueQuickAction + { + /// Initializes a new instance of MessageTemplateValueQuickAction. + public MessageTemplateValueQuickAction() + { + } + + /// The [Optional] quick action text. + public string Text { get; set; } + /// The [Optional] quick action payload. + public string Payload { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueText.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueText.Serialization.cs new file mode 100644 index 000000000000..cdf6e2c4e0fd --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueText.Serialization.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class MessageTemplateValueText : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueText.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueText.cs new file mode 100644 index 000000000000..99e7f08adc44 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueText.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// The message template's text value information. + internal partial class MessageTemplateValueText + { + /// Initializes a new instance of MessageTemplateValueText. + /// The text value. + /// is null. + public MessageTemplateValueText(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + } + + /// The text value. + public string Text { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueWhatsAppSubType.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueWhatsAppSubType.cs new file mode 100644 index 000000000000..ec18bec255dd --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueWhatsAppSubType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The WhatsApp button sub type. + public readonly partial struct MessageTemplateValueWhatsAppSubType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MessageTemplateValueWhatsAppSubType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string QuickReplyValue = "quickReply"; + private const string UrlValue = "url"; + + /// quickReply. + public static MessageTemplateValueWhatsAppSubType QuickReply { get; } = new MessageTemplateValueWhatsAppSubType(QuickReplyValue); + /// url. + public static MessageTemplateValueWhatsAppSubType Url { get; } = new MessageTemplateValueWhatsAppSubType(UrlValue); + /// Determines if two values are the same. + public static bool operator ==(MessageTemplateValueWhatsAppSubType left, MessageTemplateValueWhatsAppSubType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MessageTemplateValueWhatsAppSubType left, MessageTemplateValueWhatsAppSubType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MessageTemplateValueWhatsAppSubType(string value) => new MessageTemplateValueWhatsAppSubType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MessageTemplateValueWhatsAppSubType other && Equals(other); + /// + public bool Equals(MessageTemplateValueWhatsAppSubType 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.Messages/src/Generated/Models/SendMessageResult.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.Serialization.cs new file mode 100644 index 000000000000..9c5c4eab5cd6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class SendMessageResult + { + internal static SendMessageResult DeserializeSendMessageResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList receipts = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("receipts"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MessageReceipt.DeserializeMessageReceipt(item)); + } + receipts = array; + continue; + } + } + return new SendMessageResult(receipts); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.cs new file mode 100644 index 000000000000..ad8023f9333c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// Result of the send message operation. + public partial class SendMessageResult + { + /// Initializes a new instance of SendMessageResult. + /// Receipts of the send message operation. + /// is null. + internal SendMessageResult(IEnumerable receipts) + { + Argument.AssertNotNull(receipts, nameof(receipts)); + + Receipts = receipts.ToList(); + } + + /// Initializes a new instance of SendMessageResult. + /// Receipts of the send message operation. + internal SendMessageResult(IReadOnlyList receipts) + { + Receipts = receipts; + } + + /// Receipts of the send message operation. + public IReadOnlyList Receipts { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendNotificationRequest.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendNotificationRequest.Serialization.cs new file mode 100644 index 000000000000..bcc9181640b5 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendNotificationRequest.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class SendNotificationRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("channelRegistrationId"u8); + writer.WriteStringValue(ChannelRegistrationId); + writer.WritePropertyName("to"u8); + writer.WriteStartArray(); + foreach (var item in To) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + if (Optional.IsDefined(MediaUri)) + { + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri); + } + if (Optional.IsDefined(Template)) + { + writer.WritePropertyName("template"u8); + writer.WriteObjectValue(Template); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendNotificationRequest.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendNotificationRequest.cs new file mode 100644 index 000000000000..0fceff2f2460 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendNotificationRequest.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// Details of the message to send. + internal partial class SendNotificationRequest + { + /// Initializes a new instance of SendNotificationRequest. + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type of message. Supports text, image, template. + /// or is null. + public SendNotificationRequest(string channelRegistrationId, IEnumerable to, CommunicationMessageType type) + { + Argument.AssertNotNull(channelRegistrationId, nameof(channelRegistrationId)); + Argument.AssertNotNull(to, nameof(to)); + + ChannelRegistrationId = channelRegistrationId; + To = to.ToList(); + Type = type; + } + + /// The Channel Registration ID for the Business Identifier. + public string ChannelRegistrationId { get; } + /// The native external platform user identifiers of the recipient. + public IList To { get; } + /// The type of message. Supports text, image, template. + public CommunicationMessageType Type { get; } + /// Message content. + public string Content { get; set; } + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + public string MediaUri { get; set; } + /// The template object used to create templates. + public MessageTemplateInternal Template { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseInternal.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseInternal.Serialization.cs new file mode 100644 index 000000000000..5723ad485516 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseInternal.Serialization.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class TemplateResponseInternal + { + internal static TemplateResponseInternal DeserializeTemplateResponseInternal(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional language = default; + Optional channelType = default; + Optional status = default; + Optional whatsApp = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + channelType = new CommunicationMessagesChannelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new TemplateStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("whatsApp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + whatsApp = TemplateResponseWhatsAppInternal.DeserializeTemplateResponseWhatsAppInternal(property.Value); + continue; + } + } + return new TemplateResponseInternal(name.Value, language.Value, Optional.ToNullable(channelType), Optional.ToNullable(status), whatsApp.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseInternal.cs new file mode 100644 index 000000000000..2dece9fb1cfb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseInternal.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.Messages +{ + /// The TemplateResponse. + internal partial class TemplateResponseInternal + { + /// Initializes a new instance of TemplateResponseInternal. + internal TemplateResponseInternal() + { + } + + /// Initializes a new instance of TemplateResponseInternal. + /// Get the template's Name. + /// Get the template's language. + /// + /// The aggregated template status. + /// The WhatsApp-specific template response contract. + internal TemplateResponseInternal(string name, string language, CommunicationMessagesChannelType? channelType, TemplateStatus? status, TemplateResponseWhatsAppInternal whatsApp) + { + Name = name; + Language = language; + ChannelType = channelType; + Status = status; + WhatsApp = whatsApp; + } + + /// Get the template's Name. + public string Name { get; } + /// Get the template's language. + public string Language { get; } + /// Gets the channel type. + public CommunicationMessagesChannelType? ChannelType { get; } + /// The aggregated template status. + public TemplateStatus? Status { get; } + /// The WhatsApp-specific template response contract. + public TemplateResponseWhatsAppInternal WhatsApp { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseWhatsAppInternal.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseWhatsAppInternal.Serialization.cs new file mode 100644 index 000000000000..fd8cf5c3ebff --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseWhatsAppInternal.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class TemplateResponseWhatsAppInternal + { + internal static TemplateResponseWhatsAppInternal DeserializeTemplateResponseWhatsAppInternal(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional content = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + content = property.Value.GetObject(); + continue; + } + } + return new TemplateResponseWhatsAppInternal(content.Value); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseWhatsAppInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseWhatsAppInternal.cs new file mode 100644 index 000000000000..88b0a9783381 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateResponseWhatsAppInternal.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.Messages +{ + /// The WhatsApp-specific template response contract. + internal partial class TemplateResponseWhatsAppInternal + { + /// Initializes a new instance of TemplateResponseWhatsAppInternal. + internal TemplateResponseWhatsAppInternal() + { + } + + /// Initializes a new instance of TemplateResponseWhatsAppInternal. + /// + /// WhatsApp platform's template content + /// This is the payload returned from WhatsApp API. + /// + internal TemplateResponseWhatsAppInternal(object content) + { + Content = content; + } + + /// + /// WhatsApp platform's template content + /// This is the payload returned from WhatsApp API. + /// + public object Content { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateStatus.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateStatus.cs new file mode 100644 index 000000000000..fb01fda63cf8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/TemplateStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The aggregated template status. + public readonly partial struct TemplateStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TemplateStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApprovedValue = "approved"; + private const string RejectedValue = "rejected"; + private const string PendingValue = "pending"; + private const string PausedValue = "paused"; + + /// approved. + public static TemplateStatus Approved { get; } = new TemplateStatus(ApprovedValue); + /// rejected. + public static TemplateStatus Rejected { get; } = new TemplateStatus(RejectedValue); + /// pending. + public static TemplateStatus Pending { get; } = new TemplateStatus(PendingValue); + /// paused. + public static TemplateStatus Paused { get; } = new TemplateStatus(PausedValue); + /// Determines if two values are the same. + public static bool operator ==(TemplateStatus left, TemplateStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TemplateStatus left, TemplateStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TemplateStatus(string value) => new TemplateStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TemplateStatus other && Equals(other); + /// + public bool Equals(TemplateStatus 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.Messages/src/Generated/NotificationMessagesRestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs new file mode 100644 index 000000000000..53bd174fdb35 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + internal partial class NotificationMessagesRestClient + { + private readonly HttpPipeline _pipeline; + private readonly string _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// Initializes a new instance of NotificationMessagesRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// Api Version. + /// , , or is null. + public NotificationMessagesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-02-01-preview") + { + ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint)); + _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion)); + } + + internal HttpMessage CreateSendMessageRequest(string channelRegistrationId, IEnumerable to, CommunicationMessageType type, string content, string mediaUri, MessageTemplateInternal template) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_endpoint, false); + uri.AppendPath("/messages/notifications/:send", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new SendNotificationRequest(channelRegistrationId, to.ToList(), type) + { + Content = content, + MediaUri = mediaUri, + Template = template + }; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(model); + request.Content = content0; + return message; + } + + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type of message. Supports text, image, template. + /// Message content. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// The template object used to create templates. + /// The cancellation token to use. + /// or is null. + public async Task> SendMessageAsync(string channelRegistrationId, IEnumerable to, CommunicationMessageType type, string content = null, string mediaUri = null, MessageTemplateInternal template = null, CancellationToken cancellationToken = default) + { + if (channelRegistrationId == null) + { + throw new ArgumentNullException(nameof(channelRegistrationId)); + } + if (to == null) + { + throw new ArgumentNullException(nameof(to)); + } + + using var message = CreateSendMessageRequest(channelRegistrationId, to, type, content, mediaUri, template); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + { + SendMessageResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SendMessageResult.DeserializeSendMessageResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type of message. Supports text, image, template. + /// Message content. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// The template object used to create templates. + /// The cancellation token to use. + /// or is null. + public Response SendMessage(string channelRegistrationId, IEnumerable to, CommunicationMessageType type, string content = null, string mediaUri = null, MessageTemplateInternal template = null, CancellationToken cancellationToken = default) + { + if (channelRegistrationId == null) + { + throw new ArgumentNullException(nameof(channelRegistrationId)); + } + if (to == null) + { + throw new ArgumentNullException(nameof(to)); + } + + using var message = CreateSendMessageRequest(channelRegistrationId, to, type, content, mediaUri, template); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + { + SendMessageResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SendMessageResult.DeserializeSendMessageResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs new file mode 100644 index 000000000000..b3dd1a1dcc7d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + internal partial class StreamRestClient + { + private readonly HttpPipeline _pipeline; + private readonly string _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// Initializes a new instance of StreamRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// Api Version. + /// , , or is null. + public StreamRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-02-01-preview") + { + ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint)); + _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion)); + } + + internal HttpMessage CreateDownloadMediaRequest(string id) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + message.BufferResponse = false; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_endpoint, false); + uri.AppendPath("/messages/streams/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Download the Media payload from a User to Business message. + /// The Media Identifier contained in the User to Business message event. + /// The cancellation token to use. + /// is null. + public async Task> DownloadMediaAsync(string id, CancellationToken cancellationToken = default) + { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateDownloadMediaRequest(id); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Download the Media payload from a User to Business message. + /// The Media Identifier contained in the User to Business message event. + /// The cancellation token to use. + /// is null. + public Response DownloadMedia(string id, CancellationToken cancellationToken = default) + { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateDownloadMediaRequest(id); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs new file mode 100644 index 000000000000..3ace6eabd880 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + internal partial class TemplateV2RestClient + { + private readonly HttpPipeline _pipeline; + private readonly string _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// Initializes a new instance of TemplateV2RestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The communication resource, for example https://my-resource.communication.azure.com. + /// Api Version. + /// , , or is null. + public TemplateV2RestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-02-01-preview") + { + ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint)); + _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion)); + } + + internal HttpMessage CreateListRequest(Guid channelId, int? maxPageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_endpoint, false); + uri.AppendPath("/messages/channels/", false); + uri.AppendPath(channelId, true); + uri.AppendPath("/templates", false); + if (maxPageSize != null) + { + uri.AppendQuery("maxPageSize", maxPageSize.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// List all templates for given ACS channel. + /// The Guid to use. + /// The Int32 to use. + /// The cancellation token to use. + public async Task> ListAsync(Guid channelId, int? maxPageSize = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(channelId, maxPageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ListTemplatesResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ListTemplatesResponse.DeserializeListTemplatesResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all templates for given ACS channel. + /// The Guid to use. + /// The Int32 to use. + /// The cancellation token to use. + public Response List(Guid channelId, int? maxPageSize = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(channelId, maxPageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ListTemplatesResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ListTemplatesResponse.DeserializeListTemplatesResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid channelId, int? maxPageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_endpoint, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// List all templates for given ACS channel. + /// The URL to the next page of results. + /// The Guid to use. + /// The Int32 to use. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, Guid channelId, int? maxPageSize = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, channelId, maxPageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ListTemplatesResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ListTemplatesResponse.DeserializeListTemplatesResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all templates for given ACS channel. + /// The URL to the next page of results. + /// The Guid to use. + /// The Int32 to use. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, Guid channelId, int? maxPageSize = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, channelId, maxPageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ListTemplatesResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ListTemplatesResponse.DeserializeListTemplatesResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs b/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs new file mode 100644 index 000000000000..ba6789b1051a --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Communication.Pipeline; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + /// + /// The Azure Communication Services Message Template client. + /// + public class MessageTemplateClient + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly TemplateV2RestClient _templateV2RestClient; + private readonly StreamRestClient _streamRestClient; + + #region public constructors + + /// + /// Initializes a new instance of + /// + /// Connection string acquired from the Azure Communication Services resource. + public MessageTemplateClient(string connectionString) + : this( + ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// Connection string acquired from the Azure Communication Services resource. + /// Client options exposing , , , etc. + public MessageTemplateClient(string connectionString, CommunicationMessagesClientOptions options) + : this( + ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + options ?? new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// The URI of the Azure Communication Services resource. + /// The used to authenticate requests. + /// Client options exposing , , , etc. + public MessageTemplateClient(Uri endpoint, AzureKeyCredential keyCredential, CommunicationMessagesClientOptions options = default) + : this( + Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, + Argument.CheckNotNull(keyCredential, nameof(keyCredential)), + options ?? new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// The URI of the Azure Communication Services resource. + /// The TokenCredential used to authenticate requests, such as DefaultAzureCredential. + /// Client options exposing , , , etc. + public MessageTemplateClient(Uri endpoint, TokenCredential tokenCredential, CommunicationMessagesClientOptions options = default) + : this( + Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, + Argument.CheckNotNull(tokenCredential, nameof(tokenCredential)), + options ?? new CommunicationMessagesClientOptions()) + { } + + #endregion + + #region private constructors + private MessageTemplateClient(ConnectionString connectionString, CommunicationMessagesClientOptions options) + : this(connectionString.GetRequired("endpoint"), options.BuildHttpPipeline(connectionString), options) + { } + + private MessageTemplateClient(string endpoint, TokenCredential tokenCredential, CommunicationMessagesClientOptions options) + : this(endpoint, options.BuildHttpPipeline(tokenCredential), options) + { } + + private MessageTemplateClient(string endpoint, AzureKeyCredential keyCredential, CommunicationMessagesClientOptions options) + : this(endpoint, options.BuildHttpPipeline(keyCredential), options) + { } + + private MessageTemplateClient(string endpoint, HttpPipeline httpPipeline, CommunicationMessagesClientOptions options) + { + _clientDiagnostics = new ClientDiagnostics(options); + _templateV2RestClient = new TemplateV2RestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); + _streamRestClient = new StreamRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); + } + + #endregion + + /// Initializes a new instance of for mocking. + protected MessageTemplateClient() + { + _clientDiagnostics = null!; + _templateV2RestClient = null!; + _streamRestClient = null!; + } + + #region List Templates Operations + /// List all templates for given ACS channel asynchronously. + /// The registration ID of the channel. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual AsyncPageable GetTemplatesAsync(string channelRegistrationId, CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MessageTemplateClient)}.{nameof(GetTemplates)}"); + scope.Start(); + + try + { + Response response = await _templateV2RestClient.ListAsync(new Guid(channelRegistrationId), pageSizeHint, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(x => new MessageTemplateItem(x)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MessageTemplateClient)}.{nameof(GetTemplates)}"); + scope.Start(); + + try + { + Response response = await _templateV2RestClient.ListNextPageAsync(nextLink, new Guid(channelRegistrationId), pageSizeHint, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(x => new MessageTemplateItem(x)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// List all templates for given ACS channel. + /// The registration ID of the channel. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual Pageable GetTemplates(string channelRegistrationId, CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MessageTemplateClient)}.{nameof(GetTemplates)}"); + scope.Start(); + + try + { + Response response = _templateV2RestClient.List(new Guid(channelRegistrationId), pageSizeHint, cancellationToken); + return Page.FromValues(response.Value.Value.Select(x=> new MessageTemplateItem(x)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MessageTemplateClient)}.{nameof(GetTemplates)}"); + scope.Start(); + + try + { + Response response = _templateV2RestClient.ListNextPage(nextLink, new Guid(channelRegistrationId), pageSizeHint, cancellationToken); + return Page.FromValues(response.Value.Value.Select(x => new MessageTemplateItem(x)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + #endregion + + private static HttpPipeline CreatePipelineFromOptions(ConnectionString connectionString, CommunicationMessagesClientOptions options) + { + return options.BuildHttpPipeline(connectionString); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/CommunicationMessagesChannelType.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/CommunicationMessagesChannelType.cs new file mode 100644 index 000000000000..78cc2eb8cb14 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/CommunicationMessagesChannelType.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// The ChannelType. + [CodeGenModel("ChannelType")] + public partial struct CommunicationMessagesChannelType + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsInternal.cs new file mode 100644 index 000000000000..11e41a720be5 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateBindings")] + internal partial class MessageTemplateBindingsInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsApp.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsApp.cs new file mode 100644 index 000000000000..7b02e29ff0ba --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsApp.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateBindingsWhatsApp")] + internal partial class MessageTemplateBindingsWhatsApp + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsAppButton.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsAppButton.cs new file mode 100644 index 000000000000..6ff65e06860c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsAppButton.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateBindingsWhatsAppButton")] + internal partial class MessageTemplateBindingsWhatsAppButton + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsAppComponent.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsAppComponent.cs new file mode 100644 index 000000000000..c11efc8c5ed2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateBindingsWhatsAppComponent.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateBindingsWhatsAppComponent")] + internal partial class MessageTemplateBindingsWhatsAppComponent + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateInternal.cs new file mode 100644 index 000000000000..199b8d988027 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplate")] + internal partial class MessageTemplateInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateParameterLocation.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateParameterLocation.cs new file mode 100644 index 000000000000..fafd25050e59 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateParameterLocation.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateParameterLocation")] + internal partial class MessageTemplateParameterLocation + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueInternal.cs new file mode 100644 index 000000000000..05ce7151160b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateValue")] + internal partial class MessageTemplateValueInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueMedia.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueMedia.cs new file mode 100644 index 000000000000..2a88d562009a --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueMedia.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateValueMedia")] + internal partial class MessageTemplateValueMedia + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueQuickAction.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueQuickAction.cs new file mode 100644 index 000000000000..ecec48585581 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueQuickAction.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateValueQuickAction")] + internal partial class MessageTemplateValueQuickAction + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueText.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueText.cs new file mode 100644 index 000000000000..0a7c554cb195 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/MessageTemplateValueText.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("MessageTemplateValueText")] + internal partial class MessageTemplateValueText + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/TemplateResponseInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/TemplateResponseInternal.cs new file mode 100644 index 000000000000..dd3936bb1a00 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/TemplateResponseInternal.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// The response item for template. + [CodeGenModel("TemplateResponse")] + internal partial class TemplateResponseInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/TemplateResponseWhatsAppInternal.cs b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/TemplateResponseWhatsAppInternal.cs new file mode 100644 index 000000000000..0a93cc25f6a7 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/InternalModels/TemplateResponseWhatsAppInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [CodeGenModel("TemplateResponseWhatsApp")] + internal partial class TemplateResponseWhatsAppInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplate.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplate.cs new file mode 100644 index 000000000000..d5b26081ba5c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplate.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The template object used to create templates. + public class MessageTemplate + { + /// + /// Initializes a new instance of the class. + /// + /// Name of the template. + /// The codes for the supported languages for templates. + /// The template values. + /// The binding object to link values to the template specific locations. + public MessageTemplate(string name, string language, IEnumerable values = null, MessageTemplateBindings bindings = null) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Language = language ?? throw new ArgumentNullException(nameof(language)); + Values = values; + Bindings = bindings; + } + + /// Name of the template. + public string Name { get; } + /// The codes for the supported languages for templates. + public string Language { get; } + /// The template values. + public IEnumerable Values { get; } + /// The binding object to link values to the template specific locations. + public MessageTemplateBindings Bindings { get; } + + internal MessageTemplateInternal ToMessageTemplateInternal() + { + var messageTemplateInternal = new MessageTemplateInternal(Name, Language); + + if (Values != null) + { + foreach (MessageTemplateValue value in Values) + { + messageTemplateInternal.Values.Add(value.Name, value.ToMessageTemplateValueInternal()); + } + } + + if (Bindings != null) + { + messageTemplateInternal.Bindings = Bindings.ToMessageTemplateBindingsInternal(); + } + + return messageTemplateInternal; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateBindings.cs new file mode 100644 index 000000000000..93ad6206eb60 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateBindings.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.Messages +{ + /// The binding object to link values to the template specific locations. + public abstract class MessageTemplateBindings + { + /// Initializes a new instance of MessageTemplateBindings. + public MessageTemplateBindings() + { + } + + internal abstract MessageTemplateBindingsInternal ToMessageTemplateBindingsInternal(); + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocumentValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocumentValue.cs new file mode 100644 index 000000000000..cff04fbefe44 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocumentValue.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Communication.Messages +{ + /// + public class MessageTemplateDocumentValue: MessageTemplateValue + { + /// + public MessageTemplateDocumentValue(string name, Uri url, string caption = null, string filename = null) : base(name) + { + Url = url; + Caption = caption; + Filename = filename; + } + + /// The (public) URL of the document media. + public Uri Url { get; set; } + /// The [optional] caption of the media object. + public string Caption { get; set; } + /// The [optional] filename of the media file. + public string Filename { get; set; } + + internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() + { + return new MessageTemplateValueInternal(MessageTemplateValueKind.Document) + { + Document = new MessageTemplateValueMedia { + Url = Url, + Caption = Caption, + Filename = Filename + } + }; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImageValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImageValue.cs new file mode 100644 index 000000000000..830a2be5c406 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImageValue.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Runtime.InteropServices.ComTypes; +using System.Xml.Linq; + +namespace Azure.Communication.Messages +{ + /// + public class MessageTemplateImageValue: MessageTemplateValue + { + /// + public MessageTemplateImageValue(string name, Uri url, string caption = null, string filename = null) : base(name) + { + Url = url; + Caption = caption; + Filename = filename; + } + + /// The (public) URL of the document media. + public Uri Url { get; set; } + /// The [optional] caption of the media object. + public string Caption { get; set; } + /// The [optional] filename of the media file. + public string Filename { get; set; } + + internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() + { + return new MessageTemplateValueInternal(MessageTemplateValueKind.Image) + { + Image = new MessageTemplateValueMedia + { + Url = Url, + Caption = Caption, + Filename = Filename + } + }; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateItem.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateItem.cs new file mode 100644 index 000000000000..f2b567d44b2b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateItem.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.Messages +{ + /// The TemplateResponse. + public partial class MessageTemplateItem + { + /// Initializes a new instance of MessageTemplateItem. + internal MessageTemplateItem() + { + } + + /// Initializes a new instance of MessageTemplateItem. + /// Get the template's Name. + /// Get the template's language. + /// + /// The aggregated template status. + /// The WhatsApp-specific template response contract. + internal MessageTemplateItem(string name, string language, CommunicationMessagesChannelType? channelType, TemplateStatus? status, MessageTemplateItemWhatsApp whatsApp) + { + Name = name; + Language = language; + ChannelType = channelType; + Status = status; + WhatsApp = whatsApp; + } + + /// Get the template's Name. + public string Name { get; } + /// Get the template's language. + public string Language { get; } + /// Gets the channel type. + public CommunicationMessagesChannelType? ChannelType { get; } + /// The aggregated template status. + public TemplateStatus? Status { get; } + /// The WhatsApp-specific template response contract. + public MessageTemplateItemWhatsApp WhatsApp { get; } + + internal MessageTemplateItem(TemplateResponseInternal templateResponseInternal) + { + Name = templateResponseInternal.Name; + Language = templateResponseInternal.Language; + ChannelType = templateResponseInternal.ChannelType; + Status = templateResponseInternal.Status; + WhatsApp = new MessageTemplateItemWhatsApp(templateResponseInternal.WhatsApp); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateItemWhatsApp.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateItemWhatsApp.cs new file mode 100644 index 000000000000..9645e73a16a8 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateItemWhatsApp.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Communication.Messages +{ + /// The WhatsApp-specific template response contract. + public partial class MessageTemplateItemWhatsApp + { + /// Initializes a new instance of TemplateResponseWhatsApp. + internal MessageTemplateItemWhatsApp() + { + } + + /// + /// WhatsApp platform's template content + /// This is the payload returned from WhatsApp API. + /// + public BinaryData Content { get; } + + internal MessageTemplateItemWhatsApp(TemplateResponseWhatsAppInternal templateResponseWhatsAppInternal) + { + Content = new BinaryData(templateResponseWhatsAppInternal.Content); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocationValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocationValue.cs new file mode 100644 index 000000000000..fee2e2741dec --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocationValue.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.Messages +{ + /// + public class MessageTemplateLocationValue : MessageTemplateValue + { + /// + public MessageTemplateLocationValue(string name, double latitude, double longitude, string locationName = null, string address = null) + : base(name) + { + Latitude = latitude; + Longitude = longitude; + LocationName = locationName; + Address = address; + } + + /// The name of the location. + public string LocationName { get; set; } + /// The address of the location. + public string Address { get; set; } + /// The latitude of the location. + public double Latitude { get; set; } + /// The longitude of the location. + public double Longitude { get; set; } + + internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() + { + return new MessageTemplateValueInternal(MessageTemplateValueKind.Location) + { + Location = new MessageTemplateParameterLocation + { + Name = LocationName, + Address = Address, + Latitude = Latitude, + Longitude = Longitude + } + }; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickActionValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickActionValue.cs new file mode 100644 index 000000000000..5d82807363ef --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickActionValue.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using static System.Net.Mime.MediaTypeNames; + +namespace Azure.Communication.Messages +{ + /// + public class MessageTemplateQuickActionValue: MessageTemplateValue + { + /// + public MessageTemplateQuickActionValue(string name, string text = null, string payload = null) : base(name) + { + Text = text; + Payload = payload; + } + + /// The quick action text. + public string Text { get; set; } + /// The quick action payload. + public string Payload { get; set; } + + internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() + { + return new MessageTemplateValueInternal(MessageTemplateValueKind.QuickAction) + { + QuickAction = new MessageTemplateValueQuickAction + { + Payload = Payload, + Text = Text + } + }; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateTextValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateTextValue.cs new file mode 100644 index 000000000000..33bb65326933 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateTextValue.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.Messages +{ + /// + public class MessageTemplateTextValue: MessageTemplateValue + { + /// + public MessageTemplateTextValue(string name, string text) : base(name) + { + Text = text; + } + + /// The message template's text value information. + public string Text { get; set; } + + internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() + { + return new MessageTemplateValueInternal(MessageTemplateValueKind.Text) + { + Text = new MessageTemplateValueText(Text) + }; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateValue.cs new file mode 100644 index 000000000000..afecb9548fbb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateValue.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// The class describes a parameter of a template. + public abstract class MessageTemplateValue + { + /// Initializes a new instance of MessageTemplateValueInternal. + /// The template value name. + public MessageTemplateValue(string name) + { + Name = name; + } + + /// The template value name. + public string Name { get; } + + internal abstract MessageTemplateValueInternal ToMessageTemplateValueInternal(); + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideoValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideoValue.cs new file mode 100644 index 000000000000..67551d992f97 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideoValue.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Communication.Messages +{ + /// + public class MessageTemplateVideoValue: MessageTemplateValue + { + /// + public MessageTemplateVideoValue(string name, Uri url, string caption = null, string filename = null) : base(name) + { + Url = url; + Caption = caption; + Filename = filename; + } + + /// The (public) URL of the document media. + public Uri Url { get; set; } + /// The [optional] caption of the media object. + public string Caption { get; set; } + /// The [optional] filename of the media file. + public string Filename { get; set; } + + internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() + { + return new MessageTemplateValueInternal(MessageTemplateValueKind.Video) + { + Video = new MessageTemplateValueMedia { + Url = Url, + Caption = Caption, + Filename = Filename + } + }; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateWhatsAppBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateWhatsAppBindings.cs new file mode 100644 index 000000000000..19f4252d55a6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateWhatsAppBindings.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System; +using System.Linq; + +namespace Azure.Communication.Messages +{ + /// The binding object to link values to the template specific locations. + public class MessageTemplateWhatsAppBindings: MessageTemplateBindings + { + /// Initializes a new instance of MessageTemplateWhatsAppBindings. + public MessageTemplateWhatsAppBindings(IEnumerable header = null, IEnumerable body = null, IEnumerable footer = null, IDictionary button = null) + { + Header = header; + Body = body; + Footer = footer; + Button = button; + } + + /// Gets the header. + public IEnumerable Header { get; } + /// Gets the body. + public IEnumerable Body { get; } + /// Gets the footer. + public IEnumerable Footer { get; } + /// Gets the button. + public IDictionary Button { get; } + + internal override MessageTemplateBindingsInternal ToMessageTemplateBindingsInternal() + { + var whatsApp = new MessageTemplateBindingsWhatsApp(); + + if (Header != null) + { + foreach (string item in Header) + { + whatsApp.Header.Add(new MessageTemplateBindingsWhatsAppComponent(item)); + } + }; + + if (Body != null) + { + foreach (string item in Body) + { + whatsApp.Body.Add(new MessageTemplateBindingsWhatsAppComponent(item)); + } + }; + + if (Footer != null) + { + foreach (string item in Footer) + { + whatsApp.Footer.Add(new MessageTemplateBindingsWhatsAppComponent(item)); + } + }; + + if (Button != null) + { + foreach (var item in Button) + { + whatsApp.Button.Add(new MessageTemplateBindingsWhatsAppButton(item.Key) { SubType = item.Value }); + } + }; + + return new MessageTemplateBindingsInternal() { WhatsApp = whatsApp }; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/SendMessageOptions.cs b/sdk/communication/Azure.Communication.Messages/src/Models/SendMessageOptions.cs new file mode 100644 index 000000000000..0af50fc982ea --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Models/SendMessageOptions.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + /// Options for the notification message. + public class SendMessageOptions + { + /// + /// Initializes a new instance of the class for sending a Text message. + /// + /// + /// + /// + public SendMessageOptions(string channelRegistrationId, IEnumerable to, string content) + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(channelRegistrationId, nameof(channelRegistrationId)); + ChannelRegistrationId = channelRegistrationId; + To = to; + Content = content; + MessageType = CommunicationMessageType.Text; + } + + /// + /// Initializes a new instance of the class for sending a Media message. + /// + /// + /// + /// + /// + public SendMessageOptions(string channelRegistrationId, IEnumerable to, Uri mediaUri, string content = null) + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + Argument.AssertNotNull(channelRegistrationId, nameof(channelRegistrationId)); + ChannelRegistrationId = channelRegistrationId; + To = to; + MediaUri = mediaUri; + Content = content; + MessageType = CommunicationMessageType.Image; + } + + /// + /// Initializes a new instance of the class for sending a Template message. + /// + /// + /// + /// + public SendMessageOptions(string channelRegistrationId, IEnumerable to, MessageTemplate template) // type implicitly Template + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(template, nameof(template)); + Argument.AssertNotNull(channelRegistrationId, nameof(channelRegistrationId)); + ChannelRegistrationId = channelRegistrationId; + To = to; + Template = template; + MessageType = CommunicationMessageType.Template; + } + + /// The Channel Registration ID for the Business Identifier. + public string ChannelRegistrationId { get; } + /// The native external platform user identifiers of the recipient. + public IEnumerable To { get; } + /// The cross-platform threadless message type. + public CommunicationMessageType MessageType { get; } + /// Threadless message content. + public string Content { get; } + /// The media Object. + public Uri MediaUri { get; } + /// The template object used to create message templates. + public MessageTemplate Template { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs b/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs new file mode 100644 index 000000000000..81cc0d049477 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Azure.Communication.Pipeline; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.Messages +{ + /// + /// The Azure Communication Services Notification Messages client. + /// + public class NotificationMessagesClient + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly NotificationMessagesRestClient _notificationMessagesRestClient; + private readonly StreamRestClient _streamRestClient; + + #region public constructors + + /// + /// Initializes a new instance of + /// + /// Connection string acquired from the Azure Communication Services resource. + public NotificationMessagesClient(string connectionString) + : this( + ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// Connection string acquired from the Azure Communication Services resource. + /// Client options exposing , , , etc. + public NotificationMessagesClient(string connectionString, CommunicationMessagesClientOptions options) + : this( + ConnectionString.Parse(Argument.CheckNotNullOrEmpty(connectionString, nameof(connectionString))), + options ?? new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// The URI of the Azure Communication Services resource. + /// The used to authenticate requests. + /// Client options exposing , , , etc. + public NotificationMessagesClient(Uri endpoint, AzureKeyCredential keyCredential, CommunicationMessagesClientOptions options = default) + : this( + Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, + Argument.CheckNotNull(keyCredential, nameof(keyCredential)), + options ?? new CommunicationMessagesClientOptions()) + { + } + + /// Initializes a new instance of . + /// The URI of the Azure Communication Services resource. + /// The TokenCredential used to authenticate requests, such as DefaultAzureCredential. + /// Client options exposing , , , etc. + public NotificationMessagesClient(Uri endpoint, TokenCredential tokenCredential, CommunicationMessagesClientOptions options = default) + : this( + Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, + Argument.CheckNotNull(tokenCredential, nameof(tokenCredential)), + options ?? new CommunicationMessagesClientOptions()) + { } + + #endregion + + #region private constructors + private NotificationMessagesClient(ConnectionString connectionString, CommunicationMessagesClientOptions options) + : this(connectionString.GetRequired("endpoint"), options.BuildHttpPipeline(connectionString), options) + { } + + private NotificationMessagesClient(string endpoint, TokenCredential tokenCredential, CommunicationMessagesClientOptions options) + : this(endpoint, options.BuildHttpPipeline(tokenCredential), options) + { } + + private NotificationMessagesClient(string endpoint, AzureKeyCredential keyCredential, CommunicationMessagesClientOptions options) + : this(endpoint, options.BuildHttpPipeline(keyCredential), options) + { } + + private NotificationMessagesClient(string endpoint, HttpPipeline httpPipeline, CommunicationMessagesClientOptions options) + { + _clientDiagnostics = new ClientDiagnostics(options); + _notificationMessagesRestClient = new NotificationMessagesRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); + _streamRestClient = new StreamRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); + } + + #endregion + + /// Initializes a new instance of for mocking. + protected NotificationMessagesClient() + { + _clientDiagnostics = null!; + _notificationMessagesRestClient = null!; + _streamRestClient = null!; + } + + #region Send Message Operations + /// Sends a notification message asynchronously. + /// Options for the message. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual async Task> SendMessageAsync(SendMessageOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(NotificationMessagesClient)}.{nameof(SendMessage)}"); + scope.Start(); + _ = options ?? throw new ArgumentNullException(nameof(options)); + + try + { + return await _notificationMessagesRestClient.SendMessageAsync(options.ChannelRegistrationId, options.To, options.MessageType, options.Content, options.MediaUri?.AbsoluteUri, options.Template?.ToMessageTemplateInternal(), cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Sends a notification message. + /// Options for the message. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual Response SendMessage(SendMessageOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(NotificationMessagesClient)}.{nameof(SendMessage)}"); + scope.Start(); + _ = options ?? throw new ArgumentNullException(nameof(options)); + + try + { + return _notificationMessagesRestClient.SendMessage(options.ChannelRegistrationId, options.To, options.MessageType, options.Content, options.MediaUri?.AbsoluteUri, options.Template?.ToMessageTemplateInternal(), cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + #endregion + + #region Download Media Operations + /// Download the Media payload from a User to Business message asynchronously. + /// The Media Identifier contained in the User to Business message event. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual async Task> DownloadMediaAsync(string mediaContentId, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(StreamRestClient)}.{nameof(DownloadMediaAsync)}"); + scope.Start(); + _ = mediaContentId ?? throw new ArgumentNullException(nameof(mediaContentId)); + + try + { + return await _streamRestClient.DownloadMediaAsync(mediaContentId, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// The downloads + /// the Media payload from a User to Business message asynchronously. + /// + /// The Media Identifier contained in the User to Business message event. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual Response DownloadMedia(string mediaContentId, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(StreamRestClient)}.{nameof(DownloadMedia)}"); + scope.Start(); + _ = mediaContentId ?? throw new ArgumentNullException(nameof(mediaContentId)); + + try + { + return _streamRestClient.DownloadMedia(mediaContentId, cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// The operation downloads the + /// specified content asynchronously, and writes the content to . + /// + /// The Media Identifier contained in the User to Business message event. + /// A to write the downloaded content to. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual async Task DownloadMediaToAsync(string mediaContentId, Stream destinationStream, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(StreamRestClient)}.{nameof(DownloadMediaAsync)}"); + scope.Start(); + _ = mediaContentId ?? throw new ArgumentNullException(nameof(mediaContentId)); + + try + { + return await DownloadMediaToAsyncInternal(mediaContentId, destinationStream, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// The operation downloads the + /// specified content, and writes the content to . + /// + /// The Media Identifier contained in the User to Business message event. + /// A to write the downloaded content to. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual Response DownloadMediaTo(string mediaContentId, Stream destinationStream, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(StreamRestClient)}.{nameof(DownloadMedia)}"); + scope.Start(); + _ = mediaContentId ?? throw new ArgumentNullException(nameof(mediaContentId)); + + try + { + return DownloadMediaToInternal(mediaContentId, destinationStream, cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// The operation downloads the + /// specified content, and writes the content to . + /// + /// The Media Identifier contained in the User to Business message event. + /// A file path to write the downloaded content to. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual async Task DownloadMediaToAsync(string mediaContentId, string destinationPath, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(StreamRestClient)}.{nameof(DownloadMediaAsync)}"); + scope.Start(); + _ = mediaContentId ?? throw new ArgumentNullException(nameof(mediaContentId)); + + using Stream destinationStream = File.Create(destinationPath); + + try + { + return await DownloadMediaToAsyncInternal(mediaContentId, destinationStream, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// The operation downloads the + /// specified content, and writes the content to . + /// + /// The Media Identifier contained in the User to Business message event. + /// A file path to write the downloaded content to. + /// The cancellation token to use. + /// The server returned an error. See for details returned from the server. + public virtual Response DownloadMediaTo(string mediaContentId, string destinationPath, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(StreamRestClient)}.{nameof(DownloadMedia)}"); + scope.Start(); + _ = mediaContentId ?? throw new ArgumentNullException(nameof(mediaContentId)); + + using Stream destinationStream = File.Create(destinationPath); + + try + { + return DownloadMediaToInternal(mediaContentId, destinationStream, cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + private async Task DownloadMediaToAsyncInternal(string mediaContentId, Stream destinationStream, CancellationToken cancellationToken = default) + { + Response initialResponse = await _streamRestClient.DownloadMediaAsync(mediaContentId, cancellationToken).ConfigureAwait(false); + + await CopyToAsync(initialResponse, destinationStream).ConfigureAwait(false); + + return initialResponse.GetRawResponse(); + } + + private Response DownloadMediaToInternal(string mediaContentId, Stream destinationStream, CancellationToken cancellationToken = default) + { + Response initialResponse = _streamRestClient.DownloadMedia(mediaContentId, cancellationToken); + + CopyTo(initialResponse, destinationStream, cancellationToken); + + return initialResponse.GetRawResponse(); + } + + private static async Task CopyToAsync(Stream result, Stream destination) + { + await result.CopyToAsync(destination).ConfigureAwait(false); + } + + private static void CopyTo(Stream result, Stream destination, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + result.CopyTo(destination); + result.Dispose(); + } + #endregion + + private static HttpPipeline CreatePipelineFromOptions(ConnectionString connectionString, CommunicationMessagesClientOptions options) + { + return options.BuildHttpPipeline(connectionString); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Properties/AssemblyInfo.cs b/sdk/communication/Azure.Communication.Messages/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..6522e17d75cc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("Communication")] diff --git a/sdk/communication/Azure.Communication.Messages/src/autorest.md b/sdk/communication/Azure.Communication.Messages/src/autorest.md new file mode 100644 index 000000000000..426e5c2e8a8b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/autorest.md @@ -0,0 +1,36 @@ +# Azure.Communication.Messages + +When a new version of the swagger needs to be updated: +1. Go to sdk\communication, and run `dotnet msbuild /t:GenerateCode` to generate code. +2. Upload the Azure.Communication.Messages.dll to the apiview.dev tool. +If any of the new objects needs to be overwritten, add the required changes to the 'Models' folder. +3. Repeat 2 and 3 until the decided interface is reflected in the apiview.dev + +### AutoRest Configuration + +> see https://aka.ms/autorest +``` yaml +input-file: + - C:\repos\azure-rest-api-specs\specification\communication\data-plane\Messages\preview\2023-02-01-preview\CommunicationServicesMessages.json +payload-flattening-threshold: 10 +generation1-convenience-client: true +directive: + from: swagger-document + where: $.definitions.* + transform: > + $["x-namespace"] = "Azure.Communication.Messages" + +``` + +### Don't buffer media downloads + +Sets the success response as binary stream, instead of error object. + +``` yaml +directive: +- from: swagger-document + where: $..[?(@.operationId=='Stream_DownloadMedia')] + transform: + $["x-csharp-buffer-response"] = false; + $.responses["200"].schema.format = "binary"; +``` diff --git a/sdk/communication/Azure.Communication.Messages/tests.yml b/sdk/communication/Azure.Communication.Messages/tests.yml new file mode 100644 index 000000000000..56c818c046ec --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests.yml @@ -0,0 +1,14 @@ +trigger: none + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + ServiceDirectory: communication + Project: Azure.Communication.Messages + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-net) + Clouds: Public diff --git a/sdk/communication/Azure.Communication.Messages/tests/Azure.Communication.Messages.Tests.csproj b/sdk/communication/Azure.Communication.Messages/tests/Azure.Communication.Messages.Tests.csproj new file mode 100644 index 000000000000..4de595b8fc55 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/Azure.Communication.Messages.Tests.csproj @@ -0,0 +1,33 @@ + + + $(RequiredTargetFrameworks) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs new file mode 100644 index 000000000000..d9ccf356ddcb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Communication.Identity; +using Azure.Core.TestFramework; + +namespace Azure.Communication.Messages.Tests +{ + public class MessagesLiveTestBase : RecordedTestBase + { + public MessagesLiveTestBase(bool isAsync) : base(isAsync, RecordedTestMode.Record) + { + SanitizedHeaders.Add("x-ms-content-sha256"); + } + + protected NotificationMessagesClient CreateInstrumentedNotificationMessagesClient() + { + var connectionString = TestEnvironment.LiveTestDynamicConnectionString; + var client = new NotificationMessagesClient(connectionString, InstrumentClientOptions(new CommunicationMessagesClientOptions())); + + return InstrumentClient(client); + } + + protected MessageTemplateClient CreateInstrumentedMessageTemplateClient() + { + var connectionString = TestEnvironment.LiveTestDynamicConnectionString; + var client = new MessageTemplateClient(connectionString, InstrumentClientOptions(new CommunicationMessagesClientOptions())); + + return InstrumentClient(client); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesTestEnvironment.cs b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesTestEnvironment.cs new file mode 100644 index 000000000000..841cfdb47121 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesTestEnvironment.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Communication.Tests; + +namespace Azure.Communication.Messages.Tests +{ + /// + /// A helper class used to retrieve information to be used for tests. + /// + public class MessagesTestEnvironment : CommunicationTestEnvironment + { + public string SenderChannelRegistrationId => GetRecordedVariable("SENDER_CHANNEL_REGISTRATION_ID"); + public string RecipientIdentifier => GetRecordedVariable("RECIPIENT_IDENTIFIER"); + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs new file mode 100644 index 000000000000..96f45db1e17f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using NUnit.Framework; + +namespace Azure.Communication.Messages.Tests +{ + public class NotificationMessagesClientLiveTests : MessagesLiveTestBase + { + public NotificationMessagesClientLiveTests(bool isAsync) : base(isAsync) + { + } + + public const string ImageUrl = "https://upload.wikimedia.org/wikipedia/commons/3/30/Building92microsoft.jpg"; + public const string VideoUrl = "https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4"; + public const string DocumentUrl = "https://go.microsoft.com/fwlink/?linkid=2131549"; + + [Test] + public async Task SendMessageShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClient(); + var options = new SendMessageOptions(TestEnvironment.SenderChannelRegistrationId, new List { TestEnvironment.RecipientIdentifier }, "LiveTest"); + + // Act + Response response = await notificationMessagesClient.SendMessageAsync(options); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendShippingConfirmationTemplateMessageShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClient(); + string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; + IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; + + var ThreeDays = new MessageTemplateTextValue("threeDays", "3"); + IEnumerable values = new List { ThreeDays }; + + MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( + body: new[] { ThreeDays.Name } + ); + + MessageTemplate template = new MessageTemplate("sample_shipping_confirmation", "en_us", values, bindings); + SendMessageOptions options = new SendMessageOptions(channelRegistrationId, recipients, template); + + // Act + Response response = await notificationMessagesClient.SendMessageAsync(options); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendPurchaseFeedbackTemplateMessageShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClient(); + string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; + IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; + + var image = new MessageTemplateImageValue("image", new Uri(ImageUrl)); + var product = new MessageTemplateTextValue("product", "Microsoft Office"); + + IEnumerable values = new List { image, product }; + MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( + header: new[] { image.Name }, + body: new[] { product.Name } + ); + MessageTemplate template = new MessageTemplate("sample_purchase_feedback", "en_us", values, bindings); + SendMessageOptions options = new SendMessageOptions(channelRegistrationId, recipients, template); + + // Act + Response response = await notificationMessagesClient.SendMessageAsync(options); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendIssueResolutionTemplateMessageShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClient(); + string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; + IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; + + var name = new MessageTemplateTextValue("name", "Gloria"); + var yes = new MessageTemplateQuickActionValue("yes", null, "Yay!"); + var no = new MessageTemplateQuickActionValue("no", null, "Nay!"); + + IEnumerable values = new List { name, yes, no }; + MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( + body: new[] { name.Name }, + button: new Dictionary { + { yes.Name, MessageTemplateValueWhatsAppSubType.QuickReply }, + { no.Name, MessageTemplateValueWhatsAppSubType.QuickReply } + } + ); + MessageTemplate template = new MessageTemplate("sample_issue_resolution", "en_us", values, bindings); + SendMessageOptions options = new SendMessageOptions(channelRegistrationId, recipients, template); + + // Act + Response response = await notificationMessagesClient.SendMessageAsync(options); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendHappyHourAnnocementTemplateMessageShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClient(); + string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; + IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; + + var venue = new MessageTemplateTextValue("venue", "Starbucks"); + var time = new MessageTemplateTextValue("time", "Today 2-4PM"); + var video = new MessageTemplateVideoValue("video", new Uri(VideoUrl)); + + IEnumerable values = new List { venue, time, video }; + MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( + header: new[] { video.Name }, + body: new[] { venue.Name, time.Name } + ); + MessageTemplate template = new MessageTemplate("sample_happy_hour_announcement", "en_us", values, bindings); + SendMessageOptions options = new SendMessageOptions(channelRegistrationId, recipients, template); + + // Act + Response response = await notificationMessagesClient.SendMessageAsync(options); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendFlightConfirmationTemplateMessageShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClient(); + string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; + IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; + + var document = new MessageTemplateDocumentValue("document", new Uri(DocumentUrl)); + var firstName = new MessageTemplateTextValue("firstName", "Gloria"); + var lastName = new MessageTemplateTextValue("lastName", "Li"); + var date = new MessageTemplateTextValue("date", "July 1st, 2023"); + + IEnumerable values = new List { document, firstName, lastName, date }; + MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( + header: new[] { document.Name }, + body: new[] { firstName.Name, lastName.Name, date.Name } + ); + MessageTemplate template = new MessageTemplate("sample_flight_confirmation", "en_us", values, bindings); + SendMessageOptions options = new SendMessageOptions(channelRegistrationId, recipients, template); + + // Act + Response response = await notificationMessagesClient.SendMessageAsync(options); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendMovieTicketConfirmationTemplateMessageShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClient(); + string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; + IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; + + var image = new MessageTemplateImageValue("image", new Uri(ImageUrl)); + var title = new MessageTemplateTextValue("title", "Avengers"); + var time = new MessageTemplateTextValue("time", "July 1st, 2023 12:30PM"); + var venue = new MessageTemplateTextValue("venue", "Cineplex"); + var seats = new MessageTemplateTextValue("seats", "Seat 1A"); + IEnumerable values = new List { image, title, time, venue, seats }; + MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( + header: new[] { image.Name }, + body: new[] { title.Name, time.Name, venue.Name, seats.Name } + ); + MessageTemplate template = new MessageTemplate("sample_movie_ticket_confirmation", "en_us", values, bindings); + SendMessageOptions options = new SendMessageOptions(channelRegistrationId, recipients, template); + + // Act + Response response = await notificationMessagesClient.SendMessageAsync(options); + + // Assert + validateResponse(response); + } + + private void validateResponse(Response response) + { + Assert.AreEqual(202, response.GetRawResponse().Status); + Assert.IsNotNull(response.Value.Receipts[0].MessageId); + Assert.IsNotNull(response.Value.Receipts[0].To); + Assert.AreEqual(TestEnvironment.RecipientIdentifier, response.Value.Receipts[0].To); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientTests.cs b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientTests.cs new file mode 100644 index 000000000000..1be3268dcbfd --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientTests.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Microsoft.Extensions.Options; +using NUnit.Framework; + +namespace Azure.Communication.Messages.Tests +{ + public class NotificationMessagesClientTests : ClientTestBase + { + protected const string ConnectionString = "endpoint=https://contoso.azure.com/;accesskey=ZHVtbXlhY2Nlc3NrZXk="; + + private const string SendMessageApiResponsePayload = "{\"receipts\":[{\"messageId\":\"d53605de-2f6e-437d-9e40-8d83b2111cb8\",\"to\":\"+1(123)456-7890\"}]}"; + + public NotificationMessagesClientTests(bool isAsync) : base(isAsync) + { + } + + [Test] + public void Constructor_InvalidParamsThrows() + { + Assert.Throws(() => new NotificationMessagesClient(null)); + Assert.Throws(() => new NotificationMessagesClient(string.Empty)); + Assert.Throws(() => new NotificationMessagesClient(" ")); + Assert.Throws(() => new NotificationMessagesClient("test")); + } + + [Test] + public async Task SendMessage_ValidParams_ShouldSucceed() + { + //arrange + NotificationMessagesClient notificationMessagesClient = CreateMockNotificationMessagesClient(202, SendMessageApiResponsePayload); + + //act + SendMessageOptions sendMessageOptions = new SendMessageOptions("testChannelRegistrationId", new List { "+1(123)456-7890" }, "testMessage"); + SendMessageResult sendMessageResult = await notificationMessagesClient.SendMessageAsync(sendMessageOptions); + + //assert + Assert.IsNotNull(sendMessageResult.Receipts[0].MessageId); + Assert.IsNotNull(sendMessageResult.Receipts[0].To); + Assert.AreEqual("d53605de-2f6e-437d-9e40-8d83b2111cb8", sendMessageResult.Receipts[0].MessageId); + Assert.AreEqual("+1(123)456-7890", sendMessageResult.Receipts[0].To); + } + + [Test] + public void SendNotificationMessage_NullSendMessageOptions_Throws() + { + //arrange + NotificationMessagesClient notificationMessagesClient = CreateMockNotificationMessagesClient(); + + //act & assert + Assert.ThrowsAsync(async () => await notificationMessagesClient.SendMessageAsync(null)); + } + + [Test] + public async Task SendMessage_InvalidChannelRegistrationId_ThrowsBadRequestException() + { + //arrange + NotificationMessagesClient notificationMessagesClient = CreateMockNotificationMessagesClient(400); + + try + { + //act + SendMessageOptions sendMessageOptions = new SendMessageOptions("invalidChannelRegistrationId", new List { "+1(123)456-7890" }, "testMessage"); + await notificationMessagesClient.SendMessageAsync(sendMessageOptions); + } + catch (RequestFailedException requestFailedException) + { + //assert + Assert.AreEqual(400, requestFailedException.Status); + } + } + + private NotificationMessagesClient CreateMockNotificationMessagesClient(int responseCode = 202, string responseContent = null) + { + var mockResponse = new MockResponse(responseCode); + if (responseContent != null) + { + mockResponse.SetContent(responseContent); + } + + var notificationMessagesClientOptions = new CommunicationMessagesClientOptions + { + Transport = new MockTransport(mockResponse) + }; + + return new NotificationMessagesClient(ConnectionString, notificationMessagesClientOptions); + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json new file mode 100644 index 000000000000..03057d524014 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json @@ -0,0 +1,104 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "584", + "Content-Type": "application/json", + "traceparent": "00-95dd7128e3939f3e97c3dfeda41c73d3-876be18b0a043922-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "407661817cac20de2bf9f6e563e67ab8", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:21:54 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_flight_confirmation", + "language": "en_us", + "values": { + "document": { + "kind": "document", + "document": { + "url": "https://go.microsoft.com/fwlink/?linkid=2131549" + } + }, + "firstName": { + "kind": "text", + "text": { + "text": "Gloria" + } + }, + "lastName": { + "kind": "text", + "text": { + "text": "Li" + } + }, + "date": { + "kind": "text", + "text": { + "text": "July 1st, 2023" + } + } + }, + "bindings": { + "whatsApp": { + "header": [ + { + "refValue": "document" + } + ], + "body": [ + { + "refValue": "firstName" + }, + { + "refValue": "lastName" + }, + { + "refValue": "date" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:02 GMT", + "MS-CV": "bgxxKVzO6UyuQLEsGOqU1w.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0KGfAZAAAAAB\u002Be8NiPXKnRKZxRW5l3IBYWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "2728ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "70dd919a-2a58-4ca3-88fe-e2acffc55952", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1734501182", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json new file mode 100644 index 000000000000..bb0425a64623 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json @@ -0,0 +1,104 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "584", + "Content-Type": "application/json", + "traceparent": "00-9d78b91ecc5b3e001d68a742f212c4e8-3443caf81c0c62e3-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b072ab85e3ed42e97718f547625b906c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:03 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_flight_confirmation", + "language": "en_us", + "values": { + "document": { + "kind": "document", + "document": { + "url": "https://go.microsoft.com/fwlink/?linkid=2131549" + } + }, + "firstName": { + "kind": "text", + "text": { + "text": "Gloria" + } + }, + "lastName": { + "kind": "text", + "text": { + "text": "Li" + } + }, + "date": { + "kind": "text", + "text": { + "text": "July 1st, 2023" + } + } + }, + "bindings": { + "whatsApp": { + "header": [ + { + "refValue": "document" + } + ], + "body": [ + { + "refValue": "firstName" + }, + { + "refValue": "lastName" + }, + { + "refValue": "date" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:08 GMT", + "MS-CV": "rqMcat/uaUy4hvHnk9m\u002BAA.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0MGfAZAAAAACX0QnLsnkRSLQCEGzo4OEIWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "616ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "58072b86-8ad1-456e-85ce-33f7ff299602", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1949570673", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json new file mode 100644 index 000000000000..703f15feeecf --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json @@ -0,0 +1,95 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "519", + "Content-Type": "application/json", + "traceparent": "00-69ee1adbacefa0bf397f9679a6e954ac-4848c5cdaa1dd531-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5b4a712dbd94bca242de3f67a9e7e602", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:21:57 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_happy_hour_announcement", + "language": "en_us", + "values": { + "venue": { + "kind": "text", + "text": { + "text": "Starbucks" + } + }, + "time": { + "kind": "text", + "text": { + "text": "Today 2-4PM" + } + }, + "video": { + "kind": "video", + "video": { + "url": "https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4" + } + } + }, + "bindings": { + "whatsApp": { + "header": [ + { + "refValue": "video" + } + ], + "body": [ + { + "refValue": "venue" + }, + { + "refValue": "time" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:03 GMT", + "MS-CV": "vhA0hvcErUWIu7PWWj1IAQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0K2fAZAAAAAD6GTKR43ItT5gN85iLmlByWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "1144ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "24980b84-3a83-477b-a5d0-2c30314deb96", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1225023802", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json new file mode 100644 index 000000000000..4be1447d6ccd --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json @@ -0,0 +1,95 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "519", + "Content-Type": "application/json", + "traceparent": "00-6e752998f0f1d389087d9014a5693461-b4135bb032c30196-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "681b74cb99ee1e83092af1f6ee05b6a1", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:03 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_happy_hour_announcement", + "language": "en_us", + "values": { + "venue": { + "kind": "text", + "text": { + "text": "Starbucks" + } + }, + "time": { + "kind": "text", + "text": { + "text": "Today 2-4PM" + } + }, + "video": { + "kind": "video", + "video": { + "url": "https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4" + } + } + }, + "bindings": { + "whatsApp": { + "header": [ + { + "refValue": "video" + } + ], + "body": [ + { + "refValue": "venue" + }, + { + "refValue": "time" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:09 GMT", + "MS-CV": "CGCegYbzDE\u002BF9p9VjsCuuw.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0MWfAZAAAAAC7Rbp5G3JcRJOX24iyM0NZWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "598ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "36b82448-1689-46fa-9e61-a453a4527172", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "868327278", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json new file mode 100644 index 000000000000..4dfc6c6d97ef --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json @@ -0,0 +1,97 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "507", + "Content-Type": "application/json", + "traceparent": "00-6768f740d79bc52e05606c0a04c72534-95d7e564181f9c42-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "8d012aec2843daa8c15a2e670783c319", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:21:58 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_issue_resolution", + "language": "en_us", + "values": { + "name": { + "kind": "text", + "text": { + "text": "Gloria" + } + }, + "yes": { + "kind": "quick_action", + "quickAction": { + "payload": "Yay!" + } + }, + "no": { + "kind": "quick_action", + "quickAction": { + "payload": "Nay!" + } + } + }, + "bindings": { + "whatsApp": { + "body": [ + { + "refValue": "name" + } + ], + "button": [ + { + "subType": "quickReply", + "refValue": "yes" + }, + { + "subType": "quickReply", + "refValue": "no" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:04 GMT", + "MS-CV": "Hpx8bHFIuEedhGU/x\u002BDO8g.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0LGfAZAAAAAC8g9E6zWeMT7Lhwk3Rzn\u002BDWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "1030ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "9a52b556-f82e-4b4b-8e15-1e7118d9ce9c", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "302563361", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json new file mode 100644 index 000000000000..dd6d04ef613f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json @@ -0,0 +1,97 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "507", + "Content-Type": "application/json", + "traceparent": "00-1463f1c8b61e6802cdabf22370e2c1ee-9ca3c5150f6dde32-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "0cff882f94f231639abcae7656b92363", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:04 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_issue_resolution", + "language": "en_us", + "values": { + "name": { + "kind": "text", + "text": { + "text": "Gloria" + } + }, + "yes": { + "kind": "quick_action", + "quickAction": { + "payload": "Yay!" + } + }, + "no": { + "kind": "quick_action", + "quickAction": { + "payload": "Nay!" + } + } + }, + "bindings": { + "whatsApp": { + "body": [ + { + "refValue": "name" + } + ], + "button": [ + { + "subType": "quickReply", + "refValue": "yes" + }, + { + "subType": "quickReply", + "refValue": "no" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:10 GMT", + "MS-CV": "CNX18BjTKEeRxunm9H3lgA.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0MmfAZAAAAADEi3E96seeSb/WPwH4/Ui/WVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "535ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "c771963b-c0a1-473c-ad71-aa8e335ea3d1", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1687097116", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json new file mode 100644 index 000000000000..7daf5e3e3ff3 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json @@ -0,0 +1,55 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "126", + "Content-Type": "application/json", + "traceparent": "00-0e9da864f99060e72bff362a56533909-efbbc8eb396bbb2f-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "85cf457f40d4391eb90a2e9984f4208c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:21:59 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "text", + "content": "LiveTest" + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:05 GMT", + "MS-CV": "t0/AK14ItEGLH0Dv3FCiGQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0LWfAZAAAAAC0BFmWBSolTabDcgInvi5DWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "815ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "b0dfcfaa-9aa9-4073-b362-e6f820436217", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1355541795", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json new file mode 100644 index 000000000000..c681b3b69172 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json @@ -0,0 +1,55 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "126", + "Content-Type": "application/json", + "traceparent": "00-aed5ba4eb20e397703b29df1fabb4ed4-85a1c62ae9088f25-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "a9adb279ff46d2e852ece92e332b23ef", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:05 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "text", + "content": "LiveTest" + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:10 GMT", + "MS-CV": "jM7ngFneHkqkgaG6Wt776A.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0MmfAZAAAAAC5D9W2KN/SRosK9YWT0CogWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "760ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "4d4dd5ff-10bf-41ee-a20e-b4d7c5898dc3", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "452774152", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json new file mode 100644 index 000000000000..45d231e97041 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json @@ -0,0 +1,113 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "679", + "Content-Type": "application/json", + "traceparent": "00-28535d3ccd5ffbda7db663df15829fc0-2eb4c83f53fc377b-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "c9b110481c4ed008ebf11f8a72d60f2b", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:00 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_movie_ticket_confirmation", + "language": "en_us", + "values": { + "image": { + "kind": "image", + "image": { + "url": "https://upload.wikimedia.org/wikipedia/commons/3/30/Building92microsoft.jpg" + } + }, + "title": { + "kind": "text", + "text": { + "text": "Avengers" + } + }, + "time": { + "kind": "text", + "text": { + "text": "July 1st, 2023 12:30PM" + } + }, + "venue": { + "kind": "text", + "text": { + "text": "Cineplex" + } + }, + "seats": { + "kind": "text", + "text": { + "text": "Seat 1A" + } + } + }, + "bindings": { + "whatsApp": { + "header": [ + { + "refValue": "image" + } + ], + "body": [ + { + "refValue": "title" + }, + { + "refValue": "time" + }, + { + "refValue": "venue" + }, + { + "refValue": "seats" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:06 GMT", + "MS-CV": "k5yrOtsvZUyoxrfPVQaxEQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0LmfAZAAAAACxx2kacp9QQKFsJM8bgakDWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "684ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "c7792fa4-7c63-43c7-b600-d013b9c03cc2", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1635571988", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json new file mode 100644 index 000000000000..94ed0c9a5bd9 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json @@ -0,0 +1,113 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "679", + "Content-Type": "application/json", + "traceparent": "00-6a12d387a5d6a77b7b9bbf07e934c0a7-6897cdd7e52e9409-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "6483009e3bb0e6339ab62660b736b64b", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:05 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_movie_ticket_confirmation", + "language": "en_us", + "values": { + "image": { + "kind": "image", + "image": { + "url": "https://upload.wikimedia.org/wikipedia/commons/3/30/Building92microsoft.jpg" + } + }, + "title": { + "kind": "text", + "text": { + "text": "Avengers" + } + }, + "time": { + "kind": "text", + "text": { + "text": "July 1st, 2023 12:30PM" + } + }, + "venue": { + "kind": "text", + "text": { + "text": "Cineplex" + } + }, + "seats": { + "kind": "text", + "text": { + "text": "Seat 1A" + } + } + }, + "bindings": { + "whatsApp": { + "header": [ + { + "refValue": "image" + } + ], + "body": [ + { + "refValue": "title" + }, + { + "refValue": "time" + }, + { + "refValue": "venue" + }, + { + "refValue": "seats" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:11 GMT", + "MS-CV": "2pd6dKQAG0atYFLYiqGdkw.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0M2fAZAAAAACgmaoU/q8CQbQNNcCgNgu0WVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "648ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "26d16e50-008d-4247-8a14-644091a2c007", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "820457927", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json new file mode 100644 index 000000000000..834064ae8eb3 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json @@ -0,0 +1,86 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "456", + "Content-Type": "application/json", + "traceparent": "00-e10c780bba399db31c97882862885bd9-64d80655544d836a-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b7aaa4647ce940e6ed23b7e28e025a5a", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:01 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_purchase_feedback", + "language": "en_us", + "values": { + "image": { + "kind": "image", + "image": { + "url": "https://upload.wikimedia.org/wikipedia/commons/3/30/Building92microsoft.jpg" + } + }, + "product": { + "kind": "text", + "text": { + "text": "Microsoft Office" + } + } + }, + "bindings": { + "whatsApp": { + "header": [ + { + "refValue": "image" + } + ], + "body": [ + { + "refValue": "product" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:07 GMT", + "MS-CV": "5TMAHYTbmUeEDqSRQLIHRQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0L2fAZAAAAACm0q5Q4aCcSpHp3j\u002BapLWkWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "702ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "7152dc2a-41b3-419c-a132-2122ae2cc45a", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "588920776", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json new file mode 100644 index 000000000000..7dd906aa09d0 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json @@ -0,0 +1,86 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "456", + "Content-Type": "application/json", + "traceparent": "00-13fd74e7ab7a0ea94910ed207c002f08-7700dfb1591b76ab-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "698d5919b6ca20be0de7833fc502545e", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:06 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_purchase_feedback", + "language": "en_us", + "values": { + "image": { + "kind": "image", + "image": { + "url": "https://upload.wikimedia.org/wikipedia/commons/3/30/Building92microsoft.jpg" + } + }, + "product": { + "kind": "text", + "text": { + "text": "Microsoft Office" + } + } + }, + "bindings": { + "whatsApp": { + "header": [ + { + "refValue": "image" + } + ], + "body": [ + { + "refValue": "product" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:12 GMT", + "MS-CV": "ozm/NX9gqEyvsQmn9AwLKA.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0NGfAZAAAAAAmmy5i7WeGR6UY30BkgPMGWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "631ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "d8bed360-8360-433a-b00c-e1a5a3e25b50", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1345316686", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json new file mode 100644 index 000000000000..4b1be7df38b1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "298", + "Content-Type": "application/json", + "traceparent": "00-617612969a9f5f2f6cb0fb7d8fb48ca9-28a7805473b0851f-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "a4add0ea94e6fcd6910bd9a031b25bdf", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:02 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_shipping_confirmation", + "language": "en_us", + "values": { + "threeDays": { + "kind": "text", + "text": { + "text": "3" + } + } + }, + "bindings": { + "whatsApp": { + "body": [ + { + "refValue": "threeDays" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:08 GMT", + "MS-CV": "fW0MllTv/02xg9TLBBQaZA.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0MGfAZAAAAAClOafE0R09TLPM1q9jZ0nRWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "732ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "5b5238b8-c801-4375-8e12-d4a8ba8a5172", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1641745930", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json new file mode 100644 index 000000000000..0fdf10e01cf5 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "298", + "Content-Type": "application/json", + "traceparent": "00-ad790380b6d028018101c2c8af1ea563-1bd6b28b566bef1f-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "9a86b014c2cbfc27399767583ef9aa63", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 00:22:07 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16043609258" + ], + "type": "template", + "template": { + "name": "sample_shipping_confirmation", + "language": "en_us", + "values": { + "threeDays": { + "kind": "text", + "text": { + "text": "3" + } + } + }, + "bindings": { + "whatsApp": { + "body": [ + { + "refValue": "threeDays" + } + ] + } + } + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 00:22:12 GMT", + "MS-CV": "Xv9APJc8CUOQ5VEZaNjsDQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0NWfAZAAAAACQJS\u002BjyG51Qp2jA8izifIaWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "528ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "4ad633ce-258c-4be6-87f6-318dc5d40f38", + "to": "\u002B16043609258" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1967587484", + "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs new file mode 100644 index 000000000000..dee4055c1559 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Communication.Messages.Tests +{ + public class MessageTemplateClientLiveTests : MessagesLiveTestBase + { + public MessageTemplateClientLiveTests(bool isAsync) : base(isAsync) + { + } + + [Test] + public async Task GetTemplatesShouldSucceed() + { + // Arrange + MessageTemplateClient messageTemplateClient = CreateInstrumentedMessageTemplateClient(); + string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; + + // Act + AsyncPageable templates = messageTemplateClient.GetTemplatesAsync(channelRegistrationId); + + var geTemplatesCount = templates.ToEnumerableAsync().Result.Count; + + await foreach (MessageTemplateItem template in templates) + { + Console.WriteLine($"{template.Name}"); + } + + // Assert + Assert.IsNotNull(templates); + } + } +} diff --git a/sdk/communication/Azure.Communication.sln b/sdk/communication/Azure.Communication.sln index d44b404a05ae..e0dd68e82743 100644 --- a/sdk/communication/Azure.Communication.sln +++ b/sdk/communication/Azure.Communication.sln @@ -68,6 +68,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Communication.CallAut EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Communication.CallAutomation.Tests", "Azure.Communication.CallAutomation\tests\Azure.Communication.CallAutomation.Tests.csproj", "{8E628698-3ECB-4FA0-BDDF-62E018FDA0CA}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Communication.Messages", "Azure.Communication.Messages\src\Azure.Communication.Messages.csproj", "{EC7299A9-8563-4FF3-97E2-CB3DDE8AEFBE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Communication.Messages.Tests", "Azure.Communication.Messages\tests\Azure.Communication.Messages.Tests.csproj", "{4232B393-700D-4AC5-9358-70ED4B98B0ED}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -190,6 +194,14 @@ Global {8E628698-3ECB-4FA0-BDDF-62E018FDA0CA}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E628698-3ECB-4FA0-BDDF-62E018FDA0CA}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E628698-3ECB-4FA0-BDDF-62E018FDA0CA}.Release|Any CPU.Build.0 = Release|Any CPU + {EC7299A9-8563-4FF3-97E2-CB3DDE8AEFBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC7299A9-8563-4FF3-97E2-CB3DDE8AEFBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC7299A9-8563-4FF3-97E2-CB3DDE8AEFBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC7299A9-8563-4FF3-97E2-CB3DDE8AEFBE}.Release|Any CPU.Build.0 = Release|Any CPU + {4232B393-700D-4AC5-9358-70ED4B98B0ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4232B393-700D-4AC5-9358-70ED4B98B0ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4232B393-700D-4AC5-9358-70ED4B98B0ED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4232B393-700D-4AC5-9358-70ED4B98B0ED}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/communication/ci.yml b/sdk/communication/ci.yml index e1d00ba3b8e4..fd304e1b6411 100644 --- a/sdk/communication/ci.yml +++ b/sdk/communication/ci.yml @@ -39,6 +39,8 @@ extends: safeName: AzureCommunicationCallingServer - name: Azure.Communication.Chat safeName: AzureCommunicationChat + - name: Azure.Communication.Messages + safeName: AzureCommunicationMessages - name: Azure.Communication.Common safeName: AzureCommunicationCommon - name: Azure.Communication.Email From d59b73ac141b1ac17431c4287ce35bfd2cd55993 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Tue, 25 Jul 2023 20:51:39 -0700 Subject: [PATCH 02/24] Work around the issue with nextLink never empty, add more tests --- .../src/MessageTemplateClient.cs | 13 + .../GetTemplatesShouldSucceed.json | 724 ++++++++++++++++++ .../GetTemplatesShouldSucceedAsync.json | 724 ++++++++++++++++++ .../MessageTemplateClientLiveTests.cs | 16 +- .../MessageTemplateClientTests.cs | 95 +++ 5 files changed, 1565 insertions(+), 7 deletions(-) create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientTests.cs diff --git a/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs b/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs index ba6789b1051a..b341862c19d2 100644 --- a/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -105,6 +106,8 @@ protected MessageTemplateClient() /// The server returned an error. See for details returned from the server. public virtual AsyncPageable GetTemplatesAsync(string channelRegistrationId, CancellationToken cancellationToken = default) { + _ = channelRegistrationId ?? throw new ArgumentNullException(nameof(channelRegistrationId)); + async Task> FirstPageFunc(int? pageSizeHint) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MessageTemplateClient)}.{nameof(GetTemplates)}"); @@ -130,6 +133,10 @@ async Task> NextPageFunc(string nextLink, int? pageSiz try { Response response = await _templateV2RestClient.ListNextPageAsync(nextLink, new Guid(channelRegistrationId), pageSizeHint, cancellationToken).ConfigureAwait(false); + if (response.Value.Value == null || response.Value.Value.Count == 0) + { + return Page.FromValues(new List(), null, response.GetRawResponse()); + } return Page.FromValues(response.Value.Value.Select(x => new MessageTemplateItem(x)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -147,6 +154,8 @@ async Task> NextPageFunc(string nextLink, int? pageSiz /// The server returned an error. See for details returned from the server. public virtual Pageable GetTemplates(string channelRegistrationId, CancellationToken cancellationToken = default) { + _ = channelRegistrationId ?? throw new ArgumentNullException(nameof(channelRegistrationId)); + Page FirstPageFunc(int? pageSizeHint) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MessageTemplateClient)}.{nameof(GetTemplates)}"); @@ -172,6 +181,10 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) try { Response response = _templateV2RestClient.ListNextPage(nextLink, new Guid(channelRegistrationId), pageSizeHint, cancellationToken); + if (response.Value.Value == null || response.Value.Value.Count == 0) + { + return Page.FromValues(new List(), null, response.GetRawResponse()); + } return Page.FromValues(response.Value.Value.Select(x => new MessageTemplateItem(x)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json new file mode 100644 index 000000000000..be25f50e349a --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json @@ -0,0 +1,724 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-c32ea118e895e2965aee1a2a3774771b-f4e056d57fd2f6f0-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "767963739d067f27bf6c0b0d786938a0", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 03:50:04 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "9864", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 03:50:11 GMT", + "MS-CV": "LEPthilkB0SIG099m4Qgfg.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "08pfAZAAAAADI07LXl9WVSJstIDTzE4f3WVRPMjIxMDkwODE5MDExADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "1519ms" + }, + "ResponseBody": { + "value": [ + { + "name": "optin_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Reply {{1}} to receive {{2}}. Txt {{3}} for HELP, Txt {{4}} to opt-out.", + "example": { + "body_text": [ + [ + "Y", + "appointment reminders", + "HELP", + "STOP" + ] + ] + } + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "This is your flight confirmation for {{1}}-{{2}} on {{3}}." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Esta \u00E9 a sua confirma\u00E7\u00E3o de voo para {{1}}-{{2}} em {{3}}." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Confirmamos tu vuelo a {{1}}-{{2}} para el {{3}}." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Ini merupakan konfirmasi penerbangan Anda untuk {{1}}-{{2}} di {{3}}." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Terima kasih sudah membeli {{1}}! Kami menghargai masukan Anda dan ingin mempelajari lebih lanjut terkait pengalaman Anda." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Ikuti survei", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Thank you for purchasing {{1}}! We value your feedback and would like to learn more about your experience." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Take Survey", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Agradecemos a aquisi\u00E7\u00E3o de {{1}}! Valorizamos seu feedback e gostar\u00EDamos de saber mais sobre sua experi\u00EAncia." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Responder \u00E0 pesquisa", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "\u00A1Gracias por comprar {{1}}! Valoramos tus comentarios y nos gustar\u00EDa saber c\u00F3mo fue tu experiencia." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Responder encuesta", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "Jam diskon telah tiba! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nBergembiralah dan nikmati hari Anda. \uD83C\uDF89\nTempat: {{1}}\nWaktu: {{2}}" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "\u00A1Lleg\u00F3 el happy hour! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nA divertirse y disfrutar. \uD83C\uDF89\nLugar: {{1}}\nHora: {{2}}" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "O happy hour chegou! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nSeja feliz e aproveite o dia. \uD83C\uDF89\nLocal: {{1}}\nHor\u00E1rio: {{2}}" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "Happy hour is here! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nPlease be merry and enjoy the day. \uD83C\uDF89\nVenue: {{1}}\nTime: {{2}}" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Oi, {{1}}. N\u00F3s conseguimos resolver o problema que voc\u00EA estava enfrentando?" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Sim" + }, + { + "type": "QUICK_REPLY", + "text": "N\u00E3o" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Hi {{1}}, were we able to solve the issue that you were facing?" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Yes" + }, + { + "type": "QUICK_REPLY", + "text": "No" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Halo {{1}}, apakah kami bisa mengatasi masalah yang sedang Anda hadapi?" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Ya" + }, + { + "type": "QUICK_REPLY", + "text": "Tidak" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Hola, {{1}}. \u00BFPudiste solucionar el problema que ten\u00EDas?" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "S\u00ED" + }, + { + "type": "QUICK_REPLY", + "text": "No" + } + ] + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Tu entrada para *{{1}}*\n*Hora* - {{2}}\n*Lugar* - {{3}}\n*Asientos* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Seu ingresso para *{{1}}*\n*Hor\u00E1rio* - {{2}}\n*Local* - {{3}}\n*Assentos* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Your ticket for *{{1}}*\n*Time* - {{2}}\n*Venue* - {{3}}\n*Seats* - {{4}}" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Tiket Anda untuk *{{1}}*\n*Waktu* - {{2}}\n*Tempat* - {{3}}\n*Kursi* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Your package has been shipped. It will be delivered in {{1}} business days." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Seu pacote foi enviado. Ele ser\u00E1 entregue em {{1}} dias \u00FAteis." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "\u00F3 tu paquete. La entrega se realizar\u00E1 en {{1}} d\u00ED." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Paket Anda sudah dikirim. Paket akan sampai dalam {{1}} hari kerja." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "appointment_reminder", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Dear {{1}} {{2}}, your next appointment with {{3}} is scheduled for {{4}}. Reply YES to confirm.", + "example": { + "body_text": [ + [ + "Eugenia", + "Lopez", + "Lamna Healthcare", + "September 25, 2022 at 9:00 AM" + ] + ] + } + } + ] + } + }, + { + "name": "order_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Your {{1}} order has been placed. Track order updates {{2}} Reply HELP for help." + } + ] + } + } + ], + "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD" + } + }, + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0f43087e96877c3213f45c9735769266-18849d9d9c2622df-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "6c666b63cd4bf7b792fbaddaf0c6b2a5", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 03:50:06 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "232", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 03:50:12 GMT", + "MS-CV": "na8o/ioldkWVyQ6xQ1O1wQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "09JfAZAAAAACgmhu3/8AHQK8PamQnxyuDWVRPMjIxMDkwODE5MDExADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "830ms" + }, + "ResponseBody": { + "value": [], + "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD\u0026api-version=2023-02-01-preview\u0026continuationToken=NDkZD" + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "583538541", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json new file mode 100644 index 000000000000..f0a49c180934 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json @@ -0,0 +1,724 @@ +{ + "Entries": [ + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-5ee7fd8f3d08e3e15113f46855a388dc-6d72ff9b8c5b6580-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "4b3c732e0fd07e611c2467315e0ddab9", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 03:50:07 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "9864", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 03:50:13 GMT", + "MS-CV": "rhruCy6lLEeyOrTYfXDRWw.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "09ZfAZAAAAAAA\u002BQuW0aY\u002BSqVLSblwnjMnWVRPMjIxMDkwODE5MDExADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "309ms" + }, + "ResponseBody": { + "value": [ + { + "name": "optin_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Reply {{1}} to receive {{2}}. Txt {{3}} for HELP, Txt {{4}} to opt-out.", + "example": { + "body_text": [ + [ + "Y", + "appointment reminders", + "HELP", + "STOP" + ] + ] + } + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "This is your flight confirmation for {{1}}-{{2}} on {{3}}." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Esta \u00E9 a sua confirma\u00E7\u00E3o de voo para {{1}}-{{2}} em {{3}}." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Confirmamos tu vuelo a {{1}}-{{2}} para el {{3}}." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Ini merupakan konfirmasi penerbangan Anda untuk {{1}}-{{2}} di {{3}}." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Terima kasih sudah membeli {{1}}! Kami menghargai masukan Anda dan ingin mempelajari lebih lanjut terkait pengalaman Anda." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Ikuti survei", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Thank you for purchasing {{1}}! We value your feedback and would like to learn more about your experience." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Take Survey", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Agradecemos a aquisi\u00E7\u00E3o de {{1}}! Valorizamos seu feedback e gostar\u00EDamos de saber mais sobre sua experi\u00EAncia." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Responder \u00E0 pesquisa", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "\u00A1Gracias por comprar {{1}}! Valoramos tus comentarios y nos gustar\u00EDa saber c\u00F3mo fue tu experiencia." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Responder encuesta", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "Jam diskon telah tiba! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nBergembiralah dan nikmati hari Anda. \uD83C\uDF89\nTempat: {{1}}\nWaktu: {{2}}" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "\u00A1Lleg\u00F3 el happy hour! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nA divertirse y disfrutar. \uD83C\uDF89\nLugar: {{1}}\nHora: {{2}}" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "O happy hour chegou! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nSeja feliz e aproveite o dia. \uD83C\uDF89\nLocal: {{1}}\nHor\u00E1rio: {{2}}" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "Happy hour is here! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nPlease be merry and enjoy the day. \uD83C\uDF89\nVenue: {{1}}\nTime: {{2}}" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Oi, {{1}}. N\u00F3s conseguimos resolver o problema que voc\u00EA estava enfrentando?" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Sim" + }, + { + "type": "QUICK_REPLY", + "text": "N\u00E3o" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Hi {{1}}, were we able to solve the issue that you were facing?" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Yes" + }, + { + "type": "QUICK_REPLY", + "text": "No" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Halo {{1}}, apakah kami bisa mengatasi masalah yang sedang Anda hadapi?" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Ya" + }, + { + "type": "QUICK_REPLY", + "text": "Tidak" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Hola, {{1}}. \u00BFPudiste solucionar el problema que ten\u00EDas?" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "S\u00ED" + }, + { + "type": "QUICK_REPLY", + "text": "No" + } + ] + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Tu entrada para *{{1}}*\n*Hora* - {{2}}\n*Lugar* - {{3}}\n*Asientos* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Seu ingresso para *{{1}}*\n*Hor\u00E1rio* - {{2}}\n*Local* - {{3}}\n*Assentos* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Your ticket for *{{1}}*\n*Time* - {{2}}\n*Venue* - {{3}}\n*Seats* - {{4}}" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Tiket Anda untuk *{{1}}*\n*Waktu* - {{2}}\n*Tempat* - {{3}}\n*Kursi* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Your package has been shipped. It will be delivered in {{1}} business days." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Seu pacote foi enviado. Ele ser\u00E1 entregue em {{1}} dias \u00FAteis." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "\u00F3 tu paquete. La entrega se realizar\u00E1 en {{1}} d\u00ED." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Paket Anda sudah dikirim. Paket akan sampai dalam {{1}} hari kerja." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "appointment_reminder", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Dear {{1}} {{2}}, your next appointment with {{3}} is scheduled for {{4}}. Reply YES to confirm.", + "example": { + "body_text": [ + [ + "Eugenia", + "Lopez", + "Lamna Healthcare", + "September 25, 2022 at 9:00 AM" + ] + ] + } + } + ] + } + }, + { + "name": "order_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Your {{1}} order has been placed. Track order updates {{2}} Reply HELP for help." + } + ] + } + } + ], + "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD" + } + }, + { + "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-e1d2dad83f34eaf4f540863750023b6c-0c28ac00b8990bb5-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "a488c5c3f429a1ef880a6cd211d65daf", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Wed, 26 Jul 2023 03:50:08 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview", + "Content-Length": "232", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jul 2023 03:50:13 GMT", + "MS-CV": "BQih0mkzqk6aC4GnH8c79Q.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "09ZfAZAAAAAA3OQw7QrkVTKXzZOOOVjiQWVRPMjIxMDkwODE5MDExADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "526ms" + }, + "ResponseBody": { + "value": [], + "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD\u0026api-version=2023-02-01-preview\u0026continuationToken=NDkZD" + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1583860081", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs index dee4055c1559..1f4d7f9dbde2 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs @@ -15,7 +15,7 @@ public MessageTemplateClientLiveTests(bool isAsync) : base(isAsync) } [Test] - public async Task GetTemplatesShouldSucceed() + public Task GetTemplatesShouldSucceed() { // Arrange MessageTemplateClient messageTemplateClient = CreateInstrumentedMessageTemplateClient(); @@ -24,15 +24,17 @@ public async Task GetTemplatesShouldSucceed() // Act AsyncPageable templates = messageTemplateClient.GetTemplatesAsync(channelRegistrationId); - var geTemplatesCount = templates.ToEnumerableAsync().Result.Count; - - await foreach (MessageTemplateItem template in templates) + // Assert + Assert.IsNotNull(templates); + var templatesEnumerable = templates.ToEnumerableAsync().Result; + Assert.IsNotEmpty(templatesEnumerable); + foreach (MessageTemplateItem template in templatesEnumerable) { - Console.WriteLine($"{template.Name}"); + Assert.IsNotNull(template.Name); + Assert.IsNotNull(template.Language); } - // Assert - Assert.IsNotNull(templates); + return Task.CompletedTask; } } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientTests.cs b/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientTests.cs new file mode 100644 index 000000000000..bc4ef6d54886 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientTests.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Communication.Messages.Tests +{ + public class MessageTemplateClientTests : ClientTestBase + { + protected const string ConnectionString = "endpoint=https://contoso.azure.com/;accesskey=ZHVtbXlhY2Nlc3NrZXk="; + private const string GetTemplatesApiResponsePayload = "{\"value\":[{\"name\":\"optin_confirmation\",\"language\":\"en_US\",\"channelType\":\"whatsApp\",\"status\":\"approved\",\"whatsApp\":{\"content\":[{\"type\":\"BODY\",\"text\":\"Reply {{1}} to receive {{2}}. Txt {{3}} for HELP, Txt {{4}} to opt-out.\"}]}},{\"name\":\"sample_flight_confirmation\",\"language\":\"en_US\",\"channelType\":\"whatsApp\",\"status\":\"approved\",\"whatsApp\":{\"content\":[{\"type\":\"HEADER\",\"format\":\"DOCUMENT\"},{\"type\":\"BODY\",\"text\":\"This is your flight confirmation for {{1}}-{{2}} on {{3}}.\"},{\"type\":\"FOOTER\",\"text\":\"This message is from an unverified business.\"}]}},{\"name\":\"sample_happy_hour_announcement\",\"language\":\"pt_BR\",\"channelType\":\"whatsApp\",\"status\":\"approved\",\"whatsApp\":{\"content\":[{\"type\":\"HEADER\",\"format\":\"VIDEO\"},{\"type\":\"BODY\",\"text\":\"O happy hour chegou! \\ud83c\\udf7a😀\\ud83c\\udf78\\nSeja feliz e aproveite o dia. \\ud83c\\udf89\\nLocal: {{1}}\\nHorário: {{2}}\"},{\"type\":\"FOOTER\",\"text\":\"Esta mensagem é de uma empresa não verificada.\"}]}}]}"; + + public MessageTemplateClientTests(bool isAsync) : base(isAsync) + { + } + + [Test] + public void Constructor_InvalidParamsThrows() + { + Assert.Throws(() => new MessageTemplateClient(null)); + Assert.Throws(() => new MessageTemplateClient(string.Empty)); + Assert.Throws(() => new MessageTemplateClient(" ")); + Assert.Throws(() => new MessageTemplateClient("test")); + } + + [Test] + public async Task GetTemplates_ValidParams_ShouldSucceed() + { + //arrange + MessageTemplateClient messageTemplateClient = CreateMockMessageTemplateClient(200, GetTemplatesApiResponsePayload); + var channelId = Guid.NewGuid().ToString(); + + //act + AsyncPageable templates = messageTemplateClient.GetTemplatesAsync(channelId); + + //assert + await foreach (MessageTemplateItem template in templates) + { + Assert.IsNotNull(template.Name); + Assert.IsNotNull(template.Language); + Assert.IsNotNull(template.Status); + Assert.AreEqual(template.ChannelType, CommunicationMessagesChannelType.WhatsApp); + } + } + + [Test] + public void GetTemplates_NullChannelId_Throws() + { + //arrange + MessageTemplateClient messageTemplateClient = CreateMockMessageTemplateClient(); + + //act & assert + Assert.Throws(() => messageTemplateClient.GetTemplatesAsync(null)); + } + + [Test] + public Task GetTemplates_InvalidChannelRegistrationId_ThrowsBadRequestException() + { + //arrange + MessageTemplateClient messageTemplateClient = CreateMockMessageTemplateClient(400); + + try + { + //act + messageTemplateClient.GetTemplatesAsync("invalidChannelRegistrationId"); + } + catch (RequestFailedException requestFailedException) + { + //assert + Assert.AreEqual(400, requestFailedException.Status); + } + + return Task.CompletedTask; + } + + private MessageTemplateClient CreateMockMessageTemplateClient(int responseCode = 200, string responseContent = null) + { + var mockResponse = new MockResponse(responseCode); + if (responseContent != null) + { + mockResponse.SetContent(responseContent); + } + + var MessageTemplateClientOptions = new CommunicationMessagesClientOptions + { + Transport = new MockTransport(mockResponse) + }; + + return new MessageTemplateClient(ConnectionString, MessageTemplateClientOptions); + } + } +} From bfa03372487d107e94dfb6f8ea79d10077a1e878 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 08:48:26 -0700 Subject: [PATCH 03/24] Update CHANGELOG.md --- sdk/communication/Azure.Communication.Messages/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md index c57a956d781d..bb642faef88f 100644 --- a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.0.0-beta.2 (2023-08-15) + +### Features Added +- Added support for sending advanced template messages +- Added support for retreiving templates + ## 1.0.0-beta.1 (2022-10-11) ### Features Added From c2d65d4389202952b4dac7788557b16958185b6b Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 08:57:58 -0700 Subject: [PATCH 04/24] Update autorest and use Github link for input file --- sdk/communication/Azure.Communication.Messages/src/autorest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/autorest.md b/sdk/communication/Azure.Communication.Messages/src/autorest.md index 426e5c2e8a8b..6777e6ac5178 100644 --- a/sdk/communication/Azure.Communication.Messages/src/autorest.md +++ b/sdk/communication/Azure.Communication.Messages/src/autorest.md @@ -11,7 +11,7 @@ If any of the new objects needs to be overwritten, add the required changes to t > see https://aka.ms/autorest ``` yaml input-file: - - C:\repos\azure-rest-api-specs\specification\communication\data-plane\Messages\preview\2023-02-01-preview\CommunicationServicesMessages.json + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/gelli/addMessagingApiSpec/specification/communication/data-plane/Messages/preview/2023-02-01-preview/CommunicationServicesMessages.json payload-flattening-threshold: 10 generation1-convenience-client: true directive: From 90bb20abe942bc0b62a64a2e5036b49a7e311c00 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 09:19:56 -0700 Subject: [PATCH 05/24] Update README.md --- .../Azure.Communication.Messages/README.md | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/README.md b/sdk/communication/Azure.Communication.Messages/README.md index af329ec5a6c0..2adc17450937 100644 --- a/sdk/communication/Azure.Communication.Messages/README.md +++ b/sdk/communication/Azure.Communication.Messages/README.md @@ -33,7 +33,8 @@ Messages clients can be authenticated using the connection string acquired from ```C# var connectionString = ""; // Find your Communication Services resource in the Azure portal -NotificationMessagesClient client = new NotificationMessagesClient(connectionString); +NotificationMessagesClient notificationMessagesClient = new NotificationMessagesClient(connectionString); +MessageTemplateClient messageTemplateClient = new MessageTemplateClient(connectionString); ``` #### Token Credential @@ -43,13 +44,16 @@ Alternatively, Messages clients can also be authenticated using a valid token cr ```C# string endpoint = ""; TokenCredential tokenCredential = new DefaultAzureCredential(); -NotificationMessagesClient client = new NotificationMessagesClient(new Uri(endpoint), tokenCredential); +NotificationMessagesClient notificationMessagesClient = new NotificationMessagesClient(new Uri(endpoint), tokenCredential); +MessageTemplateClient messageTemplateClient = new MessageTemplateClient(new Uri(endpoint), tokenCredential); ``` ## Examples ### Send an Notification Message To send a notification message, call the `SendMessage` or `SendMessageAsync` function from the `NotificationMessagesClient`. + +#### Send a text message ```C# // Create the recipient list, currently only one recipient is supported var recipient = new List { "" }; @@ -58,6 +62,40 @@ SendMessageResult result = await notificationMessagesClient.SendMessageAsync(opt Console.WriteLine($"Message id: {result.Receipts[0].MessageId}"); ``` +#### Send a template message +```C# +// Create the recipient list, currently only one recipient is supported +var recipient = new List { "" }; +string templateName = "sample_template"; +string templateLanguage = "en_us"; +var messageTemplate = new MessageTemplate(templateName, templateLanguage); +var sendTemplateMessageOptions = new SendMessageOptions(channelRegistrationId, recipientList, messageTemplate); +SendMessageResult result = await notificationMessagesClient.SendMessageAsync(sendTemplateMessageOptions); +Console.WriteLine($"Message id: {result.Receipts[0].MessageId}"); +``` + +#### Send a media message +```C# +// Create the recipient list, currently only one recipient is supported +var recipient = new List { "" }; +var uri = new Uri("https://aka.ms/acsicon1"); +var sendMediaMessageOptions = new SendMessageOptions(channelRegistrationId, recipientList, uri); +SendMessageResult result = await notificationMessagesClient.SendMessageAsync(sendMediaMessageOptions); +Console.WriteLine($"Message id: {result.Receipts[0].MessageId}"); +``` + +### Retrieve templates +To retrieve templates, call the `GetMessages` or `GetMessagesAsync` function from the `MessageTemplateClient`. + + +```C# +AsyncPageable templates = messageTemplateClient.GetTemplatesAsync(channelId); +await foreach (MessageTemplateItem template in templates) +{ + Console.WriteLine($"{template.Name}"); +} +``` + ## Troubleshooting A `RequestFailedException` is thrown as a service response for any unsuccessful requests. The exception contains information about what response code was returned from the service. From 20cb30fccb018873095b9493dbcefda6077148e9 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 10:04:24 -0700 Subject: [PATCH 06/24] dropping the Value suffix on everything but the base class (MessageTemplateValue) --- ...entValue.cs => MessageTemplateDocument.cs} | 4 +-- ...eImageValue.cs => MessageTemplateImage.cs} | 4 +-- ...ionValue.cs => MessageTemplateLocation.cs} | 4 +-- ...ateTextValue.cs => MessageTemplateText.cs} | 4 +-- ...eVideoValue.cs => MessageTemplateVideo.cs} | 4 +-- .../NotificationMessagesClientLiveTests.cs | 32 +++++++++---------- 6 files changed, 26 insertions(+), 26 deletions(-) rename sdk/communication/Azure.Communication.Messages/src/Models/{MessageTemplateDocumentValue.cs => MessageTemplateDocument.cs} (85%) rename sdk/communication/Azure.Communication.Messages/src/Models/{MessageTemplateImageValue.cs => MessageTemplateImage.cs} (86%) rename sdk/communication/Azure.Communication.Messages/src/Models/{MessageTemplateLocationValue.cs => MessageTemplateLocation.cs} (86%) rename sdk/communication/Azure.Communication.Messages/src/Models/{MessageTemplateTextValue.cs => MessageTemplateText.cs} (82%) rename sdk/communication/Azure.Communication.Messages/src/Models/{MessageTemplateVideoValue.cs => MessageTemplateVideo.cs} (85%) diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocumentValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs similarity index 85% rename from sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocumentValue.cs rename to sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs index cff04fbefe44..a697c77fb7a0 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocumentValue.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs @@ -6,10 +6,10 @@ namespace Azure.Communication.Messages { /// - public class MessageTemplateDocumentValue: MessageTemplateValue + public class MessageTemplateDocument: MessageTemplateValue { /// - public MessageTemplateDocumentValue(string name, Uri url, string caption = null, string filename = null) : base(name) + public MessageTemplateDocument(string name, Uri url, string caption = null, string filename = null) : base(name) { Url = url; Caption = caption; diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImageValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs similarity index 86% rename from sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImageValue.cs rename to sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs index 830a2be5c406..ade7e2a378af 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImageValue.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs @@ -8,10 +8,10 @@ namespace Azure.Communication.Messages { /// - public class MessageTemplateImageValue: MessageTemplateValue + public class MessageTemplateImage: MessageTemplateValue { /// - public MessageTemplateImageValue(string name, Uri url, string caption = null, string filename = null) : base(name) + public MessageTemplateImage(string name, Uri url, string caption = null, string filename = null) : base(name) { Url = url; Caption = caption; diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocationValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocation.cs similarity index 86% rename from sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocationValue.cs rename to sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocation.cs index fee2e2741dec..d89ce369843e 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocationValue.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateLocation.cs @@ -4,10 +4,10 @@ namespace Azure.Communication.Messages { /// - public class MessageTemplateLocationValue : MessageTemplateValue + public class MessageTemplateLocation : MessageTemplateValue { /// - public MessageTemplateLocationValue(string name, double latitude, double longitude, string locationName = null, string address = null) + public MessageTemplateLocation(string name, double latitude, double longitude, string locationName = null, string address = null) : base(name) { Latitude = latitude; diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateTextValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateText.cs similarity index 82% rename from sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateTextValue.cs rename to sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateText.cs index 33bb65326933..0f7fb02a7e44 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateTextValue.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateText.cs @@ -4,10 +4,10 @@ namespace Azure.Communication.Messages { /// - public class MessageTemplateTextValue: MessageTemplateValue + public class MessageTemplateText: MessageTemplateValue { /// - public MessageTemplateTextValue(string name, string text) : base(name) + public MessageTemplateText(string name, string text) : base(name) { Text = text; } diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideoValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs similarity index 85% rename from sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideoValue.cs rename to sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs index 67551d992f97..063d27c57504 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideoValue.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs @@ -6,10 +6,10 @@ namespace Azure.Communication.Messages { /// - public class MessageTemplateVideoValue: MessageTemplateValue + public class MessageTemplateVideo: MessageTemplateValue { /// - public MessageTemplateVideoValue(string name, Uri url, string caption = null, string filename = null) : base(name) + public MessageTemplateVideo(string name, Uri url, string caption = null, string filename = null) : base(name) { Url = url; Caption = caption; diff --git a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs index 96f45db1e17f..d7a5755362b7 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs @@ -40,7 +40,7 @@ public async Task SendShippingConfirmationTemplateMessageShouldSucceed() string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; - var ThreeDays = new MessageTemplateTextValue("threeDays", "3"); + var ThreeDays = new MessageTemplateText("threeDays", "3"); IEnumerable values = new List { ThreeDays }; MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( @@ -65,8 +65,8 @@ public async Task SendPurchaseFeedbackTemplateMessageShouldSucceed() string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; - var image = new MessageTemplateImageValue("image", new Uri(ImageUrl)); - var product = new MessageTemplateTextValue("product", "Microsoft Office"); + var image = new MessageTemplateImage("image", new Uri(ImageUrl)); + var product = new MessageTemplateText("product", "Microsoft Office"); IEnumerable values = new List { image, product }; MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( @@ -91,7 +91,7 @@ public async Task SendIssueResolutionTemplateMessageShouldSucceed() string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; - var name = new MessageTemplateTextValue("name", "Gloria"); + var name = new MessageTemplateText("name", "Gloria"); var yes = new MessageTemplateQuickActionValue("yes", null, "Yay!"); var no = new MessageTemplateQuickActionValue("no", null, "Nay!"); @@ -121,9 +121,9 @@ public async Task SendHappyHourAnnocementTemplateMessageShouldSucceed() string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; - var venue = new MessageTemplateTextValue("venue", "Starbucks"); - var time = new MessageTemplateTextValue("time", "Today 2-4PM"); - var video = new MessageTemplateVideoValue("video", new Uri(VideoUrl)); + var venue = new MessageTemplateText("venue", "Starbucks"); + var time = new MessageTemplateText("time", "Today 2-4PM"); + var video = new MessageTemplateVideo("video", new Uri(VideoUrl)); IEnumerable values = new List { venue, time, video }; MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( @@ -148,10 +148,10 @@ public async Task SendFlightConfirmationTemplateMessageShouldSucceed() string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; - var document = new MessageTemplateDocumentValue("document", new Uri(DocumentUrl)); - var firstName = new MessageTemplateTextValue("firstName", "Gloria"); - var lastName = new MessageTemplateTextValue("lastName", "Li"); - var date = new MessageTemplateTextValue("date", "July 1st, 2023"); + var document = new MessageTemplateDocument("document", new Uri(DocumentUrl)); + var firstName = new MessageTemplateText("firstName", "Gloria"); + var lastName = new MessageTemplateText("lastName", "Li"); + var date = new MessageTemplateText("date", "July 1st, 2023"); IEnumerable values = new List { document, firstName, lastName, date }; MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( @@ -176,11 +176,11 @@ public async Task SendMovieTicketConfirmationTemplateMessageShouldSucceed() string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; - var image = new MessageTemplateImageValue("image", new Uri(ImageUrl)); - var title = new MessageTemplateTextValue("title", "Avengers"); - var time = new MessageTemplateTextValue("time", "July 1st, 2023 12:30PM"); - var venue = new MessageTemplateTextValue("venue", "Cineplex"); - var seats = new MessageTemplateTextValue("seats", "Seat 1A"); + var image = new MessageTemplateImage("image", new Uri(ImageUrl)); + var title = new MessageTemplateText("title", "Avengers"); + var time = new MessageTemplateText("time", "July 1st, 2023 12:30PM"); + var venue = new MessageTemplateText("venue", "Cineplex"); + var seats = new MessageTemplateText("seats", "Seat 1A"); IEnumerable values = new List { image, title, time, venue, seats }; MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( header: new[] { image.Name }, From 4fef9058d5705ea6c852a02fc14d2cb609122d55 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 10:08:09 -0700 Subject: [PATCH 07/24] change the param name from url to uri, filename to fileName --- .../MessageTemplateValueMedia.Serialization.cs | 4 ++-- .../Generated/Models/MessageTemplateValueMedia.cs | 2 +- .../src/Models/MessageTemplateDocument.cs | 14 +++++++------- .../src/Models/MessageTemplateImage.cs | 8 ++++---- .../src/Models/MessageTemplateVideo.cs | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs index ae66196ea8fb..424e29cfd0ef 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs @@ -15,10 +15,10 @@ internal partial class MessageTemplateValueMedia : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Url)) + if (Optional.IsDefined(Uri)) { writer.WritePropertyName("url"u8); - writer.WriteStringValue(Url.AbsoluteUri); + writer.WriteStringValue(Uri.AbsoluteUri); } if (Optional.IsDefined(Caption)) { diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs index ba3317e778a8..ddfe8abfc406 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs @@ -21,7 +21,7 @@ public MessageTemplateValueMedia() } /// The (public) URL of the media. - public Uri Url { get; set; } + public Uri Uri { get; set; } /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs index a697c77fb7a0..4745cf9511d8 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs @@ -9,28 +9,28 @@ namespace Azure.Communication.Messages public class MessageTemplateDocument: MessageTemplateValue { /// - public MessageTemplateDocument(string name, Uri url, string caption = null, string filename = null) : base(name) + public MessageTemplateDocument(string name, Uri uri, string caption = null, string filename = null) : base(name) { - Url = url; + Uri = uri; Caption = caption; - Filename = filename; + FileName = filename; } /// The (public) URL of the document media. - public Uri Url { get; set; } + public Uri Uri { get; set; } /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. - public string Filename { get; set; } + public string FileName { get; set; } internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() { return new MessageTemplateValueInternal(MessageTemplateValueKind.Document) { Document = new MessageTemplateValueMedia { - Url = Url, + Uri = Uri, Caption = Caption, - Filename = Filename + Filename = FileName } }; } diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs index ade7e2a378af..f0860fd8cf70 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs @@ -11,15 +11,15 @@ namespace Azure.Communication.Messages public class MessageTemplateImage: MessageTemplateValue { /// - public MessageTemplateImage(string name, Uri url, string caption = null, string filename = null) : base(name) + public MessageTemplateImage(string name, Uri uri, string caption = null, string filename = null) : base(name) { - Url = url; + Uri = uri; Caption = caption; Filename = filename; } /// The (public) URL of the document media. - public Uri Url { get; set; } + public Uri Uri { get; set; } /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. @@ -31,7 +31,7 @@ internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() { Image = new MessageTemplateValueMedia { - Url = Url, + Uri = Uri, Caption = Caption, Filename = Filename } diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs index 063d27c57504..052f82a6aafa 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs @@ -9,15 +9,15 @@ namespace Azure.Communication.Messages public class MessageTemplateVideo: MessageTemplateValue { /// - public MessageTemplateVideo(string name, Uri url, string caption = null, string filename = null) : base(name) + public MessageTemplateVideo(string name, Uri uri, string caption = null, string filename = null) : base(name) { - Url = url; + Uri = uri; Caption = caption; Filename = filename; } /// The (public) URL of the document media. - public Uri Url { get; set; } + public Uri Uri { get; set; } /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. @@ -28,7 +28,7 @@ internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() return new MessageTemplateValueInternal(MessageTemplateValueKind.Video) { Video = new MessageTemplateValueMedia { - Url = Url, + Uri = Uri, Caption = Caption, Filename = Filename } From dcd80ddb1d5eaf323fbc298076fc79dc90152e9e Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 10:23:51 -0700 Subject: [PATCH 08/24] Update CHANGELOG.md --- .../Azure.Communication.Messages/CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md index bb642faef88f..5af39cd70b54 100644 --- a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md @@ -1,12 +1,12 @@ # Release History -## 1.0.0-beta.2 (2023-08-15) +## 1.0.0-beta.1 (2023-08-15) -### Features Added -- Added support for sending advanced template messages -- Added support for retreiving templates +This is the first Public Preview release of Azure Communication Services for advanced messages. For more information, please see the [README][read_me] and [documentation][documentation]. -## 1.0.0-beta.1 (2022-10-11) +This is a Public Preview version, so breaking changes are possible in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + + +[read_me]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Messages/README.md +[documentation]: https://docs.microsoft.com/azure/communication-services/quickstarts/advancedmessaging/whatsapp/get-started -### Features Added -Add the SDK - Initial commit From 07357a2a6df38576b5e28113beb2a52876933566 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 10:27:32 -0700 Subject: [PATCH 09/24] revert accidental check in of RecordedTestMode --- .../tests/Infrastructure/MessagesLiveTestBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs index d9ccf356ddcb..2abf8fa54490 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs @@ -8,7 +8,7 @@ namespace Azure.Communication.Messages.Tests { public class MessagesLiveTestBase : RecordedTestBase { - public MessagesLiveTestBase(bool isAsync) : base(isAsync, RecordedTestMode.Record) + public MessagesLiveTestBase(bool isAsync) : base(isAsync) { SanitizedHeaders.Add("x-ms-content-sha256"); } From 07970fbbbe0a2f3318a4aeaaef262a2422f1d130 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 10:44:40 -0700 Subject: [PATCH 10/24] sanitize session records --- .../GetTemplatesShouldSucceed.json | 38 +++++++++---------- .../GetTemplatesShouldSucceedAsync.json | 38 +++++++++---------- ...firmationTemplateMessageShouldSucceed.json | 28 +++++++------- ...tionTemplateMessageShouldSucceedAsync.json | 28 +++++++------- ...nnocementTemplateMessageShouldSucceed.json | 28 +++++++------- ...mentTemplateMessageShouldSucceedAsync.json | 28 +++++++------- ...esolutionTemplateMessageShouldSucceed.json | 28 +++++++------- ...tionTemplateMessageShouldSucceedAsync.json | 28 +++++++------- .../SendMessageShouldSucceed.json | 28 +++++++------- .../SendMessageShouldSucceedAsync.json | 28 +++++++------- ...firmationTemplateMessageShouldSucceed.json | 28 +++++++------- ...tionTemplateMessageShouldSucceedAsync.json | 28 +++++++------- ...eFeedbackTemplateMessageShouldSucceed.json | 28 +++++++------- ...backTemplateMessageShouldSucceedAsync.json | 28 +++++++------- ...firmationTemplateMessageShouldSucceed.json | 28 +++++++------- ...tionTemplateMessageShouldSucceedAsync.json | 28 +++++++------- 16 files changed, 234 insertions(+), 234 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json index be25f50e349a..2cfaf8a81771 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json @@ -1,16 +1,16 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-c32ea118e895e2965aee1a2a3774771b-f4e056d57fd2f6f0-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "767963739d067f27bf6c0b0d786938a0", + "traceparent": "00-747bbe8ffa1a06d0502c620427689d49-adfbbb54d470490d-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "3d38eb74cc8e19be8e913768d2408107", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 03:50:04 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:17 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -19,13 +19,13 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "9864", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 03:50:11 GMT", - "MS-CV": "LEPthilkB0SIG099m4Qgfg.0", + "Date": "Wed, 26 Jul 2023 17:30:23 GMT", + "MS-CV": "luFe4KVoDEOe\u002BPEFCG0D0A.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "08pfAZAAAAADI07LXl9WVSJstIDTzE4f3WVRPMjIxMDkwODE5MDExADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0L1jBZAAAAACBdFrDdVvjTq/c\u002BZoGbgb7WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "1519ms" + "X-Processing-Time": "544ms" }, "ResponseBody": { "value": [ @@ -684,16 +684,16 @@ } }, { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-0f43087e96877c3213f45c9735769266-18849d9d9c2622df-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "6c666b63cd4bf7b792fbaddaf0c6b2a5", + "traceparent": "00-2aa332429bfc6ed208e9d6b7acf0a99a-24a708389efb671c-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "65440f118c6fc6733b75995c478cda36", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 03:50:06 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:18 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -702,13 +702,13 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "232", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 03:50:12 GMT", - "MS-CV": "na8o/ioldkWVyQ6xQ1O1wQ.0", + "Date": "Wed, 26 Jul 2023 17:30:24 GMT", + "MS-CV": "p9E6woaRwkqYqOuc/THglQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "09JfAZAAAAACgmhu3/8AHQK8PamQnxyuDWVRPMjIxMDkwODE5MDExADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0MFjBZAAAAABqI8q85QppS5JOh5meNLKCWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "830ms" + "X-Processing-Time": "692ms" }, "ResponseBody": { "value": [], @@ -718,7 +718,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "583538541", + "RandomSeed": "1649180013", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json index f0a49c180934..b76860aad566 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json @@ -1,16 +1,16 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5ee7fd8f3d08e3e15113f46855a388dc-6d72ff9b8c5b6580-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "4b3c732e0fd07e611c2467315e0ddab9", + "traceparent": "00-075bde845cb099b7624b61112f91b51e-6f1bb114baa9dd0b-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "2541279b167239483389b102dec074a1", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 03:50:07 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:19 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -19,13 +19,13 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "9864", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 03:50:13 GMT", - "MS-CV": "rhruCy6lLEeyOrTYfXDRWw.0", + "Date": "Wed, 26 Jul 2023 17:30:25 GMT", + "MS-CV": "mk2ogWSx0U\u002Bi32BeiQlLTw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "09ZfAZAAAAAAA\u002BQuW0aY\u002BSqVLSblwnjMnWVRPMjIxMDkwODE5MDExADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0MVjBZAAAAAA9HFOZegZ0QZ5UQ4Vz7Rx7WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "309ms" + "X-Processing-Time": "338ms" }, "ResponseBody": { "value": [ @@ -684,16 +684,16 @@ } }, { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-e1d2dad83f34eaf4f540863750023b6c-0c28ac00b8990bb5-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a488c5c3f429a1ef880a6cd211d65daf", + "traceparent": "00-e5887a06c1de6202611034b67008e619-68a4be4e1482d448-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "44c383c35c5be82bcddf922d622b8798", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 03:50:08 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:19 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -702,13 +702,13 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "232", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 03:50:13 GMT", - "MS-CV": "BQih0mkzqk6aC4GnH8c79Q.0", + "Date": "Wed, 26 Jul 2023 17:30:25 GMT", + "MS-CV": "wwJzTJF5H0i4/Ojkd83qmw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "09ZfAZAAAAAA3OQw7QrkVTKXzZOOOVjiQWVRPMjIxMDkwODE5MDExADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0MVjBZAAAAAC3tZfHvyuLTbUP1QOV\u002B5GWWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "526ms" + "X-Processing-Time": "271ms" }, "ResponseBody": { "value": [], @@ -718,7 +718,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1583860081", + "RandomSeed": "509697157", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json index 03057d524014..e88d3b75c922 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "584", "Content-Type": "application/json", - "traceparent": "00-95dd7128e3939f3e97c3dfeda41c73d3-876be18b0a043922-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "407661817cac20de2bf9f6e563e67ab8", + "traceparent": "00-863aafd4ac441cb9d36943b7a34d468b-f634362b9a0d97b1-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "4f8624b4f0c81350b0831e3787d2c472", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:21:54 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:20 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -77,19 +77,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:02 GMT", - "MS-CV": "bgxxKVzO6UyuQLEsGOqU1w.0", + "Date": "Wed, 26 Jul 2023 17:30:26 GMT", + "MS-CV": "6Y5nXf89IU6a30hocoUfgw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0KGfAZAAAAAB\u002Be8NiPXKnRKZxRW5l3IBYWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0MljBZAAAAAA0d5vAVA0XS4wq\u002BsQn22cnWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "2728ms" + "X-Processing-Time": "1088ms" }, "ResponseBody": { "receipts": [ { - "messageId": "70dd919a-2a58-4ca3-88fe-e2acffc55952", - "to": "\u002B16043609258" + "messageId": "a995847c-50d2-4f1d-89c2-41ab46397c90", + "to": "\u002B16041234567" } ] } @@ -97,8 +97,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1734501182", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "24231859", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json index bb0425a64623..a4d2d29ff843 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "584", "Content-Type": "application/json", - "traceparent": "00-9d78b91ecc5b3e001d68a742f212c4e8-3443caf81c0c62e3-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b072ab85e3ed42e97718f547625b906c", + "traceparent": "00-403aee5905971ef6d955f369306b3954-55e248c69176ab6a-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b75360b1eac096b3c5768ffa99fc0338", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:03 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:25 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -77,19 +77,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:08 GMT", - "MS-CV": "rqMcat/uaUy4hvHnk9m\u002BAA.0", + "Date": "Wed, 26 Jul 2023 17:30:32 GMT", + "MS-CV": "IkE8j8xSekODKGlqwtLRJA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MGfAZAAAAACX0QnLsnkRSLQCEGzo4OEIWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0N1jBZAAAAABVys6LYxC7RLglKUGohmN2WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "616ms" + "X-Processing-Time": "626ms" }, "ResponseBody": { "receipts": [ { - "messageId": "58072b86-8ad1-456e-85ce-33f7ff299602", - "to": "\u002B16043609258" + "messageId": "1c3de82a-e7a9-4bc5-912b-a0ed7b0a6a38", + "to": "\u002B16041234567" } ] } @@ -97,8 +97,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1949570673", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "652824940", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json index 703f15feeecf..78f23d07dadc 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "519", "Content-Type": "application/json", - "traceparent": "00-69ee1adbacefa0bf397f9679a6e954ac-4848c5cdaa1dd531-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "5b4a712dbd94bca242de3f67a9e7e602", + "traceparent": "00-f43e69bae371b63f05fdb2c8aa44f55b-98135e900d4728e0-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5ac704d5b75e22e5407fb4f5940bbc37", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:21:57 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:21 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -68,19 +68,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:03 GMT", - "MS-CV": "vhA0hvcErUWIu7PWWj1IAQ.0", + "Date": "Wed, 26 Jul 2023 17:30:27 GMT", + "MS-CV": "nRXD23zQNUGQM0FToTNT3g.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0K2fAZAAAAAD6GTKR43ItT5gN85iLmlByWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0M1jBZAAAAAD40cfU60U\u002BS6mnX0CiM8H2WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "1144ms" + "X-Processing-Time": "535ms" }, "ResponseBody": { "receipts": [ { - "messageId": "24980b84-3a83-477b-a5d0-2c30314deb96", - "to": "\u002B16043609258" + "messageId": "adbaac75-f8f8-473d-8683-97e62b726286", + "to": "\u002B16041234567" } ] } @@ -88,8 +88,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1225023802", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "735807981", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json index 4be1447d6ccd..91774336ddef 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "519", "Content-Type": "application/json", - "traceparent": "00-6e752998f0f1d389087d9014a5693461-b4135bb032c30196-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "681b74cb99ee1e83092af1f6ee05b6a1", + "traceparent": "00-4d8314c08659b549dcd907786bd15d0e-3711e44e22e0b6f4-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "385f2acc50e04feb95d038ab9c3fca1c", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:03 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:26 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -68,19 +68,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:09 GMT", - "MS-CV": "CGCegYbzDE\u002BF9p9VjsCuuw.0", + "Date": "Wed, 26 Jul 2023 17:30:32 GMT", + "MS-CV": "8tlPPCvPl0u\u002Blf4VC/u0pg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MWfAZAAAAAC7Rbp5G3JcRJOX24iyM0NZWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0OFjBZAAAAACNNSNO1kVSRYrxZv5qHzzMWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "598ms" + "X-Processing-Time": "575ms" }, "ResponseBody": { "receipts": [ { - "messageId": "36b82448-1689-46fa-9e61-a453a4527172", - "to": "\u002B16043609258" + "messageId": "cf080c8e-a761-4445-ab6e-44c908e6fe5b", + "to": "\u002B16041234567" } ] } @@ -88,8 +88,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "868327278", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "2138585794", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json index 4dfc6c6d97ef..d1c96c092085 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "507", "Content-Type": "application/json", - "traceparent": "00-6768f740d79bc52e05606c0a04c72534-95d7e564181f9c42-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "8d012aec2843daa8c15a2e670783c319", + "traceparent": "00-4227b534ea115b3b2c286d4bfc9b7191-e86504abac88147f-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "ec2cfbc1c2a1c45a0b0b270b2cf4beb4", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:21:58 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:21 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -70,19 +70,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:04 GMT", - "MS-CV": "Hpx8bHFIuEedhGU/x\u002BDO8g.0", + "Date": "Wed, 26 Jul 2023 17:30:28 GMT", + "MS-CV": "mwxnQyMvTkqKrX28FnUbqg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0LGfAZAAAAAC8g9E6zWeMT7Lhwk3Rzn\u002BDWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0M1jBZAAAAAD04XCWYTDRQZXFKz/z6bNvWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "1030ms" + "X-Processing-Time": "1023ms" }, "ResponseBody": { "receipts": [ { - "messageId": "9a52b556-f82e-4b4b-8e15-1e7118d9ce9c", - "to": "\u002B16043609258" + "messageId": "8dc52aa1-f494-4095-a3b7-1a88f348577a", + "to": "\u002B16041234567" } ] } @@ -90,8 +90,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "302563361", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "1179365444", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json index dd6d04ef613f..b677701fdbdd 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "507", "Content-Type": "application/json", - "traceparent": "00-1463f1c8b61e6802cdabf22370e2c1ee-9ca3c5150f6dde32-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "0cff882f94f231639abcae7656b92363", + "traceparent": "00-4512568854fb4f12f3d111b1e9960d7a-1e148d9a10c91f7e-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "daef7c3a4fd6234cdbc9d55da868c14b", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:04 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:27 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -70,19 +70,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:10 GMT", - "MS-CV": "CNX18BjTKEeRxunm9H3lgA.0", + "Date": "Wed, 26 Jul 2023 17:30:33 GMT", + "MS-CV": "ZD2fm\u002Bz3xEa73PyjzO33kQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MmfAZAAAAADEi3E96seeSb/WPwH4/Ui/WVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0OVjBZAAAAAA9Ec6hqbF\u002BTr2NT7MwEH8eWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "535ms" + "X-Processing-Time": "581ms" }, "ResponseBody": { "receipts": [ { - "messageId": "c771963b-c0a1-473c-ad71-aa8e335ea3d1", - "to": "\u002B16043609258" + "messageId": "ac249a5d-9e5d-4fe6-803c-4dff131c949f", + "to": "\u002B16041234567" } ] } @@ -90,8 +90,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1687097116", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "1458285250", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json index 7daf5e3e3ff3..15982b6d0fec 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-0e9da864f99060e72bff362a56533909-efbbc8eb396bbb2f-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "85cf457f40d4391eb90a2e9984f4208c", + "traceparent": "00-a995e4188741dcb30baa05af9c339316-1908f856ce368ba9-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "85e67157bc75cf3d0f948cb5fd851cc2", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:21:59 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:23 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "text", "content": "LiveTest" @@ -28,19 +28,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:05 GMT", - "MS-CV": "t0/AK14ItEGLH0Dv3FCiGQ.0", + "Date": "Wed, 26 Jul 2023 17:30:29 GMT", + "MS-CV": "OUfaVI6QcUmGo8W4Tce\u002BAQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0LWfAZAAAAAC0BFmWBSolTabDcgInvi5DWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0NVjBZAAAAAAcEW1SC5GkT4F0aQzJDw2LWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "815ms" + "X-Processing-Time": "613ms" }, "ResponseBody": { "receipts": [ { - "messageId": "b0dfcfaa-9aa9-4073-b362-e6f820436217", - "to": "\u002B16043609258" + "messageId": "0f29d09a-5411-40a3-9812-0f5d794deab8", + "to": "\u002B16041234567" } ] } @@ -48,8 +48,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1355541795", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "131367304", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json index c681b3b69172..94eb92f29636 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-aed5ba4eb20e397703b29df1fabb4ed4-85a1c62ae9088f25-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a9adb279ff46d2e852ece92e332b23ef", + "traceparent": "00-92d17f14a92b422130a2663772348c58-6b0f4990aa578276-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "baad02496482e11c26692dc8d81a29c3", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:05 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:27 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "text", "content": "LiveTest" @@ -28,19 +28,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:10 GMT", - "MS-CV": "jM7ngFneHkqkgaG6Wt776A.0", + "Date": "Wed, 26 Jul 2023 17:30:34 GMT", + "MS-CV": "y4ojjHMafkqKcPqUqetsSQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MmfAZAAAAAC5D9W2KN/SRosK9YWT0CogWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0OVjBZAAAAAAsizFVntD\u002BSp\u002BpISpXpScwWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "760ms" + "X-Processing-Time": "603ms" }, "ResponseBody": { "receipts": [ { - "messageId": "4d4dd5ff-10bf-41ee-a20e-b4d7c5898dc3", - "to": "\u002B16043609258" + "messageId": "74a29880-19ca-4327-81f9-8bf990a8cb86", + "to": "\u002B16041234567" } ] } @@ -48,8 +48,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "452774152", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "1152443371", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json index 45d231e97041..b2ada6e96fd1 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "679", "Content-Type": "application/json", - "traceparent": "00-28535d3ccd5ffbda7db663df15829fc0-2eb4c83f53fc377b-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "c9b110481c4ed008ebf11f8a72d60f2b", + "traceparent": "00-d812fb3383a5a5c3e0f8bfe170584db6-d2ea76bd7e0afa1d-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "976069e0077282ec9ed2b1547a34e9dc", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:00 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:23 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -86,19 +86,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:06 GMT", - "MS-CV": "k5yrOtsvZUyoxrfPVQaxEQ.0", + "Date": "Wed, 26 Jul 2023 17:30:30 GMT", + "MS-CV": "IN17IaBSCka6aEqS4NiYdA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0LmfAZAAAAACxx2kacp9QQKFsJM8bgakDWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0NVjBZAAAAAD0Es613iKsQLneXtq\u002Ba9ONWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "684ms" + "X-Processing-Time": "611ms" }, "ResponseBody": { "receipts": [ { - "messageId": "c7792fa4-7c63-43c7-b600-d013b9c03cc2", - "to": "\u002B16043609258" + "messageId": "2f2c16b5-3a3a-4585-85e4-5f58654e9465", + "to": "\u002B16041234567" } ] } @@ -106,8 +106,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1635571988", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "1255569645", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json index 94ed0c9a5bd9..6c16f8b0ad1e 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "679", "Content-Type": "application/json", - "traceparent": "00-6a12d387a5d6a77b7b9bbf07e934c0a7-6897cdd7e52e9409-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "6483009e3bb0e6339ab62660b736b64b", + "traceparent": "00-110eea695df412573c6ecad6d8ee9896-6aec97caab246e64-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "3761d298e14ca97b45124c9105126f30", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:05 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:29 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -86,19 +86,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:11 GMT", - "MS-CV": "2pd6dKQAG0atYFLYiqGdkw.0", + "Date": "Wed, 26 Jul 2023 17:30:35 GMT", + "MS-CV": "WMA1wt1HCkqHx4eI39Okxw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0M2fAZAAAAACgmaoU/q8CQbQNNcCgNgu0WVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0O1jBZAAAAAAUUxBQZYMdRI/jEatdS5lRWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "648ms" + "X-Processing-Time": "906ms" }, "ResponseBody": { "receipts": [ { - "messageId": "26d16e50-008d-4247-8a14-644091a2c007", - "to": "\u002B16043609258" + "messageId": "f86c872f-bae2-45f5-9c29-cea05e680c47", + "to": "\u002B16041234567" } ] } @@ -106,8 +106,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "820457927", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "514284666", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json index 834064ae8eb3..fd55a299107c 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "456", "Content-Type": "application/json", - "traceparent": "00-e10c780bba399db31c97882862885bd9-64d80655544d836a-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b7aaa4647ce940e6ed23b7e28e025a5a", + "traceparent": "00-8fa7cfbe03e08f54085fe6b1ba9de1d2-456680ede034d6e3-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "f7c09da9f23e79d70614ddf7e0a8b27b", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:01 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:24 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -59,19 +59,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:07 GMT", - "MS-CV": "5TMAHYTbmUeEDqSRQLIHRQ.0", + "Date": "Wed, 26 Jul 2023 17:30:30 GMT", + "MS-CV": "KKIitoiahEeM26DfK3uomQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0L2fAZAAAAACm0q5Q4aCcSpHp3j\u002BapLWkWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0NljBZAAAAACBVeDH8fI2Tpzhb017FbPxWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "702ms" + "X-Processing-Time": "629ms" }, "ResponseBody": { "receipts": [ { - "messageId": "7152dc2a-41b3-419c-a132-2122ae2cc45a", - "to": "\u002B16043609258" + "messageId": "421b88a1-8225-4c70-be61-a8379520b3c0", + "to": "\u002B16041234567" } ] } @@ -79,8 +79,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "588920776", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "51084227", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json index 7dd906aa09d0..8f8a43eeb533 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "456", "Content-Type": "application/json", - "traceparent": "00-13fd74e7ab7a0ea94910ed207c002f08-7700dfb1591b76ab-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "698d5919b6ca20be0de7833fc502545e", + "traceparent": "00-d76e5406e4af7dd150310c8b09fb9a65-14fbf0b54d0659b9-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "559b2bdece2268f77ee44edc4709a4c2", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:06 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:29 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -59,19 +59,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:12 GMT", - "MS-CV": "ozm/NX9gqEyvsQmn9AwLKA.0", + "Date": "Wed, 26 Jul 2023 17:30:36 GMT", + "MS-CV": "4vuzIEG4dUyT8ZjmucVu0A.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0NGfAZAAAAAAmmy5i7WeGR6UY30BkgPMGWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0O1jBZAAAAAAcjRGqUjBpSJE85b3zmxUuWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "631ms" + "X-Processing-Time": "601ms" }, "ResponseBody": { "receipts": [ { - "messageId": "d8bed360-8360-433a-b00c-e1a5a3e25b50", - "to": "\u002B16043609258" + "messageId": "6c9a2f5b-f99e-4778-8aa1-b74a2b454d3b", + "to": "\u002B16041234567" } ] } @@ -79,8 +79,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1345316686", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "89470489", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json index 4b1be7df38b1..03dadbd20e10 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "298", "Content-Type": "application/json", - "traceparent": "00-617612969a9f5f2f6cb0fb7d8fb48ca9-28a7805473b0851f-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a4add0ea94e6fcd6910bd9a031b25bdf", + "traceparent": "00-e2416804e4b8aa3863d0890cdf26a854-db5caac684eda377-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "71d43d29ada13548140270403c72ce0d", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:02 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:25 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -48,19 +48,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:08 GMT", - "MS-CV": "fW0MllTv/02xg9TLBBQaZA.0", + "Date": "Wed, 26 Jul 2023 17:30:31 GMT", + "MS-CV": "lpiuFjJ1eUmHeqXqvs/HBA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MGfAZAAAAAClOafE0R09TLPM1q9jZ0nRWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0N1jBZAAAAACV2RwTx9psRJpMSwexvK\u002B6WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "732ms" + "X-Processing-Time": "561ms" }, "ResponseBody": { "receipts": [ { - "messageId": "5b5238b8-c801-4375-8e12-d4a8ba8a5172", - "to": "\u002B16043609258" + "messageId": "b0bcbfad-11bb-4559-bc76-1ee742b14b58", + "to": "\u002B16041234567" } ] } @@ -68,8 +68,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1641745930", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "970949867", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json index 0fdf10e01cf5..52370f092442 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "https://acsxplatmg-sandbox.unitedstates.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "298", "Content-Type": "application/json", - "traceparent": "00-ad790380b6d028018101c2c8af1ea563-1bd6b28b566bef1f-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230725.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "9a86b014c2cbfc27399767583ef9aa63", + "traceparent": "00-f66896ff6e1dbb3d0b412080f0f4ddb6-6f7cd83f6350c9b3-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "72d625494fcfac29ab99658e5043bf31", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 00:22:07 GMT", + "x-ms-date": "Wed, 26 Jul 2023 17:30:30 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", "to": [ - "\u002B16043609258" + "\u002B16041234567" ], "type": "template", "template": { @@ -48,19 +48,19 @@ "api-supported-versions": "2023-02-01-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 00:22:12 GMT", - "MS-CV": "Xv9APJc8CUOQ5VEZaNjsDQ.0", + "Date": "Wed, 26 Jul 2023 17:30:36 GMT", + "MS-CV": "/os5IL3suUuQIQ\u002BhBTQnzw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0NWfAZAAAAACQJS\u002BjyG51Qp2jA8izifIaWVRPMjIxMDkwODIwMDMzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0PFjBZAAAAAD3H\u002B6sRraISbOI7eIQUrB2WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "528ms" + "X-Processing-Time": "513ms" }, "ResponseBody": { "receipts": [ { - "messageId": "4ad633ce-258c-4be6-87f6-318dc5d40f38", - "to": "\u002B16043609258" + "messageId": "4ac3bee5-9435-4e69-9691-a01ab6652f6b", + "to": "\u002B16041234567" } ] } @@ -68,8 +68,8 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1967587484", - "RECIPIENT_IDENTIFIER": "\u002B16043609258", + "RandomSeed": "1368047638", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } From 6246b931de7da44321e1c013ec38b78dd0649d21 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 26 Jul 2023 10:53:34 -0700 Subject: [PATCH 11/24] remove unneeded import --- .../src/Models/MessageTemplateImage.cs | 2 -- .../tests/Infrastructure/MessagesLiveTestBase.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs index f0860fd8cf70..03572d7716a8 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs @@ -2,8 +2,6 @@ // Licensed under the MIT License. using System; -using System.Runtime.InteropServices.ComTypes; -using System.Xml.Linq; namespace Azure.Communication.Messages { diff --git a/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs index 2abf8fa54490..3c29516a7f06 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Communication.Identity; using Azure.Core.TestFramework; namespace Azure.Communication.Messages.Tests From 58d97b407c3732f2ab796bfe09d5020db2a27f80 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Fri, 18 Aug 2023 10:44:27 -0700 Subject: [PATCH 12/24] update to 2023-08-24-preview api version --- .../Models/MessageTemplateValueMedia.Serialization.cs | 10 +++++----- .../src/Generated/Models/MessageTemplateValueMedia.cs | 4 ++-- .../src/Generated/NotificationMessagesRestClient.cs | 2 +- .../src/Generated/StreamRestClient.cs | 2 +- .../src/Generated/TemplateV2RestClient.cs | 2 +- .../src/Models/MessageTemplateDocument.cs | 8 ++++---- .../src/Models/MessageTemplateImage.cs | 10 +++++----- .../src/Models/MessageTemplateVideo.cs | 10 +++++----- .../Azure.Communication.Messages/src/autorest.md | 2 +- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs index 424e29cfd0ef..a92f825758df 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.Serialization.cs @@ -15,20 +15,20 @@ internal partial class MessageTemplateValueMedia : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Uri)) + if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); - writer.WriteStringValue(Uri.AbsoluteUri); + writer.WriteStringValue(Url.AbsoluteUri); } if (Optional.IsDefined(Caption)) { writer.WritePropertyName("caption"u8); writer.WriteStringValue(Caption); } - if (Optional.IsDefined(Filename)) + if (Optional.IsDefined(FileName)) { - writer.WritePropertyName("filename"u8); - writer.WriteStringValue(Filename); + writer.WritePropertyName("fileName"u8); + writer.WriteStringValue(FileName); } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs index ddfe8abfc406..f1c94c5f871a 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageTemplateValueMedia.cs @@ -21,10 +21,10 @@ public MessageTemplateValueMedia() } /// The (public) URL of the media. - public Uri Uri { get; set; } + public Uri Url { get; set; } /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. - public string Filename { get; set; } + public string FileName { get; set; } } } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs index 53bd174fdb35..d01c8776975d 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs @@ -32,7 +32,7 @@ internal partial class NotificationMessagesRestClient /// The communication resource, for example https://my-resource.communication.azure.com. /// Api Version. /// , , or is null. - public NotificationMessagesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-02-01-preview") + public NotificationMessagesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-08-24-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs index b3dd1a1dcc7d..e69af78e664f 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs @@ -30,7 +30,7 @@ internal partial class StreamRestClient /// The communication resource, for example https://my-resource.communication.azure.com. /// Api Version. /// , , or is null. - public StreamRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-02-01-preview") + public StreamRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-08-24-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs index 3ace6eabd880..a06164b1aa71 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs @@ -30,7 +30,7 @@ internal partial class TemplateV2RestClient /// The communication resource, for example https://my-resource.communication.azure.com. /// Api Version. /// , , or is null. - public TemplateV2RestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-02-01-preview") + public TemplateV2RestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-08-24-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs index 4745cf9511d8..86364c176559 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateDocument.cs @@ -9,11 +9,11 @@ namespace Azure.Communication.Messages public class MessageTemplateDocument: MessageTemplateValue { /// - public MessageTemplateDocument(string name, Uri uri, string caption = null, string filename = null) : base(name) + public MessageTemplateDocument(string name, Uri uri, string caption = null, string fileName = null) : base(name) { Uri = uri; Caption = caption; - FileName = filename; + FileName = fileName; } /// The (public) URL of the document media. @@ -28,9 +28,9 @@ internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() return new MessageTemplateValueInternal(MessageTemplateValueKind.Document) { Document = new MessageTemplateValueMedia { - Uri = Uri, + Url = Uri, Caption = Caption, - Filename = FileName + FileName = FileName } }; } diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs index 03572d7716a8..c42a816c625e 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateImage.cs @@ -9,11 +9,11 @@ namespace Azure.Communication.Messages public class MessageTemplateImage: MessageTemplateValue { /// - public MessageTemplateImage(string name, Uri uri, string caption = null, string filename = null) : base(name) + public MessageTemplateImage(string name, Uri uri, string caption = null, string fileName = null) : base(name) { Uri = uri; Caption = caption; - Filename = filename; + FileName = fileName; } /// The (public) URL of the document media. @@ -21,7 +21,7 @@ public MessageTemplateImage(string name, Uri uri, string caption = null, string /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. - public string Filename { get; set; } + public string FileName { get; set; } internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() { @@ -29,9 +29,9 @@ internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() { Image = new MessageTemplateValueMedia { - Uri = Uri, + Url = Uri, Caption = Caption, - Filename = Filename + FileName = FileName } }; } diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs index 052f82a6aafa..5ff68d901b0f 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateVideo.cs @@ -9,11 +9,11 @@ namespace Azure.Communication.Messages public class MessageTemplateVideo: MessageTemplateValue { /// - public MessageTemplateVideo(string name, Uri uri, string caption = null, string filename = null) : base(name) + public MessageTemplateVideo(string name, Uri uri, string caption = null, string fileName = null) : base(name) { Uri = uri; Caption = caption; - Filename = filename; + FileName = fileName; } /// The (public) URL of the document media. @@ -21,16 +21,16 @@ public MessageTemplateVideo(string name, Uri uri, string caption = null, string /// The [optional] caption of the media object. public string Caption { get; set; } /// The [optional] filename of the media file. - public string Filename { get; set; } + public string FileName { get; set; } internal override MessageTemplateValueInternal ToMessageTemplateValueInternal() { return new MessageTemplateValueInternal(MessageTemplateValueKind.Video) { Video = new MessageTemplateValueMedia { - Uri = Uri, + Url = Uri, Caption = Caption, - Filename = Filename + FileName = FileName } }; } diff --git a/sdk/communication/Azure.Communication.Messages/src/autorest.md b/sdk/communication/Azure.Communication.Messages/src/autorest.md index 6777e6ac5178..877f0ec354f7 100644 --- a/sdk/communication/Azure.Communication.Messages/src/autorest.md +++ b/sdk/communication/Azure.Communication.Messages/src/autorest.md @@ -11,7 +11,7 @@ If any of the new objects needs to be overwritten, add the required changes to t > see https://aka.ms/autorest ``` yaml input-file: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/gelli/addMessagingApiSpec/specification/communication/data-plane/Messages/preview/2023-02-01-preview/CommunicationServicesMessages.json + - https://github.com/Azure/azure-rest-api-specs/blob/0cb2e7ec983a65238c45ab3cc50bd323eacae8b7/specification/communication/data-plane/Messages/preview/2023-08-24-preview/CommunicationServicesMessages.json payload-flattening-threshold: 10 generation1-convenience-client: true directive: From 2c0cc8ef324806e9e51c348eb68432d9718d7b60 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Fri, 18 Aug 2023 11:05:03 -0700 Subject: [PATCH 13/24] update CommunicationMessagesClientOptions api version to 2023-08-24-preview --- .../src/CommunicationMessagesClientOptions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/CommunicationMessagesClientOptions.cs b/sdk/communication/Azure.Communication.Messages/src/CommunicationMessagesClientOptions.cs index 055695d44b88..8207ac74eafb 100644 --- a/sdk/communication/Azure.Communication.Messages/src/CommunicationMessagesClientOptions.cs +++ b/sdk/communication/Azure.Communication.Messages/src/CommunicationMessagesClientOptions.cs @@ -14,7 +14,7 @@ public class CommunicationMessagesClientOptions : ClientOptions /// /// The latest version of the Chat service. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V2023_02_01_Preview; + internal const ServiceVersion LatestVersion = ServiceVersion.V2023_08_24_Preview; internal string ApiVersion { get; } @@ -25,7 +25,7 @@ public CommunicationMessagesClientOptions(ServiceVersion version = LatestVersion { ApiVersion = version switch { - ServiceVersion.V2023_02_01_Preview => "2023-02-01-preview", + ServiceVersion.V2023_08_24_Preview => "2023-08-24-preview", _ => throw new ArgumentOutOfRangeException(nameof(version)), }; } @@ -40,7 +40,7 @@ public enum ServiceVersion /// #pragma warning disable CA1707 // Identifiers should not contain underscores #pragma warning disable AZC0016 // Invalid ServiceVersion member name. - V2023_02_01_Preview = 1 + V2023_08_24_Preview = 1 #pragma warning restore AZC0016 // Invalid ServiceVersion member name. #pragma warning restore CA1707 // Identifiers should not contain underscores } From 7b661856b20845d20d82aabb45bc002c27bbf2cf Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Fri, 18 Aug 2023 11:13:00 -0700 Subject: [PATCH 14/24] re-run live test recording --- .../GetTemplatesShouldSucceed.json | 51 +++++++++---------- .../GetTemplatesShouldSucceedAsync.json | 51 +++++++++---------- ...firmationTemplateMessageShouldSucceed.json | 24 ++++----- ...tionTemplateMessageShouldSucceedAsync.json | 24 ++++----- ...nnocementTemplateMessageShouldSucceed.json | 24 ++++----- ...mentTemplateMessageShouldSucceedAsync.json | 24 ++++----- ...esolutionTemplateMessageShouldSucceed.json | 24 ++++----- ...tionTemplateMessageShouldSucceedAsync.json | 24 ++++----- .../SendMessageShouldSucceed.json | 24 ++++----- .../SendMessageShouldSucceedAsync.json | 24 ++++----- ...firmationTemplateMessageShouldSucceed.json | 24 ++++----- ...tionTemplateMessageShouldSucceedAsync.json | 24 ++++----- ...eFeedbackTemplateMessageShouldSucceed.json | 24 ++++----- ...backTemplateMessageShouldSucceedAsync.json | 24 ++++----- ...firmationTemplateMessageShouldSucceed.json | 24 ++++----- ...tionTemplateMessageShouldSucceedAsync.json | 24 ++++----- 16 files changed, 218 insertions(+), 220 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json index 2cfaf8a81771..772f61c7f3c0 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json @@ -1,31 +1,31 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-747bbe8ffa1a06d0502c620427689d49-adfbbb54d470490d-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "3d38eb74cc8e19be8e913768d2408107", + "traceparent": "00-01301e1091797db33f76e62a7ae5b26f-4de8adf2f06b9639-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "78fac250730cf0453e7847f10bb3bd13", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:17 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:54 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", - "Content-Length": "9864", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "9833", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:23 GMT", - "MS-CV": "luFe4KVoDEOe\u002BPEFCG0D0A.0", + "Date": "Fri, 18 Aug 2023 18:07:58 GMT", + "MS-CV": "7DtaWjYZTEOIfeaxmuefiw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0L1jBZAAAAACBdFrDdVvjTq/c\u002BZoGbgb7WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0f7PfZAAAAAAz4f3ZYYnrT5/JKnmjBIsITEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "544ms" + "X-Processing-Time": "249ms" }, "ResponseBody": { "value": [ @@ -680,45 +680,44 @@ } } ], - "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD" + "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD" } }, { - "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-2aa332429bfc6ed208e9d6b7acf0a99a-24a708389efb671c-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "65440f118c6fc6733b75995c478cda36", + "traceparent": "00-f78296139f291ca70d8e0edd40bd4dd7-1be6220b6199bb8d-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "155ff1bf8c7add28ad2adbff5042d7df", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:18 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:55 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", - "Content-Length": "232", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:24 GMT", - "MS-CV": "p9E6woaRwkqYqOuc/THglQ.0", + "Date": "Fri, 18 Aug 2023 18:07:59 GMT", + "MS-CV": "NjbeUHakpk28DPtX9oSHww.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MFjBZAAAAABqI8q85QppS5JOh5meNLKCWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0f7PfZAAAAABd7M7ZMlLoQryRIJwMb6P1TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "692ms" + "X-Processing-Time": "144ms" }, "ResponseBody": { - "value": [], - "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD\u0026api-version=2023-02-01-preview\u0026continuationToken=NDkZD" + "value": [] } } ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1649180013", + "RandomSeed": "1784237815", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json index b76860aad566..87a28bfe09e1 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json @@ -1,31 +1,31 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-075bde845cb099b7624b61112f91b51e-6f1bb114baa9dd0b-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "2541279b167239483389b102dec074a1", + "traceparent": "00-2e7b951c517c8ac4fde4f0d8fd6a3cf2-53fecf36790d4582-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "a7da4051ac334a7002677c35800c25c7", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:19 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:55 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", - "Content-Length": "9864", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "9833", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:25 GMT", - "MS-CV": "mk2ogWSx0U\u002Bi32BeiQlLTw.0", + "Date": "Fri, 18 Aug 2023 18:07:59 GMT", + "MS-CV": "XpOK7rDhi02mrEQ1kbdVxw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MVjBZAAAAAA9HFOZegZ0QZ5UQ4Vz7Rx7WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0gLPfZAAAAAAsAJYILREpT6uLReWYI9DgTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "338ms" + "X-Processing-Time": "193ms" }, "ResponseBody": { "value": [ @@ -680,45 +680,44 @@ } } ], - "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD" + "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD" } }, { - "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-e5887a06c1de6202611034b67008e619-68a4be4e1482d448-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "44c383c35c5be82bcddf922d622b8798", + "traceparent": "00-2e0970de01a0da39bb59e209807145b6-86cc7699ed463ae8-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "910a74d9d1e04258ed49c412624cbe60", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:19 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:55 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", - "Content-Length": "232", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:25 GMT", - "MS-CV": "wwJzTJF5H0i4/Ojkd83qmw.0", + "Date": "Fri, 18 Aug 2023 18:07:59 GMT", + "MS-CV": "oz1MkQooKU2mJDvpMRrybw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MVjBZAAAAAC3tZfHvyuLTbUP1QOV\u002B5GWWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0gLPfZAAAAACObi9NYkNrRro\u002BGlPrc7b2TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "271ms" + "X-Processing-Time": "111ms" }, "ResponseBody": { - "value": [], - "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-02-01-preview\u0026api-version=2023-02-01-preview\u0026continuationToken=MjQZD\u0026api-version=2023-02-01-preview\u0026continuationToken=NDkZD" + "value": [] } } ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "509697157", + "RandomSeed": "2034252982", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json index e88d3b75c922..0f9a2eaedf01 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "584", "Content-Type": "application/json", - "traceparent": "00-863aafd4ac441cb9d36943b7a34d468b-f634362b9a0d97b1-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "4f8624b4f0c81350b0831e3787d2c472", + "traceparent": "00-00953ddaee4aa0adb3e6f1776c4f777f-186a8b9cc2ea214d-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "2c9f27686fe33fb90c95fb27c2b7e768", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:20 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:56 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -74,21 +74,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:26 GMT", - "MS-CV": "6Y5nXf89IU6a30hocoUfgw.0", + "Date": "Fri, 18 Aug 2023 18:08:00 GMT", + "MS-CV": "bM15LsKPUEymO0r9E4zUaw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0MljBZAAAAAA0d5vAVA0XS4wq\u002BsQn22cnWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0gLPfZAAAAAAneTE9mu3CTqHpuOy73EuLTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "1088ms" + "X-Processing-Time": "391ms" }, "ResponseBody": { "receipts": [ { - "messageId": "a995847c-50d2-4f1d-89c2-41ab46397c90", + "messageId": "314b5edf-97b2-4ca9-b160-0ddf4a4ab7be", "to": "\u002B16041234567" } ] @@ -97,7 +97,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "24231859", + "RandomSeed": "136719512", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json index a4d2d29ff843..8dba5103addb 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "584", "Content-Type": "application/json", - "traceparent": "00-403aee5905971ef6d955f369306b3954-55e248c69176ab6a-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b75360b1eac096b3c5768ffa99fc0338", + "traceparent": "00-d43f12a5bbec3e88f3fb1b2b732147cc-0ac420b0aa97be72-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "7e2e7da1cf9fb134e87dac256963ac0e", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:25 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:59 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -74,21 +74,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:32 GMT", - "MS-CV": "IkE8j8xSekODKGlqwtLRJA.0", + "Date": "Fri, 18 Aug 2023 18:08:03 GMT", + "MS-CV": "m4cMqI6k10qwtUaQUqpu7A.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0N1jBZAAAAABVys6LYxC7RLglKUGohmN2WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0g7PfZAAAAABJxWi7PhEDT7yR8n2mYY9UTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "626ms" + "X-Processing-Time": "417ms" }, "ResponseBody": { "receipts": [ { - "messageId": "1c3de82a-e7a9-4bc5-912b-a0ed7b0a6a38", + "messageId": "5151ddcd-cdee-410f-8fbc-581f85ea7b81", "to": "\u002B16041234567" } ] @@ -97,7 +97,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "652824940", + "RandomSeed": "331261707", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json index 78f23d07dadc..32c2783ece57 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "519", "Content-Type": "application/json", - "traceparent": "00-f43e69bae371b63f05fdb2c8aa44f55b-98135e900d4728e0-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "5ac704d5b75e22e5407fb4f5940bbc37", + "traceparent": "00-f2e4100274b5b97b80177ef3c5d780be-1781e0c3460599dd-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "eaa4351e5bda1dc6c47c45619b2b2e68", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:21 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:56 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -65,21 +65,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:27 GMT", - "MS-CV": "nRXD23zQNUGQM0FToTNT3g.0", + "Date": "Fri, 18 Aug 2023 18:08:00 GMT", + "MS-CV": "TboctDOFtESR0oTJqW7zyA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0M1jBZAAAAAD40cfU60U\u002BS6mnX0CiM8H2WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0gbPfZAAAAADcQkxqtBISQI73OnY0o/H7TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "535ms" + "X-Processing-Time": "425ms" }, "ResponseBody": { "receipts": [ { - "messageId": "adbaac75-f8f8-473d-8683-97e62b726286", + "messageId": "1ff0150a-0c1e-4ee3-a7ca-b88e4d2201b9", "to": "\u002B16041234567" } ] @@ -88,7 +88,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "735807981", + "RandomSeed": "519068326", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json index 91774336ddef..f6162aad9fb2 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "519", "Content-Type": "application/json", - "traceparent": "00-4d8314c08659b549dcd907786bd15d0e-3711e44e22e0b6f4-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "385f2acc50e04feb95d038ab9c3fca1c", + "traceparent": "00-87f6fed20986b873718aefbc87ea2535-57df2f0b73168042-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "960c6154b0afa9a7626daf3966be8643", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:26 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:59 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -65,21 +65,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:32 GMT", - "MS-CV": "8tlPPCvPl0u\u002Blf4VC/u0pg.0", + "Date": "Fri, 18 Aug 2023 18:08:03 GMT", + "MS-CV": "SRC\u002BJUaHEkSgPSZWC9xvJQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0OFjBZAAAAACNNSNO1kVSRYrxZv5qHzzMWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0hLPfZAAAAABgUGpV6p7rRYt6hmsxFodeTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "575ms" + "X-Processing-Time": "368ms" }, "ResponseBody": { "receipts": [ { - "messageId": "cf080c8e-a761-4445-ab6e-44c908e6fe5b", + "messageId": "1b0cfbe0-1bf9-42e6-a2c1-e6d77862cad9", "to": "\u002B16041234567" } ] @@ -88,7 +88,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2138585794", + "RandomSeed": "854015714", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json index d1c96c092085..c1f068bc7536 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "507", "Content-Type": "application/json", - "traceparent": "00-4227b534ea115b3b2c286d4bfc9b7191-e86504abac88147f-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "ec2cfbc1c2a1c45a0b0b270b2cf4beb4", + "traceparent": "00-5ab985255da34b62efdb7eec74d08967-12e5ea62e03a4338-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "6ec185eb204a82641408b5b2f2909626", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:21 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:56 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -67,21 +67,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:28 GMT", - "MS-CV": "mwxnQyMvTkqKrX28FnUbqg.0", + "Date": "Fri, 18 Aug 2023 18:08:01 GMT", + "MS-CV": "oDITyjZZBEGFt407Zu3HHQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0M1jBZAAAAAD04XCWYTDRQZXFKz/z6bNvWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0gbPfZAAAAADPV0Pe5QG3QqwHHchFIK4DTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "1023ms" + "X-Processing-Time": "370ms" }, "ResponseBody": { "receipts": [ { - "messageId": "8dc52aa1-f494-4095-a3b7-1a88f348577a", + "messageId": "24420d4b-5ead-4721-94d9-2ee81beb29fc", "to": "\u002B16041234567" } ] @@ -90,7 +90,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1179365444", + "RandomSeed": "501265864", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json index b677701fdbdd..0879d6e8f076 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "507", "Content-Type": "application/json", - "traceparent": "00-4512568854fb4f12f3d111b1e9960d7a-1e148d9a10c91f7e-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "daef7c3a4fd6234cdbc9d55da868c14b", + "traceparent": "00-4e491c12d68aba09693f8a05e78e632e-6e039b5b56b634f2-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "f8ef2eea6979d4c73de22cdcf60228c5", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:27 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:59 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -67,21 +67,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:33 GMT", - "MS-CV": "ZD2fm\u002Bz3xEa73PyjzO33kQ.0", + "Date": "Fri, 18 Aug 2023 18:08:04 GMT", + "MS-CV": "pp7I1Qz3dkyXx3ccC/xXYg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0OVjBZAAAAAA9Ec6hqbF\u002BTr2NT7MwEH8eWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0hLPfZAAAAADh5fJExxgKRYsEsa2zr0cmTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "581ms" + "X-Processing-Time": "356ms" }, "ResponseBody": { "receipts": [ { - "messageId": "ac249a5d-9e5d-4fe6-803c-4dff131c949f", + "messageId": "b731d607-9604-4580-bfc2-ed1de774fe49", "to": "\u002B16041234567" } ] @@ -90,7 +90,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1458285250", + "RandomSeed": "2056620339", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json index 15982b6d0fec..755f7794f1d8 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-a995e4188741dcb30baa05af9c339316-1908f856ce368ba9-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "85e67157bc75cf3d0f948cb5fd851cc2", + "traceparent": "00-097bcaf7744ff9f3cdd18241b7364e41-f3ef6cde30da0d67-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "061ded85e1b51fbed44b8d498920dd31", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:23 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:57 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -25,21 +25,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:29 GMT", - "MS-CV": "OUfaVI6QcUmGo8W4Tce\u002BAQ.0", + "Date": "Fri, 18 Aug 2023 18:08:01 GMT", + "MS-CV": "Qhqxp7dLk02QsqXo9VwIsQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0NVjBZAAAAAAcEW1SC5GkT4F0aQzJDw2LWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0gbPfZAAAAADd1rlUclKoSbWF5NabZGVQTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "613ms" + "X-Processing-Time": "365ms" }, "ResponseBody": { "receipts": [ { - "messageId": "0f29d09a-5411-40a3-9812-0f5d794deab8", + "messageId": "e41127ce-7b42-4997-9d4a-373c8e0c78ff", "to": "\u002B16041234567" } ] @@ -48,7 +48,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "131367304", + "RandomSeed": "432431733", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json index 94eb92f29636..2715ef37a6d6 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-92d17f14a92b422130a2663772348c58-6b0f4990aa578276-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "baad02496482e11c26692dc8d81a29c3", + "traceparent": "00-ae8267afb963b9e6df628c64b00bd605-b9e89a8fffcb736a-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "023f02c0a36e959b6b9762457aeaa2b8", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:27 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:08:00 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -25,21 +25,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:34 GMT", - "MS-CV": "y4ojjHMafkqKcPqUqetsSQ.0", + "Date": "Fri, 18 Aug 2023 18:08:04 GMT", + "MS-CV": "tkVciEwfKUGE5q6\u002BRJGRzw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0OVjBZAAAAAAsizFVntD\u002BSp\u002BpISpXpScwWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0hLPfZAAAAAClYPRKpfIASJFAtPQFE\u002BZkTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "603ms" + "X-Processing-Time": "356ms" }, "ResponseBody": { "receipts": [ { - "messageId": "74a29880-19ca-4327-81f9-8bf990a8cb86", + "messageId": "97f98eeb-ec25-415f-afdf-161a4a42b2bd", "to": "\u002B16041234567" } ] @@ -48,7 +48,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1152443371", + "RandomSeed": "1572942681", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json index b2ada6e96fd1..7cc1646c2f57 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "679", "Content-Type": "application/json", - "traceparent": "00-d812fb3383a5a5c3e0f8bfe170584db6-d2ea76bd7e0afa1d-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "976069e0077282ec9ed2b1547a34e9dc", + "traceparent": "00-ecfcaa9efede29fb38433f0a1f0b29f6-746a4021940c1314-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "4e146816f6222242424fdb0ad7f1dfe9", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:23 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:57 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -83,21 +83,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:30 GMT", - "MS-CV": "IN17IaBSCka6aEqS4NiYdA.0", + "Date": "Fri, 18 Aug 2023 18:08:02 GMT", + "MS-CV": "swIPqdXGTk2l7qb7RcxWCA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0NVjBZAAAAAD0Es613iKsQLneXtq\u002Ba9ONWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0grPfZAAAAABdStZMfeN\u002BTIDY7N\u002BQCwEwTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "611ms" + "X-Processing-Time": "408ms" }, "ResponseBody": { "receipts": [ { - "messageId": "2f2c16b5-3a3a-4585-85e4-5f58654e9465", + "messageId": "4c722835-945c-4ac2-84fe-cf783f6b74dd", "to": "\u002B16041234567" } ] @@ -106,7 +106,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1255569645", + "RandomSeed": "518291675", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json index 6c16f8b0ad1e..54a13b454a52 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "679", "Content-Type": "application/json", - "traceparent": "00-110eea695df412573c6ecad6d8ee9896-6aec97caab246e64-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "3761d298e14ca97b45124c9105126f30", + "traceparent": "00-88169776b3c9b0a5970a2c45a22ab2c7-b82c23634c2f361b-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "52aeedca0b14dbbc3ab8e75decebb8d0", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:29 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:08:00 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -83,21 +83,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:35 GMT", - "MS-CV": "WMA1wt1HCkqHx4eI39Okxw.0", + "Date": "Fri, 18 Aug 2023 18:08:05 GMT", + "MS-CV": "j96v3xFqDUaT8ia1P66gKQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0O1jBZAAAAAAUUxBQZYMdRI/jEatdS5lRWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0hbPfZAAAAAA2LQxQLi0OS64nqBrB3s7GTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "906ms" + "X-Processing-Time": "406ms" }, "ResponseBody": { "receipts": [ { - "messageId": "f86c872f-bae2-45f5-9c29-cea05e680c47", + "messageId": "7230d759-d774-41f9-b294-4cb1c15ceb83", "to": "\u002B16041234567" } ] @@ -106,7 +106,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "514284666", + "RandomSeed": "504003146", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json index fd55a299107c..18dfc798343f 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "456", "Content-Type": "application/json", - "traceparent": "00-8fa7cfbe03e08f54085fe6b1ba9de1d2-456680ede034d6e3-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "f7c09da9f23e79d70614ddf7e0a8b27b", + "traceparent": "00-1cb16c1d31b38e485f93862001f3a2ee-7a4365ee9bd36cc5-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "f5351c6b2d9bd70afc28c87f8c63826e", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:24 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:58 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -56,21 +56,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:30 GMT", - "MS-CV": "KKIitoiahEeM26DfK3uomQ.0", + "Date": "Fri, 18 Aug 2023 18:08:02 GMT", + "MS-CV": "wG/PIsDVQke3Uw5LNfbo4A.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0NljBZAAAAACBVeDH8fI2Tpzhb017FbPxWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0grPfZAAAAACxsWt82tafTr6ya0Toahq3TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "629ms" + "X-Processing-Time": "388ms" }, "ResponseBody": { "receipts": [ { - "messageId": "421b88a1-8225-4c70-be61-a8379520b3c0", + "messageId": "2345999e-3db5-4d90-b3cb-6d7b60281f5e", "to": "\u002B16041234567" } ] @@ -79,7 +79,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "51084227", + "RandomSeed": "199331711", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json index 8f8a43eeb533..a6b8df85d420 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "456", "Content-Type": "application/json", - "traceparent": "00-d76e5406e4af7dd150310c8b09fb9a65-14fbf0b54d0659b9-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "559b2bdece2268f77ee44edc4709a4c2", + "traceparent": "00-bc495984add8946f9f23c84c427f2daa-7b497688c85063a4-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "c461b6a01a61cb0f7f49a34a28d9e07c", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:29 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:08:01 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -56,21 +56,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:36 GMT", - "MS-CV": "4vuzIEG4dUyT8ZjmucVu0A.0", + "Date": "Fri, 18 Aug 2023 18:08:05 GMT", + "MS-CV": "cwnWDbmCmEadnaeyLN\u002Bu2A.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0O1jBZAAAAAAcjRGqUjBpSJE85b3zmxUuWVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0hbPfZAAAAADVE8Y61XouTY8Dv5QF6UQNTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "601ms" + "X-Processing-Time": "417ms" }, "ResponseBody": { "receipts": [ { - "messageId": "6c9a2f5b-f99e-4778-8aa1-b74a2b454d3b", + "messageId": "fb8e9c51-d955-4ea1-b186-9ad9d07f4977", "to": "\u002B16041234567" } ] @@ -79,7 +79,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "89470489", + "RandomSeed": "803060726", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json index 03dadbd20e10..d89e83a52bda 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "298", "Content-Type": "application/json", - "traceparent": "00-e2416804e4b8aa3863d0890cdf26a854-db5caac684eda377-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "71d43d29ada13548140270403c72ce0d", + "traceparent": "00-492043c0287f3be40a5773e0810bc395-a6f20853a5e423ae-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "698da84ceea1a113b6bcaa8dedd4ae92", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:25 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:07:58 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -45,21 +45,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:31 GMT", - "MS-CV": "lpiuFjJ1eUmHeqXqvs/HBA.0", + "Date": "Fri, 18 Aug 2023 18:08:02 GMT", + "MS-CV": "oaoBd4oOaUatU7ax0lxBfQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0N1jBZAAAAACV2RwTx9psRJpMSwexvK\u002B6WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0g7PfZAAAAADbobmA86VuQbCfN7Y/gSQQTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "561ms" + "X-Processing-Time": "348ms" }, "ResponseBody": { "receipts": [ { - "messageId": "b0bcbfad-11bb-4559-bc76-1ee742b14b58", + "messageId": "247f899e-2106-467b-85eb-5f94cd7d994f", "to": "\u002B16041234567" } ] @@ -68,7 +68,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "970949867", + "RandomSeed": "564286513", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json index 52370f092442..1e8bc64b2767 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-02-01-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "298", "Content-Type": "application/json", - "traceparent": "00-f66896ff6e1dbb3d0b412080f0f4ddb6-6f7cd83f6350c9b3-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230726.1 (.NET 7.0.9; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "72d625494fcfac29ab99658e5043bf31", + "traceparent": "00-891f25a52bf1d20c198c0b32dfa5a243-6449dd8c24849f4e-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "f3a932beef54467b44daf4cee582ca4f", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Wed, 26 Jul 2023 17:30:30 GMT", + "x-ms-date": "Fri, 18 Aug 2023 18:08:01 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -45,21 +45,21 @@ }, "StatusCode": 202, "ResponseHeaders": { - "api-supported-versions": "2023-02-01-preview", + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 26 Jul 2023 17:30:36 GMT", - "MS-CV": "/os5IL3suUuQIQ\u002BhBTQnzw.0", + "Date": "Fri, 18 Aug 2023 18:08:05 GMT", + "MS-CV": "7/sKgIcsdkOgawbf8GKIug.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0PFjBZAAAAAD3H\u002B6sRraISbOI7eIQUrB2WVRPMjIxMDkwODIwMDI3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0hrPfZAAAAAD5HvLLTFcMR6wUUymsNlz7TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "513ms" + "X-Processing-Time": "347ms" }, "ResponseBody": { "receipts": [ { - "messageId": "4ac3bee5-9435-4e69-9691-a01ab6652f6b", + "messageId": "dab0088d-9bb2-45e9-8578-74f42aa8c664", "to": "\u002B16041234567" } ] @@ -68,7 +68,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1368047638", + "RandomSeed": "29202494", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } From d1a4ceb3dc566c3672247bc6b854b0d5635ef8ee Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Wed, 23 Aug 2023 12:56:14 -0700 Subject: [PATCH 15/24] fix broken link --- sdk/communication/Azure.Communication.Messages/CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md index 5af39cd70b54..4d7c16e63756 100644 --- a/sdk/communication/Azure.Communication.Messages/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Messages/CHANGELOG.md @@ -8,5 +8,3 @@ This is a Public Preview version, so breaking changes are possible in subsequent [read_me]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Messages/README.md -[documentation]: https://docs.microsoft.com/azure/communication-services/quickstarts/advancedmessaging/whatsapp/get-started - From bbe654d2f7a5fa5f5502521a741d8360f5febe90 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Thu, 24 Aug 2023 16:48:02 -0700 Subject: [PATCH 16/24] use latest swagger --- .../src/Generated/NotificationMessagesRestClient.cs | 6 +++--- .../src/Generated/StreamRestClient.cs | 6 +++--- .../src/Generated/TemplateV2RestClient.cs | 8 ++++---- .../src/MessageTemplateClient.cs | 8 ++++---- .../src/NotificationMessagesClient.cs | 8 ++++---- .../Azure.Communication.Messages/src/autorest.md | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs index d01c8776975d..ddf5bdefa29e 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationMessagesRestClient.cs @@ -20,7 +20,7 @@ namespace Azure.Communication.Messages internal partial class NotificationMessagesRestClient { 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. @@ -32,7 +32,7 @@ internal partial class NotificationMessagesRestClient /// The communication resource, for example https://my-resource.communication.azure.com. /// Api Version. /// , , or is null. - public NotificationMessagesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-08-24-preview") + public NotificationMessagesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-08-24-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -46,7 +46,7 @@ internal HttpMessage CreateSendMessageRequest(string channelRegistrationId, IEnu var request = message.Request; request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); - uri.AppendRaw(_endpoint, false); + uri.Reset(_endpoint); uri.AppendPath("/messages/notifications/:send", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs index e69af78e664f..d42b1c26eb7f 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/StreamRestClient.cs @@ -18,7 +18,7 @@ namespace Azure.Communication.Messages internal partial class StreamRestClient { 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 +30,7 @@ internal partial class StreamRestClient /// The communication resource, for example https://my-resource.communication.azure.com. /// Api Version. /// , , or is null. - public StreamRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-08-24-preview") + public StreamRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-08-24-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -45,7 +45,7 @@ internal HttpMessage CreateDownloadMediaRequest(string id) message.BufferResponse = false; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw(_endpoint, false); + uri.Reset(_endpoint); uri.AppendPath("/messages/streams/", false); uri.AppendPath(id, true); uri.AppendQuery("api-version", _apiVersion, true); diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs index a06164b1aa71..bb42713c2f8c 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TemplateV2RestClient.cs @@ -18,7 +18,7 @@ namespace Azure.Communication.Messages internal partial class TemplateV2RestClient { 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 +30,7 @@ internal partial class TemplateV2RestClient /// The communication resource, for example https://my-resource.communication.azure.com. /// Api Version. /// , , or is null. - public TemplateV2RestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2023-08-24-preview") + public TemplateV2RestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-08-24-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -44,7 +44,7 @@ internal HttpMessage CreateListRequest(Guid channelId, int? maxPageSize) var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw(_endpoint, false); + uri.Reset(_endpoint); uri.AppendPath("/messages/channels/", false); uri.AppendPath(channelId, true); uri.AppendPath("/templates", false); @@ -108,7 +108,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, Guid channelId, var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw(_endpoint, false); + uri.Reset(_endpoint); uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs b/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs index b341862c19d2..a226ceac4bfb 100644 --- a/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs @@ -71,18 +71,18 @@ public MessageTemplateClient(Uri endpoint, TokenCredential tokenCredential, Comm #region private constructors private MessageTemplateClient(ConnectionString connectionString, CommunicationMessagesClientOptions options) - : this(connectionString.GetRequired("endpoint"), options.BuildHttpPipeline(connectionString), options) + : this(new Uri(connectionString.GetRequired("endpoint")), options.BuildHttpPipeline(connectionString), options) { } private MessageTemplateClient(string endpoint, TokenCredential tokenCredential, CommunicationMessagesClientOptions options) - : this(endpoint, options.BuildHttpPipeline(tokenCredential), options) + : this(new Uri(endpoint), options.BuildHttpPipeline(tokenCredential), options) { } private MessageTemplateClient(string endpoint, AzureKeyCredential keyCredential, CommunicationMessagesClientOptions options) - : this(endpoint, options.BuildHttpPipeline(keyCredential), options) + : this(new Uri(endpoint), options.BuildHttpPipeline(keyCredential), options) { } - private MessageTemplateClient(string endpoint, HttpPipeline httpPipeline, CommunicationMessagesClientOptions options) + private MessageTemplateClient(Uri endpoint, HttpPipeline httpPipeline, CommunicationMessagesClientOptions options) { _clientDiagnostics = new ClientDiagnostics(options); _templateV2RestClient = new TemplateV2RestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); diff --git a/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs b/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs index 81cc0d049477..3190a1c2dfd0 100644 --- a/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs @@ -70,18 +70,18 @@ public NotificationMessagesClient(Uri endpoint, TokenCredential tokenCredential, #region private constructors private NotificationMessagesClient(ConnectionString connectionString, CommunicationMessagesClientOptions options) - : this(connectionString.GetRequired("endpoint"), options.BuildHttpPipeline(connectionString), options) + : this(new Uri(connectionString.GetRequired("endpoint")), options.BuildHttpPipeline(connectionString), options) { } private NotificationMessagesClient(string endpoint, TokenCredential tokenCredential, CommunicationMessagesClientOptions options) - : this(endpoint, options.BuildHttpPipeline(tokenCredential), options) + : this(new Uri(endpoint), options.BuildHttpPipeline(tokenCredential), options) { } private NotificationMessagesClient(string endpoint, AzureKeyCredential keyCredential, CommunicationMessagesClientOptions options) - : this(endpoint, options.BuildHttpPipeline(keyCredential), options) + : this(new Uri(endpoint), options.BuildHttpPipeline(keyCredential), options) { } - private NotificationMessagesClient(string endpoint, HttpPipeline httpPipeline, CommunicationMessagesClientOptions options) + private NotificationMessagesClient(Uri endpoint, HttpPipeline httpPipeline, CommunicationMessagesClientOptions options) { _clientDiagnostics = new ClientDiagnostics(options); _notificationMessagesRestClient = new NotificationMessagesRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); diff --git a/sdk/communication/Azure.Communication.Messages/src/autorest.md b/sdk/communication/Azure.Communication.Messages/src/autorest.md index 877f0ec354f7..9f71a4f1dae7 100644 --- a/sdk/communication/Azure.Communication.Messages/src/autorest.md +++ b/sdk/communication/Azure.Communication.Messages/src/autorest.md @@ -11,7 +11,7 @@ If any of the new objects needs to be overwritten, add the required changes to t > see https://aka.ms/autorest ``` yaml input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/0cb2e7ec983a65238c45ab3cc50bd323eacae8b7/specification/communication/data-plane/Messages/preview/2023-08-24-preview/CommunicationServicesMessages.json + - https://github.com/Azure/azure-rest-api-specs/blob/0734629ebe21f0ff3a46794e71a095deafbae029/specification/communication/data-plane/Messages/preview/2023-08-24-preview/CommunicationServicesMessages.json payload-flattening-threshold: 10 generation1-convenience-client: true directive: From 79287f37c2d3f213cf4b7a4e68fb32f307dd38d1 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Thu, 24 Aug 2023 17:21:02 -0700 Subject: [PATCH 17/24] Remove unsupported auth type, add more live tests, and re-run the live tests --- .../src/MessageTemplateClient.cs | 11 - .../src/NotificationMessagesClient.cs | 11 - .../Infrastructure/MessagesLiveTestBase.cs | 22 + .../NotificationMessagesClientLiveTests.cs | 14 + .../GetTemplatesShouldSucceed.json | 34 +- .../GetTemplatesShouldSucceedAsync.json | 34 +- ...esWithAzureKeyCredentialShouldSucceed.json | 723 ++++++++++++++++++ ...hAzureKeyCredentialShouldSucceedAsync.json | 723 ++++++++++++++++++ ...firmationTemplateMessageShouldSucceed.json | 20 +- ...tionTemplateMessageShouldSucceedAsync.json | 20 +- ...nnocementTemplateMessageShouldSucceed.json | 20 +- ...mentTemplateMessageShouldSucceedAsync.json | 20 +- ...esolutionTemplateMessageShouldSucceed.json | 20 +- ...tionTemplateMessageShouldSucceedAsync.json | 20 +- .../SendMessageShouldSucceed.json | 20 +- .../SendMessageShouldSucceedAsync.json | 20 +- ...geWithAzureKeyCredentialShouldSucceed.json | 55 ++ ...hAzureKeyCredentialShouldSucceedAsync.json | 55 ++ ...firmationTemplateMessageShouldSucceed.json | 20 +- ...tionTemplateMessageShouldSucceedAsync.json | 20 +- ...eFeedbackTemplateMessageShouldSucceed.json | 20 +- ...backTemplateMessageShouldSucceedAsync.json | 20 +- ...firmationTemplateMessageShouldSucceed.json | 20 +- ...tionTemplateMessageShouldSucceedAsync.json | 20 +- .../MessageTemplateClientLiveTests.cs | 23 + 25 files changed, 1789 insertions(+), 196 deletions(-) create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceedAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceed.json create mode 100644 sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceedAsync.json diff --git a/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs b/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs index a226ceac4bfb..02772bc58706 100644 --- a/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/MessageTemplateClient.cs @@ -56,17 +56,6 @@ public MessageTemplateClient(Uri endpoint, AzureKeyCredential keyCredential, Com { } - /// Initializes a new instance of . - /// The URI of the Azure Communication Services resource. - /// The TokenCredential used to authenticate requests, such as DefaultAzureCredential. - /// Client options exposing , , , etc. - public MessageTemplateClient(Uri endpoint, TokenCredential tokenCredential, CommunicationMessagesClientOptions options = default) - : this( - Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, - Argument.CheckNotNull(tokenCredential, nameof(tokenCredential)), - options ?? new CommunicationMessagesClientOptions()) - { } - #endregion #region private constructors diff --git a/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs b/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs index 3190a1c2dfd0..7bbe835d7be3 100644 --- a/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs +++ b/sdk/communication/Azure.Communication.Messages/src/NotificationMessagesClient.cs @@ -55,17 +55,6 @@ public NotificationMessagesClient(Uri endpoint, AzureKeyCredential keyCredential { } - /// Initializes a new instance of . - /// The URI of the Azure Communication Services resource. - /// The TokenCredential used to authenticate requests, such as DefaultAzureCredential. - /// Client options exposing , , , etc. - public NotificationMessagesClient(Uri endpoint, TokenCredential tokenCredential, CommunicationMessagesClientOptions options = default) - : this( - Argument.CheckNotNull(endpoint, nameof(endpoint)).AbsoluteUri, - Argument.CheckNotNull(tokenCredential, nameof(tokenCredential)), - options ?? new CommunicationMessagesClientOptions()) - { } - #endregion #region private constructors diff --git a/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs index 3c29516a7f06..e8283c3f60b2 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/Infrastructure/MessagesLiveTestBase.cs @@ -1,7 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; +using Azure.Core; using Azure.Core.TestFramework; +using Azure.Identity; namespace Azure.Communication.Messages.Tests { @@ -20,6 +23,15 @@ protected NotificationMessagesClient CreateInstrumentedNotificationMessagesClien return InstrumentClient(client); } + protected NotificationMessagesClient CreateInstrumentedNotificationMessagesClientWithAzureKeyCredential() + { + var endpoint = TestEnvironment.LiveTestDynamicEndpoint; + var accessKey = TestEnvironment.LiveTestDynamicAccessKey; + var client = new NotificationMessagesClient(endpoint, new AzureKeyCredential(accessKey), InstrumentClientOptions(new CommunicationMessagesClientOptions())); + + return InstrumentClient(client); + } + protected MessageTemplateClient CreateInstrumentedMessageTemplateClient() { var connectionString = TestEnvironment.LiveTestDynamicConnectionString; @@ -27,5 +39,15 @@ protected MessageTemplateClient CreateInstrumentedMessageTemplateClient() return InstrumentClient(client); } + + protected MessageTemplateClient CreateInstrumentedMessageTemplateClientWithAzureKeyCredential() + { + var endpoint = TestEnvironment.LiveTestDynamicEndpoint; + var accessKey = TestEnvironment.LiveTestDynamicAccessKey; + + var client = new MessageTemplateClient(endpoint, new AzureKeyCredential(accessKey), InstrumentClientOptions(new CommunicationMessagesClientOptions())); + + return InstrumentClient(client); + } } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs index d7a5755362b7..ac5a8d9b15d4 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs @@ -32,6 +32,20 @@ public async Task SendMessageShouldSucceed() validateResponse(response); } + [Test] + public async Task SendMessageWithAzureKeyCredentialShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClientWithAzureKeyCredential(); + var options = new SendMessageOptions(TestEnvironment.SenderChannelRegistrationId, new List { TestEnvironment.RecipientIdentifier }, "LiveTest"); + + // Act + Response response = await notificationMessagesClient.SendMessageAsync(options); + + // Assert + validateResponse(response); + } + [Test] public async Task SendShippingConfirmationTemplateMessageShouldSucceed() { diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json index 772f61c7f3c0..212554e1e8ba 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json @@ -6,11 +6,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-01301e1091797db33f76e62a7ae5b26f-4de8adf2f06b9639-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "78fac250730cf0453e7847f10bb3bd13", + "traceparent": "00-f9e6c509f98d262f96f77514c5a990cd-35ff71170248ef05-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "ce3c75669e673b53abf886f13a157104", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:54 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:06 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -19,13 +19,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "9833", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:07:58 GMT", - "MS-CV": "7DtaWjYZTEOIfeaxmuefiw.0", + "Date": "Thu, 24 Aug 2023 23:53:15 GMT", + "MS-CV": "QPUqzSS7vUSmKbLGn34q1Q.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0f7PfZAAAAAAz4f3ZYYnrT5/JKnmjBIsITEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0bO3nZAAAAADgW8EJAClBTpWblFtRfrPsTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "249ms" + "X-Processing-Time": "295ms" }, "ResponseBody": { "value": [ @@ -689,11 +689,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-f78296139f291ca70d8e0edd40bd4dd7-1be6220b6199bb8d-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "155ff1bf8c7add28ad2adbff5042d7df", + "traceparent": "00-5496045ee1e2ee78e65acd7e4a469af6-3be81e649ccc66e0-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "8e7723839e1b340bb8a403ade1654f3f", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:55 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:07 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -702,13 +702,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:07:59 GMT", - "MS-CV": "NjbeUHakpk28DPtX9oSHww.0", + "Date": "Thu, 24 Aug 2023 23:53:16 GMT", + "MS-CV": "QokhG/QeFEmUfMVlGpQ/iA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0f7PfZAAAAABd7M7ZMlLoQryRIJwMb6P1TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0bO3nZAAAAABjf7v97KHETo7Vbn21oeq8TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "144ms" + "X-Processing-Time": "149ms" }, "ResponseBody": { "value": [] @@ -717,7 +717,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1784237815", + "RandomSeed": "433192584", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json index 87a28bfe09e1..8a126efc0e5e 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json @@ -6,11 +6,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-2e7b951c517c8ac4fde4f0d8fd6a3cf2-53fecf36790d4582-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a7da4051ac334a7002677c35800c25c7", + "traceparent": "00-3c38742e36e17888b5c7b17dd66f139e-d4dd34c4ff0d1ee0-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "2e029dcc38ff26f7b1763b7a4e5cd0e8", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:55 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:09 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -19,13 +19,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "9833", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:07:59 GMT", - "MS-CV": "XpOK7rDhi02mrEQ1kbdVxw.0", + "Date": "Thu, 24 Aug 2023 23:53:17 GMT", + "MS-CV": "n14JIxxvW0GR9T1II6H\u002Bnw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0gLPfZAAAAAAsAJYILREpT6uLReWYI9DgTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0bu3nZAAAAACbR73JbHPrRL19zLF5Qwe7TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "193ms" + "X-Processing-Time": "195ms" }, "ResponseBody": { "value": [ @@ -689,11 +689,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-2e0970de01a0da39bb59e209807145b6-86cc7699ed463ae8-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "910a74d9d1e04258ed49c412624cbe60", + "traceparent": "00-9f4495df33c60d27d276b583723bd9c8-a9d175617a0b664a-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "d2526a795d24b81c613fe448dd07357b", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:55 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:09 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -702,13 +702,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:07:59 GMT", - "MS-CV": "oz1MkQooKU2mJDvpMRrybw.0", + "Date": "Thu, 24 Aug 2023 23:53:17 GMT", + "MS-CV": "/vgS3LQ5nUaHIbdeXrXwTA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0gLPfZAAAAACObi9NYkNrRro\u002BGlPrc7b2TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0bu3nZAAAAACiLO2i7tAfQqTgovdB6NU6TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "111ms" + "X-Processing-Time": "179ms" }, "ResponseBody": { "value": [] @@ -717,7 +717,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2034252982", + "RandomSeed": "280328817", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json new file mode 100644 index 000000000000..cda3127fff6b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json @@ -0,0 +1,723 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-178e726c4c24c3435d23890befa21e1a-4a27e83af601df54-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b66c29abaf4d268a8d63ff5b9a47be4e", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 24 Aug 2023 23:53:08 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "9833", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 24 Aug 2023 23:53:16 GMT", + "MS-CV": "6qOJAc7Ne02dwXu5IiE1/w.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0be3nZAAAAABcEuF7hnG6TLQWINRYB9ARTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "358ms" + }, + "ResponseBody": { + "value": [ + { + "name": "optin_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Reply {{1}} to receive {{2}}. Txt {{3}} for HELP, Txt {{4}} to opt-out.", + "example": { + "body_text": [ + [ + "Y", + "appointment reminders", + "HELP", + "STOP" + ] + ] + } + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "This is your flight confirmation for {{1}}-{{2}} on {{3}}." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Esta \u00E9 a sua confirma\u00E7\u00E3o de voo para {{1}}-{{2}} em {{3}}." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Confirmamos tu vuelo a {{1}}-{{2}} para el {{3}}." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Ini merupakan konfirmasi penerbangan Anda untuk {{1}}-{{2}} di {{3}}." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Terima kasih sudah membeli {{1}}! Kami menghargai masukan Anda dan ingin mempelajari lebih lanjut terkait pengalaman Anda." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Ikuti survei", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Thank you for purchasing {{1}}! We value your feedback and would like to learn more about your experience." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Take Survey", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Agradecemos a aquisi\u00E7\u00E3o de {{1}}! Valorizamos seu feedback e gostar\u00EDamos de saber mais sobre sua experi\u00EAncia." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Responder \u00E0 pesquisa", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "\u00A1Gracias por comprar {{1}}! Valoramos tus comentarios y nos gustar\u00EDa saber c\u00F3mo fue tu experiencia." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Responder encuesta", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "Jam diskon telah tiba! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nBergembiralah dan nikmati hari Anda. \uD83C\uDF89\nTempat: {{1}}\nWaktu: {{2}}" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "\u00A1Lleg\u00F3 el happy hour! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nA divertirse y disfrutar. \uD83C\uDF89\nLugar: {{1}}\nHora: {{2}}" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "O happy hour chegou! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nSeja feliz e aproveite o dia. \uD83C\uDF89\nLocal: {{1}}\nHor\u00E1rio: {{2}}" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "Happy hour is here! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nPlease be merry and enjoy the day. \uD83C\uDF89\nVenue: {{1}}\nTime: {{2}}" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Oi, {{1}}. N\u00F3s conseguimos resolver o problema que voc\u00EA estava enfrentando?" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Sim" + }, + { + "type": "QUICK_REPLY", + "text": "N\u00E3o" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Hi {{1}}, were we able to solve the issue that you were facing?" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Yes" + }, + { + "type": "QUICK_REPLY", + "text": "No" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Halo {{1}}, apakah kami bisa mengatasi masalah yang sedang Anda hadapi?" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Ya" + }, + { + "type": "QUICK_REPLY", + "text": "Tidak" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Hola, {{1}}. \u00BFPudiste solucionar el problema que ten\u00EDas?" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "S\u00ED" + }, + { + "type": "QUICK_REPLY", + "text": "No" + } + ] + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Tu entrada para *{{1}}*\n*Hora* - {{2}}\n*Lugar* - {{3}}\n*Asientos* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Seu ingresso para *{{1}}*\n*Hor\u00E1rio* - {{2}}\n*Local* - {{3}}\n*Assentos* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Your ticket for *{{1}}*\n*Time* - {{2}}\n*Venue* - {{3}}\n*Seats* - {{4}}" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Tiket Anda untuk *{{1}}*\n*Waktu* - {{2}}\n*Tempat* - {{3}}\n*Kursi* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Your package has been shipped. It will be delivered in {{1}} business days." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Seu pacote foi enviado. Ele ser\u00E1 entregue em {{1}} dias \u00FAteis." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "\u00F3 tu paquete. La entrega se realizar\u00E1 en {{1}} d\u00ED." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Paket Anda sudah dikirim. Paket akan sampai dalam {{1}} hari kerja." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "appointment_reminder", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Dear {{1}} {{2}}, your next appointment with {{3}} is scheduled for {{4}}. Reply YES to confirm.", + "example": { + "body_text": [ + [ + "Eugenia", + "Lopez", + "Lamna Healthcare", + "September 25, 2022 at 9:00 AM" + ] + ] + } + } + ] + } + }, + { + "name": "order_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Your {{1}} order has been placed. Track order updates {{2}} Reply HELP for help." + } + ] + } + } + ], + "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD" + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-aabeca5691ce92a81313cf93c3618d88-a093845f952ffe9a-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5e6d5667efabac38a99d4cdb22a554e6", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 24 Aug 2023 23:53:08 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "12", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 24 Aug 2023 23:53:17 GMT", + "MS-CV": "i/yOcwBa8UGvGOTbPFrSyg.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0bu3nZAAAAADI\u002BFiajjLzQJnNocjoS/orTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "277ms" + }, + "ResponseBody": { + "value": [] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "610886330", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceedAsync.json new file mode 100644 index 000000000000..f9182150831b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceedAsync.json @@ -0,0 +1,723 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-ff1419a2ab442467e982dd445b875ff6-3979b4216d84324e-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "21d34dbdb2a3b17bd1c93735bde48fa8", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 24 Aug 2023 23:53:09 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "9833", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 24 Aug 2023 23:53:18 GMT", + "MS-CV": "ehCaEGEkE0\u002BtTwv\u002B4axoKQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0bu3nZAAAAADwLyD58wYHR46a\u002BZx/PuIDTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "331ms" + }, + "ResponseBody": { + "value": [ + { + "name": "optin_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Reply {{1}} to receive {{2}}. Txt {{3}} for HELP, Txt {{4}} to opt-out.", + "example": { + "body_text": [ + [ + "Y", + "appointment reminders", + "HELP", + "STOP" + ] + ] + } + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "This is your flight confirmation for {{1}}-{{2}} on {{3}}." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Esta \u00E9 a sua confirma\u00E7\u00E3o de voo para {{1}}-{{2}} em {{3}}." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Confirmamos tu vuelo a {{1}}-{{2}} para el {{3}}." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_flight_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "DOCUMENT" + }, + { + "type": "BODY", + "text": "Ini merupakan konfirmasi penerbangan Anda untuk {{1}}-{{2}} di {{3}}." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Terima kasih sudah membeli {{1}}! Kami menghargai masukan Anda dan ingin mempelajari lebih lanjut terkait pengalaman Anda." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Ikuti survei", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Thank you for purchasing {{1}}! We value your feedback and would like to learn more about your experience." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Take Survey", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Agradecemos a aquisi\u00E7\u00E3o de {{1}}! Valorizamos seu feedback e gostar\u00EDamos de saber mais sobre sua experi\u00EAncia." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Responder \u00E0 pesquisa", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_purchase_feedback", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "\u00A1Gracias por comprar {{1}}! Valoramos tus comentarios y nos gustar\u00EDa saber c\u00F3mo fue tu experiencia." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "URL", + "text": "Responder encuesta", + "url": "https://www.example.com/" + } + ] + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "Jam diskon telah tiba! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nBergembiralah dan nikmati hari Anda. \uD83C\uDF89\nTempat: {{1}}\nWaktu: {{2}}" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "\u00A1Lleg\u00F3 el happy hour! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nA divertirse y disfrutar. \uD83C\uDF89\nLugar: {{1}}\nHora: {{2}}" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "O happy hour chegou! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nSeja feliz e aproveite o dia. \uD83C\uDF89\nLocal: {{1}}\nHor\u00E1rio: {{2}}" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_happy_hour_announcement", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "VIDEO" + }, + { + "type": "BODY", + "text": "Happy hour is here! \uD83C\uDF7A\uD83D\uDE00\uD83C\uDF78\nPlease be merry and enjoy the day. \uD83C\uDF89\nVenue: {{1}}\nTime: {{2}}" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Oi, {{1}}. N\u00F3s conseguimos resolver o problema que voc\u00EA estava enfrentando?" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Sim" + }, + { + "type": "QUICK_REPLY", + "text": "N\u00E3o" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Hi {{1}}, were we able to solve the issue that you were facing?" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Yes" + }, + { + "type": "QUICK_REPLY", + "text": "No" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Halo {{1}}, apakah kami bisa mengatasi masalah yang sedang Anda hadapi?" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "Ya" + }, + { + "type": "QUICK_REPLY", + "text": "Tidak" + } + ] + } + ] + } + }, + { + "name": "sample_issue_resolution", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Hola, {{1}}. \u00BFPudiste solucionar el problema que ten\u00EDas?" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + }, + { + "type": "BUTTONS", + "buttons": [ + { + "type": "QUICK_REPLY", + "text": "S\u00ED" + }, + { + "type": "QUICK_REPLY", + "text": "No" + } + ] + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Tu entrada para *{{1}}*\n*Hora* - {{2}}\n*Lugar* - {{3}}\n*Asientos* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Seu ingresso para *{{1}}*\n*Hor\u00E1rio* - {{2}}\n*Local* - {{3}}\n*Assentos* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Your ticket for *{{1}}*\n*Time* - {{2}}\n*Venue* - {{3}}\n*Seats* - {{4}}" + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_movie_ticket_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "HEADER", + "format": "IMAGE" + }, + { + "type": "BODY", + "text": "Tiket Anda untuk *{{1}}*\n*Waktu* - {{2}}\n*Tempat* - {{3}}\n*Kursi* - {{4}}" + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Your package has been shipped. It will be delivered in {{1}} business days." + }, + { + "type": "FOOTER", + "text": "This message is from an unverified business." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "pt_BR", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Seu pacote foi enviado. Ele ser\u00E1 entregue em {{1}} dias \u00FAteis." + }, + { + "type": "FOOTER", + "text": "Esta mensagem \u00E9 de uma empresa n\u00E3o verificada." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "es", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "\u00F3 tu paquete. La entrega se realizar\u00E1 en {{1}} d\u00ED." + }, + { + "type": "FOOTER", + "text": "Este mensaje proviene de un negocio no verificado." + } + ] + } + }, + { + "name": "sample_shipping_confirmation", + "language": "id", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Paket Anda sudah dikirim. Paket akan sampai dalam {{1}} hari kerja." + }, + { + "type": "FOOTER", + "text": "Pesan ini berasal dari bisnis yang tidak terverifikasi." + } + ] + } + }, + { + "name": "appointment_reminder", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Dear {{1}} {{2}}, your next appointment with {{3}} is scheduled for {{4}}. Reply YES to confirm.", + "example": { + "body_text": [ + [ + "Eugenia", + "Lopez", + "Lamna Healthcare", + "September 25, 2022 at 9:00 AM" + ] + ] + } + } + ] + } + }, + { + "name": "order_confirmation", + "language": "en_US", + "channelType": "whatsApp", + "status": "approved", + "whatsApp": { + "content": [ + { + "type": "BODY", + "text": "Your {{1}} order has been placed. Track order updates {{2}} Reply HELP for help." + } + ] + } + } + ], + "nextLink": "/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD" + } + }, + { + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-f9b2ce43be0d72d31ef9358ce9c0810e-82b2805cbeee0e45-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "17665af6d108ce96e421b34e564b9c8c", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 24 Aug 2023 23:53:10 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "12", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 24 Aug 2023 23:53:18 GMT", + "MS-CV": "c3Xou3Lnr0WJIGOriS87rQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0b\u002B3nZAAAAACe0juflKttQo2lkBQ6EwkRTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "138ms" + }, + "ResponseBody": { + "value": [] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "376216920", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json index 0f9a2eaedf01..538e71b9baf5 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "584", "Content-Type": "application/json", - "traceparent": "00-00953ddaee4aa0adb3e6f1776c4f777f-186a8b9cc2ea214d-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "2c9f27686fe33fb90c95fb27c2b7e768", + "traceparent": "00-45f8eeb9d3309761424ed0e32cd70ce9-1f5107d081c285d5-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "20886787de5750d570bf5db9b9f51e92", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:56 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:10 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -77,18 +77,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:00 GMT", - "MS-CV": "bM15LsKPUEymO0r9E4zUaw.0", + "Date": "Thu, 24 Aug 2023 23:53:19 GMT", + "MS-CV": "oceNvFDeD0eO7HN0mtMROA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0gLPfZAAAAAAneTE9mu3CTqHpuOy73EuLTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0b\u002B3nZAAAAAALYnaSN9BFQbEV0GlJ8PdRTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "391ms" + "X-Processing-Time": "405ms" }, "ResponseBody": { "receipts": [ { - "messageId": "314b5edf-97b2-4ca9-b160-0ddf4a4ab7be", + "messageId": "01073589-20c1-4487-9b72-85ad6d01e02e", "to": "\u002B16041234567" } ] @@ -97,7 +97,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "136719512", + "RandomSeed": "1714007036", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json index 8dba5103addb..993a5db54677 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "584", "Content-Type": "application/json", - "traceparent": "00-d43f12a5bbec3e88f3fb1b2b732147cc-0ac420b0aa97be72-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "7e2e7da1cf9fb134e87dac256963ac0e", + "traceparent": "00-3d5d845b12cc8049c34e01091263b2e4-4d4c086beef91d2a-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "1f097d6b0420f7f723c59cf8c0d5eb01", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:59 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:14 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -77,18 +77,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:03 GMT", - "MS-CV": "m4cMqI6k10qwtUaQUqpu7A.0", + "Date": "Thu, 24 Aug 2023 23:53:23 GMT", + "MS-CV": "0e9pOspTw0W1nf6/sdyZlg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0g7PfZAAAAABJxWi7PhEDT7yR8n2mYY9UTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0dO3nZAAAAAC0DgKDYt9GR4RnsFJm9b2OTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "417ms" + "X-Processing-Time": "396ms" }, "ResponseBody": { "receipts": [ { - "messageId": "5151ddcd-cdee-410f-8fbc-581f85ea7b81", + "messageId": "d49a0fc0-96cf-4b0a-a444-478312db9ea9", "to": "\u002B16041234567" } ] @@ -97,7 +97,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "331261707", + "RandomSeed": "1645121986", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json index 32c2783ece57..bbf4f5ca1031 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "519", "Content-Type": "application/json", - "traceparent": "00-f2e4100274b5b97b80177ef3c5d780be-1781e0c3460599dd-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "eaa4351e5bda1dc6c47c45619b2b2e68", + "traceparent": "00-e5b92d69b18777d69529719de10ee4f0-d984dcc4528f2296-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "9577caa2892488fb5a631dda8fd87b0b", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:56 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:11 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -68,18 +68,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:00 GMT", - "MS-CV": "TboctDOFtESR0oTJqW7zyA.0", + "Date": "Thu, 24 Aug 2023 23:53:19 GMT", + "MS-CV": "9i3fIUXVkUyYHKIBIud7GA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0gbPfZAAAAADcQkxqtBISQI73OnY0o/H7TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0cO3nZAAAAAA2F6ImX55wT7zUpvOxwHpnTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "425ms" + "X-Processing-Time": "387ms" }, "ResponseBody": { "receipts": [ { - "messageId": "1ff0150a-0c1e-4ee3-a7ca-b88e4d2201b9", + "messageId": "05e393bf-b247-410f-a6db-1e1141781f3f", "to": "\u002B16041234567" } ] @@ -88,7 +88,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "519068326", + "RandomSeed": "1091170123", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json index f6162aad9fb2..b329c6252774 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "519", "Content-Type": "application/json", - "traceparent": "00-87f6fed20986b873718aefbc87ea2535-57df2f0b73168042-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "960c6154b0afa9a7626daf3966be8643", + "traceparent": "00-0cc81c4c11afb2a8dcc84a6ae30b23f3-9f080556b9135d26-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "48721feaaca96b98a67157b3e130ba12", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:59 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:15 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -68,18 +68,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:03 GMT", - "MS-CV": "SRC\u002BJUaHEkSgPSZWC9xvJQ.0", + "Date": "Thu, 24 Aug 2023 23:53:24 GMT", + "MS-CV": "rLEa/Ci7/0SbKXMe8JO/Ag.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0hLPfZAAAAABgUGpV6p7rRYt6hmsxFodeTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0dO3nZAAAAAC57PSe4XBXSb29mcHYhih7TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "368ms" + "X-Processing-Time": "396ms" }, "ResponseBody": { "receipts": [ { - "messageId": "1b0cfbe0-1bf9-42e6-a2c1-e6d77862cad9", + "messageId": "2dbb07ad-c36f-4acd-956e-c2d8f2ddafea", "to": "\u002B16041234567" } ] @@ -88,7 +88,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "854015714", + "RandomSeed": "222030596", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json index c1f068bc7536..cc27487f9906 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "507", "Content-Type": "application/json", - "traceparent": "00-5ab985255da34b62efdb7eec74d08967-12e5ea62e03a4338-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "6ec185eb204a82641408b5b2f2909626", + "traceparent": "00-0fd28e1c37e07e813a5dcdbd72379a7f-6f55b9a9c2bcc110-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "861384a9f70442c1068d91e123727016", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:56 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:11 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -70,18 +70,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:01 GMT", - "MS-CV": "oDITyjZZBEGFt407Zu3HHQ.0", + "Date": "Thu, 24 Aug 2023 23:53:20 GMT", + "MS-CV": "29XakRlFiE6cPof9hIM\u002BVQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0gbPfZAAAAADPV0Pe5QG3QqwHHchFIK4DTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0cO3nZAAAAACiu2as\u002B4nhRaeyvgdwjGCtTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "370ms" + "X-Processing-Time": "438ms" }, "ResponseBody": { "receipts": [ { - "messageId": "24420d4b-5ead-4721-94d9-2ee81beb29fc", + "messageId": "99662649-b6eb-4362-adc9-03dd1fe763d4", "to": "\u002B16041234567" } ] @@ -90,7 +90,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "501265864", + "RandomSeed": "2028815987", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json index 0879d6e8f076..a75b2cf52559 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "507", "Content-Type": "application/json", - "traceparent": "00-4e491c12d68aba09693f8a05e78e632e-6e039b5b56b634f2-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "f8ef2eea6979d4c73de22cdcf60228c5", + "traceparent": "00-1dcbfed44c21f7bd402cbfb737f088d1-618bda0b6bb6ce1c-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "85d347acaf6beafb8edcf6603cb1586f", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:59 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:15 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -70,18 +70,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:04 GMT", - "MS-CV": "pp7I1Qz3dkyXx3ccC/xXYg.0", + "Date": "Thu, 24 Aug 2023 23:53:24 GMT", + "MS-CV": "Yj5qZBMaTEK6FnhvttZ\u002BdQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0hLPfZAAAAADh5fJExxgKRYsEsa2zr0cmTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0de3nZAAAAADflBhV1DK1T480hZsb8y2iTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "356ms" + "X-Processing-Time": "330ms" }, "ResponseBody": { "receipts": [ { - "messageId": "b731d607-9604-4580-bfc2-ed1de774fe49", + "messageId": "b0f3c267-5cae-4c51-abe6-72e760d1816e", "to": "\u002B16041234567" } ] @@ -90,7 +90,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2056620339", + "RandomSeed": "1690741504", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json index 755f7794f1d8..46e553710a06 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-097bcaf7744ff9f3cdd18241b7364e41-f3ef6cde30da0d67-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "061ded85e1b51fbed44b8d498920dd31", + "traceparent": "00-65e65c68bc4568d3d213885f3de9d214-588d684aefe61d06-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "d85d34750cdc60aaba288f3bf9da5c1d", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:57 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:12 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -28,18 +28,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:01 GMT", - "MS-CV": "Qhqxp7dLk02QsqXo9VwIsQ.0", + "Date": "Thu, 24 Aug 2023 23:53:20 GMT", + "MS-CV": "Q2eUYnJ1gUq6EJmVxJLOgw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0gbPfZAAAAADd1rlUclKoSbWF5NabZGVQTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0ce3nZAAAAAB16ICsOCY6T4yrb87QXF1eTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "365ms" + "X-Processing-Time": "412ms" }, "ResponseBody": { "receipts": [ { - "messageId": "e41127ce-7b42-4997-9d4a-373c8e0c78ff", + "messageId": "fe310d4b-6484-4b2d-9cdb-cdcdaad05c44", "to": "\u002B16041234567" } ] @@ -48,7 +48,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "432431733", + "RandomSeed": "125082402", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json index 2715ef37a6d6..05dee1af1129 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-ae8267afb963b9e6df628c64b00bd605-b9e89a8fffcb736a-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "023f02c0a36e959b6b9762457aeaa2b8", + "traceparent": "00-3d5c837765ab147182266101329983c5-777d04d233b1eb46-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "622aea6c5f21937d8966014b99364a5e", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:08:00 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:16 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -28,18 +28,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:04 GMT", - "MS-CV": "tkVciEwfKUGE5q6\u002BRJGRzw.0", + "Date": "Thu, 24 Aug 2023 23:53:24 GMT", + "MS-CV": "gOyRNYVzUUipz3nXncqtMQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0hLPfZAAAAAClYPRKpfIASJFAtPQFE\u002BZkTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0de3nZAAAAACH3o4metYLS7rb/HAXPEoyTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "356ms" + "X-Processing-Time": "337ms" }, "ResponseBody": { "receipts": [ { - "messageId": "97f98eeb-ec25-415f-afdf-161a4a42b2bd", + "messageId": "7c80cce6-cff2-4981-8f18-4f5f810f6e47", "to": "\u002B16041234567" } ] @@ -48,7 +48,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1572942681", + "RandomSeed": "1742026768", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceed.json new file mode 100644 index 000000000000..537485570fdc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceed.json @@ -0,0 +1,55 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "126", + "Content-Type": "application/json", + "traceparent": "00-835f02ba7e0bc7f98509671a9c1f83ab-080045db93f7909b-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "8c348b5b815cc0b2fd62b2b04ba46c1d", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 24 Aug 2023 23:53:12 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16041234567" + ], + "type": "text", + "content": "LiveTest" + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 24 Aug 2023 23:53:21 GMT", + "MS-CV": "wRMj8RenykWUaYwq4nZT/w.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0ce3nZAAAAADVwirU1IlgT5EGCEW3RgFcTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "335ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "c4edf3b0-5246-4257-b72d-b14911949e64", + "to": "\u002B16041234567" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "28193595", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceedAsync.json new file mode 100644 index 000000000000..9b5c2564d8ac --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceedAsync.json @@ -0,0 +1,55 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "126", + "Content-Type": "application/json", + "traceparent": "00-2f915e6e9fc3183866eeb7ede4f5cb04-7de159e117bf409d-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "81c33dff5bb749e6a9b77e4c20eff3ff", + "x-ms-content-sha256": "Sanitized", + "x-ms-date": "Thu, 24 Aug 2023 23:53:16 GMT", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "channelRegistrationId": "59aced66-68ae-4b7a-8430-36f4c5dfa328", + "to": [ + "\u002B16041234567" + ], + "type": "text", + "content": "LiveTest" + }, + "StatusCode": 202, + "ResponseHeaders": { + "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", + "Content-Length": "87", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 24 Aug 2023 23:53:26 GMT", + "MS-CV": "D8awx1gELUiDNPN3r7ql\u002BQ.0", + "Request-Context": "appId=", + "Strict-Transport-Security": "max-age=2592000", + "X-Azure-Ref": "0de3nZAAAAADbba19kRMLS6Uah3DPitHdTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Cache": "CONFIG_NOCACHE", + "X-Processing-Time": "513ms" + }, + "ResponseBody": { + "receipts": [ + { + "messageId": "bed94b65-94e3-4db9-a098-abbf48ddf321", + "to": "\u002B16041234567" + } + ] + } + } + ], + "Variables": { + "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", + "RandomSeed": "1819452733", + "RECIPIENT_IDENTIFIER": "\u002B16041234567", + "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" + } +} diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json index 7cc1646c2f57..ed16aea29340 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "679", "Content-Type": "application/json", - "traceparent": "00-ecfcaa9efede29fb38433f0a1f0b29f6-746a4021940c1314-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "4e146816f6222242424fdb0ad7f1dfe9", + "traceparent": "00-640f588991b558dfc1b2ee53b0f8d1cf-172327200f66d26b-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b3d9329eec314148743106e6b1a84988", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:57 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:12 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -86,18 +86,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:02 GMT", - "MS-CV": "swIPqdXGTk2l7qb7RcxWCA.0", + "Date": "Thu, 24 Aug 2023 23:53:22 GMT", + "MS-CV": "sO2GduhAy02OCxNcQSbGEg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0grPfZAAAAABdStZMfeN\u002BTIDY7N\u002BQCwEwTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0cu3nZAAAAAB6KXnk5EyWToehCloZZBRLTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "408ms" + "X-Processing-Time": "1051ms" }, "ResponseBody": { "receipts": [ { - "messageId": "4c722835-945c-4ac2-84fe-cf783f6b74dd", + "messageId": "de3d5ac7-466b-4c1f-a827-f6d444970d99", "to": "\u002B16041234567" } ] @@ -106,7 +106,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "518291675", + "RandomSeed": "1028799287", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json index 54a13b454a52..bbf799fed176 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "679", "Content-Type": "application/json", - "traceparent": "00-88169776b3c9b0a5970a2c45a22ab2c7-b82c23634c2f361b-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "52aeedca0b14dbbc3ab8e75decebb8d0", + "traceparent": "00-7f00956b8fc92f16504f1f591a27fb35-90c052ec6bf93589-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "50a8a0873e4e9c9e6ef9c41570f642e5", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:08:00 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:17 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -86,18 +86,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:05 GMT", - "MS-CV": "j96v3xFqDUaT8ia1P66gKQ.0", + "Date": "Thu, 24 Aug 2023 23:53:26 GMT", + "MS-CV": "UW3ZETBf7kmCJ2Nn8tEe9A.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0hbPfZAAAAAA2LQxQLi0OS64nqBrB3s7GTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0du3nZAAAAADDVcjc8mF6R59w4abYD5OPTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "406ms" + "X-Processing-Time": "416ms" }, "ResponseBody": { "receipts": [ { - "messageId": "7230d759-d774-41f9-b294-4cb1c15ceb83", + "messageId": "4e2d096e-b395-40b1-ab0c-af6c121c9562", "to": "\u002B16041234567" } ] @@ -106,7 +106,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "504003146", + "RandomSeed": "2104350765", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json index 18dfc798343f..143faa5d0d5e 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "456", "Content-Type": "application/json", - "traceparent": "00-1cb16c1d31b38e485f93862001f3a2ee-7a4365ee9bd36cc5-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "f5351c6b2d9bd70afc28c87f8c63826e", + "traceparent": "00-43e726f6402f6a8cc0dd4e5468533fe2-cd3c179b99a2dacc-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "4daf86eaa159442488b79e50ea5aebe3", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:58 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:14 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -59,18 +59,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:02 GMT", - "MS-CV": "wG/PIsDVQke3Uw5LNfbo4A.0", + "Date": "Thu, 24 Aug 2023 23:53:22 GMT", + "MS-CV": "RIo7MMRypk2yKxrBrruopg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0grPfZAAAAACxsWt82tafTr6ya0Toahq3TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0c\u002B3nZAAAAAA2GLIpWunzR7gCBylGcSrFTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "388ms" + "X-Processing-Time": "418ms" }, "ResponseBody": { "receipts": [ { - "messageId": "2345999e-3db5-4d90-b3cb-6d7b60281f5e", + "messageId": "8b89c725-03dc-4d97-98a8-1beec6c3e081", "to": "\u002B16041234567" } ] @@ -79,7 +79,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "199331711", + "RandomSeed": "972908627", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json index a6b8df85d420..50eb66b76441 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "456", "Content-Type": "application/json", - "traceparent": "00-bc495984add8946f9f23c84c427f2daa-7b497688c85063a4-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "c461b6a01a61cb0f7f49a34a28d9e07c", + "traceparent": "00-f9e2215d16a34f31dd8b25cedbe73b82-0858fecd3a6894b8-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b200d7134f66c94a7314b6488b536372", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:08:01 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:17 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -59,18 +59,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:05 GMT", - "MS-CV": "cwnWDbmCmEadnaeyLN\u002Bu2A.0", + "Date": "Thu, 24 Aug 2023 23:53:27 GMT", + "MS-CV": "0TQmKJYlH0iXw8YR/N5bKg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0hbPfZAAAAADVE8Y61XouTY8Dv5QF6UQNTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0du3nZAAAAAC1JFvQdhZvR4qC3D7fMklETEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "417ms" + "X-Processing-Time": "370ms" }, "ResponseBody": { "receipts": [ { - "messageId": "fb8e9c51-d955-4ea1-b186-9ad9d07f4977", + "messageId": "429e67ac-7613-4aa4-a336-6bd4c306e8fb", "to": "\u002B16041234567" } ] @@ -79,7 +79,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "803060726", + "RandomSeed": "1949234695", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json index d89e83a52bda..1676840aed1c 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "298", "Content-Type": "application/json", - "traceparent": "00-492043c0287f3be40a5773e0810bc395-a6f20853a5e423ae-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "698da84ceea1a113b6bcaa8dedd4ae92", + "traceparent": "00-4794de276ce2052aa6aa833a3fb43488-4b09e1777b89a7d1-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "752692ab78af8d9ac3a6c04c2997519a", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:07:58 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:14 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -48,18 +48,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:02 GMT", - "MS-CV": "oaoBd4oOaUatU7ax0lxBfQ.0", + "Date": "Thu, 24 Aug 2023 23:53:23 GMT", + "MS-CV": "tTrfGxkSbEa8r29WQAwWFA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0g7PfZAAAAADbobmA86VuQbCfN7Y/gSQQTEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0c\u002B3nZAAAAACcTWo84UIlR5/gX4nfi\u002BcfTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "348ms" + "X-Processing-Time": "364ms" }, "ResponseBody": { "receipts": [ { - "messageId": "247f899e-2106-467b-85eb-5f94cd7d994f", + "messageId": "4441b28a-c8b7-47f8-bbdb-71aa5fdad18b", "to": "\u002B16041234567" } ] @@ -68,7 +68,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "564286513", + "RandomSeed": "400380273", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json index 1e8bc64b2767..a77433e51003 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "298", "Content-Type": "application/json", - "traceparent": "00-891f25a52bf1d20c198c0b32dfa5a243-6449dd8c24849f4e-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230818.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "f3a932beef54467b44daf4cee582ca4f", + "traceparent": "00-7def62ba137be3228ac570035fcdc54b-1342fa305618d6e8-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "a6d737f970b8f607d98187b1b2e51807", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Fri, 18 Aug 2023 18:08:01 GMT", + "x-ms-date": "Thu, 24 Aug 2023 23:53:18 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -48,18 +48,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 18 Aug 2023 18:08:05 GMT", - "MS-CV": "7/sKgIcsdkOgawbf8GKIug.0", + "Date": "Thu, 24 Aug 2023 23:53:27 GMT", + "MS-CV": "sDFUzatL\u002B0SMEh/TNuUHPQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0hrPfZAAAAAD5HvLLTFcMR6wUUymsNlz7TEFYMzExMDAwMTA4MDA3ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0d\u002B3nZAAAAADUlIfgybMHSbrSWmj5PRa9TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "347ms" + "X-Processing-Time": "405ms" }, "ResponseBody": { "receipts": [ { - "messageId": "dab0088d-9bb2-45e9-8578-74f42aa8c664", + "messageId": "fd5f36cd-d563-473d-abb6-25613f38288c", "to": "\u002B16041234567" } ] @@ -68,7 +68,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "29202494", + "RandomSeed": "2101114995", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs index 1f4d7f9dbde2..bbb7787da395 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/TemplateClient/MessageTemplateClientLiveTests.cs @@ -36,5 +36,28 @@ public Task GetTemplatesShouldSucceed() return Task.CompletedTask; } + + [Test] + public Task GetTemplatesWithAzureKeyCredentialShouldSucceed() + { + // Arrange + MessageTemplateClient messageTemplateClient = CreateInstrumentedMessageTemplateClientWithAzureKeyCredential(); + string channelRegistrationId = TestEnvironment.SenderChannelRegistrationId; + + // Act + AsyncPageable templates = messageTemplateClient.GetTemplatesAsync(channelRegistrationId); + + // Assert + Assert.IsNotNull(templates); + var templatesEnumerable = templates.ToEnumerableAsync().Result; + Assert.IsNotEmpty(templatesEnumerable); + foreach (MessageTemplateItem template in templatesEnumerable) + { + Assert.IsNotNull(template.Name); + Assert.IsNotNull(template.Language); + } + + return Task.CompletedTask; + } } } From f19c5abf101cc2d4462b1e2aac7bab797f5e7de2 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Thu, 24 Aug 2023 18:04:24 -0700 Subject: [PATCH 18/24] use the swagger that does not have operation-id response header --- sdk/communication/Azure.Communication.Messages/src/autorest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/autorest.md b/sdk/communication/Azure.Communication.Messages/src/autorest.md index 9f71a4f1dae7..a9bb639cfb1a 100644 --- a/sdk/communication/Azure.Communication.Messages/src/autorest.md +++ b/sdk/communication/Azure.Communication.Messages/src/autorest.md @@ -11,7 +11,7 @@ If any of the new objects needs to be overwritten, add the required changes to t > see https://aka.ms/autorest ``` yaml input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/0734629ebe21f0ff3a46794e71a095deafbae029/specification/communication/data-plane/Messages/preview/2023-08-24-preview/CommunicationServicesMessages.json + - https://github.com/Azure/azure-rest-api-specs/blob/ef0a60c7e99e6cb611b3ffd21bd1a08d89f1cb6b/specification/communication/data-plane/Messages/preview/2023-08-24-preview/CommunicationServicesMessages.json payload-flattening-threshold: 10 generation1-convenience-client: true directive: From 6d1cda44e2486f7520c7207f300b432517ce0ce7 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Mon, 28 Aug 2023 16:43:03 -0700 Subject: [PATCH 19/24] Take Value suffix off MessageTemplateQuickAction --- ...plateQuickActionValue.cs => MessageTemplateQuickAction.cs} | 4 ++-- .../NotificationMessagesClientLiveTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename sdk/communication/Azure.Communication.Messages/src/Models/{MessageTemplateQuickActionValue.cs => MessageTemplateQuickAction.cs} (83%) diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickActionValue.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickAction.cs similarity index 83% rename from sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickActionValue.cs rename to sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickAction.cs index 5d82807363ef..93704a902b5d 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickActionValue.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateQuickAction.cs @@ -6,10 +6,10 @@ namespace Azure.Communication.Messages { /// - public class MessageTemplateQuickActionValue: MessageTemplateValue + public class MessageTemplateQuickAction: MessageTemplateValue { /// - public MessageTemplateQuickActionValue(string name, string text = null, string payload = null) : base(name) + public MessageTemplateQuickAction(string name, string text = null, string payload = null) : base(name) { Text = text; Payload = payload; diff --git a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs index ac5a8d9b15d4..ca0c559066c3 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs @@ -106,8 +106,8 @@ public async Task SendIssueResolutionTemplateMessageShouldSucceed() IEnumerable recipients = new List { TestEnvironment.RecipientIdentifier }; var name = new MessageTemplateText("name", "Gloria"); - var yes = new MessageTemplateQuickActionValue("yes", null, "Yay!"); - var no = new MessageTemplateQuickActionValue("no", null, "Nay!"); + var yes = new MessageTemplateQuickAction("yes", null, "Yay!"); + var no = new MessageTemplateQuickAction("no", null, "Nay!"); IEnumerable values = new List { name, yes, no }; MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( From 6788b1474286b238ce13334e010079294087d428 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Fri, 6 Oct 2023 18:07:35 -0700 Subject: [PATCH 20/24] update sdk to latest - change autorest to using readme instead of swagger input-file - update Butotn from IDictionary to IEnumerable for maintaining orders - autorest point to azure-rest-api-specs-pr - re-run live tests to get new session records --- .../Azure.Communication.Messages/README.md | 12 ------ .../CommunicationMessagesModelFactory.cs | 3 +- .../Models/MessageTemplateWhatsAppBindings.cs | 4 +- .../src/autorest.md | 13 +++---- .../NotificationMessagesClientLiveTests.cs | 6 +-- .../GetTemplatesShouldSucceed.json | 34 ++++++++--------- .../GetTemplatesShouldSucceedAsync.json | 38 +++++++++---------- ...esWithAzureKeyCredentialShouldSucceed.json | 38 +++++++++---------- ...hAzureKeyCredentialShouldSucceedAsync.json | 34 ++++++++--------- ...firmationTemplateMessageShouldSucceed.json | 20 +++++----- ...tionTemplateMessageShouldSucceedAsync.json | 20 +++++----- ...nnocementTemplateMessageShouldSucceed.json | 20 +++++----- ...mentTemplateMessageShouldSucceedAsync.json | 20 +++++----- ...esolutionTemplateMessageShouldSucceed.json | 20 +++++----- ...tionTemplateMessageShouldSucceedAsync.json | 20 +++++----- .../SendMessageShouldSucceed.json | 20 +++++----- .../SendMessageShouldSucceedAsync.json | 20 +++++----- ...geWithAzureKeyCredentialShouldSucceed.json | 20 +++++----- ...hAzureKeyCredentialShouldSucceedAsync.json | 20 +++++----- ...firmationTemplateMessageShouldSucceed.json | 20 +++++----- ...tionTemplateMessageShouldSucceedAsync.json | 20 +++++----- ...eFeedbackTemplateMessageShouldSucceed.json | 20 +++++----- ...backTemplateMessageShouldSucceedAsync.json | 20 +++++----- ...firmationTemplateMessageShouldSucceed.json | 22 +++++------ ...tionTemplateMessageShouldSucceedAsync.json | 20 +++++----- 25 files changed, 244 insertions(+), 260 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/README.md b/sdk/communication/Azure.Communication.Messages/README.md index 2adc17450937..090d7029c809 100644 --- a/sdk/communication/Azure.Communication.Messages/README.md +++ b/sdk/communication/Azure.Communication.Messages/README.md @@ -37,18 +37,6 @@ NotificationMessagesClient notificationMessagesClient = new NotificationMessages MessageTemplateClient messageTemplateClient = new MessageTemplateClient(connectionString); ``` -#### Token Credential - -Alternatively, Messages clients can also be authenticated using a valid token credential. - -```C# -string endpoint = ""; -TokenCredential tokenCredential = new DefaultAzureCredential(); -NotificationMessagesClient notificationMessagesClient = new NotificationMessagesClient(new Uri(endpoint), tokenCredential); -MessageTemplateClient messageTemplateClient = new MessageTemplateClient(new Uri(endpoint), tokenCredential); -``` - - ## Examples ### Send an Notification Message To send a notification message, call the `SendMessage` or `SendMessageAsync` function from the `NotificationMessagesClient`. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs index 94dec5e0bfae..e09c9d3b3bae 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs @@ -8,9 +8,8 @@ using System; using System.Collections.Generic; using System.Linq; -using Azure.Communication.Messages; -namespace Azure.Communication.Messages.Models +namespace Azure.Communication.Messages { /// Model factory for models. public static partial class CommunicationMessagesModelFactory diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateWhatsAppBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateWhatsAppBindings.cs index 19f4252d55a6..5f87acb75472 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateWhatsAppBindings.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/MessageTemplateWhatsAppBindings.cs @@ -11,7 +11,7 @@ namespace Azure.Communication.Messages public class MessageTemplateWhatsAppBindings: MessageTemplateBindings { /// Initializes a new instance of MessageTemplateWhatsAppBindings. - public MessageTemplateWhatsAppBindings(IEnumerable header = null, IEnumerable body = null, IEnumerable footer = null, IDictionary button = null) + public MessageTemplateWhatsAppBindings(IEnumerable header = null, IEnumerable body = null, IEnumerable footer = null, IEnumerable> button = null) { Header = header; Body = body; @@ -26,7 +26,7 @@ public MessageTemplateWhatsAppBindings(IEnumerable header = null, IEnume /// Gets the footer. public IEnumerable Footer { get; } /// Gets the button. - public IDictionary Button { get; } + public IEnumerable> Button { get; } internal override MessageTemplateBindingsInternal ToMessageTemplateBindingsInternal() { diff --git a/sdk/communication/Azure.Communication.Messages/src/autorest.md b/sdk/communication/Azure.Communication.Messages/src/autorest.md index a9bb639cfb1a..1831ba2619ce 100644 --- a/sdk/communication/Azure.Communication.Messages/src/autorest.md +++ b/sdk/communication/Azure.Communication.Messages/src/autorest.md @@ -10,16 +10,13 @@ If any of the new objects needs to be overwritten, add the required changes to t > see https://aka.ms/autorest ``` yaml -input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/ef0a60c7e99e6cb611b3ffd21bd1a08d89f1cb6b/specification/communication/data-plane/Messages/preview/2023-08-24-preview/CommunicationServicesMessages.json +title: Messages +tag: package-2023-08-24-preview +model-namespace: false +require: + - https://github.com/Azure/azure-rest-api-specs-pr/blob/5e85419bed6c70dbfd28f872e298b23d794aa880/specification/communication/data-plane/Messages/readme.md payload-flattening-threshold: 10 generation1-convenience-client: true -directive: - from: swagger-document - where: $.definitions.* - transform: > - $["x-namespace"] = "Azure.Communication.Messages" - ``` ### Don't buffer media downloads diff --git a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs index ca0c559066c3..3085023aebd6 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs @@ -112,9 +112,9 @@ public async Task SendIssueResolutionTemplateMessageShouldSucceed() IEnumerable values = new List { name, yes, no }; MessageTemplateWhatsAppBindings bindings = new MessageTemplateWhatsAppBindings( body: new[] { name.Name }, - button: new Dictionary { - { yes.Name, MessageTemplateValueWhatsAppSubType.QuickReply }, - { no.Name, MessageTemplateValueWhatsAppSubType.QuickReply } + button: new[] { + new KeyValuePair(yes.Name, MessageTemplateValueWhatsAppSubType.QuickReply), + new KeyValuePair(no.Name, MessageTemplateValueWhatsAppSubType.QuickReply), } ); MessageTemplate template = new MessageTemplate("sample_issue_resolution", "en_us", values, bindings); diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json index 212554e1e8ba..6f771fa284bd 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceed.json @@ -6,11 +6,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-f9e6c509f98d262f96f77514c5a990cd-35ff71170248ef05-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "ce3c75669e673b53abf886f13a157104", + "traceparent": "00-8570f5ccd3dfd6ce6777d0a08d1ba0b5-dfb1a805bbd63c39-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "d824e77a461ffaa87df9cb7150d5e937", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:06 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:15 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -19,13 +19,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "9833", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:15 GMT", - "MS-CV": "QPUqzSS7vUSmKbLGn34q1Q.0", + "Date": "Sat, 07 Oct 2023 01:01:16 GMT", + "MS-CV": "HSVUeJZ21023ph9hVFUaKw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0bO3nZAAAAADgW8EJAClBTpWblFtRfrPsTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "03K0gZQAAAACCTJz6LdAWSq690\u002BSbtvcUWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "295ms" + "X-Processing-Time": "514ms" }, "ResponseBody": { "value": [ @@ -689,11 +689,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5496045ee1e2ee78e65acd7e4a469af6-3be81e649ccc66e0-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "8e7723839e1b340bb8a403ade1654f3f", + "traceparent": "00-ed568cd511b864a9aeccc81aaad752de-d943206472d67079-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "865b2c0e3c8ac241ad864b537ae18160", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:07 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:17 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -702,13 +702,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:16 GMT", - "MS-CV": "QokhG/QeFEmUfMVlGpQ/iA.0", + "Date": "Sat, 07 Oct 2023 01:01:17 GMT", + "MS-CV": "D0Geczfgq0SNStVwrBGXlQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0bO3nZAAAAABjf7v97KHETo7Vbn21oeq8TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "03a0gZQAAAAAFoJ3bQj82RZq2b\u002BaUk7ZMWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "149ms" + "X-Processing-Time": "440ms" }, "ResponseBody": { "value": [] @@ -717,7 +717,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "433192584", + "RandomSeed": "307047532", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json index 8a126efc0e5e..c1f5a09ce270 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json @@ -1,16 +1,16 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", + "RequestUri": "https://sanitizedcommunication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-3c38742e36e17888b5c7b17dd66f139e-d4dd34c4ff0d1ee0-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "2e029dcc38ff26f7b1763b7a4e5cd0e8", + "traceparent": "00-011a3fe03f19fcbfa4178d42ef8e5d9a-64cce9f7766f2ea3-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "efb9e77c0d6a1d4979fd3ec2afdf693c", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:09 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:19 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -19,13 +19,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "9833", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:17 GMT", - "MS-CV": "n14JIxxvW0GR9T1II6H\u002Bnw.0", + "Date": "Sat, 07 Oct 2023 01:01:19 GMT", + "MS-CV": "CECycpoKAEuAetLY0HvRbw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0bu3nZAAAAACbR73JbHPrRL19zLF5Qwe7TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0360gZQAAAAAAArMCtdFwQJeQwoVSowOIWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "195ms" + "X-Processing-Time": "376ms" }, "ResponseBody": { "value": [ @@ -684,16 +684,16 @@ } }, { - "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", + "RequestUri": "https://sanitizedcommunication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-9f4495df33c60d27d276b583723bd9c8-a9d175617a0b664a-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "d2526a795d24b81c613fe448dd07357b", + "traceparent": "00-819ca6c0b23ddd961c0de6304fc36809-269437e3bf197793-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "9491b3811273fa6ff6769b27e2e75fdc", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:09 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:19 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -702,13 +702,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:17 GMT", - "MS-CV": "/vgS3LQ5nUaHIbdeXrXwTA.0", + "Date": "Sat, 07 Oct 2023 01:01:19 GMT", + "MS-CV": "I1RfSdPPFk\u002BtPlnaorPJoA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0bu3nZAAAAACiLO2i7tAfQqTgovdB6NU6TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "04K0gZQAAAACOc\u002BOaK3qOSqEXfw\u002BA6jAmWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "179ms" + "X-Processing-Time": "325ms" }, "ResponseBody": { "value": [] @@ -717,7 +717,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "280328817", + "RandomSeed": "221729722", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json index cda3127fff6b..d5816249d4f2 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json @@ -1,16 +1,16 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", + "RequestUri": "https://sanitizedcommunication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-178e726c4c24c3435d23890befa21e1a-4a27e83af601df54-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b66c29abaf4d268a8d63ff5b9a47be4e", + "traceparent": "00-aaf19dc41005bafcd0b5228b9364f7d1-0ad7114f5adeb89a-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "a9d52edc108c9fc4551e6c10e08d4f4c", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:08 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:18 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -19,13 +19,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "9833", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:16 GMT", - "MS-CV": "6qOJAc7Ne02dwXu5IiE1/w.0", + "Date": "Sat, 07 Oct 2023 01:01:18 GMT", + "MS-CV": "cOKPLQZ8HUSmXEuHv7l36w.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0be3nZAAAAABcEuF7hnG6TLQWINRYB9ARTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "03q0gZQAAAAAcrz/IW1UmRLvrDycf\u002B85TWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "358ms" + "X-Processing-Time": "410ms" }, "ResponseBody": { "value": [ @@ -684,16 +684,16 @@ } }, { - "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", + "RequestUri": "https://sanitizedcommunication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-aabeca5691ce92a81313cf93c3618d88-a093845f952ffe9a-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "5e6d5667efabac38a99d4cdb22a554e6", + "traceparent": "00-1bac7abff5f0e9ef2f00b3df2e6f5926-c6333d834b580bae-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "9a89f7751bc9c5e37a78c0a96dab4187", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:08 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:18 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -702,13 +702,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:17 GMT", - "MS-CV": "i/yOcwBa8UGvGOTbPFrSyg.0", + "Date": "Sat, 07 Oct 2023 01:01:18 GMT", + "MS-CV": "npKJcuovqEeZPHWdTALfCQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0bu3nZAAAAADI\u002BFiajjLzQJnNocjoS/orTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0360gZQAAAAAfHNNQWWPoTbJsMpzdwlP6WVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "277ms" + "X-Processing-Time": "339ms" }, "ResponseBody": { "value": [] @@ -717,7 +717,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "610886330", + "RandomSeed": "2063248734", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceedAsync.json index f9182150831b..c680676a6d3a 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceedAsync.json @@ -6,11 +6,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-ff1419a2ab442467e982dd445b875ff6-3979b4216d84324e-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "21d34dbdb2a3b17bd1c93735bde48fa8", + "traceparent": "00-002f3498c8a48460f230f8ff846da6eb-22c6d8db6ac095e3-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "2ee392ebecdd6b787b444eccb46c4e43", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:09 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:20 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -19,13 +19,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "9833", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:18 GMT", - "MS-CV": "ehCaEGEkE0\u002BtTwv\u002B4axoKQ.0", + "Date": "Sat, 07 Oct 2023 01:01:20 GMT", + "MS-CV": "W/UMsv\u002BlckS20OBwgQILcA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0bu3nZAAAAADwLyD58wYHR46a\u002BZx/PuIDTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "04K0gZQAAAABW8m13NEJySJPAVxyfnx0AWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "331ms" + "X-Processing-Time": "367ms" }, "ResponseBody": { "value": [ @@ -689,11 +689,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-f9b2ce43be0d72d31ef9358ce9c0810e-82b2805cbeee0e45-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "17665af6d108ce96e421b34e564b9c8c", + "traceparent": "00-63e66c13220b3335fcbdb4df1ed96f6a-eb2f17bfb01d43af-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "1aa6ae78185f51d4580dc8de10c4a984", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:10 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:20 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -702,13 +702,13 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:18 GMT", - "MS-CV": "c3Xou3Lnr0WJIGOriS87rQ.0", + "Date": "Sat, 07 Oct 2023 01:01:20 GMT", + "MS-CV": "rqf4J1VvAk212bBLYuXaeQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0b\u002B3nZAAAAACe0juflKttQo2lkBQ6EwkRTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "04K0gZQAAAAAl4x0KVzvNRaJ8koPoFkw/WVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "138ms" + "X-Processing-Time": "337ms" }, "ResponseBody": { "value": [] @@ -717,7 +717,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "376216920", + "RandomSeed": "1377625755", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json index 538e71b9baf5..590a7dd4bda0 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "584", "Content-Type": "application/json", - "traceparent": "00-45f8eeb9d3309761424ed0e32cd70ce9-1f5107d081c285d5-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "20886787de5750d570bf5db9b9f51e92", + "traceparent": "00-5b302ea9abb9c00f631dfe69dbe8d2d0-b87cd84b819a53a5-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "c0cebc46eeecc75e0bc5b321ea6d0f82", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:10 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:21 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -77,18 +77,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:19 GMT", - "MS-CV": "oceNvFDeD0eO7HN0mtMROA.0", + "Date": "Sat, 07 Oct 2023 01:01:21 GMT", + "MS-CV": "x/NvXQjmrEKJhELrhdK9lQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0b\u002B3nZAAAAAALYnaSN9BFQbEV0GlJ8PdRTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "04a0gZQAAAABGakUZz/AzQ63klzOmukJMWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "405ms" + "X-Processing-Time": "870ms" }, "ResponseBody": { "receipts": [ { - "messageId": "01073589-20c1-4487-9b72-85ad6d01e02e", + "messageId": "973115cb-7c71-4447-8b69-ca63f52107e3", "to": "\u002B16041234567" } ] @@ -97,7 +97,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1714007036", + "RandomSeed": "1148499426", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json index 993a5db54677..11bb274c003e 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendFlightConfirmationTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "584", "Content-Type": "application/json", - "traceparent": "00-3d5d845b12cc8049c34e01091263b2e4-4d4c086beef91d2a-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "1f097d6b0420f7f723c59cf8c0d5eb01", + "traceparent": "00-dac936a57341dff0d9745b4fa978bab5-7ef27d78253f922e-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "16559d33213de4b550542f081050671e", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:14 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:28 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -77,18 +77,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:23 GMT", - "MS-CV": "0e9pOspTw0W1nf6/sdyZlg.0", + "Date": "Sat, 07 Oct 2023 01:01:28 GMT", + "MS-CV": "JqdH6Sk4wUGI1V5eW7VAzA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0dO3nZAAAAAC0DgKDYt9GR4RnsFJm9b2OTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "06K0gZQAAAABzg34ku7ZrRrkccoq7KgiZWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "396ms" + "X-Processing-Time": "803ms" }, "ResponseBody": { "receipts": [ { - "messageId": "d49a0fc0-96cf-4b0a-a444-478312db9ea9", + "messageId": "1851243d-de4d-4923-a39d-c31016e6e0d1", "to": "\u002B16041234567" } ] @@ -97,7 +97,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1645121986", + "RandomSeed": "1598327269", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json index bbf4f5ca1031..8ea56a2b5aef 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "519", "Content-Type": "application/json", - "traceparent": "00-e5b92d69b18777d69529719de10ee4f0-d984dcc4528f2296-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "9577caa2892488fb5a631dda8fd87b0b", + "traceparent": "00-3d664034721f674f6386bfb96f8c9ec6-68032dc64a7533b3-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "ed9f2d6c6e5bd4362604199b56d95a69", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:11 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:22 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -68,18 +68,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:19 GMT", - "MS-CV": "9i3fIUXVkUyYHKIBIud7GA.0", + "Date": "Sat, 07 Oct 2023 01:01:22 GMT", + "MS-CV": "AnsPlmXunUCI1P4Wejk6xQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0cO3nZAAAAAA2F6ImX55wT7zUpvOxwHpnTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "04q0gZQAAAADnbAFnc4G6SLP6f6LHfdtmWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "387ms" + "X-Processing-Time": "837ms" }, "ResponseBody": { "receipts": [ { - "messageId": "05e393bf-b247-410f-a6db-1e1141781f3f", + "messageId": "d6254a6d-0556-4a81-8627-f75320bd7d09", "to": "\u002B16041234567" } ] @@ -88,7 +88,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1091170123", + "RandomSeed": "1238209351", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json index b329c6252774..781daf6ccf76 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendHappyHourAnnocementTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "519", "Content-Type": "application/json", - "traceparent": "00-0cc81c4c11afb2a8dcc84a6ae30b23f3-9f080556b9135d26-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "48721feaaca96b98a67157b3e130ba12", + "traceparent": "00-8c1ba28a05a241978bb05ee096a24826-e540bf11a4767a89-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "1f70ecea5a455aa5532a232266791aac", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:15 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:29 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -68,18 +68,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:24 GMT", - "MS-CV": "rLEa/Ci7/0SbKXMe8JO/Ag.0", + "Date": "Sat, 07 Oct 2023 01:01:29 GMT", + "MS-CV": "Zh/m2eCriEeW8MvEapZZQQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0dO3nZAAAAAC57PSe4XBXSb29mcHYhih7TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "06a0gZQAAAABjP7mBv30CTKjJeqm72qMhWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "396ms" + "X-Processing-Time": "818ms" }, "ResponseBody": { "receipts": [ { - "messageId": "2dbb07ad-c36f-4acd-956e-c2d8f2ddafea", + "messageId": "194c60fb-0ff1-4492-8afe-abfccb052f34", "to": "\u002B16041234567" } ] @@ -88,7 +88,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "222030596", + "RandomSeed": "1767657619", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json index cc27487f9906..ba304e3c0bf5 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "507", "Content-Type": "application/json", - "traceparent": "00-0fd28e1c37e07e813a5dcdbd72379a7f-6f55b9a9c2bcc110-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "861384a9f70442c1068d91e123727016", + "traceparent": "00-c91ff39b5d9256151777c286fb2930d4-bc6a49d24b15a8ba-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5682e393246220dc2ffa1c9a29a74f06", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:11 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:23 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -70,18 +70,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:20 GMT", - "MS-CV": "29XakRlFiE6cPof9hIM\u002BVQ.0", + "Date": "Sat, 07 Oct 2023 01:01:23 GMT", + "MS-CV": "ZrDgRvpSJEKn45UDZqY6lA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0cO3nZAAAAACiu2as\u002B4nhRaeyvgdwjGCtTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0460gZQAAAAAczrG8lIWTRr\u002BH\u002BKmjZUHYWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "438ms" + "X-Processing-Time": "642ms" }, "ResponseBody": { "receipts": [ { - "messageId": "99662649-b6eb-4362-adc9-03dd1fe763d4", + "messageId": "77673d05-57de-4926-b22a-973e348ce44f", "to": "\u002B16041234567" } ] @@ -90,7 +90,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2028815987", + "RandomSeed": "1388647227", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json index a75b2cf52559..4cb36c0ae984 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendIssueResolutionTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "507", "Content-Type": "application/json", - "traceparent": "00-1dcbfed44c21f7bd402cbfb737f088d1-618bda0b6bb6ce1c-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "85d347acaf6beafb8edcf6603cb1586f", + "traceparent": "00-6d0fb03b868c08da6478265c59bbf923-d6fab23b44ad7f92-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "3605649c32ad65980526ecd19e6f197e", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:15 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:30 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -70,18 +70,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:24 GMT", - "MS-CV": "Yj5qZBMaTEK6FnhvttZ\u002BdQ.0", + "Date": "Sat, 07 Oct 2023 01:01:30 GMT", + "MS-CV": "fye6SSfDHkezlLGxvthDhw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0de3nZAAAAADflBhV1DK1T480hZsb8y2iTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "06q0gZQAAAADi54HnAk3eQJokVKM\u002B/YCMWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "330ms" + "X-Processing-Time": "745ms" }, "ResponseBody": { "receipts": [ { - "messageId": "b0f3c267-5cae-4c51-abe6-72e760d1816e", + "messageId": "eaaba955-e6f9-4cd9-96c8-f645f9d250e9", "to": "\u002B16041234567" } ] @@ -90,7 +90,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1690741504", + "RandomSeed": "1703708581", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json index 46e553710a06..81e91fe19863 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-65e65c68bc4568d3d213885f3de9d214-588d684aefe61d06-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "d85d34750cdc60aaba288f3bf9da5c1d", + "traceparent": "00-a19b8d7e5b13fd1afce0167aec3bce86-b4d288d5ee0b9624-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "fb098fd65d54824e5e846fc9674db0c4", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:12 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:24 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -28,18 +28,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:20 GMT", - "MS-CV": "Q2eUYnJ1gUq6EJmVxJLOgw.0", + "Date": "Sat, 07 Oct 2023 01:01:24 GMT", + "MS-CV": "ZIHd9FLNMU6nhxdZ3\u002Bjfbg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0ce3nZAAAAAB16ICsOCY6T4yrb87QXF1eTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "05K0gZQAAAADyMGec3lgrR5g0sQsmsXQJWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "412ms" + "X-Processing-Time": "728ms" }, "ResponseBody": { "receipts": [ { - "messageId": "fe310d4b-6484-4b2d-9cdb-cdcdaad05c44", + "messageId": "3627b7be-1d1b-4506-9aa9-f38e07235191", "to": "\u002B16041234567" } ] @@ -48,7 +48,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "125082402", + "RandomSeed": "1281624781", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json index 05dee1af1129..27686b24ba57 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-3d5c837765ab147182266101329983c5-777d04d233b1eb46-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "622aea6c5f21937d8966014b99364a5e", + "traceparent": "00-28291313fcabb2734dbbbe464f6b17bc-30b2b90f988ba3c2-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b66516d31b3a94219e3ab990d3b7247e", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:16 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:31 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -28,18 +28,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:24 GMT", - "MS-CV": "gOyRNYVzUUipz3nXncqtMQ.0", + "Date": "Sat, 07 Oct 2023 01:01:31 GMT", + "MS-CV": "GO2FCAzOUkaLPShPRD5Umw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0de3nZAAAAACH3o4metYLS7rb/HAXPEoyTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0660gZQAAAACtE3\u002BLpKqTRKUjpLdT6sUmWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "337ms" + "X-Processing-Time": "724ms" }, "ResponseBody": { "receipts": [ { - "messageId": "7c80cce6-cff2-4981-8f18-4f5f810f6e47", + "messageId": "82eff05b-8d81-43e8-b760-a0fcf81d2764", "to": "\u002B16041234567" } ] @@ -48,7 +48,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1742026768", + "RandomSeed": "800021773", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceed.json index 537485570fdc..b6d591cbe932 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-835f02ba7e0bc7f98509671a9c1f83ab-080045db93f7909b-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "8c348b5b815cc0b2fd62b2b04ba46c1d", + "traceparent": "00-b9ccba99cf859a0f08517056b168adf5-f31f09e84ac8fdba-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "0594c92d3d032fa3b57b67c8e02b4ef6", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:12 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:24 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -28,18 +28,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:21 GMT", - "MS-CV": "wRMj8RenykWUaYwq4nZT/w.0", + "Date": "Sat, 07 Oct 2023 01:01:25 GMT", + "MS-CV": "Gpo\u002BsOhLAkON12CWErZSow.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0ce3nZAAAAADVwirU1IlgT5EGCEW3RgFcTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "05a0gZQAAAAAvIsKSMUUhQ6cSzgGCdixFWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "335ms" + "X-Processing-Time": "731ms" }, "ResponseBody": { "receipts": [ { - "messageId": "c4edf3b0-5246-4257-b72d-b14911949e64", + "messageId": "b77d2e27-721a-4a85-b8c2-49229592ed7e", "to": "\u002B16041234567" } ] @@ -48,7 +48,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "28193595", + "RandomSeed": "1061618726", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceedAsync.json index 9b5c2564d8ac..928767a21d97 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMessageWithAzureKeyCredentialShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "126", "Content-Type": "application/json", - "traceparent": "00-2f915e6e9fc3183866eeb7ede4f5cb04-7de159e117bf409d-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "81c33dff5bb749e6a9b77e4c20eff3ff", + "traceparent": "00-0f206a1b799efa69be54d322bcfeac63-d8a8563506aaecf6-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "fb76eef7f35060afa689256f8e41d40b", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:16 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:31 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -28,18 +28,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:26 GMT", - "MS-CV": "D8awx1gELUiDNPN3r7ql\u002BQ.0", + "Date": "Sat, 07 Oct 2023 01:01:32 GMT", + "MS-CV": "LJRUTRFezk\u002BjQZcBHC0fGQ.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0de3nZAAAAADbba19kRMLS6Uah3DPitHdTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0660gZQAAAACGCnGn5Q9STbDvRqzmwqTXWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "513ms" + "X-Processing-Time": "747ms" }, "ResponseBody": { "receipts": [ { - "messageId": "bed94b65-94e3-4db9-a098-abbf48ddf321", + "messageId": "e909a302-c3a7-4a8e-b606-e2441411c1e8", "to": "\u002B16041234567" } ] @@ -48,7 +48,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1819452733", + "RandomSeed": "1573986230", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json index ed16aea29340..22e33c9e7eb6 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "679", "Content-Type": "application/json", - "traceparent": "00-640f588991b558dfc1b2ee53b0f8d1cf-172327200f66d26b-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b3d9329eec314148743106e6b1a84988", + "traceparent": "00-28a069dec931b615a4a192902c7bdae4-ccbe83da90024398-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "c6d70676df5992d30b28968e6ddee0d0", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:12 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:25 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -86,18 +86,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:22 GMT", - "MS-CV": "sO2GduhAy02OCxNcQSbGEg.0", + "Date": "Sat, 07 Oct 2023 01:01:26 GMT", + "MS-CV": "eeFMv\u002BsqPUiznrNh9XsuRA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0cu3nZAAAAAB6KXnk5EyWToehCloZZBRLTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "05a0gZQAAAABORaHDlyiKTZjQiCJGKEyFWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "1051ms" + "X-Processing-Time": "789ms" }, "ResponseBody": { "receipts": [ { - "messageId": "de3d5ac7-466b-4c1f-a827-f6d444970d99", + "messageId": "ef59fa36-dec4-415e-b784-ebc01082370f", "to": "\u002B16041234567" } ] @@ -106,7 +106,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1028799287", + "RandomSeed": "1486206713", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json index bbf799fed176..bbfb48d3fe32 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendMovieTicketConfirmationTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "679", "Content-Type": "application/json", - "traceparent": "00-7f00956b8fc92f16504f1f591a27fb35-90c052ec6bf93589-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "50a8a0873e4e9c9e6ef9c41570f642e5", + "traceparent": "00-373af7b647622765e299dec47f79fae4-1d0c7e7a9dd25051-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "ac66a37a6fc67070d329bcc5bb9fef70", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:17 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:32 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -86,18 +86,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:26 GMT", - "MS-CV": "UW3ZETBf7kmCJ2Nn8tEe9A.0", + "Date": "Sat, 07 Oct 2023 01:01:32 GMT", + "MS-CV": "0P0MHOLtSEW5XPRLAshBuA.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0du3nZAAAAADDVcjc8mF6R59w4abYD5OPTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "07K0gZQAAAABcrp2ZajUFS4N\u002BBuFIG/KLWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "416ms" + "X-Processing-Time": "788ms" }, "ResponseBody": { "receipts": [ { - "messageId": "4e2d096e-b395-40b1-ab0c-af6c121c9562", + "messageId": "afda89b5-906f-4131-b98b-3f25f6f7564c", "to": "\u002B16041234567" } ] @@ -106,7 +106,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2104350765", + "RandomSeed": "48928599", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json index 143faa5d0d5e..b27036901648 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceed.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "456", "Content-Type": "application/json", - "traceparent": "00-43e726f6402f6a8cc0dd4e5468533fe2-cd3c179b99a2dacc-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "4daf86eaa159442488b79e50ea5aebe3", + "traceparent": "00-c7c3e7a3626b5967930ed5cf378fa681-e72bfd2a03a8e038-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "f3855ba96456edafd257c159fe5a515e", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:14 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:26 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -59,18 +59,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:22 GMT", - "MS-CV": "RIo7MMRypk2yKxrBrruopg.0", + "Date": "Sat, 07 Oct 2023 01:01:26 GMT", + "MS-CV": "3XJpA1EE\u002BEuvg8eA5pH9qw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0c\u002B3nZAAAAAA2GLIpWunzR7gCBylGcSrFTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "05q0gZQAAAACv3m4YFraBS4ouf/dAwXXPWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "418ms" + "X-Processing-Time": "772ms" }, "ResponseBody": { "receipts": [ { - "messageId": "8b89c725-03dc-4d97-98a8-1beec6c3e081", + "messageId": "9d32a9ba-535a-45a3-b314-cf89f2d1c6fc", "to": "\u002B16041234567" } ] @@ -79,7 +79,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "972908627", + "RandomSeed": "200691319", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json index 50eb66b76441..cdface20e865 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendPurchaseFeedbackTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "456", "Content-Type": "application/json", - "traceparent": "00-f9e2215d16a34f31dd8b25cedbe73b82-0858fecd3a6894b8-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b200d7134f66c94a7314b6488b536372", + "traceparent": "00-913861f2b409168794dfe53454963f50-7adf8c14a29e5b7d-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "9af600b4717209ed7b6413a938b3c74a", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:17 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:33 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -59,18 +59,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:27 GMT", - "MS-CV": "0TQmKJYlH0iXw8YR/N5bKg.0", + "Date": "Sat, 07 Oct 2023 01:01:33 GMT", + "MS-CV": "/Fs2gutpikuYNqK17XF8sw.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0du3nZAAAAAC1JFvQdhZvR4qC3D7fMklETEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "07a0gZQAAAAB767DXOlxrSJyaGRAqau0jWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "370ms" + "X-Processing-Time": "818ms" }, "ResponseBody": { "receipts": [ { - "messageId": "429e67ac-7613-4aa4-a336-6bd4c306e8fb", + "messageId": "a8224921-46df-4880-95a9-fcf7a4552047", "to": "\u002B16041234567" } ] @@ -79,7 +79,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "1949234695", + "RandomSeed": "1926562621", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json index 1676840aed1c..fb10947c662a 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json @@ -1,18 +1,18 @@ { "Entries": [ { - "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", + "RequestUri": "https://sanitizedcommunication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "298", "Content-Type": "application/json", - "traceparent": "00-4794de276ce2052aa6aa833a3fb43488-4b09e1777b89a7d1-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "752692ab78af8d9ac3a6c04c2997519a", + "traceparent": "00-c5094b4dab6e94babfa4474517fdceca-b63405a9b5f0ba06-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "64ad9df3e9f199cd4d8163643796ea15", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:14 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:27 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -48,18 +48,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:23 GMT", - "MS-CV": "tTrfGxkSbEa8r29WQAwWFA.0", + "Date": "Sat, 07 Oct 2023 01:01:27 GMT", + "MS-CV": "sgJSvemGzkS2nQ7\u002BkUAV0g.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0c\u002B3nZAAAAACcTWo84UIlR5/gX4nfi\u002BcfTEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "0560gZQAAAADh70gXXPljTLoAHPCD1L9mWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "364ms" + "X-Processing-Time": "731ms" }, "ResponseBody": { "receipts": [ { - "messageId": "4441b28a-c8b7-47f8-bbdb-71aa5fdad18b", + "messageId": "f9b7d2c0-2203-4efa-ab44-7ce810564491", "to": "\u002B16041234567" } ] @@ -68,7 +68,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "400380273", + "RandomSeed": "1830441038", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json index a77433e51003..4085a444bcb6 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceedAsync.json @@ -8,11 +8,11 @@ "Authorization": "Sanitized", "Content-Length": "298", "Content-Type": "application/json", - "traceparent": "00-7def62ba137be3228ac570035fcdc54b-1342fa305618d6e8-00", - "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20230824.1 (.NET 7.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a6d737f970b8f607d98187b1b2e51807", + "traceparent": "00-eb20ca5d3d660ee50b61e27d7de4b63b-09c1259b41262bc8-00", + "User-Agent": "azsdk-net-Communication.Messages/1.0.0-alpha.20231006.1 (.NET 7.0.11; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "09535b8bdef4aa8251b74a2a35a5ab0b", "x-ms-content-sha256": "Sanitized", - "x-ms-date": "Thu, 24 Aug 2023 23:53:18 GMT", + "x-ms-date": "Sat, 07 Oct 2023 01:01:34 GMT", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -48,18 +48,18 @@ "api-supported-versions": "2023-02-01-preview, 2023-08-24-preview", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 24 Aug 2023 23:53:27 GMT", - "MS-CV": "sDFUzatL\u002B0SMEh/TNuUHPQ.0", + "Date": "Sat, 07 Oct 2023 01:01:34 GMT", + "MS-CV": "bl2BfznVskaJWGHFBBpgHg.0", "Request-Context": "appId=", "Strict-Transport-Security": "max-age=2592000", - "X-Azure-Ref": "0d\u002B3nZAAAAADUlIfgybMHSbrSWmj5PRa9TEFYMzExMDAwMTA4MDIzADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", + "X-Azure-Ref": "07q0gZQAAAADXuVvCzWUGSoBtUN5uY4NzWVZSMzExMDAwMTE1MDQ1ADlmYzdiNTE5LWE4Y2MtNGY4OS05MzVlLWM5MTQ4YWUwOWU4MQ==", "X-Cache": "CONFIG_NOCACHE", - "X-Processing-Time": "405ms" + "X-Processing-Time": "766ms" }, "ResponseBody": { "receipts": [ { - "messageId": "fd5f36cd-d563-473d-abb6-25613f38288c", + "messageId": "0f574fa9-8357-41f1-b86a-cf86ac83d306", "to": "\u002B16041234567" } ] @@ -68,7 +68,7 @@ ], "Variables": { "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": "endpoint=https://sanitized.communication.azure.com/;accesskey=Kg==", - "RandomSeed": "2101114995", + "RandomSeed": "1946321366", "RECIPIENT_IDENTIFIER": "\u002B16041234567", "SENDER_CHANNEL_REGISTRATION_ID": "59aced66-68ae-4b7a-8430-36f4c5dfa328" } From 1e13e97dfde900ec770fab7812ac8bfcac7d69f7 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Mon, 9 Oct 2023 15:07:33 -0700 Subject: [PATCH 21/24] update the source file to the public azure specs repo --- sdk/communication/Azure.Communication.Messages/src/autorest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/autorest.md b/sdk/communication/Azure.Communication.Messages/src/autorest.md index 1831ba2619ce..c036372cc217 100644 --- a/sdk/communication/Azure.Communication.Messages/src/autorest.md +++ b/sdk/communication/Azure.Communication.Messages/src/autorest.md @@ -14,7 +14,7 @@ title: Messages tag: package-2023-08-24-preview model-namespace: false require: - - https://github.com/Azure/azure-rest-api-specs-pr/blob/5e85419bed6c70dbfd28f872e298b23d794aa880/specification/communication/data-plane/Messages/readme.md + - https://github.com/Azure/azure-rest-api-specs/blob/bf04fb1344aec3daf86deff14ae5d73f943d7cca/specification/communication/data-plane/Messages/readme.md payload-flattening-threshold: 10 generation1-convenience-client: true ``` From 30c4f8b763076d804407b3c61017d4190a68582f Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Mon, 9 Oct 2023 16:27:43 -0700 Subject: [PATCH 22/24] fix recording --- .../GetTemplatesShouldSucceedAsync.json | 4 ++-- .../GetTemplatesWithAzureKeyCredentialShouldSucceed.json | 4 ++-- .../SendShippingConfirmationTemplateMessageShouldSucceed.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json index c1f5a09ce270..d3c816460e0f 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesShouldSucceedAsync.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://sanitizedcommunication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", @@ -684,7 +684,7 @@ } }, { - "RequestUri": "https://sanitizedcommunication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json index d5816249d4f2..e3228b1c784d 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/MessageTemplateClientLiveTests/GetTemplatesWithAzureKeyCredentialShouldSucceed.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://sanitizedcommunication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", @@ -684,7 +684,7 @@ } }, { - "RequestUri": "https://sanitizedcommunication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", + "RequestUri": "https://sanitized.communication.azure.com/messages/channels/59aced66-68ae-4b7a-8430-36f4c5dfa328/templates?api-version=2023-08-24-preview\u0026continuationToken=MjQZD", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", diff --git a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json index fb10947c662a..7a4b8f0aad25 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json +++ b/sdk/communication/Azure.Communication.Messages/tests/SessionRecords/NotificationMessagesClientLiveTests/SendShippingConfirmationTemplateMessageShouldSucceed.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://sanitizedcommunication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", + "RequestUri": "https://sanitized.communication.azure.com/messages/notifications/:send?api-version=2023-08-24-preview", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", From 47e788e37e1926361237ce07fb080359181773d0 Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Mon, 9 Oct 2023 18:22:18 -0700 Subject: [PATCH 23/24] run "eng\scripts\Export-API.ps1 communication" --- ...e.Communication.Messages.netstandard2.0.cs | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs diff --git a/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs b/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs new file mode 100644 index 000000000000..da475957b2e2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs @@ -0,0 +1,240 @@ +namespace Azure.Communication.Messages +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CommunicationMessagesChannelType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CommunicationMessagesChannelType(string value) { throw null; } + public static Azure.Communication.Messages.CommunicationMessagesChannelType WhatsApp { get { throw null; } } + public bool Equals(Azure.Communication.Messages.CommunicationMessagesChannelType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Communication.Messages.CommunicationMessagesChannelType left, Azure.Communication.Messages.CommunicationMessagesChannelType right) { throw null; } + public static implicit operator Azure.Communication.Messages.CommunicationMessagesChannelType (string value) { throw null; } + public static bool operator !=(Azure.Communication.Messages.CommunicationMessagesChannelType left, Azure.Communication.Messages.CommunicationMessagesChannelType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CommunicationMessagesClientOptions : Azure.Core.ClientOptions + { + public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2023_08_24_Preview) { } + public enum ServiceVersion + { + V2023_08_24_Preview = 1, + } + } + public static partial class CommunicationMessagesModelFactory + { + public static Azure.Communication.Messages.MessageReceipt MessageReceipt(string messageId = null, string to = null) { throw null; } + public static Azure.Communication.Messages.SendMessageResult SendMessageResult(System.Collections.Generic.IEnumerable receipts = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CommunicationMessageType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CommunicationMessageType(string value) { throw null; } + public static Azure.Communication.Messages.CommunicationMessageType Image { get { throw null; } } + public static Azure.Communication.Messages.CommunicationMessageType Template { get { throw null; } } + public static Azure.Communication.Messages.CommunicationMessageType Text { get { throw null; } } + public bool Equals(Azure.Communication.Messages.CommunicationMessageType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Communication.Messages.CommunicationMessageType left, Azure.Communication.Messages.CommunicationMessageType right) { throw null; } + public static implicit operator Azure.Communication.Messages.CommunicationMessageType (string value) { throw null; } + public static bool operator !=(Azure.Communication.Messages.CommunicationMessageType left, Azure.Communication.Messages.CommunicationMessageType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MessageReceipt + { + internal MessageReceipt() { } + public string MessageId { get { throw null; } } + public string To { get { throw null; } } + } + public partial class MessageTemplate + { + public MessageTemplate(string name, string language, System.Collections.Generic.IEnumerable values = null, Azure.Communication.Messages.MessageTemplateBindings bindings = null) { } + public Azure.Communication.Messages.MessageTemplateBindings Bindings { get { throw null; } } + public string Language { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IEnumerable Values { get { throw null; } } + } + public abstract partial class MessageTemplateBindings + { + public MessageTemplateBindings() { } + internal abstract Azure.Communication.Messages.MessageTemplateBindingsInternal ToMessageTemplateBindingsInternal(); + } + public partial class MessageTemplateClient + { + protected MessageTemplateClient() { } + public MessageTemplateClient(string connectionString) { } + public MessageTemplateClient(string connectionString, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public MessageTemplateClient(System.Uri endpoint, Azure.AzureKeyCredential keyCredential, Azure.Communication.Messages.CommunicationMessagesClientOptions options = null) { } + public virtual Azure.Pageable GetTemplates(string channelRegistrationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTemplatesAsync(string channelRegistrationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MessageTemplateDocument : Azure.Communication.Messages.MessageTemplateValue + { + public MessageTemplateDocument(string name, System.Uri uri, string caption = null, string fileName = null) : base (default(string)) { } + public string Caption { get { throw null; } set { } } + public string FileName { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + } + public partial class MessageTemplateImage : Azure.Communication.Messages.MessageTemplateValue + { + public MessageTemplateImage(string name, System.Uri uri, string caption = null, string fileName = null) : base (default(string)) { } + public string Caption { get { throw null; } set { } } + public string FileName { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + } + public partial class MessageTemplateItem + { + internal MessageTemplateItem() { } + public Azure.Communication.Messages.CommunicationMessagesChannelType? ChannelType { get { throw null; } } + public string Language { get { throw null; } } + public string Name { get { throw null; } } + public Azure.Communication.Messages.TemplateStatus? Status { get { throw null; } } + public Azure.Communication.Messages.MessageTemplateItemWhatsApp WhatsApp { get { throw null; } } + } + public partial class MessageTemplateItemWhatsApp + { + internal MessageTemplateItemWhatsApp() { } + public System.BinaryData Content { get { throw null; } } + } + public partial class MessageTemplateLocation : Azure.Communication.Messages.MessageTemplateValue + { + public MessageTemplateLocation(string name, double latitude, double longitude, string locationName = null, string address = null) : base (default(string)) { } + public string Address { get { throw null; } set { } } + public double Latitude { get { throw null; } set { } } + public string LocationName { get { throw null; } set { } } + public double Longitude { get { throw null; } set { } } + } + public partial class MessageTemplateQuickAction : Azure.Communication.Messages.MessageTemplateValue + { + public MessageTemplateQuickAction(string name, string text = null, string payload = null) : base (default(string)) { } + public string Payload { get { throw null; } set { } } + public string Text { get { throw null; } set { } } + } + public partial class MessageTemplateText : Azure.Communication.Messages.MessageTemplateValue + { + public MessageTemplateText(string name, string text) : base (default(string)) { } + public string Text { get { throw null; } set { } } + } + public abstract partial class MessageTemplateValue + { + public MessageTemplateValue(string name) { } + public string Name { get { throw null; } } + internal abstract Azure.Communication.Messages.MessageTemplateValueInternal ToMessageTemplateValueInternal(); + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MessageTemplateValueKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MessageTemplateValueKind(string value) { throw null; } + public static Azure.Communication.Messages.MessageTemplateValueKind Document { get { throw null; } } + public static Azure.Communication.Messages.MessageTemplateValueKind Image { get { throw null; } } + public static Azure.Communication.Messages.MessageTemplateValueKind Location { get { throw null; } } + public static Azure.Communication.Messages.MessageTemplateValueKind QuickAction { get { throw null; } } + public static Azure.Communication.Messages.MessageTemplateValueKind Text { get { throw null; } } + public static Azure.Communication.Messages.MessageTemplateValueKind Video { get { throw null; } } + public bool Equals(Azure.Communication.Messages.MessageTemplateValueKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Communication.Messages.MessageTemplateValueKind left, Azure.Communication.Messages.MessageTemplateValueKind right) { throw null; } + public static implicit operator Azure.Communication.Messages.MessageTemplateValueKind (string value) { throw null; } + public static bool operator !=(Azure.Communication.Messages.MessageTemplateValueKind left, Azure.Communication.Messages.MessageTemplateValueKind right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MessageTemplateValueWhatsAppSubType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MessageTemplateValueWhatsAppSubType(string value) { throw null; } + public static Azure.Communication.Messages.MessageTemplateValueWhatsAppSubType QuickReply { get { throw null; } } + public static Azure.Communication.Messages.MessageTemplateValueWhatsAppSubType Url { get { throw null; } } + public bool Equals(Azure.Communication.Messages.MessageTemplateValueWhatsAppSubType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Communication.Messages.MessageTemplateValueWhatsAppSubType left, Azure.Communication.Messages.MessageTemplateValueWhatsAppSubType right) { throw null; } + public static implicit operator Azure.Communication.Messages.MessageTemplateValueWhatsAppSubType (string value) { throw null; } + public static bool operator !=(Azure.Communication.Messages.MessageTemplateValueWhatsAppSubType left, Azure.Communication.Messages.MessageTemplateValueWhatsAppSubType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MessageTemplateVideo : Azure.Communication.Messages.MessageTemplateValue + { + public MessageTemplateVideo(string name, System.Uri uri, string caption = null, string fileName = null) : base (default(string)) { } + public string Caption { get { throw null; } set { } } + public string FileName { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + } + public partial class MessageTemplateWhatsAppBindings : Azure.Communication.Messages.MessageTemplateBindings + { + public MessageTemplateWhatsAppBindings(System.Collections.Generic.IEnumerable header = null, System.Collections.Generic.IEnumerable body = null, System.Collections.Generic.IEnumerable footer = null, System.Collections.Generic.IEnumerable> button = null) { } + public System.Collections.Generic.IEnumerable Body { get { throw null; } } + public System.Collections.Generic.IEnumerable> Button { get { throw null; } } + public System.Collections.Generic.IEnumerable Footer { get { throw null; } } + public System.Collections.Generic.IEnumerable Header { get { throw null; } } + } + public partial class NotificationMessagesClient + { + protected NotificationMessagesClient() { } + public NotificationMessagesClient(string connectionString) { } + public NotificationMessagesClient(string connectionString, Azure.Communication.Messages.CommunicationMessagesClientOptions options) { } + public NotificationMessagesClient(System.Uri endpoint, Azure.AzureKeyCredential keyCredential, Azure.Communication.Messages.CommunicationMessagesClientOptions options = null) { } + public virtual Azure.Response DownloadMedia(string mediaContentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadMediaAsync(string mediaContentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DownloadMediaTo(string mediaContentId, System.IO.Stream destinationStream, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DownloadMediaTo(string mediaContentId, string destinationPath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DownloadMediaToAsync(string mediaContentId, System.IO.Stream destinationStream, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DownloadMediaToAsync(string mediaContentId, string destinationPath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SendMessage(Azure.Communication.Messages.SendMessageOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SendMessageAsync(Azure.Communication.Messages.SendMessageOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class SendMessageOptions + { + public SendMessageOptions(string channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.MessageTemplate template) { } + public SendMessageOptions(string channelRegistrationId, System.Collections.Generic.IEnumerable to, string content) { } + public SendMessageOptions(string channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri, string content = null) { } + public string ChannelRegistrationId { get { throw null; } } + public string Content { get { throw null; } } + public System.Uri MediaUri { get { throw null; } } + public Azure.Communication.Messages.CommunicationMessageType MessageType { get { throw null; } } + public Azure.Communication.Messages.MessageTemplate Template { get { throw null; } } + public System.Collections.Generic.IEnumerable To { get { throw null; } } + } + public partial class SendMessageResult + { + internal SendMessageResult() { } + public System.Collections.Generic.IReadOnlyList Receipts { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TemplateStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TemplateStatus(string value) { throw null; } + public static Azure.Communication.Messages.TemplateStatus Approved { get { throw null; } } + public static Azure.Communication.Messages.TemplateStatus Paused { get { throw null; } } + public static Azure.Communication.Messages.TemplateStatus Pending { get { throw null; } } + public static Azure.Communication.Messages.TemplateStatus Rejected { get { throw null; } } + public bool Equals(Azure.Communication.Messages.TemplateStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Communication.Messages.TemplateStatus left, Azure.Communication.Messages.TemplateStatus right) { throw null; } + public static implicit operator Azure.Communication.Messages.TemplateStatus (string value) { throw null; } + public static bool operator !=(Azure.Communication.Messages.TemplateStatus left, Azure.Communication.Messages.TemplateStatus right) { throw null; } + public override string ToString() { throw null; } + } +} From c0a82870d309eb7a91ab6818760147efffff4cba Mon Sep 17 00:00:00 2001 From: glorialimicrosoft Date: Mon, 9 Oct 2023 23:58:29 -0700 Subject: [PATCH 24/24] run "eng\scripts\CodeChecks.ps1 -ServiceDirectory communication" --- .../Generated/Models/CommunicationErrorResponse.Serialization.cs | 1 - .../src/Generated/Models/MessageReceipt.Serialization.cs | 1 - .../src/Generated/Models/SendMessageResult.Serialization.cs | 1 - 3 files changed, 3 deletions(-) diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.Serialization.cs index 4cc637c6ef5e..e40c439387cf 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.Serialization.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/CommunicationErrorResponse.Serialization.cs @@ -6,7 +6,6 @@ #nullable disable using System.Text.Json; -using Azure.Core; namespace Azure.Communication.Messages { diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.Serialization.cs index d7a092300bc1..7addd236cd54 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.Serialization.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/MessageReceipt.Serialization.cs @@ -6,7 +6,6 @@ #nullable disable using System.Text.Json; -using Azure.Core; namespace Azure.Communication.Messages { diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.Serialization.cs index 9c5c4eab5cd6..e9c3af81261c 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/Models/SendMessageResult.Serialization.cs @@ -7,7 +7,6 @@ using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Communication.Messages {