diff --git a/sdk/communication/Azure.Communication.Chat/CHANGELOG.md b/sdk/communication/Azure.Communication.Chat/CHANGELOG.md index 0ffc1a5179703..85c536138456c 100644 --- a/sdk/communication/Azure.Communication.Chat/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Chat/CHANGELOG.md @@ -1,13 +1,20 @@ # Release History -## 1.0.0-beta.4 (2021-02-08) -# Breaking -- Support for CreateChatThreadResult and AddChatParticipantsResult to handle partial errors in batch calls. +## 1.0.0-beta.4 (2021-02-09) + +### Breaking Changes + +- Updated to Azure.Communication.Common version 1.0.0-beta.4. Now uses `CommunicationUserIdentifier` and `CommunicationIdentifier` in place of `CommunicationUser`, and `CommunicationTokenCredential` instead of `CommunicationUserCredential`. +- Removed `Priority` field from `ChatMessage`. + +### Added + +- Added support for `CreateChatThreadResult` and `AddChatParticipantsResult` to handle partial errors in batch calls. - Added idempotency identifier parameter for chat creation calls. -- Added support for readreceipts and getparticipants pagination. -- Added new model for messages anc ontent types : Text, Html, ParticipantAdded, ParticipantRemoved, TopicUpdated -- Removed priority field (ChatMessage.Priority) -- Added new model for errors (CommunicationError) +- Added pagination support for `GetReadReceipts`, `GetReadReceiptsAsync` and `GetParticipants`, `GetParticipantsAsync`. +- Added new model for messages and content types: `Text`, `Html`, `ParticipantAdded`, `ParticipantRemoved`, `TopicUpdated`. +- Added new model for errors (`CommunicationError`). +- Added notifications for thread level changes. ## 1.0.0-beta.3 (2020-11-16) diff --git a/sdk/communication/Azure.Communication.Chat/README.md b/sdk/communication/Azure.Communication.Chat/README.md index 86530b586fc28..d1ffdef2e791d 100644 --- a/sdk/communication/Azure.Communication.Chat/README.md +++ b/sdk/communication/Azure.Communication.Chat/README.md @@ -2,7 +2,7 @@ > Server - Chat Api Version: 2020-11-01-preview3 -> Client - Chat SDK Version: 1.0.0-beta.3 +> Client - Chat SDK Version: 1.0.0-beta.4 This package contains a C# SDK for Azure Communication Services for chat. diff --git a/sdk/communication/Azure.Communication.Common/CHANGELOG.md b/sdk/communication/Azure.Communication.Common/CHANGELOG.md index f62d2efd8bf47..ecbf560d090bc 100644 --- a/sdk/communication/Azure.Communication.Common/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Common/CHANGELOG.md @@ -1,17 +1,18 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.4 (2021-02-09) ### Added - Added `MicrosoftTeamsUserIdentifier`. ### Breaking Changes - Renamed `CommunicationUserCredential` to `CommunicationTokenCredential`. -- Replace `CommunicationTokenCredential(bool refreshProactively, Func tokenRefresher,Func>? asyncTokenRefresher = null, string? initialToken = null)` +- Replaced `CommunicationTokenCredential(bool refreshProactively, Func tokenRefresher,Func>? asyncTokenRefresher = null, string? initialToken = null)`. with `CommunicationTokenCredential(CommunicationTokenRefreshOptions tokenRefreshOptions)`. -- Renamed `PhoneNumber` to `PhoneNumberIdentifier` -- Renamed `CommunicationUser` to `CommunicationUserIdentifier ` -- Renamed `CallingApplication` to `CallingApplicationIdentifier` +- Renamed `PhoneNumber` to `PhoneNumberIdentifier`. +- Renamed `CommunicationUser` to `CommunicationUserIdentifier`. +- Removed `CallingApplication`. +- Renamed `Id` to `RawId` in `PhoneNumberIdentifier`. ## 1.0.0-beta.3 (2020-11-16) Updated `Azure.Communication.Common` version. diff --git a/sdk/communication/Azure.Communication.Common/README.md b/sdk/communication/Azure.Communication.Common/README.md index d5ab06e7ebc09..50917d652c18a 100644 --- a/sdk/communication/Azure.Communication.Common/README.md +++ b/sdk/communication/Azure.Communication.Common/README.md @@ -9,7 +9,7 @@ This package contains common code for Azure Communication Service libraries. Install the Azure Communication Common client library for .NET with [NuGet][nuget]. ```Powershell -dotnet add package Azure.Communication.Common --version 1.0.0-beta.3 +dotnet add package Azure.Communication.Common --version 1.0.0-beta.4 ``` ### Prerequisites diff --git a/sdk/communication/Azure.Communication.Identity/CHANGELOG.md b/sdk/communication/Azure.Communication.Identity/CHANGELOG.md index 4afa5bccd8aad..8333494770945 100644 --- a/sdk/communication/Azure.Communication.Identity/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Identity/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.4 (2021-02-09) ### Added - Added CommunicationIdentityClient (originally was part of the Azure.Communication.Administration package). diff --git a/sdk/communication/Azure.Communication.Identity/README.md b/sdk/communication/Azure.Communication.Identity/README.md index c7b4189d35c6b..ad4732be34598 100644 --- a/sdk/communication/Azure.Communication.Identity/README.md +++ b/sdk/communication/Azure.Communication.Identity/README.md @@ -14,7 +14,7 @@ Azure Communication Identity is managing tokens for Azure Communication Services Install the Azure Communication Identity client library for .NET with [NuGet][nuget]: ```Powershell -dotnet add package Azure.Communication.Identity --version 1.0.0-beta.3 +dotnet add package Azure.Communication.Identity --version 1.0.0-beta.4 ``` ### Prerequisites @@ -41,7 +41,15 @@ var connectionString = ""; var client = new CommunicationIdentityClient(connectionString); ``` -Clients also have the option to authenticate using a valid token. +Or alternatively using the endpoint and access key acquired from an Azure Communication Resources in the [Azure Portal][azure_portal]. + +```C# Snippet:CreateCommunicationIdentityFromAccessKey +var endpoint = new Uri("https://my-resource.communication.azure.com"); +var accessKey = ""; +var client = new CommunicationIdentityClient(endpoint, new AzureKeyCredential(accessKey)); +``` + +Clients also have the option to authenticate using a valid Active Directory token. ```C# Snippet:CreateCommunicationIdentityFromToken var endpoint = new Uri("https://my-resource.communication.azure.com"); diff --git a/sdk/communication/Azure.Communication.Identity/samples/Sample1_CommunicationIdentityClient.md b/sdk/communication/Azure.Communication.Identity/samples/Sample1_CommunicationIdentityClient.md index bcec26c194a9c..58aa004b3f86f 100644 --- a/sdk/communication/Azure.Communication.Identity/samples/Sample1_CommunicationIdentityClient.md +++ b/sdk/communication/Azure.Communication.Identity/samples/Sample1_CommunicationIdentityClient.md @@ -18,7 +18,15 @@ var connectionString = ""; var client = new CommunicationIdentityClient(connectionString); ``` -Clients also have the option to authenticate using a valid token. +Or alternatively using the endpoint and access key acquired from an Azure Communication Resources in the [Azure Portal][azure_portal]. + +```C# Snippet:CreateCommunicationIdentityFromAccessKey +var endpoint = new Uri("https://my-resource.communication.azure.com"); +var accessKey = ""; +var client = new CommunicationIdentityClient(endpoint, new AzureKeyCredential(accessKey)); +``` + +Clients also have the option to authenticate using a valid Active Directory token. ```C# Snippet:CreateCommunicationIdentityFromToken var endpoint = new Uri("https://my-resource.communication.azure.com"); diff --git a/sdk/communication/Azure.Communication.Identity/samples/Sample1_CommunicationIdentityClientAsync.md b/sdk/communication/Azure.Communication.Identity/samples/Sample1_CommunicationIdentityClientAsync.md index 27d51ed212fb8..3c9beabc33397 100644 --- a/sdk/communication/Azure.Communication.Identity/samples/Sample1_CommunicationIdentityClientAsync.md +++ b/sdk/communication/Azure.Communication.Identity/samples/Sample1_CommunicationIdentityClientAsync.md @@ -18,7 +18,15 @@ var connectionString = ""; var client = new CommunicationIdentityClient(connectionString); ``` -Clients also have the option to authenticate using a valid token. +Or alternatively using the endpoint and access key acquired from an Azure Communication Resources in the [Azure Portal][azure_portal]. + +```C# Snippet:CreateCommunicationIdentityFromAccessKey +var endpoint = new Uri("https://my-resource.communication.azure.com"); +var accessKey = ""; +var client = new CommunicationIdentityClient(endpoint, new AzureKeyCredential(accessKey)); +``` + +Clients also have the option to authenticate using a valid Active Directory token. ```C# Snippet:CreateCommunicationIdentityFromToken var endpoint = new Uri("https://my-resource.communication.azure.com"); diff --git a/sdk/communication/Azure.Communication.Identity/tests/SessionRecords/Sample1_CommunicationIdentityClient/CreateIdentityWithAccessKey.json b/sdk/communication/Azure.Communication.Identity/tests/SessionRecords/Sample1_CommunicationIdentityClient/CreateIdentityWithAccessKey.json new file mode 100644 index 0000000000000..e9b9d59be8090 --- /dev/null +++ b/sdk/communication/Azure.Communication.Identity/tests/SessionRecords/Sample1_CommunicationIdentityClient/CreateIdentityWithAccessKey.json @@ -0,0 +1,46 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/identities?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "2", + "Content-Type": "application/json", + "Date": "Tue, 09 Feb 2021 19:00:18 GMT", + "traceparent": "00-2739853fa682a64c86302ad2efcd8fc8-8f2ca594ec986949-00", + "User-Agent": [ + "azsdk-net-Communication.Identity/1.0.0-alpha.20210209.1", + "(.NET 5.0.2; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "b422eb1b4a717086d6d88b88fdbdf281", + "x-ms-content-sha256": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": {}, + "StatusCode": 201, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview2, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 09 Feb 2021 19:00:20 GMT", + "MS-CV": "rm9vx5vriEuE1IxS1M\u002BgMw.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0xNsiYAAAAAAqG3Oxmm/qS4ut8lDJEZc4WVZSMzBFREdFMDQyMQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "x-ms-client-request-id": "b422eb1b4a717086d6d88b88fdbdf281", + "X-Processing-Time": "16ms" + }, + "ResponseBody": { + "identity": { + "id": "Sanitized" + } + } + } + ], + "Variables": { + "COMMUNICATION_ACCESS_KEY": "Kg==", + "COMMUNICATION_ENDPOINT": "https://sanitized.communication.azure.com/", + "RandomSeed": "1331219107" + } +} \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.Identity/tests/SessionRecords/Sample1_CommunicationIdentityClient/CreateIdentityWithAccessKeyAsync.json b/sdk/communication/Azure.Communication.Identity/tests/SessionRecords/Sample1_CommunicationIdentityClient/CreateIdentityWithAccessKeyAsync.json new file mode 100644 index 0000000000000..ef963431a2b27 --- /dev/null +++ b/sdk/communication/Azure.Communication.Identity/tests/SessionRecords/Sample1_CommunicationIdentityClient/CreateIdentityWithAccessKeyAsync.json @@ -0,0 +1,46 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.communication.azure.com/identities?api-version=2021-03-07", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "2", + "Content-Type": "application/json", + "Date": "Tue, 09 Feb 2021 19:00:28 GMT", + "traceparent": "00-432592baa38f9f478fc4a7ff65820db4-642995910d5ad240-00", + "User-Agent": [ + "azsdk-net-Communication.Identity/1.0.0-alpha.20210209.1", + "(.NET 5.0.2; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "0037185a72fdbbffcd7a5fb531f1f483", + "x-ms-content-sha256": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": {}, + "StatusCode": 201, + "ResponseHeaders": { + "api-supported-versions": "2020-07-20-preview2, 2021-03-07", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 09 Feb 2021 19:00:28 GMT", + "MS-CV": "wonWSTdSpEy1gnUlYGEsoA.0", + "Strict-Transport-Security": "max-age=2592000", + "Transfer-Encoding": "chunked", + "X-Azure-Ref": "0zNsiYAAAAAAKX7\u002BaTzYwS6A76kBLBZBeWVZSMzBFREdFMDQyMQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "x-ms-client-request-id": "0037185a72fdbbffcd7a5fb531f1f483", + "X-Processing-Time": "17ms" + }, + "ResponseBody": { + "identity": { + "id": "Sanitized" + } + } + } + ], + "Variables": { + "COMMUNICATION_ACCESS_KEY": "Kg==", + "COMMUNICATION_ENDPOINT": "https://sanitized.communication.azure.com/", + "RandomSeed": "1340713197" + } +} \ No newline at end of file diff --git a/sdk/communication/Azure.Communication.Identity/tests/samples/Sample1_CommunicationIdentityClient.cs b/sdk/communication/Azure.Communication.Identity/tests/samples/Sample1_CommunicationIdentityClient.cs index d68ad49abf3d2..08e1b647d99ba 100644 --- a/sdk/communication/Azure.Communication.Identity/tests/samples/Sample1_CommunicationIdentityClient.cs +++ b/sdk/communication/Azure.Communication.Identity/tests/samples/Sample1_CommunicationIdentityClient.cs @@ -113,6 +113,28 @@ public async Task CreateIdentityWithToken() } } + [Test] + public async Task CreateIdentityWithAccessKey() + { + #region Snippet:CreateCommunicationIdentityFromAccessKey + var endpoint = new Uri("https://my-resource.communication.azure.com"); + var accessKey = ""; + /*@@*/ endpoint = TestEnvironment.Endpoint; + /*@@*/ accessKey = TestEnvironment.AccessKey; + var client = new CommunicationIdentityClient(endpoint, new AzureKeyCredential(accessKey)); + #endregion Snippet:CreateCommunicationIdentityFromAccessKey + + client = CreateClientWithAzureKeyCredential(); + try + { + Response userResponse = await client.CreateUserAsync(); + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + } + [Test] public async Task Troubleshooting() { @@ -131,7 +153,7 @@ public async Task Troubleshooting() { Console.WriteLine(ex.Message); } - #endregion + #endregion Snippet:CommunicationIdentityClient_Troubleshooting catch (Exception ex) { Assert.Fail($"Unexpected error: {ex}");