From 529f255c579c5448d4a80dd879bccf7c11c11638 Mon Sep 17 00:00:00 2001 From: Reza Jooyandeh Date: Thu, 23 Apr 2020 15:11:17 -0700 Subject: [PATCH 1/2] Add Communication Services Specifications --- cSpell.json | 7 + .../communicationserviceschat.json | 1617 +++++++++++++++++ .../Conversations_ListChatReadReceipts.json | 50 + .../Conversations_SendChatReadReceipt.json | 37 + .../examples/Messages_DeleteChatMessage.json | 35 + .../examples/Messages_GetChatMessage.json | 46 + ...Messages_ListChatMessagesWithPageSize.json | 89 + .../examples/Messages_SendChatMessage.json | 46 + .../Messages_SendTypingNotification.json | 35 + .../examples/Messages_UpdateChatMessage.json | 38 + .../ThreadMembers_AddChatThreadMembers.json | 69 + .../ThreadMembers_ListChatThreadMembers.json | 50 + .../ThreadMembers_RemoveChatThreadMember.json | 35 + .../examples/Threads_CreateChatThread.json | 83 + .../examples/Threads_DeleteChatThread.json | 34 + .../examples/Threads_GetChatThread.json | 51 + .../Threads_ListChatThreadsWithPageSize.json | 70 + .../Threads_UpdateChatThreadTopic.json | 37 + .../CommunicationIdentity.json | 264 +++ .../examples/CreateIdentity.json | 14 + .../examples/DeleteIdentity.json | 11 + .../examples/IssueToken.json | 22 + .../examples/UpdateIdentity.json | 14 + .../communicationservicessms.json | 145 ++ .../2020-07-20-preview1/examples/send.json | 23 + .../communication/data-plane/readme.csharp.md | 15 + .../communication/data-plane/readme.go.md | 19 + .../communication/data-plane/readme.md | 95 + .../communication/data-plane/readme.python.md | 21 + .../communication/data-plane/readme.ruby.md | 19 + .../data-plane/readme.typescript.md | 13 + 31 files changed, 3104 insertions(+) create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/communicationserviceschat.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Conversations_ListChatReadReceipts.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Conversations_SendChatReadReceipt.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_DeleteChatMessage.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_GetChatMessage.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_ListChatMessagesWithPageSize.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_SendChatMessage.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_SendTypingNotification.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_UpdateChatMessage.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_AddChatThreadMembers.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_ListChatThreadMembers.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_RemoveChatThreadMember.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_CreateChatThread.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_DeleteChatThread.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_GetChatThread.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_ListChatThreadsWithPageSize.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_UpdateChatThreadTopic.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/CommunicationIdentity.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/CreateIdentity.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/DeleteIdentity.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/IssueToken.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/UpdateIdentity.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/communicationservicessms.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/examples/send.json create mode 100644 specification/communication/data-plane/readme.csharp.md create mode 100644 specification/communication/data-plane/readme.go.md create mode 100644 specification/communication/data-plane/readme.md create mode 100644 specification/communication/data-plane/readme.python.md create mode 100644 specification/communication/data-plane/readme.ruby.md create mode 100644 specification/communication/data-plane/readme.typescript.md diff --git a/cSpell.json b/cSpell.json index 794394747940..15c786ff967f 100644 --- a/cSpell.json +++ b/cSpell.json @@ -729,5 +729,12 @@ "Fpushpins" ] } + , + { + "filename": "**/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/communicationserviceschat.json", + "words": [ + "readreceipts" + ] + } ] } diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/communicationserviceschat.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/communicationserviceschat.json new file mode 100644 index 000000000000..73e83b57a414 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/communicationserviceschat.json @@ -0,0 +1,1617 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Communication Chat Service", + "description": "Azure Communication Chat Service", + "contact": { + "email": "acsdevexdisc@microsoft.com" + }, + "version": "2020-09-21-preview2" + }, + "paths": { + "/chat/threads/{chatThreadId}/readreceipts": { + "get": { + "tags": [ + "Threads" + ], + "summary": "Gets read receipts for a thread.", + "operationId": "ListChatReadReceipts", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to get the read receipts for.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns the requested `ReadReceipt` resources.", + "schema": { + "$ref": "#/definitions/ReadReceiptsCollection" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get thread read receipts": { + "$ref": "./examples/Conversations_ListChatReadReceipts.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + }, + "post": { + "tags": [ + "Threads" + ], + "summary": "Sends a read receipt event to a thread, on behalf of a user.", + "operationId": "SendChatReadReceipt", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to send the read receipt event to.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "description": "Read receipt details.", + "required": true, + "schema": { + "$ref": "#/definitions/SendReadReceiptRequest" + } + } + ], + "responses": { + "201": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Send read receipt": { + "$ref": "./examples/Conversations_SendChatReadReceipt.json" + } + } + } + }, + "/chat/threads/{chatThreadId}/messages": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Sends a message to a thread.", + "operationId": "SendChatMessage", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id to send the message to.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "description": "Details of the message to send.", + "required": true, + "schema": { + "$ref": "#/definitions/SendChatMessageRequest" + } + } + ], + "responses": { + "201": { + "description": "Message sent, the `Location` header contains the URL for the newly sent message.", + "schema": { + "$ref": "#/definitions/SendChatMessageResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Send Message": { + "$ref": "./examples/Messages_SendChatMessage.json" + } + } + }, + "get": { + "tags": [ + "Messages" + ], + "summary": "Gets a list of messages from a thread.", + "operationId": "ListChatMessages", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id of the message.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "maxPageSize", + "description": "The maximum number of messages to be returned per page.", + "type": "integer", + "format": "int32" + }, + { + "in": "query", + "name": "startTime", + "description": "The earliest point in time to get messages up to. The timestamp should be in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "format": "date-time" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ChatMessagesCollection" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get messages with pagination (max page size)": { + "$ref": "./examples/Messages_ListChatMessagesWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/chat/threads/{chatThreadId}/messages/{chatMessageId}": { + "get": { + "tags": [ + "Messages" + ], + "summary": "Gets a message by id.", + "operationId": "GetChatMessage", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id to which the message was sent.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "chatMessageId", + "description": "The message id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns a `Message` resource.", + "schema": { + "$ref": "#/definitions/ChatMessage" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get Message": { + "$ref": "./examples/Messages_GetChatMessage.json" + } + } + }, + "patch": { + "tags": [ + "Messages" + ], + "summary": "Updates a message.", + "operationId": "UpdateChatMessage", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id to which the message was sent.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "chatMessageId", + "description": "The message id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "description": "Details of the request to update the message.", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateChatMessageRequest" + } + } + ], + "responses": { + "200": { + "description": "Message is successfully updated." + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Update message content": { + "$ref": "./examples/Messages_UpdateChatMessage.json" + } + } + }, + "delete": { + "tags": [ + "Messages" + ], + "summary": "Deletes a message.", + "operationId": "DeleteChatMessage", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id to which the message was sent.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "chatMessageId", + "description": "The message id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "204": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Delete message": { + "$ref": "./examples/Messages_DeleteChatMessage.json" + } + } + } + }, + "/chat/threads/{chatThreadId}/typing": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Posts a typing event to a thread, on behalf of a user.", + "operationId": "SendTypingNotification", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Id of the thread.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Post typing event to a thread": { + "$ref": "./examples/Messages_SendTypingNotification.json" + } + } + } + }, + "/chat/threads/{chatThreadId}/members": { + "get": { + "tags": [ + "ThreadMembers" + ], + "summary": "Gets the members of a thread.", + "operationId": "ListChatThreadMembers", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to get members for.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns the members of a thread.", + "schema": { + "$ref": "#/definitions/ChatThreadMembersCollection" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get thread members": { + "$ref": "./examples/ThreadMembers_ListChatThreadMembers.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + }, + "post": { + "tags": [ + "ThreadMembers" + ], + "summary": "Adds thread members to a thread. If members already exist, no change occurs.", + "operationId": "AddChatThreadMembers", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Id of the thread to add members to.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "description": "Thread members to be added to the thread.", + "required": true, + "schema": { + "$ref": "#/definitions/AddChatThreadMembersRequest" + } + } + ], + "responses": { + "207": { + "description": "Multi status response, containing the status for the thread member addition operations." + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Add thread members": { + "$ref": "./examples/ThreadMembers_AddChatThreadMembers.json" + } + } + } + }, + "/chat/threads/{chatThreadId}/members/{chatMemberId}": { + "delete": { + "tags": [ + "ThreadMembers" + ], + "summary": "Remove a member from a thread.", + "operationId": "RemoveChatThreadMember", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to remove the member from.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "chatMemberId", + "description": "Id of the thread member to remove from the thread.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "204": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Remove thread member": { + "$ref": "./examples/ThreadMembers_RemoveChatThreadMember.json" + } + } + } + }, + "/chat/threads": { + "post": { + "tags": [ + "Threads" + ], + "summary": "Creates a chat thread.", + "operationId": "CreateChatThread", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "description": "Request payload for creating a chat thread.", + "required": true, + "schema": { + "$ref": "#/definitions/CreateChatThreadRequest" + } + } + ], + "responses": { + "207": { + "description": "Multi status response, containing the status for the thread creation and the thread member addition operations.\r\nIf the thread was created successfully, `Location` header would contain the URL for the newly created thread.", + "schema": { + "$ref": "#/definitions/MultiStatusResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Create chat thread": { + "$ref": "./examples/Threads_CreateChatThread.json" + } + } + }, + "get": { + "tags": [ + "Threads" + ], + "summary": "Gets the list of chat threads of a user.", + "operationId": "ListChatThreads", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "maxPageSize", + "description": "The maximum number of chat threads returned per page.", + "type": "integer", + "format": "int32" + }, + { + "in": "query", + "name": "startTime", + "description": "The earliest point in time to get chat threads up to. The timestamp should be in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "format": "date-time" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns a `GetThreadsResponse` resource.", + "schema": { + "$ref": "#/definitions/ChatThreadsInfoCollection" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get threads with pagination (Max Page Size)": { + "$ref": "./examples/Threads_ListChatThreadsWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/chat/threads/{chatThreadId}": { + "patch": { + "tags": [ + "Threads" + ], + "summary": "Updates a thread's properties.", + "operationId": "UpdateChatThread", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The id of the thread to update.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "description": "Request payload for updating a chat thread.", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateChatThreadRequest" + } + } + ], + "responses": { + "200": { + "description": "Thread was successfully updated." + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Update chat thread topic": { + "$ref": "./examples/Threads_UpdateChatThreadTopic.json" + } + } + }, + "get": { + "tags": [ + "Threads" + ], + "summary": "Gets a chat thread.", + "operationId": "GetChatThread", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to get.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns a `Thread` resource.", + "schema": { + "$ref": "#/definitions/ChatThread" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get chat thread": { + "$ref": "./examples/Threads_GetChatThread.json" + } + } + }, + "delete": { + "tags": [ + "Threads" + ], + "summary": "Deletes a thread.", + "operationId": "DeleteChatThread", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to delete.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "204": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable", + "schema": { + "$ref": "#/definitions/Error" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Delete chat thread": { + "$ref": "./examples/Threads_DeleteChatThread.json" + } + } + } + } + }, + "definitions": { + "ReadReceipt": { + "description": "A read receipt indicates the time a chat message was read by a recipient.", + "type": "object", + "properties": { + "senderId": { + "description": "Read receipt sender id.", + "type": "string", + "readOnly": true, + "example": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "chatMessageId": { + "description": "Id for the chat message that has been read. This id is generated by the server.", + "type": "string", + "readOnly": true, + "example": "1591137790240" + }, + "readOn": { + "format": "date-time", + "description": "Read receipt timestamp. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "readOnly": true, + "example": "2020-10-30T10:50:50Z" + } + } + }, + "ReadReceiptsCollection": { + "type": "object", + "properties": { + "value": { + "description": "Collection of read receipts.", + "type": "array", + "items": { + "$ref": "#/definitions/ReadReceipt" + }, + "readOnly": true + }, + "nextLink": { + "description": "If there are more read receipts that can be retrieved, the next link will be populated.", + "type": "string", + "readOnly": true + } + } + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "readOnly": true + }, + "message": { + "type": "string", + "readOnly": true + }, + "target": { + "type": "string", + "readOnly": true + }, + "innerErrors": { + "type": "array", + "items": { + "$ref": "#/definitions/Error" + }, + "readOnly": true + } + } + }, + "SendReadReceiptRequest": { + "description": "Request payload for sending a read receipt.", + "required": [ + "chatMessageId" + ], + "type": "object", + "properties": { + "chatMessageId": { + "description": "Id of the latest chat message read by the user.", + "type": "string", + "example": "1592435762364" + } + } + }, + "ChatMessagePriority": { + "description": "The chat message priority.", + "enum": [ + "Normal", + "High" + ], + "type": "string", + "x-ms-enum": { + "name": "ChatMessagePriority", + "modelAsString": true + } + }, + "SendChatMessageRequest": { + "description": "Details of the message to send.", + "required": [ + "content" + ], + "type": "object", + "properties": { + "priority": { + "$ref": "#/definitions/ChatMessagePriority" + }, + "content": { + "description": "Chat message content.", + "type": "string", + "example": "Come one guys, lets go for lunch together." + }, + "senderDisplayName": { + "description": "The display name of the chat message sender. This property is used to populate sender name for push notifications.", + "type": "string", + "example": "Bob Admin" + } + } + }, + "SendChatMessageResult": { + "description": "Result of the send message operation.", + "type": "object", + "properties": { + "id": { + "description": "A server-generated message id.", + "type": "string", + "readOnly": true, + "example": "123456789" + } + } + }, + "ChatMessage": { + "type": "object", + "properties": { + "id": { + "description": "The id of the chat message. This id is server generated.", + "type": "string", + "readOnly": true, + "example": "123456789" + }, + "type": { + "description": "Type of the chat message.\r\n \r\nPossible values:\r\n - Text\r\n - ThreadActivity/TopicUpdate\r\n - ThreadActivity/AddMember\r\n - ThreadActivity/DeleteMember", + "type": "string", + "example": "Text" + }, + "priority": { + "$ref": "#/definitions/ChatMessagePriority" + }, + "version": { + "description": "Version of the chat message.", + "type": "string", + "readOnly": true + }, + "content": { + "description": "Content of the chat message.", + "type": "string", + "example": "Come one guys, lets go for lunch together." + }, + "senderDisplayName": { + "description": "The display name of the chat message sender. This property is used to populate sender name for push notifications.", + "type": "string", + "example": "Jane" + }, + "createdOn": { + "format": "date-time", + "description": "The timestamp when the chat message arrived at the server. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "readOnly": true, + "example": "2020-10-30T10:50:50Z" + }, + "senderId": { + "description": "The id of the chat message sender.", + "type": "string", + "readOnly": true, + "example": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "deletedOn": { + "format": "date-time", + "description": "The timestamp when the chat message was deleted. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + }, + "editedOn": { + "format": "date-time", + "description": "The timestamp when the chat message was edited. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + } + } + }, + "ChatMessagesCollection": { + "description": "Collection of chat messages for a particular chat thread.", + "type": "object", + "properties": { + "value": { + "description": "Collection of chat messages.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatMessage" + }, + "readOnly": true + }, + "nextLink": { + "description": "If there are more chat messages that can be retrieved, the next link will be populated.", + "type": "string", + "readOnly": true + } + } + }, + "UpdateChatMessageRequest": { + "type": "object", + "properties": { + "content": { + "description": "Chat message content.", + "type": "string", + "example": "Let's go for lunch together." + }, + "priority": { + "$ref": "#/definitions/ChatMessagePriority" + } + } + }, + "ChatThreadMember": { + "description": "A member of the chat thread.", + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "description": "The id of the chat thread member in the format `8:acs:ResourceId_AcsUserId`.", + "type": "string", + "example": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "displayName": { + "description": "Display name for the chat thread member.", + "type": "string", + "example": "Bob" + }, + "shareHistoryTime": { + "format": "date-time", + "description": "Time from which the chat history is shared with the member. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + } + } + }, + "ChatThreadMembersCollection": { + "description": "Collection of thread members belong to a particular thread.", + "type": "object", + "properties": { + "value": { + "description": "Chat thread members.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatThreadMember" + } + }, + "nextLink": { + "description": "If there are more chat threads that can be retrieved, the next link will be populated.", + "type": "string", + "readOnly": true + } + } + }, + "AddChatThreadMembersRequest": { + "description": "Thread members to be added to the thread.", + "required": [ + "members" + ], + "type": "object", + "properties": { + "members": { + "description": "Members to add to a chat thread.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatThreadMember" + } + } + } + }, + "CreateChatThreadRequest": { + "description": "Request payload for creating a chat thread.", + "required": [ + "members", + "topic" + ], + "type": "object", + "properties": { + "topic": { + "description": "The chat thread topic.", + "type": "string", + "example": "Lunch Thread" + }, + "members": { + "description": "Members to be added to the chat thread.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatThreadMember" + } + } + } + }, + "IndividualStatusResponse": { + "type": "object", + "properties": { + "id": { + "description": "Identifies the resource to which the individual status corresponds.", + "type": "string", + "readOnly": true + }, + "statusCode": { + "format": "int32", + "description": "The status code of the resource operation.\r\n \r\nPossible values include:\r\n 200 for a successful update or delete,\r\n 201 for successful creation,\r\n 400 for a malformed input,\r\n 403 for lacking permission to execute the operation,\r\n 404 for resource not found.", + "type": "integer", + "readOnly": true + }, + "message": { + "description": "The message explaining why the operation failed for the resource identified by the key; null if the operation succeeded.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "Identifies the type of the resource to which the individual status corresponds.", + "type": "string", + "readOnly": true + } + } + }, + "MultiStatusResponse": { + "type": "object", + "properties": { + "multipleStatus": { + "description": "The list of status information for each resource in the request.", + "type": "array", + "items": { + "$ref": "#/definitions/IndividualStatusResponse" + }, + "readOnly": true + } + } + }, + "ChatThreadInfo": { + "type": "object", + "properties": { + "id": { + "description": "Chat thread id.", + "type": "string", + "readOnly": true, + "example": "19:uni01_uy5ucb66ugp3lrhe7pxso6xx4hsmm3dl6eyjfefv2n6x3rrurpea@thread.v2" + }, + "topic": { + "description": "Chat thread topic.", + "type": "string", + "example": "Lunch Chat thread" + }, + "isDeleted": { + "description": "Flag if a chat thread is soft deleted.", + "type": "boolean", + "example": false + }, + "lastMessageReceivedOn": { + "format": "date-time", + "description": "The timestamp when the last message arrived at the server. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "readOnly": true, + "example": "2020-10-30T10:50:50Z" + } + } + }, + "ChatThreadsInfoCollection": { + "description": "Collection of chat threads.", + "type": "object", + "properties": { + "value": { + "description": "Collection of chat threads.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatThreadInfo" + }, + "readOnly": true + }, + "nextLink": { + "description": "If there are more chat threads that can be retrieved, the next link will be populated.", + "type": "string", + "readOnly": true + } + } + }, + "UpdateChatThreadRequest": { + "type": "object", + "properties": { + "topic": { + "description": "Chat thread topic.", + "type": "string", + "example": "Lunch Thread" + } + } + }, + "ChatThread": { + "type": "object", + "properties": { + "id": { + "description": "Chat thread id.", + "type": "string", + "readOnly": true, + "example": "19:uni01_uy5ucb66ugp3lrhe7pxso6xx4hsmm3dl6eyjfefv2n6x3rrurpea@thread.v2" + }, + "topic": { + "description": "Chat thread topic.", + "type": "string", + "example": "Lunch Chat thread" + }, + "createdOn": { + "format": "date-time", + "description": "The timestamp when the chat thread was created. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "readOnly": true, + "example": "2020-10-30T10:50:50Z" + }, + "createdBy": { + "description": "Id of the chat thread owner.", + "type": "string", + "readOnly": true, + "example": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "members": { + "description": "Chat thread members.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatThreadMember" + } + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "in": "query", + "name": "api-version", + "description": "Version of API to invoke.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "Endpoint": { + "in": "path", + "name": "endpoint", + "description": "The endpoint of the Azure Communication resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + }, + "securityDefinitions": { + "Authorization": { + "type": "apiKey", + "name": "Authorization", + "in": "header", + "description": "An ACS (Azure Communication Services) user access token." + } + }, + "security": [ + { + "Authorization": [] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Conversations_ListChatReadReceipts.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Conversations_ListChatReadReceipts.json new file mode 100644 index 000000000000..44d3ad9bd31e --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Conversations_ListChatReadReceipts.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "senderId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "chatMessageId": "1591137790240", + "readOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "senderId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c00a", + "chatMessageId": "1591768249318", + "readOn": "2020-06-06T05:55:41.6460000Z" + } + ], + "nextLink": null + } + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Conversations_SendChatReadReceipt.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Conversations_SendChatReadReceipt.json new file mode 100644 index 000000000000..45ab2f0680bb --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Conversations_SendChatReadReceipt.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "body": { + "chatMessageId": "1591137790240" + } + }, + "responses": { + "201": {}, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_DeleteChatMessage.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_DeleteChatMessage.json new file mode 100644 index 000000000000..00551b5f9d65 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_DeleteChatMessage.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "chatMessageId": "1591768249318" + }, + "responses": { + "204": {}, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_GetChatMessage.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_GetChatMessage.json new file mode 100644 index 000000000000..70d7dacb2aac --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_GetChatMessage.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "chatMessageId": "1591768249318" + }, + "responses": { + "200": { + "body": { + "id": "1591768249318", + "type": "Text", + "version": "1599016601134", + "priority": "Normal", + "content": "Let's head out for lunch in 15 minutes.", + "senderDisplayName": "Jane", + "createdOn": "2020-06-10T05:50:49.3180000Z", + "senderId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_ListChatMessagesWithPageSize.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_ListChatMessagesWithPageSize.json new file mode 100644 index 000000000000..0323cbabc954 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_ListChatMessagesWithPageSize.json @@ -0,0 +1,89 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "19:453dafb77b26481ea2e73bcada0324af@thread.v2", + "maxPageSize": 5 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "1593107077690", + "type": "Text", + "priority": "Normal", + "version": "1593107077683", + "content": "So where should we get lunch from today?", + "senderDisplayName": "Jane", + "createdOn": "2020-06-25T17:44:37.6830000Z", + "senderId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + { + "id": "1593107077683", + "type": "Text", + "priority": "Normal", + "version": "1593107077683", + "content": "Let's use this chat to decide what to get for lunch today.", + "senderDisplayName": "Jane", + "createdOn": "2020-06-25T17:44:37.6830000Z", + "senderId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + { + "id": "1593107046498", + "type": "Text", + "priority": "Normal", + "version": "1593107046498", + "content": "Good morning everyone!", + "senderDisplayName": "Jane", + "createdOn": "2020-06-25T17:44:06.4980000Z", + "senderId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + { + "id": "1593106976785", + "type": "ThreadActivity/TopicUpdate", + "priority": "Normal", + "version": "1593106976785", + "content": "15931069767858:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10bLunch", + "createdOn": "2020-06-25T17:42:56.7850000Z", + "senderId": "19:453dafb77b26481ea2e73bcada0324af@thread.v2" + }, + { + "id": "1593106976753", + "type": "ThreadActivity/AddMember", + "priority": "Normal", + "version": "1593106976753", + "content": "15931069767538:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b15931069765668:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b8:acs:29d8ac59-6011-44dc-87c0-1f9f93dbc713_2a711a-6c8ffcdc418:acs:29d8ac59-6011-44dc-87c0-1f9f93dbc713_2a711a-6c8ffcdc418:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "createdOn": "2020-06-25T17:42:56.7530000Z", + "senderId": "19:453dafb77b26481ea2e73bcada0324af@thread.v2" + } + ], + "nextLink": "https://contoso.westus.communications.azure.com/chat/threads/19:453dafb77b26481ea2e73bcada0324af@thread.v2/messages?syncState=3e4700000031393a756e6930315f7a626e68336e74326466756666657a6333736f7837646f67377766686b36793571653272776c6e66686c68647a69726968647071407468726561642e763201451fe6e77201000004357fea72010000&startTime=0&maxPageSize=5&api-version=2020-09-21-preview2" + } + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_SendChatMessage.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_SendChatMessage.json new file mode 100644 index 000000000000..df0395bea381 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_SendChatMessage.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "body": { + "priority": "Normal", + "content": "Let's head out for lunch in 15 minutes.", + "senderDisplayName": "Jane" + } + }, + "responses": { + "201": { + "headers": { + "Location": "https://contoso.westus.communications.azure.com/chat/threads/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/messages/1593072104708" + }, + "body": { + "id": "1593072104708" + } + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_SendTypingNotification.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_SendTypingNotification.json new file mode 100644 index 000000000000..6435d0e29153 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_SendTypingNotification.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "x-skypetoken": "token", + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345" + }, + "responses": { + "200": {}, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_UpdateChatMessage.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_UpdateChatMessage.json new file mode 100644 index 000000000000..f77e9c5e8dd9 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Messages_UpdateChatMessage.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "chatMessageId": "1591768249318", + "body": { + "content": "Updated message content" + } + }, + "responses": { + "200": {}, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_AddChatThreadMembers.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_AddChatThreadMembers.json new file mode 100644 index 000000000000..17cc78cfb022 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_AddChatThreadMembers.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "19:f2167429acf6482880c6b7790a9086c1@thread.v2", + "body": { + "members": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Alex", + "shareHistoryTime": "2020-06-06T05:55:41Z" + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "displayName": "Peter", + "shareHistoryTime": "2020-06-06T05:55:41Z" + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "displayName": "Rama", + "shareHistoryTime": "2020-06-06T05:55:41Z" + } + ] + } + }, + "responses": { + "207": { + "multipleStatus": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "statusCode": 403, + "message": "Permissions check failed" + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "statusCode": 201 + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "statusCode": 201 + } + ] + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_ListChatThreadMembers.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_ListChatThreadMembers.json new file mode 100644 index 000000000000..2f7522e9e0a1 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_ListChatThreadMembers.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "19:f2167429acf6482880c6b7790a9086c1@thread.v2" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "displayName": "Jane", + "shareHistoryTime": "2020-06-06T05:55:41Z" + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Alex", + "shareHistoryTime": "2020-06-06T05:55:41Z" + } + ], + "nextLink": null + } + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_RemoveChatThreadMember.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_RemoveChatThreadMember.json new file mode 100644 index 000000000000..e4f34c5ab80d --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/ThreadMembers_RemoveChatThreadMember.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "19:f2167429acf6482880c6b7790a9086c1@thread.v2", + "chatMemberId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a" + }, + "responses": { + "204": {}, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_CreateChatThread.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_CreateChatThread.json new file mode 100644 index 000000000000..f2e8c4bb469c --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_CreateChatThread.json @@ -0,0 +1,83 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "body": { + "topic": "Lunch", + "members": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "displayName": "Jane" + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Alex" + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "displayName": "Bob" + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "displayName": "Peter" + } + ] + } + }, + "responses": { + "207": { + "headers": { + "Location": "https://contoso.westus.communications.azure.com/chat/threads/19%3Auni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2" + }, + "body": { + "multipleStatus": [ + { + "id": "19:b355e41860604e7dacd072d586f47818@thread.v2", + "statusCode": 201 + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "statusCode": 201 + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "statusCode": 201 + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "statusCode": 201 + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "statusCode": 403, + "message": "Permissions check failed" + } + ] + } + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_DeleteChatThread.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_DeleteChatThread.json new file mode 100644 index 000000000000..8d2b13efb17a --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_DeleteChatThread.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "19:9525281ac1f947fc884bcee1a9f983c2@thread.v2" + }, + "responses": { + "204": {}, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_GetChatThread.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_GetChatThread.json new file mode 100644 index 000000000000..2bcaff7565cb --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_GetChatThread.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2" + }, + "responses": { + "200": { + "body": { + "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "topic": "Lunch", + "createdOn": "2020-06-06T05:55:41.6460000Z", + "createdBy": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "members": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "shareHistoryTime": "2020-06-06T05:55:41Z" + }, + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "shareHistoryTime": "2020-06-06T05:55:41Z" + } + ] + } + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_ListChatThreadsWithPageSize.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_ListChatThreadsWithPageSize.json new file mode 100644 index 000000000000..07a5dc602c3d --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_ListChatThreadsWithPageSize.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "maxmaxPageSize": 5 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "topic": "Chat with Samantha", + "isDeleted": false, + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "id": "19:a0dfe5fc10e04a7f8d8a64d455f4196d@thread.v2", + "topic": "Presentation Brainstorming", + "isDeleted": false, + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "id": "19:uni01_n242d2bzammtwxiib7pbjtozeevjqzavzn654ku3dajocexfo2na@thread.v2", + "topic": "Chat with Alex", + "isDeleted": false, + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "id": "19:0062022a28be4e0983734f7e45cd8566@thread.v2", + "topic": "Lunch", + "isDeleted": false, + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpe@thread.v2", + "topic": "Chat with Bob", + "isDeleted": false, + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + } + ], + "nextLink": "https://contoso.westus.communications.azure.com/chat/threads?syncState=W3sic3RhcnQiOiIyMDIwLTA2LTIzVDIzOjMyOjQ3LjMwNSswMDowMCIsImVuZCI6IjIwMjAtMDYtMjVUMDY6NTY6MjMuNjk2KzAwOjAwIn0seyJzdGFydCI6IjE5NzAtMDEtMDFUMDA6MDA6MDArMDA6MDAiLCJlbmQiOiIxOTcwLTAxLTAxVDAwOjAwOjAwKzAwOjAwIn1d&api-version=2020-09-21-preview2&maxmaxPageSize=5" + } + }, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_UpdateChatThreadTopic.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_UpdateChatThreadTopic.json new file mode 100644 index 000000000000..fc22cf010c46 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/examples/Threads_UpdateChatThreadTopic.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2020-09-21-preview2", + "chatThreadId": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "body": { + "topic": "Updated Thread Topic" + } + }, + "responses": { + "200": {}, + "401": { + "body": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + }, + "403": { + "body": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + }, + "429": { + "body": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + }, + "503": { + "body": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/CommunicationIdentity.json b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/CommunicationIdentity.json new file mode 100644 index 000000000000..c87ad2bfe5c3 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/CommunicationIdentity.json @@ -0,0 +1,264 @@ +{ + "swagger": "2.0", + "info": { + "title": "CommunicationIdentityClient", + "description": "Azure Communication Identity Service", + "contact": { + "email": "acsdevexdisc@microsoft.com" + }, + "version": "2020-07-20-preview2" + }, + "paths": { + "/identities": { + "post": { + "tags": [ + "Identity" + ], + "summary": "Create a new identity.", + "operationId": "CommunicationIdentity_Create", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "api-version", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK - Returns the created identity.", + "schema": { + "$ref": "#/definitions/CommunicationIdentity" + } + } + }, + "x-ms-examples": { + "Create Identity": { + "$ref": "./examples/CreateIdentity.json" + } + } + } + }, + "/identities/{id}": { + "delete": { + "tags": [ + "Identity" + ], + "summary": "Delete the identity, revoke all tokens of the identity and delete all associated data.", + "operationId": "CommunicationIdentity_Delete", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Identifier of the identity to be deleted.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Delete Identity": { + "$ref": "./examples/DeleteIdentity.json" + } + } + }, + "patch": { + "tags": [ + "Identity" + ], + "summary": "Update an Identity.", + "operationId": "CommunicationIdentity_Update", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Identifier of the identity.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "The properties of the identity to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/CommunicationIdentityUpdateRequest" + } + } + ], + "responses": { + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Update Identity": { + "$ref": "./examples/UpdateIdentity.json" + } + } + } + }, + "/identities/{id}/token": { + "post": { + "tags": [ + "Token" + ], + "summary": "Generate a new token for an identity.", + "operationId": "CommunicationIdentity_IssueToken", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Identifier of the identity to issue token for.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "Requesting scopes for the new token.", + "required": true, + "schema": { + "$ref": "#/definitions/CommunicationTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CommunicationIdentityToken" + } + } + }, + "x-ms-examples": { + "Issue Token": { + "$ref": "./examples/IssueToken.json" + } + } + } + } + }, + "definitions": { + "CommunicationIdentity": { + "description": "A communication identity.", + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "description": "Identifier of the identity.", + "type": "string" + } + } + }, + "CommunicationIdentityUpdateRequest": { + "type": "object", + "properties": { + "tokensValidFrom": { + "format": "date-time", + "description": "All tokens that are issued prior to this time will be revoked.", + "type": "string" + } + } + }, + "CommunicationTokenRequest": { + "required": [ + "scopes" + ], + "type": "object", + "properties": { + "scopes": { + "description": "List of scopes attached to the token.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "CommunicationIdentityToken": { + "required": [ + "expiresOn", + "id", + "token" + ], + "type": "object", + "properties": { + "id": { + "description": "Identifier of the identity owning the token.", + "type": "string" + }, + "token": { + "description": "The token issued for the identity.", + "type": "string" + }, + "expiresOn": { + "format": "date-time", + "description": "The expiry time of the token.", + "type": "string" + } + } + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "description": "Auth and Identity endpoint", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + ] + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/CreateIdentity.json b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/CreateIdentity.json new file mode 100644 index 000000000000..a7a69a592539 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/CreateIdentity.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2020-07-20-preview2", + "content-type": "application/json", + "endpoint": "https://contoso.communication.azure.com/identities" + }, + "responses": { + "200": { + "body": { + "id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081" + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/DeleteIdentity.json b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/DeleteIdentity.json new file mode 100644 index 000000000000..1a7eec13edb8 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/DeleteIdentity.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2020-07-20-preview2", + "content-type": "application/json", + "id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081", + "endpoint": "https://contoso.communication.azure.com/identities" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/IssueToken.json b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/IssueToken.json new file mode 100644 index 000000000000..b63e6b9c2264 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/IssueToken.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2020-07-20-preview2", + "content-type": "application/merge-patch+json", + "id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081", + "body": { + "scopes": [ + "chat" + ] + }, + "endpoint": "https://contoso.communication.azure.com/identities/" + }, + "responses": { + "200": { + "body": { + "id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081", + "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwMl9pbnQiLCJ0eXAiOiJKV1QifQ.eyJza3lwZWlkIjoiYWNzOjJkZWU1M2I0LTM2OGItNDViNC1hYjUyLTg0OTNmYjExNzY1Ml8wMDAwMDAwNS0xNGIwLWIwM2QtY2NjYy1iYWExZTEzYzAwMDEiLCJzY3AiOjE3OTIsImNzaSI6IjE1OTk2ODc1NzkiLCJpYXQiOjE1OTk2ODc1NzksImV4cCI6MTU5OTc3Mzk3OSwiYWNzU2NvcGUiOiJjaGF0IiwicmVzb3VyY2VJZCI6IjJkZWU1M2I0LTM2OGItNDViNC1hYjUyLTg0OTNmYjExNzY1MiJ9.S8Pryk7MVe0L8_KcTOjsGaU_6FXmcupVS8X73kJ2FW1CAotyJZb0YUoft_iXkbnTpJ3XK01SyhaXHcT48tXTsi1NcvyUqDk9u4rVKZkheA2F4ddLKYckO-RBw4mCHxlwsuiALNesR0MruhgiOSE1F0h_djDn6oKewSkyfd1FTWVqReeY1oIY4U0yi7_B8u3zNPiEFlv-Aqe4y1ISqi0009lt2u3EApjQ6pOIP8Jk9HAqbINwi2_lN5VAxUgK1XqvMBsiBmiB7fEfh-dNxB9tgH-tTGZQfRSprkjg6_KBVdYY7DTSr80J7Qez4JjoHwQ22DYKF8mleuFOysbTlLD0AA", + "expiresOn": "2020-09-10T21:39:39.3244584+00:00" + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/UpdateIdentity.json b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/UpdateIdentity.json new file mode 100644 index 000000000000..c6ee654739d9 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/examples/UpdateIdentity.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2020-07-20-preview2", + "content-type": "application/merge-patch+json", + "id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081", + "endpoint": "https://contoso.communication.azure.com/identities/", + "body": { + "tokensValidFrom": "2017-04-17T05:04:18.070Z" + } + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/communicationservicessms.json b/specification/communication/data-plane/Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/communicationservicessms.json new file mode 100644 index 000000000000..0d989bdbeee6 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/communicationservicessms.json @@ -0,0 +1,145 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Communication SMS Service", + "description": "Azure Communication SMS Service", + "contact": { + "email": "acsdevexdisc@microsoft.com" + }, + "version": "2020-07-20-preview1" + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/sms": { + "post": { + "tags": [ + "Sms" + ], + "summary": "Sends a SMS message from a phone number that belongs to the authenticated account.", + "operationId": "Sms_Send", + "x-ms-examples": { + "SuccessfulSend": { + "$ref": "./examples/send.json" + } + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "SendMessageRequest", + "description": "Represents the body of the send message request.", + "required": true, + "schema": { + "$ref": "#/definitions/SendMessageRequest" + } + }, + { + "name": "api-version", + "in": "query", + "description": "Version of API to invoke.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "SMS message is successfully scheduled for sending.", + "schema": { + "$ref": "#/definitions/SendSmsResponse" + } + } + } + } + } + }, + "definitions": { + "SendSmsOptions": { + "description": "Optional configuration for sending SMS messages", + "type": "object", + "properties": { + "enableDeliveryReport": { + "description": "Enable this flag to receive a delivery report for this message on the Azure Resource EventGrid", + "type": "boolean" + } + } + }, + "SendMessageRequest": { + "description": "Represents the properties of a send message request.", + "required": [ + "message", + "to", + "from" + ], + "type": "object", + "properties": { + "from": { + "description": "The sender's phone number in E.164 format that is owned by the authenticated account.", + "type": "string" + }, + "to": { + "description": "The recipients' phone number in E.164 format. In this version, only one recipient in the list is supported.", + "maxLength": 1, + "minLength": 1, + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "description": "The contents of the message that will be sent to the recipient. The allowable content is defined by RFC 5724.", + "maxLength": 2048, + "minLength": 0, + "type": "string" + }, + "sendSmsOptions": { + "$ref": "#/definitions/SendSmsOptions" + } + } + }, + "SendSmsResponse": { + "description": "Response for a successful send Sms request.", + "type": "object", + "properties": { + "messageId": { + "description": "The identifier of the outgoing SMS message", + "type": "string" + } + } + } + }, + "parameters": { + "Endpoint": { + "in": "path", + "name": "endpoint", + "description": "The endpoint of the Azure Communication resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/examples/send.json b/specification/communication/data-plane/Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/examples/send.json new file mode 100644 index 000000000000..306feda3416f --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/examples/send.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "SendMessageRequest": { + "from": "+18001110000", + "to": [ + "+18002220000" + ], + "message": "Hello world!", + "sendSmsOptions": { + "enableDeliveryReport": true + } + }, + "api-version": "2020-07-20-preview1", + "endpoint": "https://contoso.communication.azure.com/" + }, + "responses": { + "200": { + "body": { + "messageId": "Outgoing_20200610203725bfd4ba70-70bf-4f77-925d-c0bdb5161bb3" + } + } + } +} diff --git a/specification/communication/data-plane/readme.csharp.md b/specification/communication/data-plane/readme.csharp.md new file mode 100644 index 000000000000..2efd3715cdc3 --- /dev/null +++ b/specification/communication/data-plane/readme.csharp.md @@ -0,0 +1,15 @@ +## C + +These settings apply only when `--csharp` is specified on the command line. +Please also specify `--csharp-sdks-folder=`. + +```yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 1 + clear-output-folder: true + client-side-validation: false + namespace: Microsoft.CommunicationServices + output-folder: $(csharp-sdks-folder)/communicationservices/management/Microsoft.CommunicationServices/GeneratedProtocol +``` diff --git a/specification/communication/data-plane/readme.go.md b/specification/communication/data-plane/readme.go.md new file mode 100644 index 000000000000..6629f8f62840 --- /dev/null +++ b/specification/communication/data-plane/readme.go.md @@ -0,0 +1,19 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +```yaml $(go) +go: + license-header: MICROSOFT_APACHE_NO_VERSION + clear-output-folder: true +``` + +### Tag: package-2020-04-16-privatepreview and go + +These settings apply only when `--tag=package-2020-04-16-privatepreview --go` is specified on the command line. +Please also specify `--go-sdks-folder=`. + +```yaml $(tag) == 'package-2020-04-16-privatepreview' && $(go) +namespace: Microsoft.CommunicationServices +output-folder: $(go-sdks-folder)/communicationservices/Generated +``` diff --git a/specification/communication/data-plane/readme.md b/specification/communication/data-plane/readme.md new file mode 100644 index 000000000000..de83c6f70173 --- /dev/null +++ b/specification/communication/data-plane/readme.md @@ -0,0 +1,95 @@ +# communicationservices + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for communicationservices. + +## Getting Started + +To build the SDKs for My API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run: + +> `autorest readme.md` + +To see additional help and options, run: + +> `autorest --help` + +For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page. + +--- + +## Configuration + +### Basic Information + +These are the global settings for the communicationservices. + +```yaml +openapi-type: data-plane +tag: package-2020-07-20-preview1 +``` + +### Tag: package-2020-07-20-preview1 + +These settings apply only when `--tag=package-2020-07-20-preview1` is specified on the command line. + +```yaml $(tag) == 'package-2020-07-20-preview1' +input-file: + - Microsoft.CommunicationServicesSms/preview/2020-07-20-preview1/communicationservicessms.json +title: + Azure Communication Services +``` + +```yaml +openapi-type: data-plane +tag: package-2020-09-21-preview2 +``` + +### Tag: package-2020-09-21-preview2 + +These settings apply only when `--tag=package-2020-09-21-preview2` is specified on the command line. + +```yaml $(tag) == 'package-2020-09-21-preview2' +input-file: + - Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/communicationserviceschat.json +title: + Azure Communication Services +``` + +### Tag: package-2020-07-20-preview2 + +These settings apply only when `--tag=package-2020-07-20-preview2` is specified on the command line. + +```yaml $(tag) == 'package-2020-07-20-preview2' +input-file: + - Microsoft.CommunicationServicesIdentity/preview/2020-07-20-preview2/CommunicationIdentity.json +``` + +--- + +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +## Go + +See configuration in [readme.go.md](./readme.go.md) + +## Python + +See configuration in [readme.python.md](./readme.python.md) + +## Ruby + +See configuration in [readme.ruby.md](./readme.ruby.md) + +## TypeScript + +See configuration in [readme.typescript.md](./readme.typescript.md) + +## CSharp + +See configuration in [readme.csharp.md](./readme.csharp.md) diff --git a/specification/communication/data-plane/readme.python.md b/specification/communication/data-plane/readme.python.md new file mode 100644 index 000000000000..f7f55ff2159b --- /dev/null +++ b/specification/communication/data-plane/readme.python.md @@ -0,0 +1,21 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +```yaml $(python) +python: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 2 + namespace: Microsoft.CommunicationServices + package-name: communicationservices + package-version: 2020-04-16-privatepreview + clear-output-folder: true +``` + +```yaml $(python) +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/azure-mgmt/communicationservices +``` diff --git a/specification/communication/data-plane/readme.ruby.md b/specification/communication/data-plane/readme.ruby.md new file mode 100644 index 000000000000..f521ab44dbf5 --- /dev/null +++ b/specification/communication/data-plane/readme.ruby.md @@ -0,0 +1,19 @@ +## Ruby + +These settings apply only when `--ruby` is specified on the command line. + +```yaml +package-name: azure_mgmt_communicationservices +package-version: 2020-04-16-privatepreview +azure-arm: true +``` + +### Tag: package-2020-04-16-privatepreview and ruby + +These settings apply only when `--tag=package-2020-04-16-privatepreview --ruby` is specified on the command line. +Please also specify `--ruby-sdks-folder=`. + +```yaml $(tag) == 'package-2020-04-16-privatepreview' && $(ruby) +namespace: Microsoft.CommunicationServices +output-folder: $(ruby-sdks-folder)/communicationservices +``` diff --git a/specification/communication/data-plane/readme.typescript.md b/specification/communication/data-plane/readme.typescript.md new file mode 100644 index 000000000000..be9f877fd1c2 --- /dev/null +++ b/specification/communication/data-plane/readme.typescript.md @@ -0,0 +1,13 @@ +## TypeScript + +These settings apply only when `--typescript` is specified on the command line. +Please also specify `--typescript-sdks-folder=`. + +```yaml $(typescript) +typescript: + azure-arm: true + package-name: "communicationservices" + output-folder: "$(typescript-sdks-folder)/packages/communicationservices" + payload-flattening-threshold: 1 + generate-metadata: true +``` From 8818a603b78a1355ba1647ab9cd4e3354cdc4b69 Mon Sep 17 00:00:00 2001 From: Reza Jooyandeh Date: Mon, 21 Sep 2020 20:56:04 -0700 Subject: [PATCH 2/2] Remove Go code generation --- .../communication/data-plane/readme.go.md | 19 ------------------- .../communication/data-plane/readme.md | 4 ---- 2 files changed, 23 deletions(-) delete mode 100644 specification/communication/data-plane/readme.go.md diff --git a/specification/communication/data-plane/readme.go.md b/specification/communication/data-plane/readme.go.md deleted file mode 100644 index 6629f8f62840..000000000000 --- a/specification/communication/data-plane/readme.go.md +++ /dev/null @@ -1,19 +0,0 @@ -## Go - -These settings apply only when `--go` is specified on the command line. - -```yaml $(go) -go: - license-header: MICROSOFT_APACHE_NO_VERSION - clear-output-folder: true -``` - -### Tag: package-2020-04-16-privatepreview and go - -These settings apply only when `--tag=package-2020-04-16-privatepreview --go` is specified on the command line. -Please also specify `--go-sdks-folder=`. - -```yaml $(tag) == 'package-2020-04-16-privatepreview' && $(go) -namespace: Microsoft.CommunicationServices -output-folder: $(go-sdks-folder)/communicationservices/Generated -``` diff --git a/specification/communication/data-plane/readme.md b/specification/communication/data-plane/readme.md index de83c6f70173..e4d7480f69cd 100644 --- a/specification/communication/data-plane/readme.md +++ b/specification/communication/data-plane/readme.md @@ -74,10 +74,6 @@ input-file: This section describes what SDK should be generated by the automatic system. This is not used by Autorest itself. -## Go - -See configuration in [readme.go.md](./readme.go.md) - ## Python See configuration in [readme.python.md](./readme.python.md)