-
Notifications
You must be signed in to change notification settings - Fork 2
/
team.go
41 lines (34 loc) · 964 Bytes
/
team.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
package runscope
import "fmt"
// Team represents a Runscope team
type Team struct {
Name string `json:"name"`
ID string `json:"id"`
UUID string `json:"uuid"`
}
// Person can't be defined by your labels
type Person struct {
Name string `json:"name"`
Email string `json:"email"`
ID string `json:"id"`
UUID string `json:"uuid"`
}
// TeamIntegration is a duplicate of Integration, except
// Runscope uses "integration_type" here instead of "type"
type TeamIntegration struct {
Description string `json:"description"`
Type string `json:"integration_type"`
ID string `json:"id"`
UUID string `json:"uuid"`
}
// ListPeople returns a listing of people
func (client *Client) ListPeople(teamID string) ([]Person, error) {
var people = []Person{}
path := fmt.Sprintf("teams/%s/people", teamID)
content, err := client.Get(path)
if err != nil {
return people, err
}
err = unmarshal(content, &people)
return people, err
}