anilist/airingschedule.go

56 lines
1.3 KiB
Go
Raw Normal View History

2022-02-03 17:23:29 +01:00
package anilist
2022-02-06 10:39:04 +01:00
import "context"
func (api *Api) GetAiringSchedule(ctx context.Context, vars AiringScheduleQuery, onError func(error)) *Cursor[AiringSchedule] {
2022-02-03 17:23:29 +01:00
resp := responseObj[*page[AiringSchedule]]{}
2022-02-06 10:39:04 +01:00
return requestPaged(api, ctx, getAiringScheduleQuery, vars.toMap(), &resp, onError)
2022-02-03 17:23:29 +01:00
}
const (
getAiringScheduleQuery = `query (
$id: Int,
$mediaId: Int,
$episode: Int,
$airingAt: Int,
$notYetAired: Boolean,
$id_in: [Int],
$id_not_in: [Int],
$mediaId_in: [Int],
$mediaId_not_in: [Int],
$episode_in: [Int],
$episode_not_in: [Int],
$episode_greater: Int,
$episode_lesser: Int,
$airingAt_greater: Int,
$airingAt_lesser: Int,
$sort: [AiringSort],
$page: Int
)
{
Page (page: $page) {
pageInfo ` + subSelectionPageInfo + `
airingSchedules (
id: $id,
mediaId: $mediaId,
episode: $episode,
airingAt: $airingAt,
notYetAired: $notYetAired,
id_in: $id_in,
id_not_in: $id_not_in,
mediaId_in: $mediaId_in,
mediaId_not_in: $mediaId_not_in,
episode_in: $episode_in,
episode_not_in: $episode_not_in,
episode_greater: $episode_greater,
episode_lesser: $episode_lesser,
airingAt_greater: $airingAt_greater,
airingAt_lesser: $airingAt_lesser,
sort: $sort,
) ` + subSelectionAiringSchedule + `
}
}`
)