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
4 changes: 2 additions & 2 deletions github/enterprise_licenses.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ type LastLicenseSyncProperties struct {
Error string `json:"error"`
}

// GetConsumedLicenses collect information about the number of consumed licenses and a collection with all the users with consumed enterprise licenses.
// ListConsumedLicenses collect information about the number of consumed licenses and a collection with all the users with consumed enterprise licenses.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing?apiVersion=2022-11-28#list-enterprise-consumed-licenses
//
//meta:operation GET /enterprises/{enterprise}/consumed-licenses
func (s *EnterpriseService) GetConsumedLicenses(ctx context.Context, enterprise string, opts *ListOptions) (*EnterpriseConsumedLicenses, *Response, error) {
func (s *EnterpriseService) ListConsumedLicenses(ctx context.Context, enterprise string, opts *ListOptions) (*EnterpriseConsumedLicenses, *Response, error) {
u := fmt.Sprintf("enterprises/%v/consumed-licenses", enterprise)
u, err := addOptions(u, opts)
if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions github/enterprise_licenses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/google/go-cmp/cmp"
)

func TestEnterpriseService_GetConsumedLicenses(t *testing.T) {
func TestEnterpriseService_ListConsumedLicenses(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

Expand Down Expand Up @@ -49,9 +49,9 @@ func TestEnterpriseService_GetConsumedLicenses(t *testing.T) {

opt := &ListOptions{Page: 2, PerPage: 10}
ctx := t.Context()
licenses, _, err := client.Enterprise.GetConsumedLicenses(ctx, "e", opt)
licenses, _, err := client.Enterprise.ListConsumedLicenses(ctx, "e", opt)
if err != nil {
t.Errorf("Enterprise.GetConsumedLicenses returned error: %v", err)
t.Errorf("Enterprise.ListConsumedLicenses returned error: %v", err)
}

userName := "User One"
Expand Down Expand Up @@ -90,17 +90,17 @@ func TestEnterpriseService_GetConsumedLicenses(t *testing.T) {
}

if !cmp.Equal(licenses, want) {
t.Errorf("Enterprise.GetConsumedLicenses returned %+v, want %+v", licenses, want)
t.Errorf("Enterprise.ListConsumedLicenses returned %+v, want %+v", licenses, want)
}

const methodName = "GetConsumedLicenses"
const methodName = "ListConsumedLicenses"
testBadOptions(t, methodName, func() (err error) {
_, _, err = client.Enterprise.GetConsumedLicenses(ctx, "\n", opt)
_, _, err = client.Enterprise.ListConsumedLicenses(ctx, "\n", opt)
return err
})

testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
got, resp, err := client.Enterprise.GetConsumedLicenses(ctx, "e", opt)
got, resp, err := client.Enterprise.ListConsumedLicenses(ctx, "e", opt)
if got != nil {
t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
}
Expand Down
35 changes: 35 additions & 0 deletions github/github-iterators.go

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

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

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

Loading