-
Notifications
You must be signed in to change notification settings - Fork 21
/
d3gd.go
422 lines (374 loc) · 17.6 KB
/
d3gd.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
package blizzard
import (
"context"
"fmt"
"github.com/FuzzyStatic/blizzard/v3/d3gd"
)
// D3SeasonIndex returns an index of seasons
func (c *Client) D3SeasonIndex(ctx context.Context) (*d3gd.SeasonIndex, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
"/data/d3/season/",
&d3gd.SeasonIndex{},
)
return dat.(*d3gd.SeasonIndex), header, err
}
// D3Season returns season data
func (c *Client) D3Season(ctx context.Context, seasonID int) (*d3gd.Season, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d", seasonID),
&d3gd.Season{},
)
return dat.(*d3gd.Season), header, err
}
// D3SeasonLeaderboard returns leaderboard data for season and leaderboard
func (c *Client) D3SeasonLeaderboard(ctx context.Context, seasonID int, leaderboard string) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/%s", seasonID, leaderboard),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardAchievementPoints returns achievement points leaderboard data for season
func (c *Client) D3SeasonLeaderboardAchievementPoints(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/achievement-points", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreBarbarian returns hardcore barbarian leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreBarbarian(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-barbarian", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardBarbarian returns barbarian leaderboard data for season
func (c *Client) D3SeasonLeaderboardBarbarian(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-barbarian", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreCrusader returns hardcore crusader leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreCrusader(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-crusader", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardCrusader returns crusader leaderboard data for season
func (c *Client) D3SeasonLeaderboardCrusader(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-crusader", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreDemonHunter returns hardcore demon hunter leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreDemonHunter(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-dh", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardDemonHunter returns barbarian leaderboard data for season
func (c *Client) D3SeasonLeaderboardDemonHunter(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-dh", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreMonk returns hardcore monk leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreMonk(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-monk", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardMonk returns monk leaderboard data for season
func (c *Client) D3SeasonLeaderboardMonk(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-monk", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreNecromancer returns hardcore necromancer leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreNecromancer(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-necromancer", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardNecromancer returns necromancer leaderboard data for season
func (c *Client) D3SeasonLeaderboardNecromancer(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-necromancer", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreWizard returns hardcore wizard leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreWizard(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-wizard", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardWizard returns wizard leaderboard data for season
func (c *Client) D3SeasonLeaderboardWizard(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-wizard", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreWitchDoctor returns hardcore witch doctor leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreWitchDoctor(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-wd", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardWitchDoctor returns witch doctor leaderboard data for season
func (c *Client) D3SeasonLeaderboardWitchDoctor(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-wd", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreTeam2 returns hardcore 2 team leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreTeam2(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-team-2", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardTeam2 returns 2 team leaderboard data for season
func (c *Client) D3SeasonLeaderboardTeam2(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-team-2", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreTeam3 returns hardcore 2 team leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreTeam3(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-team-3", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardTeam3 returns 3 team leaderboard data for season
func (c *Client) D3SeasonLeaderboardTeam3(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-team-3", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardHardcoreTeam4 returns hardcore 4 team leaderboard data for season
func (c *Client) D3SeasonLeaderboardHardcoreTeam4(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-hardcore-team-4", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3SeasonLeaderboardTeam4 returns 4 team leaderboard data for season
func (c *Client) D3SeasonLeaderboardTeam4(ctx context.Context, seasonID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/season/%d/leaderboard/rift-team-4", seasonID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraIndex returns an index of seasons
func (c *Client) D3EraIndex(ctx context.Context) (*d3gd.EraIndex, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
"/data/d3/era/",
&d3gd.EraIndex{},
)
return dat.(*d3gd.EraIndex), header, err
}
// D3Era returns season data
func (c *Client) D3Era(ctx context.Context, eraID int) (*d3gd.Era, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d", eraID),
&d3gd.Era{},
)
return dat.(*d3gd.Era), header, err
}
// D3EraLeaderboardHardcoreBarbarian returns hardcore barbarian leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreBarbarian(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-barbarian", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardBarbarian returns barbarian leaderboard data for season
func (c *Client) D3EraLeaderboardBarbarian(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-barbarian", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreCrusader returns hardcore crusader leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreCrusader(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-crusader", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardCrusader returns crusader leaderboard data for season
func (c *Client) D3EraLeaderboardCrusader(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-crusader", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreDemonHunter returns hardcore demon hunter leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreDemonHunter(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-dh", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardDemonHunter returns barbarian leaderboard data for season
func (c *Client) D3EraLeaderboardDemonHunter(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-dh", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreMonk returns hardcore monk leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreMonk(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-monk", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardMonk returns monk leaderboard data for season
func (c *Client) D3EraLeaderboardMonk(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-monk", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreNecromancer returns hardcore necromancer leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreNecromancer(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-necromancer", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardNecromancer returns necromancer leaderboard data for season
func (c *Client) D3EraLeaderboardNecromancer(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-necromancer", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreWizard returns hardcore wizard leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreWizard(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-wizard", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardWizard returns wizard leaderboard data for season
func (c *Client) D3EraLeaderboardWizard(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-wizard", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreWitchDoctor returns hardcore witch doctor leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreWitchDoctor(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-wd", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardWitchDoctor returns witch doctor leaderboard data for season
func (c *Client) D3EraLeaderboardWitchDoctor(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-wd", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreTeam2 returns hardcore 2 team leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreTeam2(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-team-2", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardTeam2 returns 2 team leaderboard data for season
func (c *Client) D3EraLeaderboardTeam2(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-team-2", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreTeam3 returns hardcore 2 team leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreTeam3(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-team-3", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardTeam3 returns 3 team leaderboard data for season
func (c *Client) D3EraLeaderboardTeam3(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-team-3", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardHardcoreTeam4 returns hardcore 4 team leaderboard data for season
func (c *Client) D3EraLeaderboardHardcoreTeam4(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-hardcore-team-4", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}
// D3EraLeaderboardTeam4 returns 4 team leaderboard data for season
func (c *Client) D3EraLeaderboardTeam4(ctx context.Context, eraID int) (*d3gd.Leaderboard, *Header, error) {
dat, header, err := c.getStructDataNoNamespace(ctx,
fmt.Sprintf("/data/d3/era/%d/leaderboard/rift-team-4", eraID),
&d3gd.Leaderboard{},
)
return dat.(*d3gd.Leaderboard), header, err
}