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
6 changes: 3 additions & 3 deletions github/enterprise_manage_ghes_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type LicenseStatus struct {
ReferenceNumber *string `json:"referenceNumber,omitempty"`
Seats *int `json:"seats,omitempty"`
SSHAllowed *bool `json:"sshAllowed,omitempty"`
SupportKey *string `json:"supportKey,omitempty"`
SupportKey *bool `json:"supportKey,omitempty"`
UnlimitedSeating *bool `json:"unlimitedSeating,omitempty"`
}

Expand Down Expand Up @@ -354,14 +354,14 @@ func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password
// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information
//
//meta:operation GET /manage/v1/config/license
func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) {
func (s *EnterpriseService) License(ctx context.Context) (*LicenseStatus, *Response, error) {
u := "manage/v1/config/license"
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var licenseStatus []*LicenseStatus
var licenseStatus *LicenseStatus
resp, err := s.client.Do(req, &licenseStatus)
if err != nil {
return nil, resp, err
Expand Down
12 changes: 6 additions & 6 deletions github/enterprise_manage_ghes_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ func TestEnterpriseService_License(t *testing.T) {

mux.HandleFunc("/manage/v1/config/license", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
fmt.Fprint(w, `[{
fmt.Fprint(w, `{
"advancedSecurityEnabled": true,
"advancedSecuritySeats": 0,
"clusterSupport": false,
Expand All @@ -424,9 +424,9 @@ func TestEnterpriseService_License(t *testing.T) {
"referenceNumber": "32a145",
"seats": 0,
"sshAllowed": true,
"supportKey": "",
"supportKey": true,
"unlimitedSeating": true
}]`)
}`)
})

ctx := t.Context()
Expand All @@ -435,7 +435,7 @@ func TestEnterpriseService_License(t *testing.T) {
t.Errorf("Enterprise.License returned error: %v", err)
}

want := []*LicenseStatus{{
want := &LicenseStatus{
AdvancedSecurityEnabled: Ptr(true),
AdvancedSecuritySeats: Ptr(0),
ClusterSupport: Ptr(false),
Expand All @@ -452,9 +452,9 @@ func TestEnterpriseService_License(t *testing.T) {
ReferenceNumber: Ptr("32a145"),
Seats: Ptr(0),
SSHAllowed: Ptr(true),
SupportKey: Ptr(""),
SupportKey: Ptr(true),
UnlimitedSeating: Ptr(true),
}}
}
if diff := cmp.Diff(want, license); diff != "" {
t.Errorf("diff mismatch (-want +got):\n%v", diff)
}
Expand Down
4 changes: 2 additions & 2 deletions github/github-accessors.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/github-accessors_test.go

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

Loading