...
1
2
3
4
5
6 package github
7
8 import (
9 "context"
10 "fmt"
11 )
12
13
14
15
16 func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) {
17 u := fmt.Sprintf("orgs/%v/security-managers", org)
18
19 req, err := s.client.NewRequest("GET", u, nil)
20 if err != nil {
21 return nil, nil, err
22 }
23
24 var teams []*Team
25 resp, err := s.client.Do(ctx, req, &teams)
26 if err != nil {
27 return nil, resp, err
28 }
29
30 return teams, resp, nil
31 }
32
33
34
35
36 func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) {
37 u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team)
38 req, err := s.client.NewRequest("PUT", u, nil)
39 if err != nil {
40 return nil, err
41 }
42
43 return s.client.Do(ctx, req, nil)
44 }
45
46
47
48
49 func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) {
50 u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team)
51 req, err := s.client.NewRequest("DELETE", u, nil)
52 if err != nil {
53 return nil, err
54 }
55
56 return s.client.Do(ctx, req, nil)
57 }
58
View as plain text