diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/HealthApi_GetServiceStatus.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/HealthApi_GetServiceStatus.json new file mode 100644 index 000000000000..64964b8a9555 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/HealthApi_GetServiceStatus.json @@ -0,0 +1,8 @@ +{ + "parameters": { + "api-version": "2021-10-01" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_AddConnectionToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_AddConnectionToGroup.json new file mode 100644 index 000000000000..fab5a7c09489 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_AddConnectionToGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "group": "group1", + "connectionId": "connection1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_AddUserToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_AddUserToGroup.json new file mode 100644 index 000000000000..8a2e03f7bb47 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_AddUserToGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "group": "group1", + "userId": "user1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CheckPermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CheckPermission.json new file mode 100644 index 000000000000..3a64b92b833a --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CheckPermission.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseAllConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseAllConnections.json new file mode 100644 index 000000000000..0b2aa8f4ec5b --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseAllConnections.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseConnection.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseConnection.json new file mode 100644 index 000000000000..fc4a12897478 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseConnection.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "connectionId": "connection1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseGroupConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseGroupConnections.json new file mode 100644 index 000000000000..f617479d7074 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseGroupConnections.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "group": "group1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseUserConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseUserConnections.json new file mode 100644 index 000000000000..35efffd56840 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_CloseUserConnections.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "userId": "user1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_ConnectionExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_ConnectionExists.json new file mode 100644 index 000000000000..1de67bfbe343 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_ConnectionExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "connectionId": "connection1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GenerateClientToken.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GenerateClientToken.json new file mode 100644 index 000000000000..f0bed1a3c14b --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GenerateClientToken.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "userId": "user1", + "minutesToExpire": 5 + }, + "responses": { + "200": { + "body": { + "token": "ABC" + } + } + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GrantPermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GrantPermission.json new file mode 100644 index 000000000000..fe7299abb560 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GrantPermission.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GroupExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GroupExists.json new file mode 100644 index 000000000000..413f5d1124d8 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_GroupExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "group": "group1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveConnectionFromGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveConnectionFromGroup.json new file mode 100644 index 000000000000..33e793772ed4 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveConnectionFromGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "group": "group1", + "connectionId": "connection1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveUserFromAllGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveUserFromAllGroups.json new file mode 100644 index 000000000000..56b127090c51 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveUserFromAllGroups.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "userId": "user1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveUserFromGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveUserFromGroup.json new file mode 100644 index 000000000000..9ae74aa90747 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RemoveUserFromGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "group": "group1", + "userId": "user1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RevokePermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RevokePermission.json new file mode 100644 index 000000000000..052c290ade36 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_RevokePermission.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToAll.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToAll.json new file mode 100644 index 000000000000..27fb46ed15d4 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToAll.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToConnection.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToConnection.json new file mode 100644 index 000000000000..d9845618ee17 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToConnection.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "connectionId": "connection1", + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToGroup.json new file mode 100644 index 000000000000..63aef0c685c3 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "group": "group1", + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToUser.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToUser.json new file mode 100644 index 000000000000..ab1cbb51f0ee --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_SendToUser.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "userId": "user1", + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_UserExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_UserExists.json new file mode 100644 index 000000000000..c2fdab12a636 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/examples/WebPubSub_UserExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "hub": "hub1", + "userId": "user1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/webpubsub.json index c6db43b78888..11b68ce5c377 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/webpubsub.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/webpubsub.json @@ -12,11 +12,6 @@ ], "summary": "Get service health status.", "operationId": "HealthApi_GetServiceStatus", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], "parameters": [ { "in": "query", @@ -33,16 +28,21 @@ "default": { "description": "Error response" } + }, + "x-ms-examples": { + "HealthApi_GetServiceStatus": { + "$ref": "./examples/HealthApi_GetServiceStatus.json" + } } } }, - "/api/hubs/{hub}/:generateToken": { + "/api/hubs/{hub}/:closeConnections": { "post": { "tags": [ "webpubsub" ], - "summary": "Generate token for the client to connect Azure Web PubSub service.", - "operationId": "WebPubSub_GenerateClientToken", + "summary": "Close the connections in the hub.", + "operationId": "WebPubSub_CloseAllConnections", "produces": [ "text/plain", "application/json", @@ -59,14 +59,8 @@ }, { "in": "query", - "name": "userId", - "description": "User Id.", - "type": "string" - }, - { - "in": "query", - "name": "role", - "description": "Roles that the connection with the generated token will have.", + "name": "excluded", + "description": "Exclude these connectionIds when closing the connections in the hub.", "type": "array", "items": { "type": "string" @@ -75,11 +69,9 @@ }, { "in": "query", - "name": "minutesToExpire", - "description": "The expire time of the generated token.", - "type": "integer", - "format": "int32", - "default": 60 + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" }, { "in": "query", @@ -90,11 +82,8 @@ } ], "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ClientTokenResponse" - } + "204": { + "description": "No Content" }, "default": { "description": "Error response", @@ -109,16 +98,21 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_CloseAllConnections": { + "$ref": "./examples/WebPubSub_CloseAllConnections.json" + } } } }, - "/api/hubs/{hub}/:closeConnections": { + "/api/hubs/{hub}/:generateToken": { "post": { "tags": [ "webpubsub" ], - "summary": "Close the connections in the hub.", - "operationId": "WebPubSub_CloseAllConnections", + "summary": "Generate token for the client to connect Azure Web PubSub service.", + "operationId": "WebPubSub_GenerateClientToken", "produces": [ "text/plain", "application/json", @@ -135,8 +129,14 @@ }, { "in": "query", - "name": "excluded", - "description": "Exclude these connectionIds when closing the connections in the hub.", + "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" @@ -145,9 +145,12 @@ }, { "in": "query", - "name": "reason", - "description": "The reason closing the client connection.", - "type": "string" + "name": "minutesToExpire", + "description": "The expire time of the generated token.", + "type": "integer", + "format": "int32", + "default": 60, + "minimum": 1 }, { "in": "query", @@ -158,8 +161,11 @@ } ], "responses": { - "204": { - "description": "Success" + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ClientTokenResponse" + } }, "default": { "description": "Error response", @@ -174,6 +180,11 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_GenerateClientToken": { + "$ref": "./examples/WebPubSub_GenerateClientToken.json" + } } } }, @@ -248,16 +259,21 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_SendToAll": { + "$ref": "./examples/WebPubSub_SendToAll.json" + } } } }, "/api/hubs/{hub}/connections/{connectionId}": { - "head": { + "delete": { "tags": [ "webpubsub" ], - "summary": "Check if the connection with the given connectionId exists.", - "operationId": "WebPubSub_ConnectionExists", + "summary": "Close the client connection.", + "operationId": "WebPubSub_CloseConnection", "produces": [ "text/plain", "application/json", @@ -275,11 +291,17 @@ { "in": "path", "name": "connectionId", - "description": "The connection Id.", + "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", @@ -289,11 +311,8 @@ } ], "responses": { - "200": { - "description": "Success" - }, - "404": { - "description": "Not Found" + "204": { + "description": "No Content" }, "default": { "description": "Error response", @@ -308,19 +327,19 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_CloseConnection": { + "$ref": "./examples/WebPubSub_CloseConnection.json" + } } }, - "delete": { + "head": { "tags": [ "webpubsub" ], - "summary": "Close the client connection.", - "operationId": "WebPubSub_CloseConnection", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], + "summary": "Check if the connection with the given connectionId exists.", + "operationId": "WebPubSub_ConnectionExists", "parameters": [ { "in": "path", @@ -333,17 +352,11 @@ { "in": "path", "name": "connectionId", - "description": "Target connection Id.", + "description": "The 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", @@ -353,14 +366,14 @@ } ], "responses": { - "204": { + "200": { "description": "Success" }, + "404": { + "description": "Not Found" + }, "default": { "description": "Error response", - "schema": { - "$ref": "#/definitions/ErrorDetail" - }, "x-ms-error-response": true, "headers": { "x-ms-error-code": { @@ -369,6 +382,11 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_ConnectionExists": { + "$ref": "./examples/WebPubSub_ConnectionExists.json" + } } } }, @@ -426,7 +444,7 @@ ], "responses": { "202": { - "description": "Success" + "description": "Accepted" }, "default": { "description": "Error response", @@ -441,6 +459,11 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_SendToConnection": { + "$ref": "./examples/WebPubSub_SendToConnection.json" + } } } }, @@ -451,11 +474,6 @@ ], "summary": "Check if there are any client connections inside the given group", "operationId": "WebPubSub_GroupExists", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], "parameters": [ { "in": "path", @@ -491,9 +509,6 @@ }, "default": { "description": "Error response", - "schema": { - "$ref": "#/definitions/ErrorDetail" - }, "x-ms-error-response": true, "headers": { "x-ms-error-code": { @@ -502,6 +517,11 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_GroupExists": { + "$ref": "./examples/WebPubSub_GroupExists.json" + } } } }, @@ -561,7 +581,7 @@ ], "responses": { "204": { - "description": "Success" + "description": "No Content" }, "default": { "description": "Error response", @@ -576,6 +596,11 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_CloseGroupConnections": { + "$ref": "./examples/WebPubSub_CloseGroupConnections.json" + } } } }, @@ -644,7 +669,7 @@ ], "responses": { "202": { - "description": "Success" + "description": "Accepted" }, "default": { "description": "Error response", @@ -659,16 +684,21 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_SendToGroup": { + "$ref": "./examples/WebPubSub_SendToGroup.json" + } } } }, "/api/hubs/{hub}/groups/{group}/connections/{connectionId}": { - "put": { + "delete": { "tags": [ "webpubsub" ], - "summary": "Add a connection to the target group.", - "operationId": "WebPubSub_AddConnectionToGroup", + "summary": "Remove a connection from the target group.", + "operationId": "WebPubSub_RemoveConnectionFromGroup", "produces": [ "text/plain", "application/json", @@ -695,7 +725,7 @@ { "in": "path", "name": "connectionId", - "description": "Target connection Id", + "description": "Target connection Id.", "required": true, "type": "string", "minLength": 1 @@ -709,8 +739,8 @@ } ], "responses": { - "200": { - "description": "Success" + "204": { + "description": "No Content" }, "default": { "description": "Error response", @@ -725,14 +755,19 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_RemoveConnectionFromGroup": { + "$ref": "./examples/WebPubSub_RemoveConnectionFromGroup.json" + } } }, - "delete": { + "put": { "tags": [ "webpubsub" ], - "summary": "Remove a connection from the target group.", - "operationId": "WebPubSub_RemoveConnectionFromGroup", + "summary": "Add a connection to the target group.", + "operationId": "WebPubSub_AddConnectionToGroup", "produces": [ "text/plain", "application/json", @@ -759,7 +794,7 @@ { "in": "path", "name": "connectionId", - "description": "Target connection Id.", + "description": "Target connection Id", "required": true, "type": "string", "minLength": 1 @@ -773,7 +808,7 @@ } ], "responses": { - "204": { + "200": { "description": "Success" }, "default": { @@ -789,16 +824,21 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_AddConnectionToGroup": { + "$ref": "./examples/WebPubSub_AddConnectionToGroup.json" + } } } }, - "/api/hubs/{hub}/users/{userId}": { - "head": { + "/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}": { + "delete": { "tags": [ "webpubsub" ], - "summary": "Check if there are any client connections connected for the given user.", - "operationId": "WebPubSub_UserExists", + "summary": "Revoke permission for the connection.", + "operationId": "WebPubSub_RevokePermission", "produces": [ "text/plain", "application/json", @@ -815,12 +855,33 @@ }, { "in": "path", - "name": "userId", - "description": "Target user Id.", + "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", @@ -830,11 +891,8 @@ } ], "responses": { - "200": { - "description": "Success" - }, - "404": { - "description": "Not Found" + "204": { + "description": "No Content" }, "default": { "description": "Error response", @@ -849,21 +907,19 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_RevokePermission": { + "$ref": "./examples/WebPubSub_RevokePermission.json" + } } - } - }, - "/api/hubs/{hub}/users/{userId}/:closeConnections": { - "post": { + }, + "head": { "tags": [ "webpubsub" ], - "summary": "Close connections for the specific user.", - "operationId": "WebPubSub_CloseUserConnections", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], + "summary": "Check if a connection has permission to the specified action.", + "operationId": "WebPubSub_CheckPermission", "parameters": [ { "in": "path", @@ -875,26 +931,31 @@ }, { "in": "path", - "name": "userId", - "description": "The user Id.", + "name": "permission", + "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", "required": true, "type": "string", - "minLength": 1 + "enum": [ + "sendToGroup", + "joinLeaveGroup" + ], + "x-ms-enum": { + "name": "WebPubSubPermission", + "modelAsString": true + } }, { - "in": "query", - "name": "excluded", - "description": "Exclude these connectionIds when closing the connections for the user.", - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "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.", + "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" }, { @@ -906,14 +967,14 @@ } ], "responses": { - "204": { + "200": { "description": "Success" }, + "404": { + "description": "Not Found" + }, "default": { "description": "Error response", - "schema": { - "$ref": "#/definitions/ErrorDetail" - }, "x-ms-error-response": true, "headers": { "x-ms-error-code": { @@ -922,21 +983,19 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_CheckPermission": { + "$ref": "./examples/WebPubSub_CheckPermission.json" + } } - } - }, - "/api/hubs/{hub}/users/{userId}/:send": { - "post": { + }, + "put": { "tags": [ "webpubsub" ], - "summary": "Send content inside request body to the specific user.", - "operationId": "WebPubSub_SendToUser", - "consumes": [ - "application/octet-stream", - "text/plain", - "application/json" - ], + "summary": "Grant permission to the connection.", + "operationId": "WebPubSub_GrantPermission", "produces": [ "text/plain", "application/json", @@ -953,32 +1012,43 @@ }, { "in": "path", - "name": "userId", - "description": "The user Id.", + "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": "api-version", - "description": "The version of the REST APIs.", - "required": true, + "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": "body", - "name": "message", - "description": "The payload body.", + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", "required": true, - "schema": { - "format": "binary", - "type": "string" - } + "type": "string" } ], "responses": { - "202": { + "200": { "description": "Success" }, "default": { @@ -994,21 +1064,21 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_GrantPermission": { + "$ref": "./examples/WebPubSub_GrantPermission.json" + } } } }, - "/api/hubs/{hub}/users/{userId}/groups/{group}": { - "put": { + "/api/hubs/{hub}/users/{userId}": { + "head": { "tags": [ "webpubsub" ], - "summary": "Add a user to the target group.", - "operationId": "WebPubSub_AddUserToGroup", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], + "summary": "Check if there are any client connections connected for the given user.", + "operationId": "WebPubSub_UserExists", "parameters": [ { "in": "path", @@ -1018,15 +1088,6 @@ "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 - }, { "in": "path", "name": "userId", @@ -1047,11 +1108,11 @@ "200": { "description": "Success" }, + "404": { + "description": "Not Found" + }, "default": { "description": "Error response", - "schema": { - "$ref": "#/definitions/ErrorDetail" - }, "x-ms-error-response": true, "headers": { "x-ms-error-code": { @@ -1060,14 +1121,21 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_UserExists": { + "$ref": "./examples/WebPubSub_UserExists.json" + } } - }, - "delete": { + } + }, + "/api/hubs/{hub}/users/{userId}/:closeConnections": { + "post": { "tags": [ "webpubsub" ], - "summary": "Remove a user from the target group.", - "operationId": "WebPubSub_RemoveUserFromGroup", + "summary": "Close connections for the specific user.", + "operationId": "WebPubSub_CloseUserConnections", "produces": [ "text/plain", "application/json", @@ -1084,20 +1152,27 @@ }, { "in": "path", - "name": "group", - "description": "Target group name, which length should be greater than 0 and less than 1025.", + "name": "userId", + "description": "The user Id.", "required": true, "type": "string", - "maxLength": 1024, "minLength": 1 }, { - "in": "path", - "name": "userId", - "description": "Target 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", @@ -1109,7 +1184,7 @@ ], "responses": { "204": { - "description": "Success" + "description": "No Content" }, "default": { "description": "Error response", @@ -1124,16 +1199,26 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_CloseUserConnections": { + "$ref": "./examples/WebPubSub_CloseUserConnections.json" + } } } }, - "/api/hubs/{hub}/users/{userId}/groups": { - "delete": { + "/api/hubs/{hub}/users/{userId}/:send": { + "post": { "tags": [ "webpubsub" ], - "summary": "Remove a user from all groups.", - "operationId": "WebPubSub_RemoveUserFromAllGroups", + "summary": "Send content inside request body to the specific user.", + "operationId": "WebPubSub_SendToUser", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], "produces": [ "text/plain", "application/json", @@ -1151,7 +1236,7 @@ { "in": "path", "name": "userId", - "description": "Target user Id.", + "description": "The user Id.", "required": true, "type": "string", "minLength": 1 @@ -1162,11 +1247,21 @@ "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" + } } ], "responses": { - "204": { - "description": "Success" + "202": { + "description": "Accepted" }, "default": { "description": "Error response", @@ -1181,16 +1276,21 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_SendToUser": { + "$ref": "./examples/WebPubSub_SendToUser.json" + } } } }, - "/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}": { - "put": { + "/api/hubs/{hub}/users/{userId}/groups": { + "delete": { "tags": [ "webpubsub" ], - "summary": "Grant permission to the connection.", - "operationId": "WebPubSub_GrantPermission", + "summary": "Remove a user from all groups.", + "operationId": "WebPubSub_RemoveUserFromAllGroups", "produces": [ "text/plain", "application/json", @@ -1207,33 +1307,12 @@ }, { "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.", + "name": "userId", + "description": "Target user 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", @@ -1243,8 +1322,8 @@ } ], "responses": { - "200": { - "description": "Success" + "204": { + "description": "The user is removed from all groups." }, "default": { "description": "Error response", @@ -1259,14 +1338,21 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_RemoveUserFromAllGroups": { + "$ref": "./examples/WebPubSub_RemoveUserFromAllGroups.json" + } } - }, + } + }, + "/api/hubs/{hub}/users/{userId}/groups/{group}": { "delete": { "tags": [ "webpubsub" ], - "summary": "Revoke permission for the connection.", - "operationId": "WebPubSub_RevokePermission", + "summary": "Remove a user from the target group.", + "operationId": "WebPubSub_RemoveUserFromGroup", "produces": [ "text/plain", "application/json", @@ -1283,33 +1369,21 @@ }, { "in": "path", - "name": "permission", - "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", "required": true, "type": "string", - "enum": [ - "sendToGroup", - "joinLeaveGroup" - ], - "x-ms-enum": { - "name": "WebPubSubPermission", - "modelAsString": true - } + "maxLength": 1024, + "minLength": 1 }, { "in": "path", - "name": "connectionId", - "description": "Target connection Id.", + "name": "userId", + "description": "Target user 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", @@ -1320,7 +1394,7 @@ ], "responses": { "204": { - "description": "Success" + "description": "The user is removed from the group." }, "default": { "description": "Error response", @@ -1335,14 +1409,19 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_RemoveUserFromGroup": { + "$ref": "./examples/WebPubSub_RemoveUserFromGroup.json" + } } }, - "head": { + "put": { "tags": [ "webpubsub" ], - "summary": "Check if a connection has permission to the specified action.", - "operationId": "WebPubSub_CheckPermission", + "summary": "Add a user to the target group.", + "operationId": "WebPubSub_AddUserToGroup", "produces": [ "text/plain", "application/json", @@ -1359,33 +1438,21 @@ }, { "in": "path", - "name": "permission", - "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", "required": true, "type": "string", - "enum": [ - "sendToGroup", - "joinLeaveGroup" - ], - "x-ms-enum": { - "name": "WebPubSubPermission", - "modelAsString": true - } + "maxLength": 1024, + "minLength": 1 }, { "in": "path", - "name": "connectionId", - "description": "Target connection Id.", + "name": "userId", + "description": "Target user 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", @@ -1398,9 +1465,6 @@ "200": { "description": "Success" }, - "404": { - "description": "Not Found" - }, "default": { "description": "Error response", "schema": { @@ -1414,6 +1478,11 @@ } } } + }, + "x-ms-examples": { + "WebPubSub_AddUserToGroup": { + "$ref": "./examples/WebPubSub_AddUserToGroup.json" + } } } }