-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmythic_keystone_profile.go
66 lines (62 loc) · 1.37 KB
/
mythic_keystone_profile.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
package wowapi
import (
"encoding/json"
"fmt"
)
type MythicKeystoneProfile struct {
CurrentMythicRating struct {
Color struct {
R float64 `json:"r"`
G float64 `json:"g"`
B float64 `json:"b"`
A float64 `json:"a"`
} `json:"color"`
Rating float64 `json:"rating"`
} `json:"current_mythic_rating"`
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
} `json:"_links"`
CurrentPeriod struct {
Period struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Id float64 `json:"id"`
} `json:"period"`
} `json:"current_period"`
Seasons []struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Id float64 `json:"id"`
} `json:"seasons"`
Character struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
Id float64 `json:"id"`
Realm struct {
Slug string `json:"slug"`
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
Id float64 `json:"id"`
} `json:"realm"`
} `json:"character"`
}
func (req RequestFunc) CharacterMythicKeystoneProfile(realm string, name string) (s MythicKeystoneProfile, err error) {
url := fmt.Sprintf("/profile/wow/character/%s/%s/mythic-keystone-profile", realm, name)
body, err := req(url)
if err != nil {
return
}
err = json.Unmarshal(body, &s)
if err != nil {
return
}
return
}