updated swagger documentation

This commit is contained in:
Bernhard B
2022-03-19 19:03:28 +01:00
parent 8292eac6fe
commit 3a5f060546
3 changed files with 282 additions and 0 deletions

View File

@@ -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 doesnt 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": {

View File

@@ -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 doesnt 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": {

View File

@@ -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 doesnt 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: