|
|
|
@ -68,6 +68,39 @@ func (p Plan) String() string { |
|
|
|
return Stringify(p) |
|
|
|
} |
|
|
|
|
|
|
|
// OrganizationsListOptions specifies the optional parameters to the
|
|
|
|
// OrganizationsService.ListAll method.
|
|
|
|
type OrganizationsListOptions struct { |
|
|
|
// Since filters Organizations by ID.
|
|
|
|
Since int `url:"since,omitempty"` |
|
|
|
} |
|
|
|
|
|
|
|
// ListAll lists all organizations, in the order that they were created on GitHub.
|
|
|
|
//
|
|
|
|
// Note: Pagination is powered exclusively by the since parameter. To continue
|
|
|
|
// listing the next set of organizations, use the ID of the last-returned organization
|
|
|
|
// as the opts.Since parameter for the next call.
|
|
|
|
//
|
|
|
|
// GitHub API docs: https://developer.github.com/v3/orgs/#list-all-organizations
|
|
|
|
func (s *OrganizationsService) ListAll(opt *OrganizationsListOptions) ([]Organization, *Response, error) { |
|
|
|
u, err := addOptions("organizations", opt) |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, nil) |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
|
|
|
|
orgs := []Organization{} |
|
|
|
resp, err := s.client.Do(req, &orgs) |
|
|
|
if err != nil { |
|
|
|
return nil, resp, err |
|
|
|
} |
|
|
|
return orgs, resp, err |
|
|
|
} |
|
|
|
|
|
|
|
// List the organizations for a user. Passing the empty string will list
|
|
|
|
// organizations for the authenticated user.
|
|
|
|
//
|
|
|
|
|