Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ linters:
- NotificationListOptions.Participating # TODO: Activities
- NotificationListOptions.Since # TODO: Activities
- OrganizationsListOptions.Since # TODO: Organizations
- OrganizationsListOptions.PerPage # TODO: Organizations
- ProjectV2ItemFieldValue.DataType # TODO: Projects
- ProjectV2ItemFieldValue.Name # TODO: Projects
- PullRequestListCommentsOptions.Direction # TODO: PullRequests
Expand Down
31 changes: 0 additions & 31 deletions github/github-iterators.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 0 additions & 72 deletions github/github-iterators_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions github/orgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,11 @@ func (p Plan) String() string {
// OrganizationsListOptions specifies the optional parameters to the
// OrganizationsService.ListAll method.
type OrganizationsListOptions struct {
// Since filters Organizations by ID.
// An organization ID. Only return organizations with an ID greater than this ID.
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
// The number of results per page (max 100).
PerPage int `url:"per_page,omitempty"`
}

// ListAll lists all organizations, in the order that they were created on GitHub.
Expand Down
5 changes: 2 additions & 3 deletions github/orgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ func TestOrganizationsService_ListAll(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

since := int64(1342004)
mux.HandleFunc("/organizations", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testFormValues(t, r, values{"since": "1342004"})
testFormValues(t, r, values{"since": "1342004", "per_page": "30"})
fmt.Fprint(w, `[{"id":4314092}]`)
})

opt := &OrganizationsListOptions{Since: since}
opt := &OrganizationsListOptions{Since: int64(1342004), PerPage: 30}
ctx := t.Context()
orgs, _, err := client.Organizations.ListAll(ctx, opt)
if err != nil {
Expand Down
Loading