api: define update emote endpoint

This commit is contained in:
Branden J Brown 2025-05-08 18:53:00 -04:00 committed by zephyr
parent 39c0e2ed0f
commit 471d35f48c
2 changed files with 121 additions and 0 deletions

View File

@ -180,6 +180,9 @@ namespace EmoteManagement {
/** Created emote. */
model CreatedEmote is Success<Emote, 202>;
/** Updated emote. */
model UpdatedEmote is Success<Emote>;
/** Request body contained an emote image which was too large. */
@error
model ErrExcessiveUpload is Error<413>;
@ -199,4 +202,12 @@ namespace EmoteManagement {
image: HttpPart<Image>;
},
): CreatedEmote | ErrBadParameters | ErrAuth | ErrExcessiveUpload;
/**
* Modify an existing emote.
*/
@patch
@operationId("UpdateEmote")
@route("/emotes/{emoteID}")
op update(@path emoteID: id, @body emote: Emote): UpdatedEmote | ErrBadParameters | ErrAuth;
}

View File

@ -154,6 +154,94 @@ paths:
contentType: image/png, image/jpeg, image/gif, image/webp, image/avif
security:
- BearerAuth: []
/emotes/{emoteID}:
patch:
operationId: UpdateEmote
description: Modify an existing emote.
parameters:
- name: emoteID
in: path
required: true
schema:
$ref: '#/components/schemas/Models.id'
responses:
'200':
description: Updated emote.
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Models.Emote'
required:
- data
'400':
description: Supplied parameters did not meet the endpoint requirements.
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Programmer-oriented error description.
message:
type: string
description: User-oriented error message.
required:
- error
- message
'401':
description: |-
Endpoint requires authentication but:
- no token was supplied (401)
- supplied token was invalid (403)
- supplied token was expired (403)
- supplied token was did not include the correct scope (403)
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Programmer-oriented error description.
message:
type: string
description: User-oriented error message.
required:
- error
- message
'403':
description: |-
Endpoint requires authentication but:
- no token was supplied (401)
- supplied token was invalid (403)
- supplied token was expired (403)
- supplied token was did not include the correct scope (403)
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Programmer-oriented error description.
message:
type: string
description: User-oriented error message.
required:
- error
- message
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Models.EmoteUpdate'
security:
- BearerAuth: []
/platforms/{platform}/connections/{connectedID}/set:
get:
operationId: GetPlatformSet
@ -474,6 +562,28 @@ components:
- $ref: '#/components/schemas/Models.id'
description: Older emote version, if any.
description: Full-detail emote model.
Models.EmoteUpdate:
type: object
properties:
name:
type: string
description: Text that should be replaced with the emote image.
tags:
type: array
items:
type: string
description: Search tags for the emote.
attributions:
type: array
items:
$ref: '#/components/schemas/Models.Attribution'
description: People who contributed to the work.
restrictions:
type: array
items:
$ref: '#/components/schemas/Models.id'
description: List of channels allowed to use the emote, if so restricted.
description: Full-detail emote model.
Models.Media:
type: object
required: