...
1
2
3
4
5
6 package github
7
8 import (
9 "context"
10 "fmt"
11 )
12
13
14 type OrganizationCustomRepoRoles struct {
15 TotalCount *int `json:"total_count,omitempty"`
16 CustomRepoRoles []*CustomRepoRoles `json:"custom_roles,omitempty"`
17 }
18
19
20
21
22 type CustomRepoRoles struct {
23 ID *int64 `json:"id,omitempty"`
24 Name *string `json:"name,omitempty"`
25 }
26
27
28
29
30
31 func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) {
32 u := fmt.Sprintf("orgs/%v/custom_roles", org)
33
34 req, err := s.client.NewRequest("GET", u, nil)
35 if err != nil {
36 return nil, nil, err
37 }
38
39 customRepoRoles := new(OrganizationCustomRepoRoles)
40 resp, err := s.client.Do(ctx, req, customRepoRoles)
41 if err != nil {
42 return nil, resp, err
43 }
44
45 return customRepoRoles, resp, nil
46 }
47
View as plain text