-
Notifications
You must be signed in to change notification settings - Fork 0
/
criteria.go
64 lines (57 loc) · 1.91 KB
/
criteria.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package comic
// IssueCriteria for querying issues.
type IssueCriteria struct {
Ids []IssueID
VendorIds []string
VendorType VendorType
Formats []Format
Limit int
Offset int
}
// CharacterSourceCriteria for querying character sources.
type CharacterSourceCriteria struct {
CharacterIDs []CharacterID
VendorUrls []string
VendorType VendorType
// If IsMain is null, it will return both.
IsMain *bool
// Include sources that are disabled. By default it does not include disabled sources.
IncludeIsDisabled bool
Limit int
Offset int
}
// CharacterCriteria for querying characters.
type CharacterCriteria struct {
IDs []CharacterID
Slugs []CharacterSlug
PublisherIDs []PublisherID
PublisherSlugs []PublisherSlug
FilterSources bool // Filter characters that only have sources. If false it returns characters regardless.
FilterIssues bool // Filter characters that only have issues. If false it returns characters regardless.
VendorTypes []VendorType // Include characters that are disabled. By default it does not.
IncludeIsDisabled bool
VendorIds []string
Limit int
Offset int
}
// PopularSortCriteria is criteria for sorting popular characters.
type PopularSortCriteria string
const (
// MostIssues sorts by the most issues for a character.
MostIssues PopularSortCriteria = "issue_count"
// AverageIssuesPerYear sorts by the highest average issues per year for each character.
AverageIssuesPerYear = "average_rank"
)
// PopularCriteria is for querying ranked and popular characters.
type PopularCriteria struct {
AppearanceType AppearanceType
SortBy PopularSortCriteria
Limit int
Offset int
}
// TrendingCriteria is for querying characters who are trending.
type TrendingCriteria struct {
PublisherID PublisherID
Limit int
Offset int
}