From de6d2c524430287c699aaa898c1325da6afea539 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Wed, 20 Jun 2018 22:39:07 +0100 Subject: Update dependencies --- vendor/github.com/google/go-github/github/orgs.go | 25 ++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'vendor/github.com/google/go-github/github/orgs.go') 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 { -- cgit v1.2.3