added endpoints to set/remove a username + change the account settings

This commit is contained in:
Bernhard B
2024-03-06 18:27:17 +01:00
parent 91d7dc0a19
commit f57512216c
6 changed files with 594 additions and 0 deletions

View File

@@ -116,6 +116,127 @@ var doc = `{
}
}
},
"/v1/accounts/{number}/settings": {
"put": {
"description": "Update the account attributes on the signal server.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Accounts"
],
"summary": "Update the account settings.",
"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.UpdateAccountSettingsRequest"
}
}
],
"responses": {
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/v1/accounts/{number}/username": {
"post": {
"description": "Allows to set the username that should be used for this account. This can either be just the nickname (e.g. test) or the complete username with discriminator (e.g. test.123). Returns the new username with discriminator and the username link.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Accounts"
],
"summary": "Set a username.",
"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.SetUsernameRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/client.SetUsernameResponse"
}
},
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
},
"delete": {
"description": "Delete the username associated with this account.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Accounts"
],
"summary": "Remove a username.",
"parameters": [
{
"type": "string",
"description": "Registered Phone Number",
"name": "number",
"in": "path",
"required": true
}
],
"responses": {
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/v1/attachments": {
"get": {
"description": "List all downloaded attachments",
@@ -1964,6 +2085,14 @@ var doc = `{
}
}
},
"api.SetUsernameRequest": {
"type": "object",
"properties": {
"username": {
"type": "string"
}
}
},
"api.TrustIdentityRequest": {
"type": "object",
"properties": {
@@ -2013,6 +2142,17 @@ var doc = `{
}
}
},
"api.UpdateAccountSettingsRequest": {
"type": "object",
"properties": {
"discoverable_by_number": {
"type": "boolean"
},
"share_number": {
"type": "boolean"
}
}
},
"api.UpdateContactRequest": {
"type": "object",
"properties": {
@@ -2166,6 +2306,17 @@ var doc = `{
"type": "integer"
}
}
},
"client.SetUsernameResponse": {
"type": "object",
"properties": {
"username": {
"type": "string"
},
"username_link": {
"type": "string"
}
}
}
},
"tags": [