-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmaps.go
50 lines (44 loc) · 1.1 KB
/
maps.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
package owl
import (
"fmt"
"net/http"
)
type MapsResponse []struct {
ID string `json:"id"`
Name struct {
EnUS string `json:"en_US"`
EsMX string `json:"es_MX"`
PtBR string `json:"pt_BR"`
DeDE string `json:"de_DE"`
EnGB string `json:"en_GB"`
EsES string `json:"es_ES"`
FrFR string `json:"fr_FR"`
ItIT string `json:"it_IT"`
PlPL string `json:"pl_PL"`
RuRU string `json:"ru_RU"`
KoKR string `json:"ko_KR"`
ZhTW string `json:"zh_TW"`
ZhCN string `json:"zh_CN"`
JaJP string `json:"ja_JP"`
} `json:"name"`
Background string `json:"background"`
Icon string `json:"icon"`
Type string `json:"type"`
Description struct {
} `json:"description"`
Thumbnail string `json:"thumbnail"`
EsportsAPIID string `json:"esportsApiId"`
}
// GetMaps gets list of competition maps from the OWL API
// Endpoint: GET /maps
func (c *Client) GetMaps() (*MapsResponse, error) {
m := &MapsResponse{}
req, err := http.NewRequest("GET", fmt.Sprintf("%s/maps", c.baseURL), nil)
if err != nil {
return m, err
}
if err = c.sendRequest(req, m); err != nil {
return m, err
}
return m, nil
}