From a1a9aea4964de45414a65c31b7589c111d157e4d Mon Sep 17 00:00:00 2001 From: LuChen-Microsoft <44377201+LuChen-Microsoft@users.noreply.github.com> Date: Tue, 19 Jan 2021 13:22:57 -0800 Subject: [PATCH] [Communication] ACS Chat: API Updates 2021.1 (#13187) * update apis * fix the tests and expose the apis * fix the tests and expose the apis * update the e2e tests * draft: upgrade the autorest version * draft: upgrade the autorest version * disable auto rest async * disable auto rest async --- .../communication-chat/package.json | 2 +- ...ording_successfully_adds_participants.json | 12 +- ...cording_successfully_creates_a_thread.json | 20 +- ...ording_successfully_deletes_a_message.json | 2 +- ...cording_successfully_deletes_a_thread.json | 2 +- ...recording_successfully_lists_messages.json | 4 +- ...rding_successfully_lists_participants.json | 4 +- ...ding_successfully_lists_read_receipts.json | 4 +- .../recording_successfully_lists_threads.json | 2 +- ...ing_successfully_remove_a_participant.json | 2 +- ...ding_successfully_retrieves_a_message.json | 4 +- ...rding_successfully_retrieves_a_thread.json | 4 +- ...ecording_successfully_sends_a_message.json | 6 +- ...rding_successfully_sends_read_receipt.json | 4 +- ...uccessfully_sends_typing_notification.json | 2 +- ...ecording_successfully_adds_participants.js | 42 +- ...recording_successfully_creates_a_thread.js | 76 +- ...ecording_successfully_deletes_a_message.js | 12 +- ...recording_successfully_deletes_a_thread.js | 12 +- .../recording_successfully_lists_messages.js | 14 +- ...cording_successfully_lists_participants.js | 14 +- ...ording_successfully_lists_read_receipts.js | 14 +- .../recording_successfully_lists_threads.js | 12 +- ...rding_successfully_remove_a_participant.js | 12 +- ...ording_successfully_retrieves_a_message.js | 14 +- ...cording_successfully_retrieves_a_thread.js | 14 +- ..._successfully_retrieves_a_thread_client.js | 2 +- .../recording_successfully_sends_a_message.js | 16 +- ...cording_successfully_sends_read_receipt.js | 12 +- ..._successfully_sends_typing_notification.js | 12 +- .../review/communication-chat.api.md | 102 ++- .../communication-chat/src/chatClient.ts | 21 +- .../src/chatThreadClient.ts | 50 +- .../src/generated/src/chatApiClient.ts | 19 +- .../src/generated/src/index.ts | 11 + .../src/generated/src/models/index.ts | 727 ++++++------------ .../src/generated/src/models/mappers.ts | 152 +++- .../src/generated/src/models/parameters.ts | 16 +- .../src/generated/src/operations/chat.ts | 115 +-- .../generated/src/operations/chatThread.ts | 357 +++++---- .../communication-chat/src/models/mappers.ts | 23 +- .../communication-chat/src/models/models.ts | 29 +- .../communication-chat/src/models/options.ts | 1 + .../communication-chat/swagger/README.md | 3 +- .../test/chatClient.spec.ts | 9 +- .../test/chatThreadClient.mocked.spec.ts | 13 +- .../test/utils/mockClient.ts | 5 +- 47 files changed, 1037 insertions(+), 968 deletions(-) create mode 100644 sdk/communication/communication-chat/src/generated/src/index.ts diff --git a/sdk/communication/communication-chat/package.json b/sdk/communication/communication-chat/package.json index 9540fc514c2c..ef5141f2a358 100644 --- a/sdk/communication/communication-chat/package.json +++ b/sdk/communication/communication-chat/package.json @@ -8,7 +8,7 @@ "types": "types/communication-chat.d.ts", "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", - "build:autorest": "autorest ./swagger/README.md --typescript --version=3.0.6267 --v3 --package-version=1.0.0-beta.3 && rushx format", + "build:autorest": "autorest ./swagger/README.md --typescript --version=3.0.6267 --v3 --disable-async-iterators=true --package-version=1.0.0-beta.3 && rushx format", "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", "build:samples": "cd samples && tsc -p .", diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_adds_participants.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_adds_participants.json index eb8e2b34f31a..009c7f2bc349 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_adds_participants.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_adds_participants.json @@ -8,31 +8,31 @@ }, "requestBody": null, "status": 200, - "response": "{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-6d40-b0b7-3a3a0d0044b9\"}", + "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-ac8c-6032-3b3a0d001c67\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } }, { "method": "POST", - "url": "https://endpoint/identities/8%3Aacs%3A188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-6d40-b0b7-3a3a0d0044b9/token", + "url": "https://endpoint/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-ac8c-6032-3b3a0d001c67/token", "query": { "api-version": "2020-07-20-preview2" }, "requestBody": "{\"scopes\":[\"chat\"]}", "status": 200, - "response": "{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-6d40-b0b7-3a3a0d0044b9\",\"token\":\"token\",\"expiresOn\":\"2020-12-31T21:14:44.3405342+00:00\"}", + "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-ac8c-6032-3b3a0d001c67\",\"token\":\"token\",\"expiresOn\":\"2021-01-14T02:06:59.8762421+00:00\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } }, { "method": "POST", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/participants/:add", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/participants/:add", "query": { "api-version": "2020-11-01-preview3" }, - "requestBody": "{\"participants\":[{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-6d40-b0b7-3a3a0d0044b9\"}]}", + "requestBody": "{\"participants\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-ac8c-6032-3b3a0d001c67\",\"shareHistoryTime\":\"2020-05-26T18:06:06.000Z\"}]}", "status": 201, "response": "{}", "responseHeaders": { @@ -44,5 +44,5 @@ "uniqueName": {}, "newDate": {} }, - "hash": "c5fde7c044908b455d100bf47e997626" + "hash": "2d0d45a11547788c4d9ed325ec30bc1a" } \ No newline at end of file diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_creates_a_thread.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_creates_a_thread.json index d5e48e858dfd..7ea8ab7ae5df 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_creates_a_thread.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_creates_a_thread.json @@ -8,20 +8,20 @@ }, "requestBody": null, "status": 200, - "response": "{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\"}", + "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } }, { "method": "POST", - "url": "https://endpoint/identities/8%3Aacs%3A188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7/token", + "url": "https://endpoint/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65/token", "query": { "api-version": "2020-07-20-preview2" }, "requestBody": "{\"scopes\":[\"chat\"]}", "status": 200, - "response": "{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\",\"token\":\"token\",\"expiresOn\":\"2020-12-31T21:14:35.2416709+00:00\"}", + "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\",\"token\":\"token\",\"expiresOn\":\"2021-01-14T02:06:56.5204429+00:00\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } @@ -34,20 +34,20 @@ }, "requestBody": null, "status": 200, - "response": "{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4c3a-b0b7-3a3a0d0044b8\"}", + "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-a040-6032-3b3a0d001c66\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } }, { "method": "POST", - "url": "https://endpoint/identities/8%3Aacs%3A188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4c3a-b0b7-3a3a0d0044b8/token", + "url": "https://endpoint/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-a040-6032-3b3a0d001c66/token", "query": { "api-version": "2020-07-20-preview2" }, "requestBody": "{\"scopes\":[\"chat\"]}", "status": 200, - "response": "{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4c3a-b0b7-3a3a0d0044b8\",\"token\":\"token\",\"expiresOn\":\"2020-12-31T21:14:35.9069477+00:00\"}", + "response": "{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-a040-6032-3b3a0d001c66\",\"token\":\"token\",\"expiresOn\":\"2021-01-14T02:06:56.7495552+00:00\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } @@ -58,12 +58,12 @@ "query": { "api-version": "2020-11-01-preview3" }, - "requestBody": "{\"topic\":\"test topic\",\"participants\":[{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\"},{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4c3a-b0b7-3a3a0d0044b8\"}]}", + "requestBody": "{\"topic\":\"test topic\",\"participants\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\",\"shareHistoryTime\":\"2020-05-26T18:06:06.000Z\"},{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-a040-6032-3b3a0d001c66\",\"shareHistoryTime\":\"2020-05-26T18:06:06.000Z\"}]}", "status": 201, - "response": "{\"chatThread\":{\"id\":\"19:4dc973636fca42dda4eeae466d18e81a@thread.v2\",\"topic\":\"test topic\",\"createdOn\":\"2020-12-30T21:14:37Z\",\"createdBy\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\"}}", + "response": "{\"chatThread\":{\"id\":\"19:cb3f43b5b0da4b17bab9e23464e3519e@thread.v2\",\"topic\":\"test topic\",\"createdOn\":\"2021-01-13T02:06:58Z\",\"createdBy\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\"}}", "responseHeaders": { "content-type": "application/json; charset=utf-8", - "location": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a@thread.v2" + "location": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e@thread.v2" } } ], @@ -71,5 +71,5 @@ "uniqueName": {}, "newDate": {} }, - "hash": "46472dfad938311e726759d1c26c9e61" + "hash": "4e2657f2d2329b19ef4b289bedfa5562" } \ No newline at end of file diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_message.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_message.json index 61fae522d798..13a10e490a67 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_message.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_message.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "DELETE", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/messages/1609362880451", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/messages/1610503619259", "query": { "api-version": "2020-11-01-preview3" }, diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_thread.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_thread.json index 4cf13553bc96..61b5ecc3dbc4 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_thread.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_deletes_a_thread.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "DELETE", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2", "query": { "api-version": "2020-11-01-preview3" }, diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_messages.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_messages.json index 1c337c0c1429..09053ed392ac 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_messages.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_messages.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/messages", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/messages", "query": { "api-version": "2020-11-01-preview3" }, "requestBody": null, "status": 200, - "response": "{\"value\":[{\"id\":\"1609362880451\",\"type\":\"text\",\"priority\":\"normal\",\"version\":\"1609362880451\",\"content\":{\"message\":\"content\"},\"senderDisplayName\":\"\",\"createdOn\":\"2020-12-30T21:14:40Z\",\"senderId\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\"},{\"id\":\"1609362877899\",\"type\":\"topicUpdated\",\"priority\":\"normal\",\"version\":\"1609362877899\",\"content\":{\"topic\":\"test topic\",\"initiator\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\"},\"createdOn\":\"2020-12-30T21:14:37Z\",\"senderId\":\"19:4dc973636fca42dda4eeae466d18e81a@thread.v2\"},{\"id\":\"1609362877867\",\"type\":\"participantAdded\",\"priority\":\"normal\",\"version\":\"1609362877867\",\"content\":{\"participants\":[{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4c3a-b0b7-3a3a0d0044b8\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"}],\"initiator\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\"},\"createdOn\":\"2020-12-30T21:14:37Z\",\"senderId\":\"19:4dc973636fca42dda4eeae466d18e81a@thread.v2\"}]}", + "response": "{\"value\":[{\"id\":\"1610503619259\",\"type\":\"Text\",\"priority\":\"Normal\",\"version\":\"1610503619259\",\"content\":\"content\",\"senderDisplayName\":\"\",\"createdOn\":\"2021-01-13T02:06:59Z\",\"senderId\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\"},{\"id\":\"1610503618290\",\"type\":\"ThreadActivity/TopicUpdate\",\"priority\":\"Normal\",\"version\":\"1610503618290\",\"content\":\"16105036182908:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65test topic\",\"createdOn\":\"2021-01-13T02:06:58Z\",\"senderId\":\"19:cb3f43b5b0da4b17bab9e23464e3519e@thread.v2\"},{\"id\":\"1610503618260\",\"type\":\"ThreadActivity/AddMember\",\"priority\":\"Normal\",\"version\":\"1610503618260\",\"content\":\"16105036182608:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c6516105036182008:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c658:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c658:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-a040-6032-3b3a0d001c668:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-a040-6032-3b3a0d001c66\",\"createdOn\":\"2021-01-13T02:06:58Z\",\"senderId\":\"19:cb3f43b5b0da4b17bab9e23464e3519e@thread.v2\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_participants.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_participants.json index 42cafe14c57b..9481a8202324 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_participants.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_participants.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/participants", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/participants", "query": { "api-version": "2020-11-01-preview3" }, "requestBody": null, "status": 200, - "response": "{\"value\":[{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4c3a-b0b7-3a3a0d0044b8\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-6d40-b0b7-3a3a0d0044b9\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"}]}", + "response": "{\"value\":[{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-a040-6032-3b3a0d001c66\",\"shareHistoryTime\":\"1970-01-01T00:00:00Z\"},{\"id\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-ac8c-6032-3b3a0d001c67\",\"shareHistoryTime\":\"2020-05-26T18:06:06Z\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_read_receipts.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_read_receipts.json index 9f1b7ed126e6..f1445e9e43a5 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_read_receipts.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_read_receipts.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/readReceipts", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/readReceipts", "query": { "api-version": "2020-11-01-preview3" }, "requestBody": null, "status": 200, - "response": "{\"value\":[{\"senderId\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\",\"chatMessageId\":\"1609362880451\",\"readOn\":\"2020-12-30T21:14:41Z\"}]}", + "response": "{\"value\":[{\"senderId\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\",\"chatMessageId\":\"1610503619259\",\"readOn\":\"2021-01-13T02:06:59Z\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_threads.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_threads.json index caf09bd14aba..847dea0a1af9 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_threads.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_lists_threads.json @@ -8,7 +8,7 @@ }, "requestBody": null, "status": 200, - "response": "{\"value\":[{\"id\":\"19:4dc973636fca42dda4eeae466d18e81a@thread.v2\",\"topic\":\"test topic\",\"lastMessageReceivedOn\":\"2020-12-30T21:14:37Z\"}]}", + "response": "{\"value\":[{\"id\":\"19:cb3f43b5b0da4b17bab9e23464e3519e@thread.v2\",\"topic\":\"test topic\",\"lastMessageReceivedOn\":\"2021-01-13T02:06:58Z\"}]}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_remove_a_participant.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_remove_a_participant.json index 6eb6f3d797b4..111c00884446 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_remove_a_participant.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_remove_a_participant.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "DELETE", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/participants/8%3Aacs%3A188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4c3a-b0b7-3a3a0d0044b8", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/participants/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-a040-6032-3b3a0d001c66", "query": { "api-version": "2020-11-01-preview3" }, diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_message.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_message.json index 9d938ba50083..3862a6b4b62e 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_message.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_message.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/messages/1609362880451", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/messages/1610503619259", "query": { "api-version": "2020-11-01-preview3" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"1609362880451\",\"type\":\"text\",\"priority\":\"normal\",\"version\":\"1609362880451\",\"content\":{\"message\":\"content\"},\"senderDisplayName\":\"\",\"createdOn\":\"2020-12-30T21:14:40Z\",\"senderId\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\"}", + "response": "{\"id\":\"1610503619259\",\"type\":\"Text\",\"priority\":\"Normal\",\"version\":\"1610503619259\",\"content\":\"content\",\"senderDisplayName\":\"\",\"createdOn\":\"2021-01-13T02:06:59Z\",\"senderId\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_thread.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_thread.json index 2de43a8ce240..621532d7bf6a 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_thread.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_retrieves_a_thread.json @@ -2,13 +2,13 @@ "recordings": [ { "method": "GET", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2", "query": { "api-version": "2020-11-01-preview3" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"19:4dc973636fca42dda4eeae466d18e81a@thread.v2\",\"topic\":\"test topic\",\"createdOn\":\"2020-12-30T21:14:37Z\",\"createdBy\":\"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-4943-b0b7-3a3a0d0044b7\"}", + "response": "{\"id\":\"19:cb3f43b5b0da4b17bab9e23464e3519e@thread.v2\",\"topic\":\"test topic\",\"createdOn\":\"2021-01-13T02:06:58Z\",\"createdBy\":\"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-9f5c-6032-3b3a0d001c65\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8" } diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_a_message.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_a_message.json index 48512f4c829d..4a2d002db8e7 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_a_message.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_a_message.json @@ -2,16 +2,16 @@ "recordings": [ { "method": "POST", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/messages", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/messages", "query": { "api-version": "2020-11-01-preview3" }, "requestBody": "{\"content\":\"content\"}", "status": 201, - "response": "{\"id\":\"1609362880451\"}", + "response": "{\"id\":\"1610503619259\"}", "responseHeaders": { "content-type": "application/json; charset=utf-8", - "location": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a@thread.v2/messages/1609362880451" + "location": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e@thread.v2/messages/1610503619259" } } ], diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_read_receipt.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_read_receipt.json index 14fb9f5cad01..7a4e0bc64528 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_read_receipt.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_read_receipt.json @@ -2,11 +2,11 @@ "recordings": [ { "method": "POST", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/readReceipts", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/readReceipts", "query": { "api-version": "2020-11-01-preview3" }, - "requestBody": "{\"chatMessageId\":\"1609362880451\"}", + "requestBody": "{\"chatMessageId\":\"1610503619259\"}", "status": 200, "response": "", "responseHeaders": { diff --git a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_typing_notification.json b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_typing_notification.json index eaf6be9e6673..e33f7eb3acc4 100644 --- a/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_typing_notification.json +++ b/sdk/communication/communication-chat/recordings/browsers/chatclient/recording_successfully_sends_typing_notification.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "POST", - "url": "https://endpoint/chat/threads/19%3A4dc973636fca42dda4eeae466d18e81a%40thread.v2/typing", + "url": "https://endpoint/chat/threads/19%3Acb3f43b5b0da4b17bab9e23464e3519e%40thread.v2/typing", "query": { "api-version": "2020-11-01-preview3" }, diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_adds_participants.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_adds_participants.js index 435d02dc4146..4dc01f079de1 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_adds_participants.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_adds_participants.js @@ -1,59 +1,59 @@ let nock = require('nock'); -module.exports.hash = "31e17666f781ad18cd063e7dde571c6c"; +module.exports.hash = "07eac232cd3a9dc288c9c1c7b401f64d"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities') .query(true) - .reply(200, {"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-2e87-1db7-3a3a0d0043a3"}, [ + .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-8307-0e04-343a0d001200"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'cLOPrgFkME6aPelkkMe3BA.0', + 'YZOA+zy4ZUSXRB6H33mHqw.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - 'd2ebb8f1-cee6-4295-b026-6e1a6ae1380a', + '46ad2a17-4c2d-48ed-9c0d-b53cbc724d8a', 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', - '62ms', + '22ms', 'X-Azure-Ref', - '0tO3sXwAAAAATLakmTQUbRoZUt0xC5rRRWVZSMzBFREdFMDQxOQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0ulX+XwAAAABhElc5zxBdQqj6rl84plB3V1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:28 GMT' + 'Wed, 13 Jan 2021 02:06:50 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities/8%3Aacs%3A188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-2e87-1db7-3a3a0d0043a3/token', {"scopes":["chat"]}) + .post('/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-8307-0e04-343a0d001200/token', {"scopes":["chat"]}) .query(true) - .reply(200, {"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-2e87-1db7-3a3a0d0043a3","token":"token","expiresOn":"2020-12-31T21:14:28.0190859+00:00"}, [ + .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-8307-0e04-343a0d001200","token":"token","expiresOn":"2021-01-14T02:06:49.203026+00:00"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'GWO8IjwebUyL8QfsJJs4Kw.0', + 'OdymPnH2/UWyzr5l5xOA/Q.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - 'c0f3627e-7224-40a4-a6c5-befc706212e4', + '58c89705-0c38-4131-9d2c-754c938f0080', 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', - '91ms', + '24ms', 'X-Azure-Ref', - '0tO3sXwAAAAD64pzxlbGpQ4CFL+4V/xPMWVZSMzBFREdFMDQxOQBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0ulX+XwAAAAD3aEZkR2JnQZXnAFssYV+AV1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:28 GMT' + 'Wed, 13 Jan 2021 02:06:50 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/participants/:add', {"participants":[{"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-2e87-1db7-3a3a0d0043a3"}]}) + .post('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/participants/:add', {"participants":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-8307-0e04-343a0d001200","shareHistoryTime":"2020-05-26T18:06:06.000Z"}]}) .query(true) .reply(201, {}, [ 'Transfer-Encoding', @@ -61,15 +61,15 @@ nock('https://endpoint', {"encodedQueryParams":true}) 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'WymZ75ejHkiljw955z6Eig.0', + 'tlGqIx4T7E+BNmlSSxvnag.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-11-01-preview3', 'X-Processing-Time', - '424ms', + '282ms', 'X-Azure-Ref', - '0te3sXwAAAABSxuADyJWoSLv1+z9nQRJEWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0ulX+XwAAAAC1fFpvOh71QbrT2Ezc4LckV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:29 GMT' + 'Wed, 13 Jan 2021 02:06:50 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js index b79b4633581c..8b4a66d7e2a4 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js @@ -1,125 +1,125 @@ let nock = require('nock'); -module.exports.hash = "d4936284041bb7af6986d6e176cba699"; +module.exports.hash = "64233ff8187dfa27fce879385526b7c0"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities') .query(true) - .reply(200, {"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2"}, [ + .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'HU/q+YyWTkmin6hmupuvkA.0', + 'R+QRrO7bPEKdKD8pOF/NTg.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - 'ed182e6f-73b0-40b5-82ac-09316f6dc10b', + 'b1988273-da29-4062-950c-b8353292b83d', 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', - '62ms', + '18ms', 'X-Azure-Ref', - '0r+3sXwAAAABLuSPm+3Y7TZc8kJ3KOF1JWVZSMzBFREdFMDMxNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0tVX+XwAAAADgHyPaQuWERY7ajteWs7wOV1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:23 GMT' + 'Wed, 13 Jan 2021 02:06:45 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities/8%3Aacs%3A188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2/token', {"scopes":["chat"]}) + .post('/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe/token', {"scopes":["chat"]}) .query(true) - .reply(200, {"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2","token":"token","expiresOn":"2020-12-31T21:14:23.1122863+00:00"}, [ + .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe","token":"token","expiresOn":"2021-01-14T02:06:46.0132731+00:00"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'gU65RAQvBEetY2YZqVFeog.0', + 'D327V2zDZkWb/ERmvL1/CA.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - '400a8ebe-d6db-4d9c-8cc2-8fba7ca720bf', + 'a22faa44-953e-4768-b3f6-c02c215f937a', 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', - '84ms', + '23ms', 'X-Azure-Ref', - '0sO3sXwAAAABypqZDwmW2TYUI1D3tlme1WVZSMzBFREdFMDMxNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0tVX+XwAAAADHcncfyh2iRIadpbEF83XVV1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:23 GMT' + 'Wed, 13 Jan 2021 02:06:46 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities') .query(true) - .reply(200, {"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1ca2-b0b7-3a3a0d0044b6"}, [ + .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-74aa-1000-343a0d0023c1"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'qkULgHTd90+wmEhCtqPIsw.0', + 'rkr6koyRz0myaLeozKRuVw.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - '64cf97bf-1c8f-4b52-b3ee-cc8b97294883', + '95f5922b-687c-43d6-a1ed-e1ea57b5f1a6', 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', - '17ms', + '19ms', 'X-Azure-Ref', - '0sO3sXwAAAAB9IH0MRm0HRLgoJIBNg/y5WVZSMzBFREdFMDMwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0tlX+XwAAAAC6zQKv9oB8SbmD3c2aFrgzV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:23 GMT' + 'Wed, 13 Jan 2021 02:06:45 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/identities/8%3Aacs%3A188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1ca2-b0b7-3a3a0d0044b6/token', {"scopes":["chat"]}) + .post('/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-74aa-1000-343a0d0023c1/token', {"scopes":["chat"]}) .query(true) - .reply(200, {"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1ca2-b0b7-3a3a0d0044b6","token":"token","expiresOn":"2020-12-31T21:14:23.417037+00:00"}, [ + .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-74aa-1000-343a0d0023c1","token":"token","expiresOn":"2021-01-14T02:06:45.5807287+00:00"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'nDJBp/AKy065exAKixJkOw.0', + '+TFfi8e1z0uWZr4KYkSEkQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - 'b8b8100c-7373-4012-9bd2-d5c6952f2e13', + '214779e4-48b7-45a1-9dd9-dbccb408da3d', 'api-supported-versions', - '2020-07-20-preview2, 2021-03-07', + '2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', - '83ms', + '25ms', 'X-Azure-Ref', - '0sO3sXwAAAABcXrZVNP8dRYNwk/pc0V1jWVZSMzBFREdFMDMwNgBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0tlX+XwAAAAB+GZeI44eLT7y75ZltWsjKV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:23 GMT' + 'Wed, 13 Jan 2021 02:06:46 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads', {"topic":"test topic","participants":[{"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2"},{"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1ca2-b0b7-3a3a0d0044b6"}]}) + .post('/chat/threads', {"topic":"test topic","participants":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe","shareHistoryTime":"2020-05-26T18:06:06.000Z"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-74aa-1000-343a0d0023c1","shareHistoryTime":"2020-05-26T18:06:06.000Z"}]}) .query(true) - .reply(201, {"chatThread":{"id":"19:0771a8d8c00d4329b664c4237e41bf0c@thread.v2","topic":"test topic","createdOn":"2020-12-30T21:14:24Z","createdBy":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2"}}, [ + .reply(201, {"chatThread":{"id":"19:883ce5bf892c47d6a7da73da6df31c7e@thread.v2","topic":"test topic","createdOn":"2021-01-13T02:06:47Z","createdBy":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe"}}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'Location', - 'https://168.61.22.92/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c@thread.v2', + 'https://13.64.171.212/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e@thread.v2', 'MS-CV', - '0x0ni1/kbkOVzKLIzOE+Rg.0', + 'qEuDQ4xHME6aVcs1UL436w.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '844ms', + '445ms', 'X-Azure-Ref', - '0sO3sXwAAAADi7IMuzpBxS6Mjrp7meP9jWVZSMzBFREdFMDQxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0tlX+XwAAAAAE5W2/7phcSJMvqTksVYhWV1NURURHRTA4MTkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:24 GMT' + 'Wed, 13 Jan 2021 02:06:47 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_message.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_message.js index 17b19109325a..d19fe1df575c 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_message.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_message.js @@ -1,23 +1,23 @@ let nock = require('nock'); -module.exports.hash = "56ef4702cc865c3b0003e57bb5f65bb2"; +module.exports.hash = "6f90ac401c7903dfc7bd077bcdb108f1"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .delete('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/messages/1609362866505') + .delete('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/messages/1610503608398') .query(true) .reply(204, "", [ 'MS-CV', - '90++Y2wll06wld8a99bYeg.0', + 'aWcpud2WmUS33RkLY1DxCg.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '404ms', + '112ms', 'X-Azure-Ref', - '0tO3sXwAAAAAoCyQXFv16Qo/G1qnZkQ6rWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0uVX+XwAAAAAxiq9/T5ZISJPMVyrzd5YwV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:28 GMT' + 'Wed, 13 Jan 2021 02:06:49 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_thread.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_thread.js index 5cbc0f8e7417..e9530f14c9dc 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_thread.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_deletes_a_thread.js @@ -1,23 +1,23 @@ let nock = require('nock'); -module.exports.hash = "39345a98092c2d516c252dd29423ff64"; +module.exports.hash = "1111e8e6bad22cbea6c2a2da200160bf"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .delete('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2') + .delete('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2') .query(true) .reply(204, "", [ 'MS-CV', - 'UqN9uY8MdU6EcWB4BRmFSQ.0', + '3jeXQ/otpUKp9hB0TEaK/w.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '299ms', + '94ms', 'X-Azure-Ref', - '0tu3sXwAAAAB+0NTxSAxDR54rdDoMiSoAWVZSMzBFREdFMDQxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0u1X+XwAAAACU4nHUMjgBT6rvSLJryRQOV1NURURHRTA4MTkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:30 GMT' + 'Wed, 13 Jan 2021 02:06:51 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_messages.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_messages.js index 194babf733f2..041fdb2e3cd6 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_messages.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_messages.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "6671f74e8fe41f7a33a111a51ebb1d5d"; +module.exports.hash = "d1b1ea54f4e60c7db92b5a7e81c4cc14"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/messages') + .get('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/messages') .query(true) - .reply(200, {"value":[{"id":"1609362866505","type":"text","priority":"normal","version":"1609362866505","content":{"message":"content"},"senderDisplayName":"","createdOn":"2020-12-30T21:14:26Z","senderId":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2"},{"id":"1609362864989","type":"topicUpdated","priority":"normal","version":"1609362864989","content":{"topic":"test topic","initiator":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2"},"createdOn":"2020-12-30T21:14:24Z","senderId":"19:0771a8d8c00d4329b664c4237e41bf0c@thread.v2"},{"id":"1609362864942","type":"participantAdded","priority":"normal","version":"1609362864942","content":{"participants":[{"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1ca2-b0b7-3a3a0d0044b6","shareHistoryTime":"1970-01-01T00:00:00Z"}],"initiator":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2"},"createdOn":"2020-12-30T21:14:24Z","senderId":"19:0771a8d8c00d4329b664c4237e41bf0c@thread.v2"}]}, [ + .reply(200, {"value":[{"id":"1610503608398","type":"Text","priority":"Normal","version":"1610503608398","content":"content","senderDisplayName":"","createdOn":"2021-01-13T02:06:48Z","senderId":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe"},{"id":"1610503607272","type":"ThreadActivity/TopicUpdate","priority":"Normal","version":"1610503607272","content":"16105036072728:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fetest topic","createdOn":"2021-01-13T02:06:47Z","senderId":"19:883ce5bf892c47d6a7da73da6df31c7e@thread.v2"},{"id":"1610503607247","type":"ThreadActivity/AddMember","priority":"Normal","version":"1610503607247","content":"16105036072478:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe16105036071978:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-74aa-1000-343a0d0023c18:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-74aa-1000-343a0d0023c1","createdOn":"2021-01-13T02:06:47Z","senderId":"19:883ce5bf892c47d6a7da73da6df31c7e@thread.v2"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'lvmt7TZfCUWLbvwfTfYDGA.0', + 'XxVFaNUhnkSxriAqj6CjjA.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '282ms', + '83ms', 'X-Azure-Ref', - '0s+3sXwAAAACcQ181T6isTbslNJFmy+ZXWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0uVX+XwAAAAD0EM+iiJ8yTZzWCM8tAr3hV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:27 GMT' + 'Wed, 13 Jan 2021 02:06:49 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_participants.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_participants.js index 702c53252963..4819ef7e97dd 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_participants.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_participants.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "445066970a0a7ca03bae7bcddd06b520"; +module.exports.hash = "b56d623d661b55248a369b405cdd5d00"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/participants') + .get('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/participants') .query(true) - .reply(200, {"value":[{"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1ca2-b0b7-3a3a0d0044b6","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-2e87-1db7-3a3a0d0043a3","shareHistoryTime":"1970-01-01T00:00:00Z"}]}, [ + .reply(200, {"value":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-74aa-1000-343a0d0023c1","shareHistoryTime":"1970-01-01T00:00:00Z"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-8307-0e04-343a0d001200","shareHistoryTime":"2020-05-26T18:06:06Z"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - '5EDiEr3TM0OGBhKfdAufsw.0', + 'JVw68mNIgUeFbwiyWAl27g.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-11-01-preview3', 'X-Processing-Time', - '273ms', + '84ms', 'X-Azure-Ref', - '0te3sXwAAAAAiJFr/oZo4Sp6mS46u9a2vWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0ulX+XwAAAAB0IVbim84FS446Ako5oHWxV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:29 GMT' + 'Wed, 13 Jan 2021 02:06:50 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_read_receipts.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_read_receipts.js index d02cd5bda9db..eb4c5dce8b6d 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_read_receipts.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_read_receipts.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "56cc94d0f288af0dc58032126a6820c4"; +module.exports.hash = "9b24f9f0b408c48d472358651b13d15f"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/readReceipts') + .get('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/readReceipts') .query(true) - .reply(200, {"value":[{"senderId":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2","chatMessageId":"1609362866505","readOn":"2020-12-30T21:14:27Z"}]}, [ + .reply(200, {"value":[{"senderId":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe","chatMessageId":"1610503608398","readOn":"2021-01-13T02:06:48Z"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'vJipRI+pX0m3+ulJ4U7DcA.0', + 'BJPSo6SXa0Oc4OuU49lsFQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '263ms', + '71ms', 'X-Azure-Ref', - '0tu3sXwAAAABvUIAYYnbfS47wkmcvd9+ZWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0u1X+XwAAAABb+hSJu5zgS6VuBYm9pzW3V1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:30 GMT' + 'Wed, 13 Jan 2021 02:06:51 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_threads.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_threads.js index b74bbad95494..9af451d795cc 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_threads.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_lists_threads.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "e811d91fee0a8c830e94b3f91f3c461d"; +module.exports.hash = "58ee2be7113924a625c4f7dfbbd61b45"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) .get('/chat/threads') .query(true) - .reply(200, {"value":[{"id":"19:0771a8d8c00d4329b664c4237e41bf0c@thread.v2","topic":"test topic","lastMessageReceivedOn":"2020-12-30T21:14:24Z"}]}, [ + .reply(200, {"value":[{"id":"19:883ce5bf892c47d6a7da73da6df31c7e@thread.v2","topic":"test topic","lastMessageReceivedOn":"2021-01-13T02:06:47Z"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'HUjBwJzYh0etyWZaNpmy6A.0', + 'tf9+XXaiyUmgwEa/46r2Vw.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '329ms', + '70ms', 'X-Azure-Ref', - '0se3sXwAAAAAwSlk0flNvRKDfwR7qBsHYWVZSMzBFREdFMDQxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0t1X+XwAAAAB87DTJvTugRZiPOqAM+XrNV1NURURHRTA4MTkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:25 GMT' + 'Wed, 13 Jan 2021 02:06:47 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_remove_a_participant.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_remove_a_participant.js index f57880c65547..953de2a722d9 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_remove_a_participant.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_remove_a_participant.js @@ -1,23 +1,23 @@ let nock = require('nock'); -module.exports.hash = "3b167aa11c9a71d3eaf96a152e30f002"; +module.exports.hash = "10e23f822ab435387529ce641b780900"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .delete('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/participants/8%3Aacs%3A188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1ca2-b0b7-3a3a0d0044b6') + .delete('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/participants/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-74aa-1000-343a0d0023c1') .query(true) .reply(204, "", [ 'MS-CV', - 'Q3JeJgKHR0aZ8UqfC2l2rg.0', + 'hVgF/ll+vE67EZI67TURLQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-11-01-preview3', 'X-Processing-Time', - '436ms', + '148ms', 'X-Azure-Ref', - '0te3sXwAAAABqSVmJ8GasSI16lgClNO4lWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0ulX+XwAAAAAYpn+J7nXmSppi8oJKlvZsV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:29 GMT' + 'Wed, 13 Jan 2021 02:06:50 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_message.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_message.js index 39809abc81b1..acd6be69cbbd 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_message.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_message.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "fc9f126b8906a13cafb1265001b083bc"; +module.exports.hash = "fb5e8197d261ca82151def1448387286"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/messages/1609362866505') + .get('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/messages/1610503608398') .query(true) - .reply(200, {"id":"1609362866505","type":"text","priority":"normal","version":"1609362866505","content":{"message":"content"},"senderDisplayName":"","createdOn":"2020-12-30T21:14:26Z","senderId":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2"}, [ + .reply(200, {"id":"1610503608398","type":"Text","priority":"Normal","version":"1610503608398","content":"content","senderDisplayName":"","createdOn":"2021-01-13T02:06:48Z","senderId":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - 'TK39ZOtFiEySFqkSs9lOGg.0', + 'vkcy4nhGgkObzkQigB3ZQg.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '271ms', + '75ms', 'X-Azure-Ref', - '0s+3sXwAAAABCmXxtR6jpTKBpWQye9jjqWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0uVX+XwAAAADaKFC5EZXIRZJV7Fnt0m0+V1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:27 GMT' + 'Wed, 13 Jan 2021 02:06:49 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread.js index 0166308ddf73..9283628aafaa 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread.js @@ -1,27 +1,27 @@ let nock = require('nock'); -module.exports.hash = "6fe8036032f08d7ab99bd99ff4cc22c8"; +module.exports.hash = "53fcb8011d3ec2a23568f7adea0f9bcf"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .get('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2') + .get('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2') .query(true) - .reply(200, {"id":"19:0771a8d8c00d4329b664c4237e41bf0c@thread.v2","topic":"test topic","createdOn":"2020-12-30T21:14:24Z","createdBy":"8:acs:188d4cea-0a9b-4840-8fdc-7a5c71fe9bd0_00000007-5562-1b5c-1db7-3a3a0d0043a2"}, [ + .reply(200, {"id":"19:883ce5bf892c47d6a7da73da6df31c7e@thread.v2","topic":"test topic","createdOn":"2021-01-13T02:06:47Z","createdBy":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000007-9960-7290-0e04-343a0d0011fe"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', - '86LzAH4CjUeaC5vLYEyUyQ.0', + 'Doum8VESeUO3ZiYQlcXvJw.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '264ms', + '69ms', 'X-Azure-Ref', - '0se3sXwAAAADPwviPJZFQSZFhO8taCub/WVZSMzBFREdFMDQxMABjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0t1X+XwAAAADC3uM+4lZ8T7GrGDmxZwiKV1NURURHRTA4MTkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:25 GMT' + 'Wed, 13 Jan 2021 02:06:47 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread_client.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread_client.js index 785c8059798d..c8d30a9e567e 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread_client.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_retrieves_a_thread_client.js @@ -1,5 +1,5 @@ let nock = require('nock'); -module.exports.hash = "927e8d313fb57a528a370d6861544f32"; +module.exports.hash = "29d94c2d90bde1cee9b41eb12c727bfa"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_a_message.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_a_message.js index 0d4a4c0e85f3..a4e8a5612dcd 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_a_message.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_a_message.js @@ -1,29 +1,29 @@ let nock = require('nock'); -module.exports.hash = "4ef54a833987be8d1884a033e0850755"; +module.exports.hash = "44a1a3fb76689a98de0cbdfbe9b12da6"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/messages', {"content":"content"}) + .post('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/messages', {"content":"content"}) .query(true) - .reply(201, {"id":"1609362866505"}, [ + .reply(201, {"id":"1610503608398"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'Location', - 'https://168.61.22.92/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c@thread.v2/messages/1609362866505', + 'https://13.64.171.212/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e@thread.v2/messages/1610503608398', 'MS-CV', - 'IsiphM151Ey/EhVxR9LZCg.0', + 'fmxawLbhrEG+fEaIVwsKJQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '378ms', + '261ms', 'X-Azure-Ref', - '0su3sXwAAAABg04r89Be9Spit2yZHeGUBWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0uFX+XwAAAADMcnMZIWzzQKdXRtCQYkZ7V1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:26 GMT' + 'Wed, 13 Jan 2021 02:06:48 GMT' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_read_receipt.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_read_receipt.js index b03a36197222..4fd9c524a1a5 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_read_receipt.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_read_receipt.js @@ -1,25 +1,25 @@ let nock = require('nock'); -module.exports.hash = "796065a7db069a243913c6c1dda765b2"; +module.exports.hash = "7bfeb93c91b865922918888b4e2a5ba3"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/readReceipts', {"chatMessageId":"1609362866505"}) + .post('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/readReceipts', {"chatMessageId":"1610503608398"}) .query(true) .reply(200, "", [ 'MS-CV', - 'ELk7Q82AjUC8qSICTUh2Gw.0', + 'rJu0zzvRnEqDC/9uJYDafA.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '489ms', + '85ms', 'X-Azure-Ref', - '0s+3sXwAAAAA23BQQbariTKqK7zKnG8uJWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0uFX+XwAAAAAOtqSAAN/YSom9vNuECw6bV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:27 GMT', + 'Wed, 13 Jan 2021 02:06:48 GMT', 'Content-Length', '0' ]); diff --git a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_typing_notification.js b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_typing_notification.js index e30d147e7259..db89503d1d48 100644 --- a/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_typing_notification.js +++ b/sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_sends_typing_notification.js @@ -1,25 +1,25 @@ let nock = require('nock'); -module.exports.hash = "29fe2507518b37de260ac15c2b37c2ef"; +module.exports.hash = "dbe5b264c11dbef1d4f15779defd44e9"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .post('/chat/threads/19%3A0771a8d8c00d4329b664c4237e41bf0c%40thread.v2/typing') + .post('/chat/threads/19%3A883ce5bf892c47d6a7da73da6df31c7e%40thread.v2/typing') .query(true) .reply(200, "", [ 'MS-CV', - '3TwqKRqz7EG7Xsar14bvPg.0', + 'Ahqv2QoFSkioNWlZp8rDAQ.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-09-21-preview2, 2020-11-01-preview3', 'X-Processing-Time', - '356ms', + '94ms', 'X-Azure-Ref', - '0su3sXwAAAAC6r9/7UYgGRp8NkUyGRkNaWVZSMzBFREdFMDQxNwBjYzkyNzU4ZC0wNWY3LTRhZDYtYWE1ZS0wZmE5NzE4ZDg5ODU=', + '0uFX+XwAAAABclQDZ89uGQYMcu/AjT7SfV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Wed, 30 Dec 2020 21:14:26 GMT', + 'Wed, 13 Jan 2021 02:06:48 GMT', 'Content-Length', '0' ]); diff --git a/sdk/communication/communication-chat/review/communication-chat.api.md b/sdk/communication/communication-chat/review/communication-chat.api.md index 35af8f32c73e..bed3c9eda8b4 100644 --- a/sdk/communication/communication-chat/review/communication-chat.api.md +++ b/sdk/communication/communication-chat/review/communication-chat.api.md @@ -17,16 +17,24 @@ import { PipelineOptions } from '@azure/core-http'; import { ReadReceiptReceivedEvent } from '@azure/communication-signaling'; import { TypingIndicatorReceivedEvent } from '@azure/communication-signaling'; +// @public +export interface AddChatParticipantsErrors { + invalidParticipants: (CommunicationError | null)[]; +} + // @public export interface AddChatParticipantsRequest extends Omit { participants: ChatParticipant[]; } -// Warning: (ae-forgotten-export) The symbol "AddChatParticipantsResult" needs to be exported by the entry point index.d.ts -// // @public export type AddChatParticipantsResponse = WithResponse; +// @public +export interface AddChatParticipantsResult { + errors?: AddChatParticipantsErrors; +} + // @public export type AddParticipantsOptions = OperationOptions; @@ -57,18 +65,27 @@ export interface ChatClientOptions extends PipelineOptions { } // @public -export interface ChatMessage extends Omit { +export interface ChatMessage extends Omit { + content?: ChatMessageContent; sender?: CommunicationUser; } +// @public (undocumented) +export interface ChatMessageContent extends Omit { + participants?: ChatParticipant[]; +} + // @public -export type ChatMessagePriority = "normal" | "high"; +export type ChatMessagePriority = string; // @public export interface ChatMessageReadReceipt extends Omit { readonly sender?: CommunicationUser; } +// @public +export type ChatMessageType = string; + // @public export interface ChatParticipant extends Omit { user: CommunicationUser; @@ -105,26 +122,42 @@ export interface ChatThreadClientOptions extends ChatClientOptions { // @public export interface ChatThreadInfo { deletedOn?: Date; - readonly id?: string; + id: string; readonly lastMessageReceivedOn?: Date; - topic?: string; + topic: string; +} + +// @public +export interface CommunicationError { + code: string; + readonly details?: (CommunicationError | null)[]; + readonly innerError?: CommunicationError | null; + message: string; + readonly target?: string; +} + +// @public +export interface CreateChatThreadErrors { + readonly invalidParticipants?: (CommunicationError | null)[]; } -// Warning: (ae-forgotten-export) The symbol "ChatCreateChatThreadOptionalParams" needs to be exported by the entry point index.d.ts -// // @public -export type CreateChatThreadOptions = ChatCreateChatThreadOptionalParams; +export type CreateChatThreadOptions = RestCreateChatThreadOptions; // @public export interface CreateChatThreadRequest extends Omit { participants: ChatParticipant[]; } -// Warning: (ae-forgotten-export) The symbol "CreateChatThreadResult" needs to be exported by the entry point index.d.ts -// // @public export type CreateChatThreadResponse = WithResponse; +// @public +export interface CreateChatThreadResult { + chatThread?: RestChatThread; + errors?: CreateChatThreadErrors; +} + // @public export type DeleteChatThreadOptions = OperationOptions; @@ -175,25 +208,32 @@ export interface RestAddChatParticipantsRequest { // @public export interface RestChatMessage { - // Warning: (ae-forgotten-export) The symbol "ChatMessageContent" needs to be exported by the entry point index.d.ts - content?: ChatMessageContent; - readonly createdOn?: Date; + content?: RestChatMessageContent; + createdOn: Date; deletedOn?: Date; editedOn?: Date; - readonly id?: string; - priority?: ChatMessagePriority; + id: string; + priority: ChatMessagePriority; senderDisplayName?: string; - readonly senderId?: string; - // Warning: (ae-forgotten-export) The symbol "ChatMessageType" needs to be exported by the entry point index.d.ts - type?: ChatMessageType; - readonly version?: string; + senderId?: string; + sequenceId: string; + type: ChatMessageType; + version: string; +} + +// @public +export interface RestChatMessageContent { + initiator?: string; + message?: string; + participants?: RestChatParticipant[]; + topic?: string; } // @public export interface RestChatMessageReadReceipt { - readonly chatMessageId?: string; - readonly readOn?: Date; - readonly senderId?: string; + chatMessageId: string; + readOn: Date; + senderId: string; } // @public @@ -205,11 +245,16 @@ export interface RestChatParticipant { // @public export interface RestChatThread { - readonly createdBy?: string; - readonly createdOn?: Date; + createdBy: string; + createdOn: Date; deletedOn?: Date; - readonly id?: string; - topic?: string; + id: string; + topic: string; +} + +// @public +export interface RestCreateChatThreadOptions extends coreHttp.OperationOptions { + repeatabilityRequestID?: string; } // @public @@ -258,6 +303,7 @@ interface SendChatMessageRequest { content: string; priority?: ChatMessagePriority; senderDisplayName?: string; + type?: ChatMessageType; } export { SendChatMessageRequest as RestSendMessageOptions } @@ -269,7 +315,7 @@ export type SendChatMessageResponse = WithResponse; // @public export interface SendChatMessageResult { - readonly id?: string; + id: string; } // @public diff --git a/sdk/communication/communication-chat/src/chatClient.ts b/sdk/communication/communication-chat/src/chatClient.ts index 346965614a43..555d9cf8f9fa 100644 --- a/sdk/communication/communication-chat/src/chatClient.ts +++ b/sdk/communication/communication-chat/src/chatClient.ts @@ -17,7 +17,6 @@ import { } from "@azure/communication-signaling"; import { getSignalingClient } from "./signaling/signalingClient"; import { createCommunicationUserCredentialPolicy } from "./credential/communicationUserCredentialPolicy"; -import { Chat, ChatApiClient } from "./generated/src/chatApiClient"; import { InternalPipelineOptions, createPipelineFromOptions, @@ -46,10 +45,10 @@ import { attachHttpResponse, mapToChatParticipantRestModel } from "./models/mappers"; -import { ChatThreadInfo } from "./generated/src/models"; +import { ChatThreadInfo, ChatApiClient } from "./generated/src"; import { CreateChatThreadRequest } from "./models/requests"; -export { ChatThreadInfo } from "./generated/src/models"; +export { ChatThreadInfo } from "./generated/src"; /** * The client to do chat operations @@ -57,7 +56,8 @@ export { ChatThreadInfo } from "./generated/src/models"; export class ChatClient { private readonly tokenCredential: CommunicationUserCredential; private readonly clientOptions: ChatClientOptions; - private readonly api: Chat; + // private readonly api: Chat; + private readonly client: ChatApiClient; private readonly signalingClient: SignalingClient | undefined = undefined; private readonly emitter = new EventEmitter(); private isRealtimeNotificationsStarted: boolean = false; @@ -102,8 +102,7 @@ export class ChatClient { const authPolicy = createCommunicationUserCredentialPolicy(this.tokenCredential); const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); - const client = new ChatApiClient(this.url, pipeline); - this.api = client.chat; + this.client = new ChatApiClient(this.url, pipeline); this.signalingClient = getSignalingClient(credential, logger); } @@ -129,7 +128,7 @@ export class ChatClient { const { span, updatedOptions } = createSpan("ChatClient-CreateChatThread", options); try { - return await this.api.createChatThread( + return await this.client.chat.createChatThread( { topic: request.topic, participants: request.participants?.map((participant) => @@ -162,7 +161,7 @@ export class ChatClient { const { span, updatedOptions } = createSpan("ChatClient-GetChatThread", options); try { - const response = await this.api.getChatThread( + const response = await this.client.chat.getChatThread( threadId, operationOptionsToRequestOptionsBase(updatedOptions) ); @@ -185,7 +184,7 @@ export class ChatClient { ): AsyncIterableIterator { const requestOptions = operationOptionsToRequestOptionsBase(options); if (!continuationState.continuationToken) { - const currentSetResponse = await this.api.listChatThreads(requestOptions); + const currentSetResponse = await this.client.chat.listChatThreads(requestOptions); continuationState.continuationToken = currentSetResponse.nextLink; if (currentSetResponse.value) { yield currentSetResponse.value; @@ -193,7 +192,7 @@ export class ChatClient { } while (continuationState.continuationToken) { - const currentSetResponse = await this.api.listChatThreadsNext( + const currentSetResponse = await this.client.chat.listChatThreadsNext( continuationState.continuationToken, requestOptions ); @@ -258,7 +257,7 @@ export class ChatClient { const { span, updatedOptions } = createSpan("ChatClient-DeleteChatThread", options); try { - return await this.api.deleteChatThread( + return await this.client.chat.deleteChatThread( threadId, operationOptionsToRequestOptionsBase(updatedOptions) ); diff --git a/sdk/communication/communication-chat/src/chatThreadClient.ts b/sdk/communication/communication-chat/src/chatThreadClient.ts index eddf41d58d77..11f4fd5cc7bc 100644 --- a/sdk/communication/communication-chat/src/chatThreadClient.ts +++ b/sdk/communication/communication-chat/src/chatThreadClient.ts @@ -5,7 +5,6 @@ import { logger } from "./models/logger"; import { SDK_VERSION } from "./constants"; import { CommunicationUser, CommunicationUserCredential } from "@azure/communication-common"; import { createCommunicationUserCredentialPolicy } from "./credential/communicationUserCredentialPolicy"; -import { ChatApiClient, ChatThread } from "./generated/src/chatApiClient"; import { InternalPipelineOptions, createPipelineFromOptions, @@ -15,8 +14,8 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { CanonicalCode } from "@opentelemetry/api"; import { createSpan } from "./tracing"; import { SendMessageRequest, AddChatParticipantsRequest } from "./models/requests"; -import { AddChatParticipantsResult, SendReadReceiptRequest } from "./generated/src/models"; -import { OperationResponse } from "./models/models"; +import { ChatApiClient, AddChatParticipantsResult, SendReadReceiptRequest } from "./generated/src"; +import { ListPageSettings, OperationResponse } from "./models/models"; import { ChatThreadClientOptions, SendMessageOptions, @@ -37,7 +36,6 @@ import { ChatParticipant, GetChatMessageResponse, ChatMessageReadReceipt, - ListPageSettings, SendChatMessageResponse } from "./models/models"; import { @@ -62,7 +60,7 @@ export class ChatThreadClient { readonly threadId: string; private readonly tokenCredential: CommunicationUserCredential; - private readonly api: ChatThread; + private readonly client: ChatApiClient; private disposed = false; private timeOfLastTypingRequest: Date | undefined = undefined; @@ -101,8 +99,7 @@ export class ChatThreadClient { const authPolicy = createCommunicationUserCredentialPolicy(this.tokenCredential); const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); - const client = new ChatApiClient(this.url, pipeline); - this.api = client.chatThread; + this.client = new ChatApiClient(this.url, pipeline); } /** @@ -113,7 +110,7 @@ export class ChatThreadClient { const { span, updatedOptions } = createSpan("ChatThreadClient-UpdateThread", options); try { - return await this.api.updateChatThread( + return await this.client.chatThread.updateChatThread( this.threadId, { topic: options.topic }, operationOptionsToRequestOptionsBase(updatedOptions) @@ -145,7 +142,7 @@ export class ChatThreadClient { // reset typing notification clock this.timeOfLastTypingRequest = undefined; - return await this.api.sendChatMessage( + return await this.client.chatThread.sendChatMessage( this.threadId, { ...request, ...options }, operationOptionsToRequestOptionsBase(updatedOptions) @@ -174,7 +171,7 @@ export class ChatThreadClient { const { span, updatedOptions } = createSpan("ChatThreadClient-GetMessage", options); try { - const response = await this.api.getChatMessage( + const response = await this.client.chatThread.getChatMessage( this.threadId, messageId, operationOptionsToRequestOptionsBase(updatedOptions) @@ -198,7 +195,10 @@ export class ChatThreadClient { ): AsyncIterableIterator { const requestOptions = operationOptionsToRequestOptionsBase(options); if (!pageSettings.continuationToken) { - const currentSetResponse = await this.api.listChatMessages(this.threadId, requestOptions); + const currentSetResponse = await this.client.chatThread.listChatMessages( + this.threadId, + requestOptions + ); pageSettings.continuationToken = currentSetResponse.nextLink; if (currentSetResponse.value) { yield currentSetResponse.value.map(mapToChatMessageSdkModel, this); @@ -206,7 +206,7 @@ export class ChatThreadClient { } while (pageSettings.continuationToken) { - const currentSetResponse = await this.api.listChatMessagesNext( + const currentSetResponse = await this.client.chatThread.listChatMessagesNext( this.threadId, pageSettings.continuationToken, requestOptions @@ -270,7 +270,7 @@ export class ChatThreadClient { const { span, updatedOptions } = createSpan("ChatThreadClient-DeleteMessage", options); try { - return await this.api.deleteChatMessage( + return await this.client.chatThread.deleteChatMessage( this.threadId, messageId, operationOptionsToRequestOptionsBase(updatedOptions) @@ -298,7 +298,7 @@ export class ChatThreadClient { const { span, updatedOptions } = createSpan("ChatThreadClient-UpdateMessage", options); try { - return await this.api.updateChatMessage( + return await this.client.chatThread.updateChatMessage( this.threadId, messageId, options, @@ -327,7 +327,7 @@ export class ChatThreadClient { const { span, updatedOptions } = createSpan("ChatThreadClient-AddParticipants", options); try { - return await this.api.addChatParticipants( + return await this.client.chatThread.addChatParticipants( this.threadId, mapToAddChatParticipantsRequestRestModel(request), operationOptionsToRequestOptionsBase(updatedOptions) @@ -349,7 +349,10 @@ export class ChatThreadClient { ): AsyncIterableIterator { const requestOptions = operationOptionsToRequestOptionsBase(options); if (!continuationState.continuationToken) { - const currentSetResponse = await this.api.listChatParticipants(this.threadId, requestOptions); + const currentSetResponse = await this.client.chatThread.listChatParticipants( + this.threadId, + requestOptions + ); continuationState.continuationToken = currentSetResponse.nextLink; if (currentSetResponse.value) { yield currentSetResponse.value.map(mapToChatParticipantSdkModel, this); @@ -357,7 +360,7 @@ export class ChatThreadClient { } while (continuationState.continuationToken) { - const currentSetResponse = await this.api.listChatParticipantsNext( + const currentSetResponse = await this.client.chatThread.listChatParticipantsNext( this.threadId, continuationState.continuationToken, requestOptions @@ -425,7 +428,7 @@ export class ChatThreadClient { const { span, updatedOptions } = createSpan("ChatThreadClient-RemoveParticipant", options); try { - return await this.api.removeChatParticipant( + return await this.client.chatThread.removeChatParticipant( this.threadId, participant.communicationUserId, operationOptionsToRequestOptionsBase(updatedOptions) @@ -455,7 +458,7 @@ export class ChatThreadClient { try { const dateNow = new Date(); if (this.canPostTypingNotification(dateNow)) { - await this.api.sendTypingNotification( + await this.client.chatThread.sendTypingNotification( this.threadId, operationOptionsToRequestOptionsBase(updatedOptions) ); @@ -490,7 +493,7 @@ export class ChatThreadClient { const { span, updatedOptions } = createSpan("ChatThreadClient-SendReadReceipt", options); try { - return await this.api.sendChatReadReceipt( + return await this.client.chatThread.sendChatReadReceipt( this.threadId, request, operationOptionsToRequestOptionsBase(updatedOptions) @@ -512,7 +515,10 @@ export class ChatThreadClient { ): AsyncIterableIterator { const requestOptions = operationOptionsToRequestOptionsBase(options); if (!continuationState.continuationToken) { - const currentSetResponse = await this.api.listChatReadReceipts(this.threadId, requestOptions); + const currentSetResponse = await this.client.chatThread.listChatReadReceipts( + this.threadId, + requestOptions + ); continuationState.continuationToken = currentSetResponse.nextLink; if (currentSetResponse.value) { yield currentSetResponse.value.map(mapToReadReceiptSdkModel, this); @@ -520,7 +526,7 @@ export class ChatThreadClient { } while (continuationState.continuationToken) { - const currentSetResponse = await this.api.listChatReadReceiptsNext( + const currentSetResponse = await this.client.chatThread.listChatReadReceiptsNext( this.threadId, continuationState.continuationToken, requestOptions diff --git a/sdk/communication/communication-chat/src/generated/src/chatApiClient.ts b/sdk/communication/communication-chat/src/generated/src/chatApiClient.ts index b352075eac8c..9763e0db47b1 100644 --- a/sdk/communication/communication-chat/src/generated/src/chatApiClient.ts +++ b/sdk/communication/communication-chat/src/generated/src/chatApiClient.ts @@ -6,13 +6,11 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as operations from "./operations"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; +import { ChatThread, Chat } from "./operations"; import { ChatApiClientContext } from "./chatApiClientContext"; import { ChatApiClientOptionalParams } from "./models"; -class ChatApiClient extends ChatApiClientContext { +export class ChatApiClient extends ChatApiClientContext { /** * Initializes a new instance of the ChatApiClient class. * @param endpoint The endpoint of the Azure Communication resource. @@ -20,15 +18,10 @@ class ChatApiClient extends ChatApiClientContext { */ constructor(endpoint: string, options?: ChatApiClientOptionalParams) { super(endpoint, options); - this.chatThread = new operations.ChatThread(this); - this.chat = new operations.Chat(this); + this.chatThread = new ChatThread(this); + this.chat = new Chat(this); } - chatThread: operations.ChatThread; - chat: operations.Chat; + chatThread: ChatThread; + chat: Chat; } - -// Operation Specifications - -export { ChatApiClient, ChatApiClientContext, Models as ChatApiModels, Mappers as ChatApiMappers }; -export * from "./operations"; diff --git a/sdk/communication/communication-chat/src/generated/src/index.ts b/sdk/communication/communication-chat/src/generated/src/index.ts new file mode 100644 index 000000000000..89e0cfaf6b86 --- /dev/null +++ b/sdk/communication/communication-chat/src/generated/src/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./models"; +export { ChatApiClient } from "./chatApiClient"; +export { ChatApiClientContext } from "./chatApiClientContext"; diff --git a/sdk/communication/communication-chat/src/generated/src/models/index.ts b/sdk/communication/communication-chat/src/generated/src/models/index.ts index ec120af898ce..3ad2962bfab9 100644 --- a/sdk/communication/communication-chat/src/generated/src/models/index.ts +++ b/sdk/communication/communication-chat/src/generated/src/models/index.ts @@ -8,774 +8,517 @@ import * as coreHttp from "@azure/core-http"; -/** - * A paged collection of chat message read receipts. - */ +/** A paged collection of chat message read receipts. */ export interface ChatMessageReadReceiptsCollection { - /** - * Collection of chat message read receipts. - */ - readonly value?: ChatMessageReadReceipt[]; + /** Collection of chat message read receipts. */ + value: ChatMessageReadReceipt[]; /** * If there are more chat message read receipts that can be retrieved, the next link will be populated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nextLink?: string; } -/** - * A chat message read receipt indicates the time a chat message was read by a recipient. - */ +/** A chat message read receipt indicates the time a chat message was read by a recipient. */ export interface ChatMessageReadReceipt { - /** - * Id of the participant who read the message. - */ - readonly senderId?: string; - /** - * Id of the chat message that has been read. This id is generated by the server. - */ - readonly chatMessageId?: string; - /** - * The time at which the message was read. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ - readonly readOn?: Date; + /** Id of the participant who read the message. */ + senderId: string; + /** Id of the chat message that has been read. This id is generated by the server. */ + chatMessageId: string; + /** The time at which the message was read. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ + readOn: Date; } -/** - * Error encountered while performing an operation. - */ -export interface ErrorModel { - /** - * Error code. - */ - readonly code?: string; +/** The Communication Services error. */ +export interface CommunicationErrorResponse { + /** The Communication Services error. */ + error: CommunicationError | null; +} + +/** The Communication Services error. */ +export interface CommunicationError { + /** The error code. */ + code: string; + /** The error message. */ + message: string; /** - * Description of the error. + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly target?: string; /** - * If applicable, would be used to indicate the property causing the error. + * Further details about specific errors that led to this error. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly target?: string; + readonly details?: (CommunicationError | null)[]; /** - * If applicable, inner errors would be returned for more details on the error. + * The inner error if any. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly innerErrors?: ErrorModel[]; + readonly innerError?: CommunicationError | null; } -/** - * Request payload for sending a read receipt. - */ +/** Request payload for sending a read receipt. */ export interface SendReadReceiptRequest { - /** - * Id of the latest chat message read by the user. - */ + /** Id of the latest chat message read by the user. */ chatMessageId: string; } -/** - * Details of the message to send. - */ +/** Details of the message to send. */ export interface SendChatMessageRequest { - /** - * The chat message priority. - */ + /** The chat message priority. */ priority?: ChatMessagePriority; - /** - * Chat message content. - */ + /** Chat message content. */ content: string; - /** - * The display name of the chat message sender. This property is used to populate sender name for push notifications. - */ + /** The display name of the chat message sender. This property is used to populate sender name for push notifications. */ senderDisplayName?: string; + /** The chat message type. */ + type?: ChatMessageType; } -/** - * Result of the send message operation. - */ +/** Result of the send message operation. */ export interface SendChatMessageResult { - /** - * A server-generated message id. - */ - readonly id?: string; + /** A server-generated message id. */ + id: string; } -/** - * Collection of chat messages for a particular chat thread. - */ +/** Collection of chat messages for a particular chat thread. */ export interface ChatMessagesCollection { - /** - * Collection of chat messages. - */ - readonly value?: ChatMessage[]; + /** Collection of chat messages. */ + value: ChatMessage[]; /** * If there are more chat messages that can be retrieved, the next link will be populated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nextLink?: string; } -/** - * Chat message. - */ +/** Chat message. */ export interface ChatMessage { - /** - * The id of the chat message. This id is server generated. - */ - readonly id?: string; - /** - * The chat message type. - */ - type?: ChatMessageType; - /** - * The chat message priority. - */ - priority?: ChatMessagePriority; - /** - * Version of the chat message. - */ - readonly version?: string; - /** - * Content of a chat message. - */ + /** The id of the chat message. This id is server generated. */ + id: string; + /** The chat message type. */ + type: ChatMessageType; + /** The chat message priority. */ + priority: ChatMessagePriority; + /** Sequence of the chat message in the conversation. */ + sequenceId: string; + /** Version of the chat message. */ + version: string; + /** Content of a chat message. */ content?: ChatMessageContent; - /** - * The display name of the chat message sender. This property is used to populate sender name for push notifications. - */ + /** The display name of the chat message sender. This property is used to populate sender name for push notifications. */ senderDisplayName?: string; - /** - * The timestamp when the chat message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ - readonly createdOn?: Date; - /** - * The id of the chat message sender. - */ - readonly senderId?: string; - /** - * The timestamp (if applicable) when the message was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** The timestamp when the chat message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ + createdOn: Date; + /** The id of the chat message sender. */ + senderId?: string; + /** The timestamp (if applicable) when the message was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ deletedOn?: Date; - /** - * The last timestamp (if applicable) when the message was edited. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** The last timestamp (if applicable) when the message was edited. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ editedOn?: Date; } -/** - * Content of a chat message. - */ +/** Content of a chat message. */ export interface ChatMessageContent { - /** - * Chat message content for type "text" or "html" messages. - */ + /** Chat message content for messages of types text or html. */ message?: string; - /** - * Chat message content for type "topicUpdated" messages. - */ + /** Chat message content for messages of type topicUpdated. */ topic?: string; - /** - * Chat message content for type "participantAdded" or "participantRemoved" messages. - */ + /** Chat message content for messages of types participantAdded or participantRemoved. */ participants?: ChatParticipant[]; - /** - * Chat message content for type "participantAdded" or "participantRemoved" messages. - */ + /** Chat message content for messages of types participantAdded or participantRemoved. */ initiator?: string; } -/** - * A participant of the chat thread. - */ +/** A participant of the chat thread. */ export interface ChatParticipant { - /** - * The id of the chat participant. - */ + /** The id of the chat participant. */ id: string; - /** - * Display name for the chat participant. - */ + /** Display name for the chat participant. */ displayName?: string; - /** - * Time from which the chat history is shared with the participant. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** Time from which the chat history is shared with the participant. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ shareHistoryTime?: Date; } -/** - * Request payload for updating a chat message. - */ +/** Request payload for updating a chat message. */ export interface UpdateChatMessageRequest { - /** - * Chat message content. - */ + /** Chat message content. */ content?: string; - /** - * The chat message priority. - */ + /** The chat message priority. */ priority?: ChatMessagePriority; } -/** - * Collection of participants belong to a particular thread. - */ +/** Collection of participants belong to a particular thread. */ export interface ChatParticipantsCollection { - /** - * Chat participants. - */ - value?: ChatParticipant[]; + /** Chat participants. */ + value: ChatParticipant[]; /** * If there are more chat participants that can be retrieved, the next link will be populated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nextLink?: string; } -/** - * Participants to be added to the thread. - */ +/** Participants to be added to the thread. */ export interface AddChatParticipantsRequest { - /** - * Participants to add to a chat thread. - */ + /** Participants to add to a chat thread. */ participants: ChatParticipant[]; } -/** - * Result of the add chat participants operation. - */ +/** Result of the add chat participants operation. */ export interface AddChatParticipantsResult { - /** - * Errors encountered during the addition of the chat participant to the chat thread. - */ + /** Errors encountered during the addition of the chat participant to the chat thread. */ errors?: AddChatParticipantsErrors; } -/** - * Errors encountered during the addition of the chat participant to the chat thread. - */ +/** Errors encountered during the addition of the chat participant to the chat thread. */ export interface AddChatParticipantsErrors { - /** - * The participants that failed to be added to the chat thread. - */ - readonly invalidParticipants?: ErrorModel[]; + /** The participants that failed to be added to the chat thread. */ + invalidParticipants: (CommunicationError | null)[]; } -/** - * Request payload for creating a chat thread. - */ +/** Request payload for creating a chat thread. */ export interface CreateChatThreadRequest { - /** - * The chat thread topic. - */ + /** The chat thread topic. */ topic: string; - /** - * Participants to be added to the chat thread. - */ + /** Participants to be added to the chat thread. */ participants: ChatParticipant[]; } -/** - * Result of the create chat thread operation. - */ +/** Result of the create chat thread operation. */ export interface CreateChatThreadResult { - /** - * Chat thread. - */ + /** Chat thread. */ chatThread?: ChatThread; - /** - * Errors encountered during the creation of the chat thread. - */ + /** Errors encountered during the creation of the chat thread. */ errors?: CreateChatThreadErrors; } -/** - * Chat thread. - */ +/** Chat thread. */ export interface ChatThread { - /** - * Chat thread id. - */ - readonly id?: string; - /** - * Chat thread topic. - */ - topic?: string; - /** - * The timestamp when the chat thread was created. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ - readonly createdOn?: Date; - /** - * Id of the chat thread owner. - */ - readonly createdBy?: string; - /** - * The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** Chat thread id. */ + id: string; + /** Chat thread topic. */ + topic: string; + /** The timestamp when the chat thread was created. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ + createdOn: Date; + /** Id of the chat thread owner. */ + createdBy: string; + /** The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ deletedOn?: Date; } -/** - * Errors encountered during the creation of the chat thread. - */ +/** Errors encountered during the creation of the chat thread. */ export interface CreateChatThreadErrors { /** * The participants that failed to be added to the chat thread. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invalidParticipants?: ErrorModel[]; + readonly invalidParticipants?: (CommunicationError | null)[]; } -/** - * Collection of chat threads. - */ +/** Collection of chat threads. */ export interface ChatThreadsInfoCollection { - /** - * Collection of chat threads. - */ - readonly value?: ChatThreadInfo[]; + /** Collection of chat threads. */ + value: ChatThreadInfo[]; /** * If there are more chat threads that can be retrieved, the next link will be populated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nextLink?: string; } -/** - * Summary information of a chat thread. - */ +/** Summary information of a chat thread. */ export interface ChatThreadInfo { - /** - * Chat thread id. - */ - readonly id?: string; - /** - * Chat thread topic. - */ - topic?: string; - /** - * The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** Chat thread id. */ + id: string; + /** Chat thread topic. */ + topic: string; + /** The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ deletedOn?: Date; /** * The timestamp when the last message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastMessageReceivedOn?: Date; } -/** - * Request payload for updating a chat thread. - */ +/** Request payload for updating a chat thread. */ export interface UpdateChatThreadRequest { - /** - * Chat thread topic. - */ + /** Chat thread topic. */ topic?: string; } +/** Known values of {@link ChatMessagePriority} that the service accepts. */ +export const enum KnownChatMessagePriority { + Normal = "normal", + High = "high" +} + /** - * Defines values for ChatMessagePriority. - */ -export type ChatMessagePriority = "normal" | "high"; -/** - * Defines values for ChatMessageType. + * Defines values for ChatMessagePriority. \ + * {@link KnownChatMessagePriority} can be used interchangeably with ChatMessagePriority, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **normal** \ + * **high** */ -export type ChatMessageType = - | "text" - | "html" - | "topicUpdated" - | "participantAdded" - | "participantRemoved"; +export type ChatMessagePriority = string; + +/** Known values of {@link ChatMessageType} that the service accepts. */ +export const enum KnownChatMessageType { + Text = "text", + Html = "html", + TopicUpdated = "topicUpdated", + ParticipantAdded = "participantAdded", + ParticipantRemoved = "participantRemoved" +} /** - * Optional parameters. + * Defines values for ChatMessageType. \ + * {@link KnownChatMessageType} can be used interchangeably with ChatMessageType, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **text** \ + * **html** \ + * **topicUpdated** \ + * **participantAdded** \ + * **participantRemoved** */ +export type ChatMessageType = string; + +/** Optional parameters. */ export interface ChatThreadListChatReadReceiptsOptionalParams extends coreHttp.OperationOptions { - /** - * The maximum number of chat message read receipts to be returned per page. - */ + /** The maximum number of chat message read receipts to be returned per page. */ maxPageSize?: number; - /** - * Skips chat message read receipts up to a specified position in response. - */ + /** Skips chat message read receipts up to a specified position in response. */ skip?: number; } -/** - * Contains response data for the listChatReadReceipts operation. - */ +/** Contains response data for the listChatReadReceipts operation. */ export type ChatThreadListChatReadReceiptsResponse = ChatMessageReadReceiptsCollection & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatMessageReadReceiptsCollection; }; }; -/** - * Contains response data for the sendChatMessage operation. - */ +/** Contains response data for the sendChatMessage operation. */ export type ChatThreadSendChatMessageResponse = SendChatMessageResult & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: SendChatMessageResult; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatThreadListChatMessagesOptionalParams extends coreHttp.OperationOptions { - /** - * The maximum number of messages to be returned per page. - */ + /** The maximum number of messages to be returned per page. */ maxPageSize?: number; - /** - * The earliest point in time to get messages up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** The earliest point in time to get messages up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ startTime?: Date; } -/** - * Contains response data for the listChatMessages operation. - */ +/** Contains response data for the listChatMessages operation. */ export type ChatThreadListChatMessagesResponse = ChatMessagesCollection & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatMessagesCollection; }; }; -/** - * Contains response data for the getChatMessage operation. - */ +/** Contains response data for the getChatMessage operation. */ export type ChatThreadGetChatMessageResponse = ChatMessage & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatMessage; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatThreadListChatParticipantsOptionalParams extends coreHttp.OperationOptions { - /** - * The maximum number of participants to be returned per page. - */ + /** The maximum number of participants to be returned per page. */ maxPageSize?: number; - /** - * Skips participants up to a specified position in response. - */ + /** Skips participants up to a specified position in response. */ skip?: number; } -/** - * Contains response data for the listChatParticipants operation. - */ +/** Contains response data for the listChatParticipants operation. */ export type ChatThreadListChatParticipantsResponse = ChatParticipantsCollection & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatParticipantsCollection; }; }; -/** - * Contains response data for the addChatParticipants operation. - */ +/** Contains response data for the addChatParticipants operation. */ export type ChatThreadAddChatParticipantsResponse = AddChatParticipantsResult & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: AddChatParticipantsResult; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatThreadListChatReadReceiptsNextOptionalParams extends coreHttp.OperationOptions { - /** - * The maximum number of chat message read receipts to be returned per page. - */ + /** The maximum number of chat message read receipts to be returned per page. */ maxPageSize?: number; - /** - * Skips chat message read receipts up to a specified position in response. - */ + /** Skips chat message read receipts up to a specified position in response. */ skip?: number; } -/** - * Contains response data for the listChatReadReceiptsNext operation. - */ +/** Contains response data for the listChatReadReceiptsNext operation. */ export type ChatThreadListChatReadReceiptsNextResponse = ChatMessageReadReceiptsCollection & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatMessageReadReceiptsCollection; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatThreadListChatMessagesNextOptionalParams extends coreHttp.OperationOptions { - /** - * The maximum number of messages to be returned per page. - */ + /** The maximum number of messages to be returned per page. */ maxPageSize?: number; - /** - * The earliest point in time to get messages up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** The earliest point in time to get messages up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ startTime?: Date; } -/** - * Contains response data for the listChatMessagesNext operation. - */ +/** Contains response data for the listChatMessagesNext operation. */ export type ChatThreadListChatMessagesNextResponse = ChatMessagesCollection & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatMessagesCollection; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatThreadListChatParticipantsNextOptionalParams extends coreHttp.OperationOptions { - /** - * The maximum number of participants to be returned per page. - */ + /** The maximum number of participants to be returned per page. */ maxPageSize?: number; - /** - * Skips participants up to a specified position in response. - */ + /** Skips participants up to a specified position in response. */ skip?: number; } -/** - * Contains response data for the listChatParticipantsNext operation. - */ +/** Contains response data for the listChatParticipantsNext operation. */ export type ChatThreadListChatParticipantsNextResponse = ChatParticipantsCollection & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatParticipantsCollection; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatCreateChatThreadOptionalParams extends coreHttp.OperationOptions { - /** - * If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-ID and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-ID is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. - */ + /** If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-ID and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-ID is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. */ repeatabilityRequestID?: string; } -/** - * Contains response data for the createChatThread operation. - */ +/** Contains response data for the createChatThread operation. */ export type ChatCreateChatThreadResponse = CreateChatThreadResult & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: CreateChatThreadResult; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatListChatThreadsOptionalParams extends coreHttp.OperationOptions { - /** - * The maximum number of chat threads returned per page. - */ + /** The maximum number of chat threads returned per page. */ maxPageSize?: number; - /** - * The earliest point in time to get chat threads up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** The earliest point in time to get chat threads up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ startTime?: Date; } -/** - * Contains response data for the listChatThreads operation. - */ +/** Contains response data for the listChatThreads operation. */ export type ChatListChatThreadsResponse = ChatThreadsInfoCollection & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatThreadsInfoCollection; }; }; -/** - * Contains response data for the getChatThread operation. - */ +/** Contains response data for the getChatThread operation. */ export type ChatGetChatThreadResponse = ChatThread & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatThread; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatListChatThreadsNextOptionalParams extends coreHttp.OperationOptions { - /** - * The maximum number of chat threads returned per page. - */ + /** The maximum number of chat threads returned per page. */ maxPageSize?: number; - /** - * The earliest point in time to get chat threads up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. - */ + /** The earliest point in time to get chat threads up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */ startTime?: Date; } -/** - * Contains response data for the listChatThreadsNext operation. - */ +/** Contains response data for the listChatThreadsNext operation. */ export type ChatListChatThreadsNextResponse = ChatThreadsInfoCollection & { - /** - * The underlying HTTP response. - */ + /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ + /** The response body as text (string format) */ bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ + /** The response body as parsed JSON or XML */ parsedBody: ChatThreadsInfoCollection; }; }; -/** - * Optional parameters. - */ +/** Optional parameters. */ export interface ChatApiClientOptionalParams extends coreHttp.ServiceClientOptions { - /** - * Api Version - */ + /** Api Version */ apiVersion?: string; - /** - * Overrides client endpoint. - */ + /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/communication/communication-chat/src/generated/src/models/mappers.ts b/sdk/communication/communication-chat/src/generated/src/models/mappers.ts index bc22d9beda50..b94a788f09e0 100644 --- a/sdk/communication/communication-chat/src/generated/src/models/mappers.ts +++ b/sdk/communication/communication-chat/src/generated/src/models/mappers.ts @@ -15,11 +15,14 @@ export const ChatMessageReadReceiptsCollection: coreHttp.CompositeMapper = { modelProperties: { value: { serializedName: "value", - readOnly: true, + required: true, type: { name: "Sequence", element: { - type: { name: "Composite", className: "ChatMessageReadReceipt" } + type: { + name: "Composite", + className: "ChatMessageReadReceipt" + } } } }, @@ -41,21 +44,21 @@ export const ChatMessageReadReceipt: coreHttp.CompositeMapper = { modelProperties: { senderId: { serializedName: "senderId", - readOnly: true, + required: true, type: { name: "String" } }, chatMessageId: { serializedName: "chatMessageId", - readOnly: true, + required: true, type: { name: "String" } }, readOn: { serializedName: "readOn", - readOnly: true, + required: true, type: { name: "DateTime" } @@ -64,21 +67,37 @@ export const ChatMessageReadReceipt: coreHttp.CompositeMapper = { } }; -export const ErrorModel: coreHttp.CompositeMapper = { +export const CommunicationErrorResponse: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "ErrorModel", + className: "CommunicationErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "CommunicationError" + } + } + } + } +}; + +export const CommunicationError: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CommunicationError", modelProperties: { code: { serializedName: "code", - readOnly: true, + required: true, type: { name: "String" } }, message: { serializedName: "message", - readOnly: true, + required: true, type: { name: "String" } @@ -90,12 +109,24 @@ export const ErrorModel: coreHttp.CompositeMapper = { name: "String" } }, - innerErrors: { - serializedName: "innerErrors", + details: { + serializedName: "details", readOnly: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "ErrorModel" } } + element: { + type: { + name: "Composite", + className: "CommunicationError" + } + } + } + }, + innerError: { + serializedName: "innererror", + type: { + name: "Composite", + className: "CommunicationError" } } } @@ -141,6 +172,12 @@ export const SendChatMessageRequest: coreHttp.CompositeMapper = { type: { name: "String" } + }, + type: { + serializedName: "type", + type: { + name: "String" + } } } } @@ -153,7 +190,7 @@ export const SendChatMessageResult: coreHttp.CompositeMapper = { modelProperties: { id: { serializedName: "id", - readOnly: true, + required: true, type: { name: "String" } @@ -169,10 +206,15 @@ export const ChatMessagesCollection: coreHttp.CompositeMapper = { modelProperties: { value: { serializedName: "value", - readOnly: true, + required: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "ChatMessage" } } + element: { + type: { + name: "Composite", + className: "ChatMessage" + } + } } }, nextLink: { @@ -193,26 +235,35 @@ export const ChatMessage: coreHttp.CompositeMapper = { modelProperties: { id: { serializedName: "id", - readOnly: true, + required: true, type: { name: "String" } }, type: { serializedName: "type", + required: true, type: { name: "String" } }, priority: { serializedName: "priority", + required: true, + type: { + name: "String" + } + }, + sequenceId: { + serializedName: "sequenceId", + required: true, type: { name: "String" } }, version: { serializedName: "version", - readOnly: true, + required: true, type: { name: "String" } @@ -232,14 +283,13 @@ export const ChatMessage: coreHttp.CompositeMapper = { }, createdOn: { serializedName: "createdOn", - readOnly: true, + required: true, type: { name: "DateTime" } }, senderId: { serializedName: "senderId", - readOnly: true, type: { name: "String" } @@ -281,7 +331,12 @@ export const ChatMessageContent: coreHttp.CompositeMapper = { serializedName: "participants", type: { name: "Sequence", - element: { type: { name: "Composite", className: "ChatParticipant" } } + element: { + type: { + name: "Composite", + className: "ChatParticipant" + } + } } }, initiator: { @@ -350,9 +405,15 @@ export const ChatParticipantsCollection: coreHttp.CompositeMapper = { modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "ChatParticipant" } } + element: { + type: { + name: "Composite", + className: "ChatParticipant" + } + } } }, nextLink: { @@ -376,7 +437,12 @@ export const AddChatParticipantsRequest: coreHttp.CompositeMapper = { required: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "ChatParticipant" } } + element: { + type: { + name: "Composite", + className: "ChatParticipant" + } + } } } } @@ -406,10 +472,15 @@ export const AddChatParticipantsErrors: coreHttp.CompositeMapper = { modelProperties: { invalidParticipants: { serializedName: "invalidParticipants", - readOnly: true, + required: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "ErrorModel" } } + element: { + type: { + name: "Composite", + className: "CommunicationError" + } + } } } } @@ -433,7 +504,12 @@ export const CreateChatThreadRequest: coreHttp.CompositeMapper = { required: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "ChatParticipant" } } + element: { + type: { + name: "Composite", + className: "ChatParticipant" + } + } } } } @@ -470,27 +546,28 @@ export const ChatThread: coreHttp.CompositeMapper = { modelProperties: { id: { serializedName: "id", - readOnly: true, + required: true, type: { name: "String" } }, topic: { serializedName: "topic", + required: true, type: { name: "String" } }, createdOn: { serializedName: "createdOn", - readOnly: true, + required: true, type: { name: "DateTime" } }, createdBy: { serializedName: "createdBy", - readOnly: true, + required: true, type: { name: "String" } @@ -515,7 +592,12 @@ export const CreateChatThreadErrors: coreHttp.CompositeMapper = { readOnly: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "ErrorModel" } } + element: { + type: { + name: "Composite", + className: "CommunicationError" + } + } } } } @@ -529,10 +611,15 @@ export const ChatThreadsInfoCollection: coreHttp.CompositeMapper = { modelProperties: { value: { serializedName: "value", - readOnly: true, + required: true, type: { name: "Sequence", - element: { type: { name: "Composite", className: "ChatThreadInfo" } } + element: { + type: { + name: "Composite", + className: "ChatThreadInfo" + } + } } }, nextLink: { @@ -553,13 +640,14 @@ export const ChatThreadInfo: coreHttp.CompositeMapper = { modelProperties: { id: { serializedName: "id", - readOnly: true, + required: true, type: { name: "String" } }, topic: { serializedName: "topic", + required: true, type: { name: "String" } diff --git a/sdk/communication/communication-chat/src/generated/src/models/parameters.ts b/sdk/communication/communication-chat/src/generated/src/models/parameters.ts index 2ac85a8ace65..56b1145e51de 100644 --- a/sdk/communication/communication-chat/src/generated/src/models/parameters.ts +++ b/sdk/communication/communication-chat/src/generated/src/models/parameters.ts @@ -7,9 +7,9 @@ */ import { + OperationParameter, OperationURLParameter, - OperationQueryParameter, - OperationParameter + OperationQueryParameter } from "@azure/core-http"; import { SendReadReceiptRequest as SendReadReceiptRequestMapper, @@ -20,6 +20,18 @@ import { CreateChatThreadRequest as CreateChatThreadRequestMapper } from "../models/mappers"; +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + export const endpoint: OperationURLParameter = { parameterPath: "endpoint", mapper: { diff --git a/sdk/communication/communication-chat/src/generated/src/operations/chat.ts b/sdk/communication/communication-chat/src/generated/src/operations/chat.ts index 648fde16d22a..156d729cab9e 100644 --- a/sdk/communication/communication-chat/src/generated/src/operations/chat.ts +++ b/sdk/communication/communication-chat/src/generated/src/operations/chat.ts @@ -21,9 +21,7 @@ import { ChatListChatThreadsNextResponse } from "../models"; -/** - * Class representing a Chat. - */ +/** Class representing a Chat. */ export class Chat { private readonly client: ChatApiClient; @@ -44,11 +42,12 @@ export class Chat { createChatThreadRequest: CreateChatThreadRequest, options?: ChatCreateChatThreadOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + createChatThreadRequest, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { createChatThreadRequest, options: operationOptions }, + operationArguments, createChatThreadOperationSpec ) as Promise; } @@ -60,11 +59,11 @@ export class Chat { listChatThreads( options?: ChatListChatThreadsOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { options: operationOptions }, + operationArguments, listChatThreadsOperationSpec ) as Promise; } @@ -78,11 +77,12 @@ export class Chat { chatThreadId: string, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, options: operationOptions }, + operationArguments, getChatThreadOperationSpec ) as Promise; } @@ -96,11 +96,12 @@ export class Chat { chatThreadId: string, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, options: operationOptions }, + operationArguments, deleteChatThreadOperationSpec ) as Promise; } @@ -114,17 +115,17 @@ export class Chat { nextLink: string, options?: ChatListChatThreadsNextOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { nextLink, options: operationOptions }, + operationArguments, listChatThreadsNextOperationSpec ) as Promise; } } // Operation Specifications - const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); const createChatThreadOperationSpec: coreHttp.OperationSpec = { @@ -135,22 +136,26 @@ const createChatThreadOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.CreateChatThreadResult }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, requestBody: Parameters.createChatThreadRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint], - headerParameters: [Parameters.contentType, Parameters.repeatabilityRequestID], + headerParameters: [Parameters.accept, Parameters.contentType, Parameters.repeatabilityRequestID], mediaType: "json", serializer }; @@ -162,20 +167,25 @@ const listChatThreadsOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatThreadsInfoCollection }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.maxPageSize, Parameters.apiVersion, Parameters.startTime], urlParameters: [Parameters.endpoint], + headerParameters: [Parameters.accept], serializer }; const getChatThreadOperationSpec: coreHttp.OperationSpec = { @@ -186,20 +196,25 @@ const getChatThreadOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatThread }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], + headerParameters: [Parameters.accept], serializer }; const deleteChatThreadOperationSpec: coreHttp.OperationSpec = { @@ -208,20 +223,25 @@ const deleteChatThreadOperationSpec: coreHttp.OperationSpec = { responses: { 204: {}, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], + headerParameters: [Parameters.accept], serializer }; const listChatThreadsNextOperationSpec: coreHttp.OperationSpec = { @@ -232,19 +252,24 @@ const listChatThreadsNextOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatThreadsInfoCollection }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.maxPageSize, Parameters.apiVersion, Parameters.startTime], urlParameters: [Parameters.endpoint, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/communication/communication-chat/src/generated/src/operations/chatThread.ts b/sdk/communication/communication-chat/src/generated/src/operations/chatThread.ts index f84d75c2a0bc..152c4c358418 100644 --- a/sdk/communication/communication-chat/src/generated/src/operations/chatThread.ts +++ b/sdk/communication/communication-chat/src/generated/src/operations/chatThread.ts @@ -33,9 +33,7 @@ import { ChatThreadListChatParticipantsNextResponse } from "../models"; -/** - * Class representing a ChatThread. - */ +/** Class representing a ChatThread. */ export class ChatThread { private readonly client: ChatApiClient; @@ -56,11 +54,12 @@ export class ChatThread { chatThreadId: string, options?: ChatThreadListChatReadReceiptsOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, options: operationOptions }, + operationArguments, listChatReadReceiptsOperationSpec ) as Promise; } @@ -76,11 +75,13 @@ export class ChatThread { sendReadReceiptRequest: SendReadReceiptRequest, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + sendReadReceiptRequest, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, sendReadReceiptRequest, options: operationOptions }, + operationArguments, sendChatReadReceiptOperationSpec ) as Promise; } @@ -96,11 +97,13 @@ export class ChatThread { sendChatMessageRequest: SendChatMessageRequest, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + sendChatMessageRequest, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, sendChatMessageRequest, options: operationOptions }, + operationArguments, sendChatMessageOperationSpec ) as Promise; } @@ -114,11 +117,12 @@ export class ChatThread { chatThreadId: string, options?: ChatThreadListChatMessagesOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, options: operationOptions }, + operationArguments, listChatMessagesOperationSpec ) as Promise; } @@ -134,11 +138,13 @@ export class ChatThread { chatMessageId: string, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + chatMessageId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, chatMessageId, options: operationOptions }, + operationArguments, getChatMessageOperationSpec ) as Promise; } @@ -156,16 +162,14 @@ export class ChatThread { updateChatMessageRequest: UpdateChatMessageRequest, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + chatMessageId, + updateChatMessageRequest, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { - chatThreadId, - chatMessageId, - updateChatMessageRequest, - options: operationOptions - }, + operationArguments, updateChatMessageOperationSpec ) as Promise; } @@ -181,11 +185,13 @@ export class ChatThread { chatMessageId: string, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + chatMessageId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, chatMessageId, options: operationOptions }, + operationArguments, deleteChatMessageOperationSpec ) as Promise; } @@ -199,11 +205,12 @@ export class ChatThread { chatThreadId: string, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, options: operationOptions }, + operationArguments, sendTypingNotificationOperationSpec ) as Promise; } @@ -217,11 +224,12 @@ export class ChatThread { chatThreadId: string, options?: ChatThreadListChatParticipantsOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, options: operationOptions }, + operationArguments, listChatParticipantsOperationSpec ) as Promise; } @@ -237,11 +245,13 @@ export class ChatThread { chatParticipantId: string, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + chatParticipantId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, chatParticipantId, options: operationOptions }, + operationArguments, removeChatParticipantOperationSpec ) as Promise; } @@ -257,11 +267,13 @@ export class ChatThread { addChatParticipantsRequest: AddChatParticipantsRequest, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + addChatParticipantsRequest, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, addChatParticipantsRequest, options: operationOptions }, + operationArguments, addChatParticipantsOperationSpec ) as Promise; } @@ -277,11 +289,13 @@ export class ChatThread { updateChatThreadRequest: UpdateChatThreadRequest, options?: coreHttp.OperationOptions ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + updateChatThreadRequest, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, updateChatThreadRequest, options: operationOptions }, + operationArguments, updateChatThreadOperationSpec ) as Promise; } @@ -297,11 +311,13 @@ export class ChatThread { nextLink: string, options?: ChatThreadListChatReadReceiptsNextOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, nextLink, options: operationOptions }, + operationArguments, listChatReadReceiptsNextOperationSpec ) as Promise; } @@ -317,11 +333,13 @@ export class ChatThread { nextLink: string, options?: ChatThreadListChatMessagesNextOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, nextLink, options: operationOptions }, + operationArguments, listChatMessagesNextOperationSpec ) as Promise; } @@ -337,17 +355,18 @@ export class ChatThread { nextLink: string, options?: ChatThreadListChatParticipantsNextOptionalParams ): Promise { - const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( - options || {} - ); + const operationArguments: coreHttp.OperationArguments = { + chatThreadId, + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; return this.client.sendOperationRequest( - { chatThreadId, nextLink, options: operationOptions }, + operationArguments, listChatParticipantsNextOperationSpec ) as Promise; } } // Operation Specifications - const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); const listChatReadReceiptsOperationSpec: coreHttp.OperationSpec = { @@ -358,20 +377,25 @@ const listChatReadReceiptsOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatMessageReadReceiptsCollection }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.maxPageSize, Parameters.skip, Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], + headerParameters: [Parameters.accept], serializer }; const sendChatReadReceiptOperationSpec: coreHttp.OperationSpec = { @@ -380,22 +404,26 @@ const sendChatReadReceiptOperationSpec: coreHttp.OperationSpec = { responses: { 200: {}, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, requestBody: Parameters.sendReadReceiptRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], - headerParameters: [Parameters.contentType], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -407,22 +435,26 @@ const sendChatMessageOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.SendChatMessageResult }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, requestBody: Parameters.sendChatMessageRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], - headerParameters: [Parameters.contentType], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -434,20 +466,25 @@ const listChatMessagesOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatMessagesCollection }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.maxPageSize, Parameters.apiVersion, Parameters.startTime], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], + headerParameters: [Parameters.accept], serializer }; const getChatMessageOperationSpec: coreHttp.OperationSpec = { @@ -458,20 +495,25 @@ const getChatMessageOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatMessage }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId, Parameters.chatMessageId], + headerParameters: [Parameters.accept], serializer }; const updateChatMessageOperationSpec: coreHttp.OperationSpec = { @@ -480,22 +522,26 @@ const updateChatMessageOperationSpec: coreHttp.OperationSpec = { responses: { 204: {}, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, requestBody: Parameters.updateChatMessageRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId, Parameters.chatMessageId], - headerParameters: [Parameters.contentType1], + headerParameters: [Parameters.accept, Parameters.contentType1], mediaType: "json", serializer }; @@ -505,20 +551,25 @@ const deleteChatMessageOperationSpec: coreHttp.OperationSpec = { responses: { 204: {}, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId, Parameters.chatMessageId], + headerParameters: [Parameters.accept], serializer }; const sendTypingNotificationOperationSpec: coreHttp.OperationSpec = { @@ -527,20 +578,25 @@ const sendTypingNotificationOperationSpec: coreHttp.OperationSpec = { responses: { 200: {}, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], + headerParameters: [Parameters.accept], serializer }; const listChatParticipantsOperationSpec: coreHttp.OperationSpec = { @@ -551,20 +607,25 @@ const listChatParticipantsOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatParticipantsCollection }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.maxPageSize, Parameters.skip, Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], + headerParameters: [Parameters.accept], serializer }; const removeChatParticipantOperationSpec: coreHttp.OperationSpec = { @@ -573,20 +634,25 @@ const removeChatParticipantOperationSpec: coreHttp.OperationSpec = { responses: { 204: {}, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId, Parameters.chatParticipantId], + headerParameters: [Parameters.accept], serializer }; const addChatParticipantsOperationSpec: coreHttp.OperationSpec = { @@ -597,22 +663,26 @@ const addChatParticipantsOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.AddChatParticipantsResult }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, requestBody: Parameters.addChatParticipantsRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], - headerParameters: [Parameters.contentType], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -622,22 +692,26 @@ const updateChatThreadOperationSpec: coreHttp.OperationSpec = { responses: { 204: {}, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, requestBody: Parameters.updateChatThreadRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId], - headerParameters: [Parameters.contentType1], + headerParameters: [Parameters.accept, Parameters.contentType1], mediaType: "json", serializer }; @@ -649,20 +723,25 @@ const listChatReadReceiptsNextOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatMessageReadReceiptsCollection }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.maxPageSize, Parameters.skip, Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; const listChatMessagesNextOperationSpec: coreHttp.OperationSpec = { @@ -673,20 +752,25 @@ const listChatMessagesNextOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatMessagesCollection }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.maxPageSize, Parameters.apiVersion, Parameters.startTime], urlParameters: [Parameters.endpoint, Parameters.chatThreadId, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; const listChatParticipantsNextOperationSpec: coreHttp.OperationSpec = { @@ -697,19 +781,24 @@ const listChatParticipantsNextOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.ChatParticipantsCollection }, 401: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 403: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 429: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true }, 503: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.CommunicationErrorResponse, + isError: true } }, queryParameters: [Parameters.maxPageSize, Parameters.skip, Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.chatThreadId, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/communication/communication-chat/src/models/mappers.ts b/sdk/communication/communication-chat/src/models/mappers.ts index 3fa1403044d5..ef680b3038e7 100644 --- a/sdk/communication/communication-chat/src/models/mappers.ts +++ b/sdk/communication/communication-chat/src/models/mappers.ts @@ -9,6 +9,7 @@ import { ChatThread, ChatParticipant, ChatMessageReadReceipt, + ChatMessageContent, WithResponse } from "./models"; @@ -36,13 +37,29 @@ export const mapToAddChatParticipantsRequestRestModel = ( }; }; +export const mapToChatContentSdkModel = ( + content: RestModel.ChatMessageContent +): ChatMessageContent => { + const { participants, ...otherChatContents } = content; + return { + participants: content.participants?.map((participant) => + mapToChatParticipantSdkModel(participant) + ), + ...otherChatContents + }; +}; + /** * Mapping chat message REST model to chat message SDK model */ export const mapToChatMessageSdkModel = (chatMessage: RestModel.ChatMessage): ChatMessage => { - const model = { ...chatMessage, sender: { communicationUserId: chatMessage.senderId! } }; - delete (model as any).senderId; - return model; + const { content, senderId, ...otherChatMessage } = chatMessage; + const contentSdkModel = content ? mapToChatContentSdkModel(content) : undefined; + return { + sender: { communicationUserId: senderId! }, + content: contentSdkModel, + ...otherChatMessage + }; }; /** diff --git a/sdk/communication/communication-chat/src/models/models.ts b/sdk/communication/communication-chat/src/models/models.ts index 14fdbe6c4710..882480a98003 100644 --- a/sdk/communication/communication-chat/src/models/models.ts +++ b/sdk/communication/communication-chat/src/models/models.ts @@ -9,26 +9,49 @@ import { ChatThread as RestChatThread, ChatParticipant as RestChatParticipant, ChatMessageReadReceipt as RestChatMessageReadReceipt, + ChatMessageContent as RestChatMessageContent, + ChatMessageType, CreateChatThreadResult, - AddChatParticipantsResult + CreateChatThreadErrors, + AddChatParticipantsResult, + AddChatParticipantsErrors, + CommunicationError } from "../generated/src/models"; export { RestChatMessage, RestChatThread, RestChatParticipant, + RestChatMessageContent, RestChatMessageReadReceipt, - SendChatMessageResult + CreateChatThreadResult, + CreateChatThreadErrors, + SendChatMessageResult, + AddChatParticipantsResult, + AddChatParticipantsErrors, + ChatMessageType, + CommunicationError }; /** * An interface representing a chat message. */ -export interface ChatMessage extends Omit { +export interface ChatMessage extends Omit { /** * The CommunicationUser that identifies this chat message sender. */ sender?: CommunicationUser; + /** + * Content of a chat message. + */ + content?: ChatMessageContent; +} + +export interface ChatMessageContent extends Omit { + /** + * Chat message content for type "participantAdded" or "participantRemoved" messages. + */ + participants?: ChatParticipant[]; } /** diff --git a/sdk/communication/communication-chat/src/models/options.ts b/sdk/communication/communication-chat/src/models/options.ts index 74a37030ff74..8fea2dd84d91 100644 --- a/sdk/communication/communication-chat/src/models/options.ts +++ b/sdk/communication/communication-chat/src/models/options.ts @@ -13,6 +13,7 @@ import { } from "../generated/src/models"; export { + RestCreateChatThreadOptions, RestSendMessageOptions, RestUpdateMessageOptions, RestUpdateThreadOptions, diff --git a/sdk/communication/communication-chat/swagger/README.md b/sdk/communication/communication-chat/swagger/README.md index d26499053b61..e2fb49cc0ce4 100644 --- a/sdk/communication/communication-chat/swagger/README.md +++ b/sdk/communication/communication-chat/swagger/README.md @@ -15,7 +15,8 @@ input-file: https://int.chatgateway.trafficmanager.net/swagger/2020-11-01-previe model-date-time-as-string: false optional-response-headers: true use-extension: - "@autorest/typescript": "6.0.0-dev.20200623.2" + "@autorest/typescript": "6.0.0-dev.20210114.1" + "@autorest/modelerfour": "4.15.442" azure-arm: false add-credentials: false ``` diff --git a/sdk/communication/communication-chat/test/chatClient.spec.ts b/sdk/communication/communication-chat/test/chatClient.spec.ts index e97f9b9a754e..10eb3540912f 100644 --- a/sdk/communication/communication-chat/test/chatClient.spec.ts +++ b/sdk/communication/communication-chat/test/chatClient.spec.ts @@ -47,7 +47,10 @@ describe("ChatClient", function() { const request = { topic: "test topic", - participants: [{ user: testUser }, { user: testUser2 }] + participants: [ + { user: testUser, shareHistoryTime: new Date("2020-05-26T18:06:06Z") }, + { user: testUser2, shareHistoryTime: new Date("2020-05-26T18:06:06Z") } + ] }; const chatThreadResult = await chatClient.createChatThread(request); @@ -123,7 +126,9 @@ describe("ChatClient", function() { it("successfully adds participants", async function() { testUser3 = (await createTestUser()).user; - const request = { participants: [{ user: testUser3 }] }; + const request = { + participants: [{ user: testUser3, shareHistoryTime: new Date("2020-05-26T18:06:06Z") }] + }; await chatThreadClient.addParticipants(request); }); diff --git a/sdk/communication/communication-chat/test/chatThreadClient.mocked.spec.ts b/sdk/communication/communication-chat/test/chatThreadClient.mocked.spec.ts index da18d1784296..33f17667f7a9 100644 --- a/sdk/communication/communication-chat/test/chatThreadClient.mocked.spec.ts +++ b/sdk/communication/communication-chat/test/chatThreadClient.mocked.spec.ts @@ -97,14 +97,18 @@ describe("[Mocked] ChatThreadClient", async () => { const { sender: responseUser, + content: repsonseContent, _response, ...responseMessage } = await chatThreadClient.getMessage(mockMessage.id!); - const { senderId: expectedId, ...expectedMessage } = mockMessage; + const { senderId: expectedId, content: expectedContent, ...expectedMessage } = mockMessage; + const { participants: expectedParticipants, ...expectedContents } = expectedContent!; + const { participants: responseParticipants, ...repsonseContents } = repsonseContent!; sinon.assert.calledOnce(spy); assert.deepEqual(responseMessage, expectedMessage); assert.equal(responseUser?.communicationUserId, expectedId); + assert.deepEqual(repsonseContents, expectedContents); const request = spy.getCall(0).args[0]; @@ -128,11 +132,14 @@ describe("[Mocked] ChatThreadClient", async () => { let count = 0; for await (const message of chatThreadClient.listMessages()) { ++count; - const { sender: responseUser, ...responseMessage } = message; - const { senderId: expectedId, ...expectedMessage } = mockMessage; + const { sender: responseUser, content: repsonseContent, ...responseMessage } = message; + const { senderId: expectedId, content: expectedContent, ...expectedMessage } = mockMessage; + const { participants: expectedParticipants, ...expectedContents } = expectedContent!; + const { participants: responseParticipants, ...repsonseContents } = repsonseContent!; assert.deepEqual(responseMessage, expectedMessage); assert.equal(responseUser?.communicationUserId, expectedId); + assert.deepEqual(repsonseContents, expectedContents); } sinon.assert.calledOnce(spy); diff --git a/sdk/communication/communication-chat/test/utils/mockClient.ts b/sdk/communication/communication-chat/test/utils/mockClient.ts index e0ff30c72f3b..33b06032ebe8 100644 --- a/sdk/communication/communication-chat/test/utils/mockClient.ts +++ b/sdk/communication/communication-chat/test/utils/mockClient.ts @@ -51,9 +51,12 @@ export const mockMessage: RestModel.ChatMessage = { type: "text", priority: "normal", version: "version", + sequenceId: "sequenceId", content: { - message: "content" + message: "content", + topic: "topic" }, + createdOn: new Date("2020-06-26T18:06:06Z"), senderDisplayName: "senderDisplayName", senderId: "senderId", deletedOn: new Date("2020-06-26T18:06:06Z")