summary refs log tree commit diff
path: root/docs/client-server/swagger_matrix/events
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-27 12:14:26 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-27 12:14:35 +0100
commit71095f4e6e0504fc51a1ca916650c6822129f401 (patch)
tree398ddd87d170c543a0717af495fdca7f6d28954e /docs/client-server/swagger_matrix/events
parentRemoved urls.rst - The API docs / swagger JSON should be used as the canonica... (diff)
downloadsynapse-71095f4e6e0504fc51a1ca916650c6822129f401.tar.xz
Updated swagger JSON: cleaned up unused entries. Converted most paths to the new format.
Diffstat (limited to 'docs/client-server/swagger_matrix/events')
-rw-r--r--docs/client-server/swagger_matrix/events317
1 files changed, 65 insertions, 252 deletions
diff --git a/docs/client-server/swagger_matrix/events b/docs/client-server/swagger_matrix/events
index c9eb3f6ff7..e8b96861f5 100644
--- a/docs/client-server/swagger_matrix/events
+++ b/docs/client-server/swagger_matrix/events
@@ -1,208 +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"
-              }
-            ]
-          },
-          "parameters": [
-            {
-              "name": "username",
-              "description": "The name that needs to be deleted",
-              "required": true,
-              "type": "string",
-              "paramType": "path"
-            }
-          ],
-          "responseMessages": [
-            {
-              "code": 400,
-              "message": "Invalid username supplied"
-            },
-            {
-              "code": 404,
-              "message": "User not found"
-            }
-          ]
-        },
-        {
           "method": "GET",
-          "summary": "Get user by user name",
-          "notes": "",
-          "type": "User",
-          "nickname": "getUserByName",
-          "authorizations": {},
+          "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 fetched. Use user1 for testing.",
+              "name": "eventId",
+              "description": "The event ID to get.",
               "required": true,
               "type": "string",
               "paramType": "path"
@@ -210,47 +61,8 @@
           ],
           "responseMessages": [
             {
-              "code": 400,
-              "message": "Invalid username supplied"
-            },
-            {
               "code": 404,
-              "message": "User not found"
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "path": "/user/login",
-      "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"
+              "message": "Event not found."
             }
           ]
         }
@@ -258,42 +70,43 @@
     }
   ],
   "models": {
-    "User": {
-      "id": "User",
+    "PaginationChunk": {
+      "id": "PaginationChunk",
       "properties": {
-        "id": {
-          "type": "integer",
-          "format": "int64"
-        },
-        "firstName": {
-          "type": "string"
-        },
-        "username": {
-          "type": "string"
-        },
-        "lastName": {
-          "type": "string"
-        },
-        "email": {
-          "type": "string"
+        "start": {
+          "type": "string",
+          "description": "A token which correlates to the first value in \"chunk\" for paginating.",
+          "required": true
         },
-        "password": {
-          "type": "string"
+        "end": {
+          "type": "string",
+          "description": "A token which correlates to the last value in \"chunk\" for paginating.",
+          "required": true
         },
-        "phone": {
-          "type": "string"
+        "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
         },
-        "userStatus": {
-          "type": "integer",
-          "format": "int32",
-          "description": "User Status",
-          "enum": [
-            "1-registered",
-            "2-active",
-            "3-closed"
-          ]
+        "room_id": {
+          "type": "string",
+          "description": "The room in which this event occurred.",
+          "required": true
         }
       }
     }
   }
-}
\ No newline at end of file
+}