aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/orgs.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/orgs.go')
-rw-r--r--vendor/github.com/google/go-github/github/orgs.go25
1 files changed, 22 insertions, 3 deletions
diff --git a/vendor/github.com/google/go-github/github/orgs.go b/vendor/github.com/google/go-github/github/orgs.go
index e6947c9..7832053 100644
--- a/vendor/github.com/google/go-github/github/orgs.go
+++ b/vendor/github.com/google/go-github/github/orgs.go
@@ -20,7 +20,7 @@ type OrganizationsService service
// Organization represents a GitHub organization account.
type Organization struct {
Login *string `json:"login,omitempty"`
- ID *int `json:"id,omitempty"`
+ ID *int64 `json:"id,omitempty"`
AvatarURL *string `json:"avatar_url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
Name *string `json:"name,omitempty"`
@@ -43,6 +43,7 @@ type Organization struct {
BillingEmail *string `json:"billing_email,omitempty"`
Type *string `json:"type,omitempty"`
Plan *Plan `json:"plan,omitempty"`
+ NodeID *string `json:"node_id,omitempty"`
// API URLs
URL *string `json:"url,omitempty"`
@@ -74,8 +75,11 @@ func (p Plan) String() string {
// OrganizationsService.ListAll method.
type OrganizationsListOptions struct {
// Since filters Organizations by ID.
- Since int `url:"since,omitempty"`
+ Since int64 `url:"since,omitempty"`
+ // Note: Pagination is powered exclusively by the Since parameter,
+ // ListOptions.Page has no effect.
+ // ListOptions.PerPage controls an undocumented GitHub API parameter.
ListOptions
}
@@ -97,6 +101,9 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opt *OrganizationsLi
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
orgs := []*Organization{}
resp, err := s.client.Do(ctx, req, &orgs)
if err != nil {
@@ -126,6 +133,9 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opt *ListO
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
var orgs []*Organization
resp, err := s.client.Do(ctx, req, &orgs)
if err != nil {
@@ -145,6 +155,9 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
organization := new(Organization)
resp, err := s.client.Do(ctx, req, organization)
if err != nil {
@@ -157,13 +170,16 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati
// GetByID fetches an organization.
//
// Note: GetByID uses the undocumented GitHub API endpoint /organizations/:id.
-func (s *OrganizationsService) GetByID(ctx context.Context, id int) (*Organization, *Response, error) {
+func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organization, *Response, error) {
u := fmt.Sprintf("organizations/%d", id)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
organization := new(Organization)
resp, err := s.client.Do(ctx, req, organization)
if err != nil {
@@ -183,6 +199,9 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
o := new(Organization)
resp, err := s.client.Do(ctx, req, o)
if err != nil {