-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsystem.go
48 lines (38 loc) · 1.49 KB
/
system.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
package eventbrite
import "golang.org/x/net/context"
type Timezones struct {
Locale string `json:"locale"`
Timezones []Timezone `json:"timezones"`
Pagination Pagination `json:"pagination"`
}
type Regions struct {
Locale string `json:"locale"`
Regions []Region `json:"regions"`
Pagination Pagination `json:"pagination"`
}
type Countries struct {
Locale string `json:"locale"`
Countries []Country `json:"countries"`
Pagination Pagination `json:"pagination"`
}
// Timezones returns a paginated response with a key of timezones, containing a list of timezones
//
// https://www.eventbrite.com/developer/v3/endpoints/system/#ebapi-get-system-timezones
func (c *Client) Timezones(ctx context.Context) (*Timezones, error) {
res := new(Timezones)
return res, c.getJSON(ctx, "/system/timezones/", nil, res)
}
// Timezones returns a single page response with a key of regions, containing a list of regions
//
// https://www.eventbrite.com/developer/v3/endpoints/system/#ebapi-get-system-regions
func (c *Client) Regions(ctx context.Context) (*Regions, error) {
res := new(Regions)
return res, c.getJSON(ctx, "/system/regions/", nil, res)
}
// Timezones returns a single page response with a key of countries, containing a list of countries
//
// https://www.eventbrite.com/developer/v3/endpoints/system/#ebapi-get-system-countries
func (c *Client) Countries(ctx context.Context) (*Countries, error) {
res := new(Countries)
return res, c.getJSON(ctx, "/system/regions/", nil, res)
}