From 052a4b8d50bfd5595a8b5b506015d18f2b65998d Mon Sep 17 00:00:00 2001 From: Siyuan Xing <87063252+xingsy97@users.noreply.github.com> Date: Fri, 16 Jun 2023 23:29:20 +0800 Subject: [PATCH] [Hub Generated] Review request for WebPubSub to add version stable/2023-07-01 (#23927) * Original * Add 2023-07-01 * update * update * remove invoke * resolve comments * resolve comments * resolve failed check * resolve failed check --------- Co-authored-by: Chenyang Liu --- .../examples/HealthApi_GetServiceStatus.json | 8 + .../WebPubSub_AddConnectionToGroup.json | 11 + .../WebPubSub_AddConnectionsToGroups.json | 16 + .../examples/WebPubSub_AddUserToGroup.json | 11 + .../examples/WebPubSub_CheckPermission.json | 13 + .../WebPubSub_CloseAllConnections.json | 10 + .../examples/WebPubSub_CloseConnection.json | 11 + .../WebPubSub_CloseGroupConnections.json | 11 + .../WebPubSub_CloseUserConnections.json | 11 + .../examples/WebPubSub_ConnectionExists.json | 11 + .../WebPubSub_GenerateClientToken.json | 15 + .../examples/WebPubSub_GrantPermission.json | 12 + .../examples/WebPubSub_GroupExists.json | 11 + ...bPubSub_RemoveConnectionFromAllGroups.json | 10 + .../WebPubSub_RemoveConnectionFromGroup.json | 11 + ...WebPubSub_RemoveConnectionsFromGroups.json | 16 + .../WebPubSub_RemoveUserFromAllGroups.json | 10 + .../WebPubSub_RemoveUserFromGroup.json | 11 + .../examples/WebPubSub_RevokePermission.json | 12 + .../examples/WebPubSub_SendToAll.json | 12 + .../examples/WebPubSub_SendToConnection.json | 12 + .../examples/WebPubSub_SendToGroup.json | 13 + .../examples/WebPubSub_SendToUser.json | 13 + .../examples/WebPubSub_UserExists.json | 11 + .../stable/2023-07-01/webpubsub.json | 1821 +++++++++++++++++ specification/webpubsub/data-plane/readme.md | 37 +- 26 files changed, 2126 insertions(+), 14 deletions(-) create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json new file mode 100644 index 000000000000..5d01bd171145 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json @@ -0,0 +1,8 @@ +{ + "parameters": { + "api-version": "2023-07-01" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json new file mode 100644 index 000000000000..c8f5a88d113f --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "group": "group1", + "connectionId": "connection1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json new file mode 100644 index 000000000000..df30f8ddc124 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "groupsToAdd": { + "groups": [ + "group1", + "group2" + ], + "filter": "startswith(userId, 'listener-')" + } + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json new file mode 100644 index 000000000000..012f55fe4b9d --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "group": "group1", + "userId": "user1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json new file mode 100644 index 000000000000..2410bb4c9cc3 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json new file mode 100644 index 000000000000..d0ced81dd1a8 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json new file mode 100644 index 000000000000..483f7dfae401 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "connectionId": "connection1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json new file mode 100644 index 000000000000..fa11c8f8c235 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "group": "group1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json new file mode 100644 index 000000000000..995b3b194cac --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "userId": "user1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json new file mode 100644 index 000000000000..1b0ea37b08a0 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "connectionId": "connection1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json new file mode 100644 index 000000000000..f19f589041f4 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "userId": "user1", + "minutesToExpire": 5 + }, + "responses": { + "200": { + "body": { + "token": "ABCDEFG.ABC.ABC" + } + } + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json new file mode 100644 index 000000000000..4414ae64b7ad --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json new file mode 100644 index 000000000000..19bfe3a196fa --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "group": "group1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json new file mode 100644 index 000000000000..6d09523e774e --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "connectionId": "connection1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json new file mode 100644 index 000000000000..6c8e239b6ee0 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "group": "group1", + "connectionId": "connection1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json new file mode 100644 index 000000000000..907ec74cb9bb --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "groupsToRemove": { + "groups": [ + "group1", + "group2" + ], + "filter": "startswith(userId, 'listener-')" + } + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json new file mode 100644 index 000000000000..928c2bccaf86 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "userId": "user1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json new file mode 100644 index 000000000000..786cf0fd2a3c --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "group": "group1", + "userId": "user1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json new file mode 100644 index 000000000000..fa567ada5480 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json new file mode 100644 index 000000000000..e5ad3a993457 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "filter": "startswith(userId, 'listener-')", + "messageTtlSeconds": 15, + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json new file mode 100644 index 000000000000..ab590a886b0d --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "connectionId": "connection1", + "messageTtlSeconds": 15, + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json new file mode 100644 index 000000000000..c7a2eeeb2a86 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "group": "group1", + "filter": "startswith(userId, 'listener-')", + "messageTtlSeconds": 15, + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json new file mode 100644 index 000000000000..181d2f93c940 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "userId": "user1", + "filter": "startswith(userId, 'listener-')", + "messageTtlSeconds": 15, + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json new file mode 100644 index 000000000000..ba4aa1b5a1c7 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "userId": "user1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json new file mode 100644 index 000000000000..ff900383ec32 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -0,0 +1,1821 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Web PubSub Service REST API", + "version": "2023-07-01" + }, + "paths": { + "/api/health": { + "head": { + "tags": [ + "general" + ], + "summary": "Get service health status.", + "operationId": "HealthApi_GetServiceStatus", + "parameters": [ + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The service is healthy" + }, + "default": { + "description": "Error response" + } + }, + "x-ms-examples": { + "HealthApi_GetServiceStatus": { + "$ref": "./examples/HealthApi_GetServiceStatus.json" + } + } + } + }, + "/api/hubs/{hub}/:addToGroups": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Add filtered connections to multiple groups.", + "operationId": "WebPubSub_AddConnectionsToGroups", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "groupsToAdd", + "description": "Target groups and connection filter.", + "required": true, + "schema": { + "$ref": "#/definitions/AddToGroupsRequest" + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_AddConnectionsToGroups": { + "$ref": "./examples/WebPubSub_AddConnectionsToGroups.json" + } + } + } + }, + "/api/hubs/{hub}/:closeConnections": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Close the connections in the hub.", + "operationId": "WebPubSub_CloseAllConnections", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "excluded", + "description": "Exclude these connectionIds when closing the connections in the hub.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CloseAllConnections": { + "$ref": "./examples/WebPubSub_CloseAllConnections.json" + } + } + } + }, + "/api/hubs/{hub}/:generateToken": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Generate token for the client to connect Azure Web PubSub service.", + "operationId": "WebPubSub_GenerateClientToken", + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "userId", + "description": "User Id.", + "type": "string" + }, + { + "in": "query", + "name": "role", + "description": "Roles that the connection with the generated token will have.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "minutesToExpire", + "description": "The expire time of the generated token.", + "type": "integer", + "format": "int32", + "default": 60, + "minimum": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "group", + "description": "Groups that the connection will join when it connects.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ClientTokenResponse" + } + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_GenerateClientToken": { + "$ref": "./examples/WebPubSub_GenerateClientToken.json" + } + } + } + }, + "/api/hubs/{hub}/:removeFromGroups": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Remove filtered connections from multiple groups.", + "operationId": "WebPubSub_RemoveConnectionsFromGroups", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "groupsToRemove", + "description": "Target groups and connection filter.", + "required": true, + "schema": { + "$ref": "#/definitions/RemoveFromGroupsRequest" + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveConnectionsFromGroups": { + "$ref": "./examples/WebPubSub_RemoveConnectionsFromGroups.json" + } + } + } + }, + "/api/hubs/{hub}/:send": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Broadcast content inside request body to all the connected client connections.", + "operationId": "WebPubSub_SendToAll", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "excluded", + "description": "Excluded connection Ids.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "filter", + "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", + "type": "string" + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 + } + ], + "responses": { + "202": { + "description": "The message is accepted. The service follows fire-and-forget pattern when sending messages." + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_SendToAll": { + "$ref": "./examples/WebPubSub_SendToAll.json" + } + } + } + }, + "/api/hubs/{hub}/connections/{connectionId}": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Close the client connection.", + "operationId": "WebPubSub_CloseConnection", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CloseConnection": { + "$ref": "./examples/WebPubSub_CloseConnection.json" + } + } + }, + "head": { + "tags": [ + "webpubsub" + ], + "summary": "Check if the connection with the given connectionId exists.", + "operationId": "WebPubSub_ConnectionExists", + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "connectionId", + "description": "The connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + }, + "default": { + "description": "Error response", + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_ConnectionExists": { + "$ref": "./examples/WebPubSub_ConnectionExists.json" + } + } + } + }, + "/api/hubs/{hub}/connections/{connectionId}/:send": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Send content inside request body to the specific connection.", + "operationId": "WebPubSub_SendToConnection", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "connectionId", + "description": "The connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_SendToConnection": { + "$ref": "./examples/WebPubSub_SendToConnection.json" + } + } + } + }, + "/api/hubs/{hub}/connections/{connectionId}/groups": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Remove a connection from all groups.", + "operationId": "WebPubSub_RemoveConnectionFromAllGroups", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "The connection is removed from all groups." + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveConnectionFromAllGroups": { + "$ref": "./examples/WebPubSub_RemoveConnectionFromAllGroups.json" + } + } + } + }, + "/api/hubs/{hub}/groups/{group}": { + "head": { + "tags": [ + "webpubsub" + ], + "summary": "Check if there are any client connections inside the given group", + "operationId": "WebPubSub_GroupExists", + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + }, + "default": { + "description": "Error response", + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_GroupExists": { + "$ref": "./examples/WebPubSub_GroupExists.json" + } + } + } + }, + "/api/hubs/{hub}/groups/{group}/:closeConnections": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Close connections in the specific group.", + "operationId": "WebPubSub_CloseGroupConnections", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "query", + "name": "excluded", + "description": "Exclude these connectionIds when closing the connections in the group.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CloseGroupConnections": { + "$ref": "./examples/WebPubSub_CloseGroupConnections.json" + } + } + } + }, + "/api/hubs/{hub}/groups/{group}/:send": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Send content inside request body to a group of connections.", + "operationId": "WebPubSub_SendToGroup", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "query", + "name": "excluded", + "description": "Excluded connection Ids", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "filter", + "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", + "type": "string" + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_SendToGroup": { + "$ref": "./examples/WebPubSub_SendToGroup.json" + } + } + } + }, + "/api/hubs/{hub}/groups/{group}/connections/{connectionId}": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Remove a connection from the target group.", + "operationId": "WebPubSub_RemoveConnectionFromGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveConnectionFromGroup": { + "$ref": "./examples/WebPubSub_RemoveConnectionFromGroup.json" + } + } + }, + "put": { + "tags": [ + "webpubsub" + ], + "summary": "Add a connection to the target group.", + "operationId": "WebPubSub_AddConnectionToGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_AddConnectionToGroup": { + "$ref": "./examples/WebPubSub_AddConnectionToGroup.json" + } + } + } + }, + "/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Revoke permission for the connection.", + "operationId": "WebPubSub_RevokePermission", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "permission", + "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", + "required": true, + "type": "string", + "enum": [ + "sendToGroup", + "joinLeaveGroup" + ], + "x-ms-enum": { + "name": "WebPubSubPermission", + "modelAsString": true + } + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "targetName", + "description": "The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RevokePermission": { + "$ref": "./examples/WebPubSub_RevokePermission.json" + } + } + }, + "head": { + "tags": [ + "webpubsub" + ], + "summary": "Check if a connection has permission to the specified action.", + "operationId": "WebPubSub_CheckPermission", + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "permission", + "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", + "required": true, + "type": "string", + "enum": [ + "sendToGroup", + "joinLeaveGroup" + ], + "x-ms-enum": { + "name": "WebPubSubPermission", + "modelAsString": true + } + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "targetName", + "description": "The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + }, + "default": { + "description": "Error response", + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CheckPermission": { + "$ref": "./examples/WebPubSub_CheckPermission.json" + } + } + }, + "put": { + "tags": [ + "webpubsub" + ], + "summary": "Grant permission to the connection.", + "operationId": "WebPubSub_GrantPermission", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "permission", + "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", + "required": true, + "type": "string", + "enum": [ + "sendToGroup", + "joinLeaveGroup" + ], + "x-ms-enum": { + "name": "WebPubSubPermission", + "modelAsString": true + } + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "targetName", + "description": "The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_GrantPermission": { + "$ref": "./examples/WebPubSub_GrantPermission.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}": { + "head": { + "tags": [ + "webpubsub" + ], + "summary": "Check if there are any client connections connected for the given user.", + "operationId": "WebPubSub_UserExists", + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "userId", + "description": "Target user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + }, + "default": { + "description": "Error response", + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_UserExists": { + "$ref": "./examples/WebPubSub_UserExists.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}/:closeConnections": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Close connections for the specific user.", + "operationId": "WebPubSub_CloseUserConnections", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "userId", + "description": "The user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "excluded", + "description": "Exclude these connectionIds when closing the connections for the user.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CloseUserConnections": { + "$ref": "./examples/WebPubSub_CloseUserConnections.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}/:send": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Send content inside request body to the specific user.", + "operationId": "WebPubSub_SendToUser", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "userId", + "description": "The user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "filter", + "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", + "type": "string" + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_SendToUser": { + "$ref": "./examples/WebPubSub_SendToUser.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}/groups": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Remove a user from all groups.", + "operationId": "WebPubSub_RemoveUserFromAllGroups", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "userId", + "description": "Target user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "The user is removed from all groups." + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveUserFromAllGroups": { + "$ref": "./examples/WebPubSub_RemoveUserFromAllGroups.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}/groups/{group}": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Remove a user from the target group.", + "operationId": "WebPubSub_RemoveUserFromGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "path", + "name": "userId", + "description": "Target user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "The user is removed from the group." + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveUserFromGroup": { + "$ref": "./examples/WebPubSub_RemoveUserFromGroup.json" + } + } + }, + "put": { + "tags": [ + "webpubsub" + ], + "summary": "Add a user to the target group.", + "operationId": "WebPubSub_AddUserToGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "path", + "name": "userId", + "description": "Target user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_AddUserToGroup": { + "$ref": "./examples/WebPubSub_AddUserToGroup.json" + } + } + } + } + }, + "definitions": { + "AddToGroupsRequest": { + "description": "The request object containing targets groups and a connection filter", + "type": "object", + "properties": { + "groups": { + "description": "A list of groups which target connections will be added into", + "type": "array", + "items": { + "type": "string" + } + }, + "filter": { + "description": "An OData filter which target connections satisfy", + "type": "string" + } + } + }, + "ClientTokenResponse": { + "description": "The response object containing the token for the client", + "type": "object", + "properties": { + "token": { + "description": "The token value for the WebSocket client to connect to the service", + "type": "string" + } + } + }, + "ErrorDetail": { + "description": "The error object.", + "type": "object", + "properties": { + "code": { + "description": "One of a server-defined set of error codes.", + "type": "string" + }, + "message": { + "description": "A human-readable representation of the error.", + "type": "string" + }, + "target": { + "description": "The target of the error.", + "type": "string" + }, + "details": { + "description": "An array of details about specific errors that led to this reported error.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorDetail" + } + }, + "inner": { + "$ref": "#/definitions/InnerError" + } + } + }, + "InnerError": { + "type": "object", + "properties": { + "code": { + "description": "A more specific error code than was provided by the containing error.", + "type": "string" + }, + "inner": { + "$ref": "#/definitions/InnerError" + } + } + }, + "RemoveFromGroupsRequest": { + "description": "The request object containing targets groups and a connection filter", + "type": "object", + "properties": { + "groups": { + "description": "A list of groups which target connections will be removed from", + "type": "array", + "items": { + "type": "string" + } + }, + "filter": { + "description": "An OData filter which target connections satisfy", + "type": "string" + } + } + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "description": "HTTP or HTTPS endpoint for the Web PubSub service instance.", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "format": "url", + "in": "path", + "x-ms-skip-url-encoding": true + } + ] + } +} diff --git a/specification/webpubsub/data-plane/readme.md b/specification/webpubsub/data-plane/readme.md index 993817ba69e1..2af5241e4544 100644 --- a/specification/webpubsub/data-plane/readme.md +++ b/specification/webpubsub/data-plane/readme.md @@ -24,14 +24,14 @@ To see additional help and options, run: These are the global settings for the Web PubSub Service API. -```yaml +``` yaml openapi-type: data-plane -tag: package-2022-11-01 +tag: package-2023-07-01 ``` ### Suppression -```yaml +``` yaml directive: - suppress: LROStatusCodesReturnTypeSchema reason: For this data plane API, it is not a long run operation and the status code indicates the results. @@ -39,11 +39,20 @@ directive: reason: There are a lot of APIs that does not have the example. While it is being worked upon disabling this to ensure that we catch and fix other violations ``` + +### Tag: package-2023-07-01 + +These settings apply only when `--tag=package-2023-07-01` is specified on the command line. + +```yaml $(tag) == 'package-2023-07-01' +input-file: + - WebPubSub/stable/2023-07-01/webpubsub.json +``` ### Tag: package-2022-11-01 These settings apply only when `--tag=package-2022-11-01` is specified on the command line. -```yaml $(tag) == 'package-2022-11-01' +``` yaml $(tag) == 'package-2022-11-01' input-file: - WebPubSub/stable/2022-11-01/webpubsub.json title: AzureMessagingWebPubSubServiceClient @@ -53,7 +62,7 @@ title: AzureMessagingWebPubSubServiceClient These settings apply only when `--tag=package-2021-10-01` is specified on the command line. -```yaml $(tag) == 'package-2021-10-01' +``` yaml $(tag) == 'package-2021-10-01' input-file: - WebPubSub/stable/2021-10-01/webpubsub.json title: AzureMessagingWebPubSubServiceClient @@ -63,7 +72,7 @@ title: AzureMessagingWebPubSubServiceClient These settings apply only when `--tag=package-2021-08-01-preview` is specified on the command line. -```yaml $(tag) == 'package-2021-08-01-preview' +``` yaml $(tag) == 'package-2021-08-01-preview' input-file: - WebPubSub/preview/2021-08-01-preview/webpubsub.json title: AzureMessagingWebPubSubServiceClient @@ -73,7 +82,7 @@ title: AzureMessagingWebPubSubServiceClient These settings apply only when `--tag=package-2021-05-01-preview` is specified on the command line. -```yaml $(tag) == 'package-2021-05-01-preview' +``` yaml $(tag) == 'package-2021-05-01-preview' input-file: - WebPubSub/preview/2021-05-01-preview/webpubsub.json title: AzureMessagingWebPubSubServiceClient @@ -86,7 +95,7 @@ title: AzureMessagingWebPubSubServiceClient This section describes what SDK should be generated by the automatic system. This is not used by Autorest itself. -```yaml $(swagger-to-sdk) +``` yaml $(swagger-to-sdk) swagger-to-sdk: - repo: azure-sdk-for-net-track2 ``` @@ -96,7 +105,7 @@ swagger-to-sdk: These settings apply only when `--csharp` is specified on the command line. Please also specify `--csharp-sdks-folder=`. -```yaml $(csharp) +``` yaml $(csharp) csharp: # last generated with AutoRest.0.17.3 azure-arm: false @@ -112,7 +121,7 @@ These settings apply only when `--python` is specified on the command line. Please also specify `--python-sdks-folder=`. Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. -```yaml $(python) +``` yaml $(python) python-mode: create azure-arm: false license-header: MICROSOFT_MIT_NO_VERSION @@ -122,12 +131,12 @@ package-version: 1.0.0b1 clear-output-folder: true ``` -```yaml $(python) && $(python-mode) == 'update' +``` yaml $(python) && $(python-mode) == 'update' no-namespace-folders: true output-folder: $(python-sdks-folder)/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice ``` -```yaml $(python) && $(python-mode) == 'create' +``` yaml $(python) && $(python-mode) == 'create' basic-setup-py: true output-folder: $(python-sdks-folder)/webpubsub/azure-messaging-webpubsubservice ``` @@ -138,7 +147,7 @@ AutoRest V3 generators require the use of `--tag=all-api-versions` to select api This block is updated by an automatic script. Edits may be lost! -```yaml $(tag) == 'all-api-versions' /* autogenerated */ +``` yaml $(tag) == 'all-api-versions' /* autogenerated */ # include the azure profile definitions from the standard location require: $(this-folder)/../../../profiles/readme.md @@ -150,7 +159,7 @@ input-file: If there are files that should not be in the `all-api-versions` set, uncomment the `exclude-file` section below and add the file paths. -```yaml $(tag) == 'all-api-versions' +``` yaml $(tag) == 'all-api-versions' #exclude-file: # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ```