anilist/medialist.go
2022-02-24 21:15:14 +01:00

54 lines
1.2 KiB
Go

package anilist
import "context"
func (api *Api) GetMediaList(ctx context.Context, vars MediaListQuery, onError func(error)) *Cursor[MediaList] {
resp := responseObj[*page[MediaList]]{}
return requestPaged(api, ctx, getMediaListQuery, vars.toMap(), &resp, onError)
}
const (
getMediaListQuery = `query (
$id: Int,
$userId: Int,
$userName: String,
$type: MediaType,
$status: MediaListStatus,
$mediaId: Int,
$isFollowing: Boolean,
$notes: String,
$userId_in: [Int],
$status_in: [MediaListStatus],
$status_not_in: [MediaListStatus],
$status_not: MediaListStatus,
$mediaId_in: [Int],
$mediaId_not_in: [Int],
$sort: [MediaListSort],
$page: Int
)
{
Page (page: $page) {
pageInfo ` + subSelectionPageInfo + `
mediaList (
id: $id,
userId: $userId,
userName: $userName,
type: $type,
status: $status,
mediaId: $mediaId,
isFollowing: $isFollowing,
notes: $notes,
userId_in: $userId_in,
status_in: $status_in,
status_not_in: $status_not_in,
status_not: $status_not,
mediaId_in: $mediaId_in,
mediaId_not_in: $mediaId_not_in,
sort: $sort
) ` + subSelectionMediaList + `
}
}`
)