From 3a5f060546771108ec1b8c5afb7aee22fa16e952 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Sat, 19 Mar 2022 19:03:28 +0100 Subject: [PATCH] updated swagger documentation --- src/docs/docs.go | 106 ++++++++++++++++++++++++++++++++++++++++++ src/docs/swagger.json | 106 ++++++++++++++++++++++++++++++++++++++++++ src/docs/swagger.yaml | 70 ++++++++++++++++++++++++++++ 3 files changed, 282 insertions(+) diff --git a/src/docs/docs.go b/src/docs/docs.go index 1874f66..fa2e4bd 100644 --- a/src/docs/docs.go +++ b/src/docs/docs.go @@ -209,6 +209,90 @@ var doc = `{ } } }, + "/v1/contacts{number}": { + "put": { + "description": "Updates the info associated to a number on the contact list.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Contacts" + ], + "summary": "Updates the info associated to a number on the contact list. If the contact doesn’t exist yet, it will be added.", + "parameters": [ + { + "type": "string", + "description": "Registered Phone Number", + "name": "number", + "in": "path", + "required": true + }, + { + "description": "Contact", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/api.UpdateContactRequest" + } + } + ], + "responses": { + "204": {}, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/api.Error" + } + } + } + } + }, + "/v1/devices/{number}": { + "post": { + "description": "Links another device to this device. Only works, if this is the master device.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Devices" + ], + "summary": "Links another device to this device.", + "parameters": [ + { + "type": "string", + "description": "Registered Phone Number", + "name": "number", + "in": "path", + "required": true + }, + { + "description": "Request", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/api.AddDeviceRequest" + } + } + ], + "responses": { + "204": {}, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/api.Error" + } + } + } + } + }, "/v1/groups/{number}": { "get": { "description": "List all Signal Groups.", @@ -1174,6 +1258,14 @@ var doc = `{ } }, "definitions": { + "api.AddDeviceRequest": { + "type": "object", + "properties": { + "uri": { + "type": "string" + } + } + }, "api.Configuration": { "type": "object", "properties": { @@ -1373,6 +1465,20 @@ var doc = `{ } } }, + "api.UpdateContactRequest": { + "type": "object", + "properties": { + "expiration_in_seconds": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "recipient": { + "type": "string" + } + } + }, "api.UpdateProfileRequest": { "type": "object", "properties": { diff --git a/src/docs/swagger.json b/src/docs/swagger.json index edfdbb5..fa3fba4 100644 --- a/src/docs/swagger.json +++ b/src/docs/swagger.json @@ -193,6 +193,90 @@ } } }, + "/v1/contacts{number}": { + "put": { + "description": "Updates the info associated to a number on the contact list.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Contacts" + ], + "summary": "Updates the info associated to a number on the contact list. If the contact doesn’t exist yet, it will be added.", + "parameters": [ + { + "type": "string", + "description": "Registered Phone Number", + "name": "number", + "in": "path", + "required": true + }, + { + "description": "Contact", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/api.UpdateContactRequest" + } + } + ], + "responses": { + "204": {}, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/api.Error" + } + } + } + } + }, + "/v1/devices/{number}": { + "post": { + "description": "Links another device to this device. Only works, if this is the master device.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Devices" + ], + "summary": "Links another device to this device.", + "parameters": [ + { + "type": "string", + "description": "Registered Phone Number", + "name": "number", + "in": "path", + "required": true + }, + { + "description": "Request", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/api.AddDeviceRequest" + } + } + ], + "responses": { + "204": {}, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/api.Error" + } + } + } + } + }, "/v1/groups/{number}": { "get": { "description": "List all Signal Groups.", @@ -1158,6 +1242,14 @@ } }, "definitions": { + "api.AddDeviceRequest": { + "type": "object", + "properties": { + "uri": { + "type": "string" + } + } + }, "api.Configuration": { "type": "object", "properties": { @@ -1357,6 +1449,20 @@ } } }, + "api.UpdateContactRequest": { + "type": "object", + "properties": { + "expiration_in_seconds": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "recipient": { + "type": "string" + } + } + }, "api.UpdateProfileRequest": { "type": "object", "properties": { diff --git a/src/docs/swagger.yaml b/src/docs/swagger.yaml index 0a3d892..5fab35c 100644 --- a/src/docs/swagger.yaml +++ b/src/docs/swagger.yaml @@ -1,5 +1,10 @@ basePath: / definitions: + api.AddDeviceRequest: + properties: + uri: + type: string + type: object api.Configuration: properties: logging: @@ -130,6 +135,15 @@ definitions: example: false type: boolean type: object + api.UpdateContactRequest: + properties: + expiration_in_seconds: + type: integer + name: + type: string + recipient: + type: string + type: object api.UpdateProfileRequest: properties: base64_avatar: @@ -321,6 +335,62 @@ paths: summary: Set the REST API configuration. tags: - General + /v1/contacts{number}: + put: + consumes: + - application/json + description: Updates the info associated to a number on the contact list. + parameters: + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Contact + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.UpdateContactRequest' + produces: + - application/json + responses: + "204": {} + "400": + description: Bad Request + schema: + $ref: '#/definitions/api.Error' + summary: Updates the info associated to a number on the contact list. If the contact doesn’t exist yet, it will be added. + tags: + - Contacts + /v1/devices/{number}: + post: + consumes: + - application/json + description: Links another device to this device. Only works, if this is the master device. + parameters: + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Request + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.AddDeviceRequest' + produces: + - application/json + responses: + "204": {} + "400": + description: Bad Request + schema: + $ref: '#/definitions/api.Error' + summary: Links another device to this device. + tags: + - Devices /v1/groups/{number}: get: consumes: