-
Notifications
You must be signed in to change notification settings - Fork 29
/
BadgeAttributes.go
52 lines (41 loc) · 1.37 KB
/
BadgeAttributes.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
package connect
// Everything from https://connect.garmin.com/modern/proxy/badge-service/badge/attributes
type BadgeType struct {
ID int `json:"badgeTypeId"`
Key string `json:"badgeTypeKey"`
}
type BadgeCategory struct {
ID int `json:"badgeCategoryId"`
Key string `json:"badgeCategoryKey"`
}
type BadgeDifficulty struct {
ID int `json:"badgeDifficultyId"`
Key string `json:"badgeDifficultyKey"`
Points int `json:"badgePoints"`
}
type BadgeUnit struct {
ID int `json:"badgeUnitId"`
Key string `json:"badgeUnitKey"`
}
type BadgeAssocType struct {
ID int `json:"badgeAssocTypeId"`
Key string `json:"badgeAssocTypeKey"`
}
type BadgeAttributes struct {
BadgeTypes []BadgeType `json:"badgeTypes"`
BadgeCategories []BadgeCategory `json:"badgeCategories"`
BadgeDifficulties []BadgeDifficulty `json:"badgeDifficulties"`
BadgeUnits []BadgeUnit `json:"badgeUnits"`
BadgeAssocTypes []BadgeAssocType `json:"badgeAssocTypes"`
}
// BadgeAttributes retrieves a list of badge attributes. At time of writing
// we're not sure how these can be utilized.
func (c *Client) BadgeAttributes() (*BadgeAttributes, error) {
URL := "https://connect.garmin.com/modern/proxy/badge-service/badge/attributes"
attributes := new(BadgeAttributes)
err := c.getJSON(URL, &attributes)
if err != nil {
return nil, err
}
return attributes, nil
}