-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathencounters_raids.go
86 lines (82 loc) · 2 KB
/
encounters_raids.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
package wowapi
import (
"encoding/json"
"fmt"
)
type EncountersRaids struct {
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
} `json:"_links"`
Character struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
Id float64 `json:"id"`
Realm struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
Id float64 `json:"id"`
Slug string `json:"slug"`
} `json:"realm"`
} `json:"character"`
Expansions []struct {
Expansion struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
Id float64 `json:"id"`
} `json:"expansion"`
Instances []struct {
Instance struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
Id float64 `json:"id"`
} `json:"instance"`
Modes []struct {
Difficulty struct {
Type string `json:"type"`
Name string `json:"name"`
} `json:"difficulty"`
Status struct {
Type string `json:"type"`
Name string `json:"name"`
} `json:"status"`
Progress struct {
CompletedCount float64 `json:"completed_count"`
TotalCount float64 `json:"total_count"`
Encounters []struct {
Encounter struct {
Id float64 `json:"id"`
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
} `json:"encounter"`
CompletedCount float64 `json:"completed_count"`
LastKillTimestamp float64 `json:"last_kill_timestamp"`
} `json:"encounters"`
} `json:"progress"`
} `json:"modes"`
} `json:"instances"`
} `json:"expansions"`
}
func (req RequestFunc) CharacterEncountersRaids(realm string, name string) (s EncountersRaids, err error) {
url := fmt.Sprintf("/profile/wow/character/%s/%s/encounters/raids", realm, name)
body, err := req(url)
if err != nil {
return
}
err = json.Unmarshal(body, &s)
if err != nil {
return
}
return
}