From f57b2094210de3de6f7333fd5169b8218478f8f9 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 24 Jul 2017 11:17:18 +0500 Subject: Add Computed Attributes to swagger --- swagger.json | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 4 deletions(-) (limited to 'swagger.json') diff --git a/swagger.json b/swagger.json index a8d4f5641..970052e79 100644 --- a/swagger.json +++ b/swagger.json @@ -607,12 +607,10 @@ "$ref": "#/parameters/userId" }, { - "name": "groupId", - "in": "query", - "type": "integer" + "$ref": "#/parameters/deviceId" }, { - "$ref": "#/parameters/deviceId" + "$ref": "#/parameters/groupId" }, { "name": "refresh", @@ -1036,6 +1034,87 @@ } } } + }, + "/attributes/computed": { + "get": { + "summary": "Fetch a list of Attributes", + "description": "Without params, it returns a list of Attributes the user has access to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + }, + { + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Attribute" + } + } + } + } + }, + "post": { + "summary": "Create an Attribute", + "parameters": [ + { + "$ref": "#/parameters/Attribute" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Attribute" + } + } + } + } + }, + "/attributes/computed/{id}": { + "put": { + "summary": "Update an Attribute", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Attribute" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Attribute" + } + } + } + }, + "delete": { + "summary": "Delete an Attribute", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } } }, "definitions": { @@ -1539,6 +1618,26 @@ }, "atributes": {} } + }, + "Attribute": { + "properties": { + "id": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "attribute": { + "type": "string" + }, + "expression": { + "type": "string" + }, + "type": { + "type": "string", + "description": "String|Number|Boolean" + } + } } }, "parameters": { @@ -1566,6 +1665,12 @@ "description": "Standard users can use this only with _deviceId_s, they have access to", "type": "integer" }, + "groupId": { + "name": "groupId", + "in": "query", + "description": "Standard users can use this only with _groupId_s, they have access to", + "type": "integer" + }, "Device": { "name": "body", "in": "body", @@ -1622,6 +1727,14 @@ "$ref": "#/definitions/Calendar" } }, + "Attribute": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Attribute" + } + }, "deviceIdArray": { "name": "deviceId", "in": "query", -- cgit v1.2.3