ListClients()

This commit is contained in:
2022-11-19 12:47:23 +01:00
parent 35ef2175bc
commit f555f0f1cf
12 changed files with 307 additions and 19 deletions

View File

@@ -47,7 +47,7 @@
},
"/api-v2/user/{uid}": {
"get": {
"summary": "Get a user (only self is allowed)",
"summary": "Get a user",
"operationId": "api-user-get",
"parameters": [
{
@@ -93,7 +93,7 @@
},
"patch": {
"description": "The body-values are optional, only send the ones you want to update",
"summary": "(Partially) update a user (only self allowed)",
"summary": "(Partially) update a user",
"operationId": "api-user-update",
"parameters": [
{
@@ -139,6 +139,53 @@
}
}
},
"/api-v2/user/{uid}/clients": {
"get": {
"summary": "List all clients",
"operationId": "api-clients-list",
"parameters": [
{
"type": "integer",
"description": "UserID",
"name": "uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.ListClients.result"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
}
}
}
},
"/api/ack.php": {
"get": {
"summary": "Acknowledge that a message was received",
@@ -667,6 +714,17 @@
}
}
},
"handler.ListClients.result": {
"type": "object",
"properties": {
"clients": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ClientJSON"
}
}
}
},
"handler.Register.response": {
"type": "object",
"properties": {
@@ -801,6 +859,32 @@
}
}
},
"models.ClientJSON": {
"type": "object",
"properties": {
"agent_model": {
"type": "string"
},
"agent_version": {
"type": "string"
},
"client_id": {
"type": "integer"
},
"fcm_token": {
"type": "string"
},
"timestamp_created": {
"type": "string"
},
"type": {
"type": "string"
},
"user_id": {
"type": "integer"
}
}
},
"models.CompatMessage": {
"type": "object",
"properties": {

View File

@@ -84,6 +84,13 @@ definitions:
user_key:
type: string
type: object
handler.ListClients.result:
properties:
clients:
items:
$ref: '#/definitions/models.ClientJSON'
type: array
type: object
handler.Register.response:
properties:
is_pro:
@@ -171,6 +178,23 @@ definitions:
uri:
type: string
type: object
models.ClientJSON:
properties:
agent_model:
type: string
agent_version:
type: string
client_id:
type: integer
fcm_token:
type: string
timestamp_created:
type: string
type:
type: string
user_id:
type: integer
type: object
models.CompatMessage:
properties:
body:
@@ -290,7 +314,7 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: Get a user (only self is allowed)
summary: Get a user
patch:
description: The body-values are optional, only send the ones you want to update
operationId: api-user-update
@@ -321,7 +345,38 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: (Partially) update a user (only self allowed)
summary: (Partially) update a user
/api-v2/user/{uid}/clients:
get:
operationId: api-clients-list
parameters:
- description: UserID
in: path
name: uid
required: true
type: integer
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.ListClients.result'
"400":
description: Bad Request
schema:
$ref: '#/definitions/ginresp.apiError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/ginresp.apiError'
"404":
description: Not Found
schema:
$ref: '#/definitions/ginresp.apiError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: List all clients
/api/ack.php:
get:
operationId: compat-ack