list

package
v0.13.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

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

func New

func New(state *state.State, converter *typeutils.Converter) Processor

func (*Processor) AddToList

func (p *Processor) AddToList(ctx context.Context, account *gtsmodel.Account, listID string, targetAccountIDs []string) gtserror.WithCode

AddToList adds targetAccountIDs to the given list, if valid.

func (*Processor) Create

func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, title string, repliesPolicy gtsmodel.RepliesPolicy) (*apimodel.List, gtserror.WithCode)

Create creates one a new list for the given account, using the provided parameters. These params should have already been validated by the time they reach this function.

func (*Processor) Delete

func (p *Processor) Delete(ctx context.Context, account *gtsmodel.Account, id string) gtserror.WithCode

Delete deletes one list for the given account.

func (*Processor) Get

func (p *Processor) Get(ctx context.Context, account *gtsmodel.Account, id string) (*apimodel.List, gtserror.WithCode)

Get returns the api model of one list with the given ID.

func (*Processor) GetAll

func (p *Processor) GetAll(ctx context.Context, account *gtsmodel.Account) ([]*apimodel.List, gtserror.WithCode)

GetMultiple returns multiple lists created by the given account, sorted by list ID DESC (newest first).

func (*Processor) GetAllListAccounts

func (p *Processor) GetAllListAccounts(
	ctx context.Context,
	account *gtsmodel.Account,
	listID string,
) ([]*apimodel.Account, gtserror.WithCode)

GetAllListAccounts returns all accounts that are in the given list, owned by the given account. There's no pagination for this endpoint.

See https://docs.joinmastodon.org/methods/lists/#query-parameters:

Limit: Integer. Maximum number of results. Defaults to 40 accounts.
Max 80 accounts. Set to 0 in order to get all accounts without pagination.

func (*Processor) GetListAccounts

func (p *Processor) GetListAccounts(
	ctx context.Context,
	account *gtsmodel.Account,
	listID string,
	maxID string,
	sinceID string,
	minID string,
	limit int,
) (*apimodel.PageableResponse, gtserror.WithCode)

GetListAccounts returns accounts that are in the given list, owned by the given account. The additional parameters can be used for paging.

func (*Processor) RemoveFromList

func (p *Processor) RemoveFromList(ctx context.Context, account *gtsmodel.Account, listID string, targetAccountIDs []string) gtserror.WithCode

RemoveFromList removes targetAccountIDs from the given list, if valid.

func (*Processor) Update

func (p *Processor) Update(
	ctx context.Context,
	account *gtsmodel.Account,
	id string,
	title *string,
	repliesPolicy *gtsmodel.RepliesPolicy,
) (*apimodel.List, gtserror.WithCode)

Update updates one list for the given account, using the provided parameters. These params should have already been validated by the time they reach this function.

Jump to

Keyboard shortcuts

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