-
Notifications
You must be signed in to change notification settings - Fork 7
/
space.go
30 lines (25 loc) · 824 Bytes
/
space.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
package podio
import "fmt"
type Space struct {
Id int64 `json:"space_id"`
Name string `json:"name"`
URL string `json:"url"`
URLLabel string `json:"url_label"`
OrgId int64 `json:"org_id"`
Push Push `json:"push"`
}
func (client *Client) GetSpaces(orgId int64) (spaces []Space, err error) {
path := fmt.Sprintf("/org/%d/space", orgId)
err = client.Request("GET", path, nil, nil, &spaces)
return
}
func (client *Client) GetSpace(id int64) (space *Space, err error) {
path := fmt.Sprintf("/space/%d", id)
err = client.Request("GET", path, nil, nil, &space)
return
}
func (client *Client) GetSpaceByOrgIdAndSlug(orgId int64, slug string) (space *Space, err error) {
path := fmt.Sprintf("/space/org/%d/url/%s", orgId, slug)
err = client.Request("GET", path, nil, nil, &space)
return
}