Skip to content
Open
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
24 changes: 12 additions & 12 deletions github/github-iterators.go

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

12 changes: 6 additions & 6 deletions github/github-iterators_test.go

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

2 changes: 1 addition & 1 deletion github/orgs_attestations.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// GitHub API docs: https://docs.github.com/rest/orgs/attestations?apiVersion=2022-11-28#list-attestations
//
//meta:operation GET /orgs/{org}/attestations/{subject_digest}
func (s *OrganizationsService) ListAttestations(ctx context.Context, org, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) {
func (s *OrganizationsService) ListAttestations(ctx context.Context, org, subjectDigest string, opts *ListCursorOptions) (*AttestationsResponse, *Response, error) {
u := fmt.Sprintf("orgs/%v/attestations/%v", org, subjectDigest)

u, err := addOptions(u, opts)
Expand Down
5 changes: 3 additions & 2 deletions github/orgs_attestations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestOrganizationsService_ListAttestations(t *testing.T) {

mux.HandleFunc("/orgs/o/attestations/digest", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testFormValues(t, r, values{"after": "a", "per_page": "1"})
fmt.Fprint(w, `{
"attestations": [
{
Expand All @@ -34,7 +35,7 @@ func TestOrganizationsService_ListAttestations(t *testing.T) {
}`)
})
ctx := t.Context()
attestations, _, err := client.Organizations.ListAttestations(ctx, "o", "digest", &ListOptions{})
attestations, _, err := client.Organizations.ListAttestations(ctx, "o", "digest", &ListCursorOptions{After: "a", PerPage: 1})
if err != nil {
t.Errorf("Organizations.ListAttestations returned error: %v", err)
}
Expand All @@ -59,7 +60,7 @@ func TestOrganizationsService_ListAttestations(t *testing.T) {
const methodName = "ListAttestations"

testBadOptions(t, methodName, func() (err error) {
_, _, err = client.Organizations.ListAttestations(ctx, "\n", "\n", &ListOptions{})
_, _, err = client.Organizations.ListAttestations(ctx, "\n", "\n", &ListCursorOptions{})
return err
})

Expand Down
2 changes: 1 addition & 1 deletion github/repos_attestations.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// GitHub API docs: https://docs.github.com/rest/repos/attestations?apiVersion=2022-11-28#list-attestations
//
//meta:operation GET /repos/{owner}/{repo}/attestations/{subject_digest}
func (s *RepositoriesService) ListAttestations(ctx context.Context, owner, repo, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) {
func (s *RepositoriesService) ListAttestations(ctx context.Context, owner, repo, subjectDigest string, opts *ListCursorOptions) (*AttestationsResponse, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/attestations/%v", owner, repo, subjectDigest)

u, err := addOptions(u, opts)
Expand Down
5 changes: 3 additions & 2 deletions github/repos_attestations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestRepositoriesService_ListAttestations(t *testing.T) {

mux.HandleFunc("/repos/o/r/attestations/digest", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testFormValues(t, r, values{"after": "a", "per_page": "1"})
fmt.Fprint(w, `{
"attestations": [
{
Expand All @@ -34,7 +35,7 @@ func TestRepositoriesService_ListAttestations(t *testing.T) {
}`)
})
ctx := t.Context()
attestations, _, err := client.Repositories.ListAttestations(ctx, "o", "r", "digest", &ListOptions{})
attestations, _, err := client.Repositories.ListAttestations(ctx, "o", "r", "digest", &ListCursorOptions{After: "a", PerPage: 1})
if err != nil {
t.Errorf("Repositories.ListAttestations returned error: %v", err)
}
Expand All @@ -59,7 +60,7 @@ func TestRepositoriesService_ListAttestations(t *testing.T) {
const methodName = "ListAttestations"

testBadOptions(t, methodName, func() (err error) {
_, _, err = client.Repositories.ListAttestations(ctx, "\n", "\n", "\n", &ListOptions{})
_, _, err = client.Repositories.ListAttestations(ctx, "\n", "\n", "\n", &ListCursorOptions{})
return err
})

Expand Down
2 changes: 1 addition & 1 deletion github/users_attestations.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// GitHub API docs: https://docs.github.com/rest/users/attestations?apiVersion=2022-11-28#list-attestations
//
//meta:operation GET /users/{username}/attestations/{subject_digest}
func (s *UsersService) ListAttestations(ctx context.Context, user, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) {
func (s *UsersService) ListAttestations(ctx context.Context, user, subjectDigest string, opts *ListCursorOptions) (*AttestationsResponse, *Response, error) {
u := fmt.Sprintf("users/%v/attestations/%v", user, subjectDigest)

u, err := addOptions(u, opts)
Expand Down
5 changes: 3 additions & 2 deletions github/users_attestations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestUsersService_ListAttestations(t *testing.T) {

mux.HandleFunc("/users/u/attestations/digest", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testFormValues(t, r, values{"after": "a", "per_page": "1"})
fmt.Fprint(w, `{
"attestations": [
{
Expand All @@ -34,7 +35,7 @@ func TestUsersService_ListAttestations(t *testing.T) {
}`)
})
ctx := t.Context()
attestations, _, err := client.Users.ListAttestations(ctx, "u", "digest", &ListOptions{})
attestations, _, err := client.Users.ListAttestations(ctx, "u", "digest", &ListCursorOptions{After: "a", PerPage: 1})
if err != nil {
t.Errorf("Users.ListAttestations returned error: %v", err)
}
Expand All @@ -59,7 +60,7 @@ func TestUsersService_ListAttestations(t *testing.T) {
const methodName = "ListAttestations"

testBadOptions(t, methodName, func() (err error) {
_, _, err = client.Users.ListAttestations(ctx, "\n", "\n", &ListOptions{})
_, _, err = client.Users.ListAttestations(ctx, "\n", "\n", &ListCursorOptions{})
return err
})

Expand Down
Loading