From 595667d15dbbe9c1e8580ea62e8095be3f0dbb2f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 3 Mar 2018 14:46:40 -0700 Subject: [PATCH] Spec /directory/list Adds https://github.com/matrix-org/matrix-doc/issues/417 Signed-off-by: Travis Ralston --- api/client-server/list_public_rooms.yaml | 111 ++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/api/client-server/list_public_rooms.yaml b/api/client-server/list_public_rooms.yaml index 6d25a1ac..4d3923bd 100644 --- a/api/client-server/list_public_rooms.yaml +++ b/api/client-server/list_public_rooms.yaml @@ -13,7 +13,7 @@ # limitations under the License. swagger: '2.0' info: - title: "Matrix Client-Server Room Creation API" + title: "Matrix Client-Server Room Directory API" version: "1.0.0" host: localhost:8008 schemes: @@ -25,6 +25,115 @@ consumes: produces: - application/json paths: + "/directory/list/room/{roomId}": + get: + summary: Gets the visibility of a room in the directory + description: |- + Gets the visibility of a given room on the server's public room directory. + operationId: getRoomVisibilityOnDirectory + security: + - accessToken: [] + parameters: + - in: path + type: string + name: roomId + description: The room ID. + required: true + x-example: "!curbf:matrix.org" + responses: + 200: + description: The visibility of the room in the directory + schema: + type: object + properties: + visibility: + type: string + enum: ['private', 'public'] + description: The visibility of the room in the directory. + examples: + application/json: { + "visibility": "public" + } + 400: + description: The room is not known to the server + examples: + application/json: { + "errcode": "M_UNKNOWN", + "error": "Room not found" + } + put: + summary: Sets the visibility of a room in the room directory + description: |- + Sets the visibility of a given room in the server's public room + directory. + operationId: setRoomVisibilityOnDirectory + security: + - accessToken: [] + parameters: + - in: path + type: string + name: roomId + description: The room ID. + required: true + x-example: "!curbf:matrix.org" + - in: body + name: body + required: true + description: |- + The new visibility for the room on the room directory. + schema: + type: object + properties: + visibility: + type: string + enum: ["private", "public"] + description: |- + The new visibility setting for the room. + Defaults to 'public'. + example: { + "visibility": "public" + } + responses: + 200: + description: The visibility was updated, or no change was needed. + examples: + application/json: { + } + 400: + description: The room is not known to the server + examples: + application/json: { + "errcode": "M_UNKNOWN", + "error": "Room not found" + } + delete: + summary: Sets a room to be private on the room directory + description: |- + Updates the visibility of a room to be private on the server's room + directory. + operationId: setRoomPrivateOnDirectory + security: + - accessToken: [] + parameters: + - in: path + type: string + name: roomId + description: The room ID. + required: true + x-example: "!curbf:matrix.org" + responses: + 200: + description: The visibility was updated, or no change was needed. + examples: + application/json: { + } + 400: + description: The room is not known to the server + examples: + application/json: { + "errcode": "M_UNKNOWN", + "error": "Room not found" + } "/publicRooms": get: summary: Lists the public rooms on the server.