lists

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDKey = "id"
	// BasePath is the base path for serving the lists API, minus the 'api' prefix
	BasePath       = "/v1/lists"
	BasePathWithID = BasePath + "/:" + IDKey
	AccountsPath   = BasePathWithID + "/accounts"
	MaxIDKey       = "max_id"
	LimitKey       = "limit"
	SinceIDKey     = "since_id"
	MinIDKey       = "min_id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

func New

func New(processor *processing.Processor) *Module

func (*Module) ListAccountsDELETEHandler added in v0.10.0

func (m *Module) ListAccountsDELETEHandler(c *gin.Context)

ListAccountsDELETEHandler swagger:operation DELETE /api/v1/lists/{id}/accounts removeListAccounts

Remove one or more accounts from the given list.

---
tags:
- lists

consumes:
- application/json
- application/xml
- application/x-www-form-urlencoded

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: ID of the list
	in: path
	required: true
-
	name: account_ids[]
	type: array
	items:
		type: string
	description: >-
		Array of accountIDs to modify.
		Each accountID must correspond to an account
		that the requesting account follows.
	in: formData
	collectionFormat: multi
	required: true

security:
- OAuth2 Bearer:
	- read:lists

responses:
	'200':
		description: list accounts updated
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ListAccountsGETHandler added in v0.10.0

func (m *Module) ListAccountsGETHandler(c *gin.Context)

ListAccountsGETHandler swagger:operation GET /api/v1/lists/{id}/accounts listAccounts

Page through accounts in this list.

The returned Link header can be used to generate the previous and next queries when scrolling up or down a timeline.

Example:

``` <https://example.org/api/v1/list/01H0W619198FX7J54NF7EH1NG2/accounts?limit=20&max_id=01FC3GSQ8A3MMJ43BPZSGEG29M>; rel="next", <https://example.org/api/v1/list/01H0W619198FX7J54NF7EH1NG2/accounts?limit=20&min_id=01FC3KJW2GYXSDDRA6RWNDM46M>; rel="prev" ````

---
tags:
- lists

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: ID of the list
	in: path
	required: true
-
	name: max_id
	type: string
	description: >-
		Return only list entries *OLDER* than the given max ID.
		The account from the list entry with the specified ID will not be included in the response.
	in: query
	required: false
-
	name: since_id
	type: string
	description: >-
		Return only list entries *NEWER* than the given since ID.
		The account from the list entry with the specified ID will not be included in the response.
	in: query
-
	name: min_id
	type: string
	description: >-
		Return only list entries *IMMEDIATELY NEWER* than the given min ID.
		The account from the list entry with the specified ID will not be included in the response.
	in: query
	required: false
-
	name: limit
	type: integer
	description: >-
		Number of accounts to return.
		If set to 0 explicitly, all accounts in the list will be returned, and pagination headers will not be used.
		This is a workaround for Mastodon API peculiarities: https://docs.joinmastodon.org/methods/lists/#query-parameters.
	default: 40
	minimum: 0
	maximum: 80
	in: query
	required: false

security:
- OAuth2 Bearer:
	- read:lists

responses:
	'200':
		headers:
			Link:
				type: string
				description: Links to the next and previous queries.
		name: accounts
		description: Array of accounts.
		schema:
			type: array
			items:
				"$ref": "#/definitions/account"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ListAccountsPOSTHandler added in v0.10.0

func (m *Module) ListAccountsPOSTHandler(c *gin.Context)

ListAccountsPOSTHandler swagger:operation POST /api/v1/lists/{id}/accounts addListAccounts

Add one or more accounts to the given list.

---
tags:
- lists

consumes:
- application/json
- application/xml
- application/x-www-form-urlencoded

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: ID of the list
	in: path
	required: true
-
	name: account_ids[]
	type: array
	items:
		type: string
	description: >-
		Array of accountIDs to modify.
		Each accountID must correspond to an account
		that the requesting account follows.
	in: formData
	collectionFormat: multi
	required: true

security:
- OAuth2 Bearer:
	- read:lists

responses:
	'200':
		description: list accounts updated
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ListCreatePOSTHandler added in v0.10.0

func (m *Module) ListCreatePOSTHandler(c *gin.Context)

ListCreatePOSTHandler swagger:operation POST /api/v1/lists listCreate

Create a new list.

---
tags:
- lists

consumes:
- application/json
- application/xml
- application/x-www-form-urlencoded

produces:
- application/json

parameters:
-
	name: title
	type: string
	description: |-
		Title of this list.
		Sample: Cool People
	in: formData
-
	name: replies_policy
	type: string
	description: |-
	  RepliesPolicy for this list.
	  followed = Show replies to any followed user
	  list = Show replies to members of the list
	  none = Show replies to no one
	  Sample: list
	enum:
		- followed
		- list
		- none
	in: formData
-
	name: exclusive
	in: formData
	description: Hide posts from members of this list from your home timeline.
	type: boolean
	default: false

security:
- OAuth2 Bearer:
	- write:lists

responses:
	'200':
		description: "The newly created list."
		schema:
			"$ref": "#/definitions/list"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'403':
		description: forbidden
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ListDELETEHandler added in v0.10.0

func (m *Module) ListDELETEHandler(c *gin.Context)

ListDELETEHandler swagger:operation DELETE /api/v1/lists/{id} listDelete

Delete a single list with the given ID.

---
tags:
- lists

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: ID of the list
	in: path
	required: true

security:
- OAuth2 Bearer:
	- write:lists

responses:
	'200':
		description: list deleted
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ListGETHandler added in v0.10.0

func (m *Module) ListGETHandler(c *gin.Context)

ListGETHandler swagger:operation GET /api/v1/lists/{id} list

Get a single list with the given ID.

---
tags:
- lists

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: ID of the list
	in: path
	required: true

security:
- OAuth2 Bearer:
	- read:lists

responses:
	'200':
		name: list
		description: Requested list.
		schema:
			"$ref": "#/definitions/list"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ListUpdatePUTHandler added in v0.10.0

func (m *Module) ListUpdatePUTHandler(c *gin.Context)

ListUpdatePUTHandler swagger:operation PUT /api/v1/lists/{id} listUpdate

Update an existing list.

---
tags:
- lists

consumes:
- application/json
- application/xml
- application/x-www-form-urlencoded

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: ID of the list
	in: path
	required: true
-
	name: title
	type: string
	description: |-
		Title of this list.
		Sample: Cool People
	in: formData
-
	name: replies_policy
	type: string
	description: |-
	  RepliesPolicy for this list.
	  followed = Show replies to any followed user
	  list = Show replies to members of the list
	  none = Show replies to no one
	  Sample: list
	enum:
		- followed
		- list
		- none
	in: formData
-
	name: exclusive
	in: formData
	description: Hide posts from members of this list from your home timeline.
	type: boolean

security:
- OAuth2 Bearer:
	- write:lists

responses:
	'200':
		description: "The newly updated list."
		schema:
			"$ref": "#/definitions/list"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'403':
		description: forbidden
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ListsGETHandler

func (m *Module) ListsGETHandler(c *gin.Context)

ListsGETHandler swagger:operation GET /api/v1/lists lists

Get all lists for owned by authorized user.

---
tags:
- lists

produces:
- application/json

security:
- OAuth2 Bearer:
	- read:lists

responses:
	'200':
		name: lists
		description: Array of all lists owned by the requesting user.
		schema:
			type: array
			items:
				"$ref": "#/definitions/list"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) Route

func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL