-
Notifications
You must be signed in to change notification settings - Fork 0
/
stories.go
86 lines (77 loc) · 2.8 KB
/
stories.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//go:generate easytags $GOFILE
package gw2api
type Story struct {
// The id of the story.
ID int `json:"id"`
// The id for the story season; resolvable against v2/stories/seasons.
Season int `json:"season"`
// The name of the story.
Name string `json:"name"`
// The description of the story.
Description string `json:"description"`
// The (in-game, not real-world) date of the story.
Timeline string `json:"timeline"`
// The minimum level required for a character to begin this story.
Level int `json:"level"`
// The order in which this story is displayed in the Story Journal.
Order int `json:"order"`
// An array of chapter objects providing details about the chapters for
// this story
Chapters []StoryChapter `json:"chapters"`
// When present, provides a list of races that are eligible to participate
// in this story.
Races []string `json:"races"`
// When present, provides a list of additional requirements for a character
// to participate in this story.
Flags []string `json:"flags"`
}
type StoryChapter struct {
// The name of the chapter.
Name string `json:"name"`
}
type StorySeason struct {
// The id of the season.
ID string `json:"id"`
// The name of the season.
Name string `json:"name"`
// The order in which this season is displayed in the Story Journal.
Order int `json:"order"`
// An array of story ids for the stories that belong to this season.
Stories []int `json:"stories"`
}
// This resource returns information about the stories that are in the game.
// Return an array of ids for each stories.
func (r *Requestor) StoryIDs(pointer *[]int) *Requestor {
r.collectionIDs("/stories", &pointer)
return r
}
// This resource returns information about the stories that are in the game.
// Return a list of response objects
func (r *Requestor) Stories(pointer *[]*Story, ids ...int) *Requestor {
r.collection("/stories", &pointer, ids)
return r
}
// This resource returns information about the stories that are in the game.
// Return an object
func (r *Requestor) Story(pointer *Story, id int) *Requestor {
r.singleton("/stories", &pointer, id)
return r
}
// This resource returns information about the stories that are in the game.
// Return an array of ids for each story season.
func (r *Requestor) StorySeasonIDs(pointer *[]string) *Requestor {
r.collectionIDs("/stories/seasons", &pointer)
return r
}
// This resource returns information about the stories that are in the game.
// Return a list of response objects
func (r *Requestor) StorySeasons(pointer *[]*StorySeason, ids ...string) *Requestor {
r.collection("/stories/seasons", &pointer, ids)
return r
}
// This resource returns information about the stories that are in the game.
// Return an object
func (r *Requestor) StorySeason(pointer *StorySeason, id string) *Requestor {
r.singleton("/stories/seasons", &pointer, id)
return r
}