Documentation ¶
Index ¶
Constants ¶
const BasePath = "/api/v1/media"
BasePath is the base API path for making media requests
const BasePathWithID = BasePath + "/:" + IDKey
BasePathWithID corresponds to a media attachment with the given ID
const IDKey = "id"
IDKey is the key for media attachment IDs
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements the ClientAPIModule interface for media
func (*Module) MediaCreatePOSTHandler ¶
MediaCreatePOSTHandler swagger:operation POST /api/v1/media mediaCreate
Upload a new media attachment.
--- tags: - media
consumes: - multipart/form-data
produces: - application/json
parameters:
- name: description in: formData description: |- Image or media description to use as alt-text on the attachment. This is very useful for users of screenreaders. May or may not be required, depending on your instance settings. type: string
- name: focus in: formData description: |- Focus of the media file. If present, it should be in the form of two comma-separated floats between -1 and 1. For example: `-0.5,0.25`. type: string
- name: file in: formData description: The media attachment to upload. type: file required: true
security: - OAuth2 Bearer:
- write:media
responses:
'200': description: The newly-created media attachment. schema: "$ref": "#/definitions/attachment" '400': description: bad request '401': description: unauthorized '403': description: forbidden '422': description: unprocessable
func (*Module) MediaGETHandler ¶
MediaGETHandler swagger:operation GET /api/v1/media/{id} mediaGet
Get a media attachment that you own.
--- tags: - media
produces: - application/json
parameters:
- name: id description: id of the attachment type: string in: path required: true
security: - OAuth2 Bearer:
- read:media
responses:
'200': description: The requested media attachment. schema: "$ref": "#/definitions/attachment" '400': description: bad request '401': description: unauthorized '403': description: forbidden '422': description: unprocessable
func (*Module) MediaPUTHandler ¶
MediaPUTHandler swagger:operation PUT /api/v1/media/{id} mediaUpdate
Update a media attachment.
You must own the media attachment, and the attachment must not yet be attached to a status.
The parameters can also be given in the body of the request, as JSON, if the content-type is set to 'application/json'. The parameters can also be given in the body of the request, as XML, if the content-type is set to 'application/xml'.
--- tags: - media
consumes: - application/json - application/xml - application/x-www-form-urlencoded
produces: - application/json
parameters:
- name: id description: id of the attachment to update type: string in: path required: true
- name: description in: formData description: |- Image or media description to use as alt-text on the attachment. This is very useful for users of screenreaders. May or may not be required, depending on your instance settings. type: string allowEmptyValue: true
- name: focus in: formData description: |- Focus of the media file. If present, it should be in the form of two comma-separated floats between -1 and 1. For example: `-0.5,0.25`. type: string allowEmptyValue: true
security: - OAuth2 Bearer:
- write:media
responses:
'200': description: The newly-updated media attachment. schema: "$ref": "#/definitions/attachment" '400': description: bad request '401': description: unauthorized '403': description: forbidden '422': description: unprocessable