Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 9a63390

Browse files
Add cloud org resource (#128)
This will be needed to fetch the cloud org's ID from its name
1 parent 2b63a7b commit 9a63390

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cloud_org.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package gapi
2+
3+
import (
4+
"fmt"
5+
"time"
6+
)
7+
8+
type CloudOrg struct {
9+
ID int64 `json:"id"`
10+
Slug string `json:"slug"`
11+
Name string `json:"name"`
12+
URL string `json:"url"`
13+
CreatedAt time.Time `json:"createdAt"`
14+
UpdatedAt time.Time `json:"updatedAt"`
15+
}
16+
17+
func (c *Client) GetCloudOrg(org string) (CloudOrg, error) {
18+
resp := CloudOrg{}
19+
err := c.request("GET", fmt.Sprintf("/api/orgs/%s", org), nil, nil, &resp)
20+
return resp, err
21+
}

0 commit comments

Comments
 (0)