diff options
Diffstat (limited to 'docs/client-server/swagger_matrix/events')
-rw-r--r-- | docs/client-server/swagger_matrix/events | 419 |
1 files changed, 183 insertions, 236 deletions
diff --git a/docs/client-server/swagger_matrix/events b/docs/client-server/swagger_matrix/events index c9eb3f6ff7..ca69d34db5 100644 --- a/docs/client-server/swagger_matrix/events +++ b/docs/client-server/swagger_matrix/events @@ -1,181 +1,59 @@ { "apiVersion": "1.0.0", "swaggerVersion": "1.2", - "basePath": "http://petstore.swagger.wordnik.com/api", - "resourcePath": "/user", + "basePath": "http://localhost:8080/matrix/client/api/v1", + "resourcePath": "/events", "produces": [ "application/json" ], "apis": [ { - "path": "/user", - "operations": [ - { - "method": "POST", - "summary": "Create user", - "notes": "This can only be done by the logged in user.", - "type": "void", - "nickname": "createUser", - "authorizations": { - "oauth2": [ - { - "scope": "test:anything", - "description": "anything" - } - ] - }, - "parameters": [ - { - "name": "body", - "description": "Created user object", - "required": true, - "type": "User", - "paramType": "body" - } - ] - } - ] - }, - { - "path": "/user/logout", + "path": "/events", "operations": [ { "method": "GET", - "summary": "Logs out current logged in user session", - "notes": "", - "type": "void", - "nickname": "logoutUser", - "authorizations": {}, - "parameters": [] + "summary": "Listen on the event stream", + "notes": "This can only be done by the logged in user. This will block until an event is received, or until the timeout is reached.", + "type": "PaginationChunk", + "nickname": "get_event_stream" } - ] - }, - { - "path": "/user/createWithArray", - "operations": [ + ], + "parameters": [ { - "method": "POST", - "summary": "Creates list of users with given input array", - "notes": "", - "type": "void", - "nickname": "createUsersWithArrayInput", - "authorizations": { - "oauth2": [ - { - "scope": "test:anything", - "description": "anything" - } - ] - }, - "parameters": [ - { - "name": "body", - "description": "List of user object", - "required": true, - "type": "array", - "items": { - "$ref": "User" - }, - "paramType": "body" - } - ] + "name": "from", + "description": "The token to stream from.", + "required": false, + "type": "string", + "paramType": "query" + }, + { + "name": "timeout", + "description": "The maximum time in milliseconds to wait for an event.", + "required": false, + "type": "integer", + "paramType": "query" } - ] - }, - { - "path": "/user/createWithList", - "operations": [ + ], + "responseMessages": [ { - "method": "POST", - "summary": "Creates list of users with given list input", - "notes": "", - "type": "void", - "nickname": "createUsersWithListInput", - "authorizations": { - "oauth2": [ - { - "scope": "test:anything", - "description": "anything" - } - ] - }, - "parameters": [ - { - "name": "body", - "description": "List of user object", - "required": true, - "type": "array", - "items": { - "$ref": "User" - }, - "paramType": "body" - } - ] + "code": 400, + "message": "Bad pagination token." } ] }, { - "path": "/user/{username}", + "path": "/events/{eventId}", "operations": [ { - "method": "PUT", - "summary": "Updated user", - "notes": "This can only be done by the logged in user.", - "type": "void", - "nickname": "updateUser", - "authorizations": { - "oauth2": [ - { - "scope": "test:anything", - "description": "anything" - } - ] - }, - "parameters": [ - { - "name": "username", - "description": "name that need to be deleted", - "required": true, - "type": "string", - "paramType": "path" - }, - { - "name": "body", - "description": "Updated user object", - "required": true, - "type": "User", - "paramType": "body" - } - ], - "responseMessages": [ - { - "code": 400, - "message": "Invalid username supplied" - }, - { - "code": 404, - "message": "User not found" - } - ] - }, - { - "method": "DELETE", - "summary": "Delete user", - "notes": "This can only be done by the logged in user.", - "type": "void", - "nickname": "deleteUser", - "authorizations": { - "oauth2": [ - { - "scope": "test:anything", - "description": "anything" - } - ] - }, + "method": "GET", + "summary": "Get information about a single event.", + "notes": "Get information about a single event.", + "type": "Event", + "nickname": "get_event", "parameters": [ { - "name": "username", - "description": "The name that needs to be deleted", + "name": "eventId", + "description": "The event ID to get.", "required": true, "type": "string", "paramType": "path" @@ -183,117 +61,186 @@ ], "responseMessages": [ { - "code": 400, - "message": "Invalid username supplied" - }, - { "code": 404, - "message": "User not found" + "message": "Event not found." } ] - }, + } + ] + }, + { + "path": "/initialSync", + "operations": [ { "method": "GET", - "summary": "Get user by user name", - "notes": "", - "type": "User", - "nickname": "getUserByName", - "authorizations": {}, + "summary": "Get this user's current state.", + "notes": "Get this user's current state.", + "type": "InitialSyncResponse", + "nickname": "initial_sync", "parameters": [ { - "name": "username", - "description": "The name that needs to be fetched. Use user1 for testing.", - "required": true, - "type": "string", - "paramType": "path" - } - ], - "responseMessages": [ - { - "code": 400, - "message": "Invalid username supplied" - }, - { - "code": 404, - "message": "User not found" + "name": "limit", + "description": "The maximum number of messages to return for each room.", + "type": "integer", + "paramType": "query", + "required": false } ] } ] }, { - "path": "/user/login", + "path": "/publicRooms", "operations": [ { "method": "GET", - "summary": "Logs user into the system", - "notes": "", - "type": "string", - "nickname": "loginUser", - "authorizations": {}, - "parameters": [ - { - "name": "username", - "description": "The user name for login", - "required": true, - "type": "string", - "paramType": "query" - }, - { - "name": "password", - "description": "The password for login in clear text", - "required": true, - "type": "string", - "paramType": "query" - } - ], - "responseMessages": [ - { - "code": 400, - "message": "Invalid username and password combination" - } - ] + "summary": "Get a list of publicly visible rooms.", + "type": "PublicRoomsPaginationChunk", + "nickname": "get_public_room_list" } ] } ], "models": { - "User": { - "id": "User", + "PaginationChunk": { + "id": "PaginationChunk", "properties": { - "id": { - "type": "integer", - "format": "int64" + "start": { + "type": "string", + "description": "A token which correlates to the first value in \"chunk\" for paginating.", + "required": true + }, + "end": { + "type": "string", + "description": "A token which correlates to the last value in \"chunk\" for paginating.", + "required": true + }, + "chunk": { + "type": "array", + "description": "An array of events.", + "required": true, + "items": { + "$ref": "Event" + } + } + } + }, + "Event": { + "id": "Event", + "properties": { + "event_id": { + "type": "string", + "description": "An ID which uniquely identifies this event.", + "required": true }, - "firstName": { - "type": "string" + "room_id": { + "type": "string", + "description": "The room in which this event occurred.", + "required": true + } + } + }, + "PublicRoomInfo": { + "id": "PublicRoomInfo", + "properties": { + "aliases": { + "type": "array", + "description": "A list of room aliases for this room.", + "items": { + "$ref": "string" + } + }, + "name": { + "type": "string", + "description": "The name of the room, as given by the m.room.name state event." + }, + "room_id": { + "type": "string", + "description": "The room ID for this public room.", + "required": true + }, + "topic": { + "type": "string", + "description": "The topic of this room, as given by the m.room.topic state event." + } + } + }, + "PublicRoomsPaginationChunk": { + "id": "PublicRoomsPaginationChunk", + "properties": { + "start": { + "type": "string", + "description": "A token which correlates to the first value in \"chunk\" for paginating.", + "required": true }, - "username": { - "type": "string" + "end": { + "type": "string", + "description": "A token which correlates to the last value in \"chunk\" for paginating.", + "required": true + }, + "chunk": { + "type": "array", + "description": "A list of public room data.", + "required": true, + "items": { + "$ref": "PublicRoomInfo" + } + } + } + }, + "InitialSyncResponse": { + "id": "InitialSyncResponse", + "properties": { + "end": { + "type": "string", + "description": "A streaming token which can be used with /events to continue from this snapshot of data.", + "required": true }, - "lastName": { - "type": "string" + "presence": { + "type": "array", + "description": "A list of presence events.", + "items": { + "$ref": "Event" + }, + "required": false }, - "email": { - "type": "string" + "rooms": { + "type": "array", + "description": "A list of initial sync room data.", + "required": false, + "items": { + "$ref": "InitialSyncRoomData" + } + } + } + }, + "InitialSyncRoomData": { + "id": "InitialSyncRoomData", + "properties": { + "membership": { + "type": "string", + "description": "This user's membership state in this room.", + "required": true }, - "password": { - "type": "string" + "room_id": { + "type": "string", + "description": "The ID of this room.", + "required": true }, - "phone": { - "type": "string" + "messages": { + "type": "PaginationChunk", + "description": "The most recent messages for this room, governed by the limit parameter.", + "required": false }, - "userStatus": { - "type": "integer", - "format": "int32", - "description": "User Status", - "enum": [ - "1-registered", - "2-active", - "3-closed" - ] + "state": { + "type": "array", + "description": "A list of state events representing the current state of the room.", + "required": false, + "items": { + "$ref": "Event" + } } } } } -} \ No newline at end of file +} |