From 530fe6e38a3bc811caa5f4aec06634f16cab85c4 Mon Sep 17 00:00:00 2001 From: JamBalaya56562 Date: Fri, 11 Sep 2026 04:45:41 +0900 Subject: [PATCH 1/4] fix!: Omit `repository_id` and `pull_request` when unset in `CodespaceCreateForUserOptions` POST /user/codespaces takes a oneOf body: either `repository_id` (with an optional `ref`) or `pull_request`. Neither field had an omit option, so every request sent both `"repository_id": 0` and `"pull_request": null` regardless of which branch of the schema was intended. --- github/codespaces.go | 4 ++-- github/codespaces_test.go | 20 +++++++++++++++++++- github/github-accessors.go | 6 +++--- github/github-accessors_test.go | 5 ++++- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/github/codespaces.go b/github/codespaces.go index b3f9097196d..27fc351f2ad 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -214,9 +214,9 @@ type CodespacePullRequestOptions struct { // CodespaceCreateForUserOptions represents options for creating a codespace for the authenticated user. type CodespaceCreateForUserOptions struct { - PullRequest *CodespacePullRequestOptions `json:"pull_request"` + PullRequest *CodespacePullRequestOptions `json:"pull_request,omitempty"` // RepositoryID represents the repository ID for this codespace. - RepositoryID int64 `json:"repository_id"` + RepositoryID *int64 `json:"repository_id,omitempty"` Ref *string `json:"ref,omitempty"` Geo *string `json:"geo,omitempty"` ClientIP *string `json:"client_ip,omitempty"` diff --git a/github/codespaces_test.go b/github/codespaces_test.go index 709de4bc6ec..4c69ecbe23f 100644 --- a/github/codespaces_test.go +++ b/github/codespaces_test.go @@ -502,7 +502,7 @@ func TestCodespacesService_Create(t *testing.T) { Geo: new("WestUs2"), Machine: new("standardLinux"), IdleTimeoutMinutes: new(60), - RepositoryID: int64(111), + RepositoryID: new(int64(111)), PullRequest: nil, } @@ -545,6 +545,24 @@ func TestCodespacesService_Create(t *testing.T) { }) } +func TestCodespaceCreateForUserOptions_Marshal(t *testing.T) { + t.Parallel() + + repoOpts := CodespaceCreateForUserOptions{ + RepositoryID: new(int64(111)), + Ref: new("main"), + } + testJSONMarshal(t, repoOpts, `{"repository_id":111,"ref":"main"}`) + + pullRequestOpts := CodespaceCreateForUserOptions{ + PullRequest: &CodespacePullRequestOptions{ + PullRequestNumber: 42, + RepositoryID: 111, + }, + } + testJSONMarshal(t, pullRequestOpts, `{"pull_request":{"pull_request_number":42,"repository_id":111}}`) +} + func TestCodespacesService_Get(t *testing.T) { t.Parallel() client, mux, _ := setup(t) diff --git a/github/github-accessors.go b/github/github-accessors.go index 2f3ea2beec1..45e16d4c166 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6398,12 +6398,12 @@ func (c *CodespaceCreateForUserOptions) GetRef() string { return *c.Ref } -// GetRepositoryID returns the RepositoryID field. +// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. func (c *CodespaceCreateForUserOptions) GetRepositoryID() int64 { - if c == nil { + if c == nil || c.RepositoryID == nil { return 0 } - return c.RepositoryID + return *c.RepositoryID } // GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index d6de992b344..844dad6b8a1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8129,7 +8129,10 @@ func TestCodespaceCreateForUserOptions_GetRef(tt *testing.T) { func TestCodespaceCreateForUserOptions_GetRepositoryID(tt *testing.T) { tt.Parallel() - c := &CodespaceCreateForUserOptions{} + var zeroValue int64 + c := &CodespaceCreateForUserOptions{RepositoryID: &zeroValue} + c.GetRepositoryID() + c = &CodespaceCreateForUserOptions{} c.GetRepositoryID() c = nil c.GetRepositoryID() From f643654119759900b7ca9e8bc8a173b32bc4ab6e Mon Sep 17 00:00:00 2001 From: JamBalaya56562 Date: Fri, 11 Sep 2026 04:46:45 +0900 Subject: [PATCH 2/4] feat: Add `DisplayName` to `UpdateCodespaceOptions` The PATCH /user/codespaces/{codespace_name} request schema has `machine`, `display_name` and `recent_folders`, but `display_name` was missing. --- github/codespaces.go | 2 ++ github/codespaces_test.go | 3 ++- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/github/codespaces.go b/github/codespaces.go index 27fc351f2ad..04f526947e0 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -234,6 +234,8 @@ type CodespaceCreateForUserOptions struct { type UpdateCodespaceOptions struct { // Machine represents a valid machine to transition this codespace to. Machine *string `json:"machine,omitempty"` + // DisplayName represents the display name for this codespace. + DisplayName *string `json:"display_name,omitempty"` // RecentFolders represents the recently opened folders inside the codespace. // It is currently used by the clients to determine the folder path to load the codespace in. RecentFolders []string `json:"recent_folders,omitempty"` diff --git a/github/codespaces_test.go b/github/codespaces_test.go index 4c69ecbe23f..3459356cb79 100644 --- a/github/codespaces_test.go +++ b/github/codespaces_test.go @@ -604,7 +604,8 @@ func TestCodespacesService_Update(t *testing.T) { client, mux, _ := setup(t) opt := &UpdateCodespaceOptions{ - Machine: new("standardLinux"), + Machine: new("standardLinux"), + DisplayName: new("my codespace"), RecentFolders: []string{ "folder1", "folder2", diff --git a/github/github-accessors.go b/github/github-accessors.go index 45e16d4c166..eee670827e6 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -44566,6 +44566,14 @@ func (u *UpdateCheckRunOptions) GetStatus() string { return *u.Status } +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (u *UpdateCodespaceOptions) GetDisplayName() string { + if u == nil || u.DisplayName == nil { + return "" + } + return *u.DisplayName +} + // GetMachine returns the Machine field if it's non-nil, zero value otherwise. func (u *UpdateCodespaceOptions) GetMachine() string { if u == nil || u.Machine == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 844dad6b8a1..be0f1559bde 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -55697,6 +55697,17 @@ func TestUpdateCheckRunOptions_GetStatus(tt *testing.T) { u.GetStatus() } +func TestUpdateCodespaceOptions_GetDisplayName(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &UpdateCodespaceOptions{DisplayName: &zeroValue} + u.GetDisplayName() + u = &UpdateCodespaceOptions{} + u.GetDisplayName() + u = nil + u.GetDisplayName() +} + func TestUpdateCodespaceOptions_GetMachine(tt *testing.T) { tt.Parallel() var zeroValue string From 9c7bdcd99976421ea89a0cbb01c55a0f4dd1bf3b Mon Sep 17 00:00:00 2001 From: JamBalaya56562 Date: Fri, 11 Sep 2026 05:14:49 +0900 Subject: [PATCH 3/4] refactor!: Pass the Codespaces body types by value and rename them to `...Request` `CreateCodespaceOptions`, `CodespaceCreateForUserOptions`, `UpdateCodespaceOptions` and `PublishCodespaceOptions` are renamed to `CreateCodespaceRequest`, `CreateCodespaceForUserRequest`, `UpdateCodespaceRequest` and `PublishCodespaceRequest`, and the five `CodespacesService` methods taking them now take them by value. This removes all four types from both `paramcheck` exception lists in `.golangci.yml`. --- .golangci.yml | 8 - github/codespaces.go | 34 +-- github/codespaces_test.go | 38 ++-- github/github-accessors.go | 240 ++++++++++---------- github/github-accessors_test.go | 376 ++++++++++++++++---------------- 5 files changed, 347 insertions(+), 349 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index cd48ccbf4e1..c91681db34e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -205,10 +205,8 @@ linters: - AddProjectItemOptions - AuthorizationRequest - CodeScanningAlertState - - CodespaceCreateForUserOptions - ConfigApplyOptions - ConfigSettings - - CreateCodespaceOptions - CreateOrUpdateIssueTypesOptions - CreateOrgInvitationOptions - CreateUpdateEnvironment @@ -229,7 +227,6 @@ linters: - PagesUpdate - PagesUpdateWithoutCNAME - ProtectionRequest - - PublishCodespaceOptions - PullRequestBranchUpdateOptions - PullRequestReviewRequest - PullRequestReviewsEnforcementUpdate @@ -246,7 +243,6 @@ linters: - TeamAddTeamMembershipOptions - TeamAddTeamRepoOptions - TeamProjectOptions - - UpdateCodespaceOptions - UpdateDefaultSetupConfigurationOptions - UpdateProjectItemOptions - UserSuspendOptions @@ -256,18 +252,15 @@ linters: body-allowed-wrong-names: - AddProjectItemOptions - CheckSuitePreferenceOptions - - CodespaceCreateForUserOptions - ConfigApplyOptions - CreateCheckRunOptions - CreateCheckSuiteOptions - - CreateCodespaceOptions - CreateOrUpdateIssueTypesOptions - CreateOrgInvitationOptions - InstallationTokenListRepoOptions - InstallationTokenOptions - LockIssueOptions - MaintenanceOptions - - PublishCodespaceOptions - PullRequestBranchUpdateOptions - RepositoryAddCollaboratorOptions - RepositoryContentFileOptions @@ -278,7 +271,6 @@ linters: - TeamAddTeamRepoOptions - TeamProjectOptions - UpdateCheckRunOptions - - UpdateCodespaceOptions - UpdateDefaultSetupConfigurationOptions - UpdateProjectItemOptions - UserSuspendOptions diff --git a/github/codespaces.go b/github/codespaces.go index 04f526947e0..4d7e482afd5 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -150,8 +150,10 @@ func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOption return codespaces, resp, nil } -// CreateCodespaceOptions represents options for the creation of a codespace in a repository. -type CreateCodespaceOptions struct { +// CreateCodespaceRequest represents a request to create a codespace in a repository. +// +//meta:schema request POST /repos/{owner}/{repo}/codespaces +type CreateCodespaceRequest struct { Ref *string `json:"ref,omitempty"` // Geo represents the geographic area for this codespace. // If not specified, the value is assigned by IP. @@ -212,8 +214,8 @@ type CodespacePullRequestOptions struct { RepositoryID int64 `json:"repository_id"` } -// CodespaceCreateForUserOptions represents options for creating a codespace for the authenticated user. -type CodespaceCreateForUserOptions struct { +// CreateCodespaceForUserRequest represents a request to create a codespace for the authenticated user. +type CreateCodespaceForUserRequest struct { PullRequest *CodespacePullRequestOptions `json:"pull_request,omitempty"` // RepositoryID represents the repository ID for this codespace. RepositoryID *int64 `json:"repository_id,omitempty"` @@ -230,8 +232,10 @@ type CodespaceCreateForUserOptions struct { DisplayName *string `json:"display_name,omitempty"` } -// UpdateCodespaceOptions represents options for updating a codespace. -type UpdateCodespaceOptions struct { +// UpdateCodespaceRequest represents a request to update a codespace. +// +//meta:schema request PATCH /user/codespaces/{codespace_name} +type UpdateCodespaceRequest struct { // Machine represents a valid machine to transition this codespace to. Machine *string `json:"machine,omitempty"` // DisplayName represents the display name for this codespace. @@ -253,8 +257,10 @@ type CodespaceExport struct { HTMLURL *string `json:"html_url,omitempty"` } -// PublishCodespaceOptions represents options for creating a repository from an unpublished codespace. -type PublishCodespaceOptions struct { +// PublishCodespaceRequest represents a request to create a repository from an unpublished codespace. +// +//meta:schema request POST /user/codespaces/{codespace_name}/publish +type PublishCodespaceRequest struct { // Name represents the name of the new repository. Name *string `json:"name,omitempty"` // Private represents whether the new repository is private. Defaults to false. @@ -275,7 +281,7 @@ type CodespacePermissions struct { // GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-in-a-repository // //meta:operation POST /repos/{owner}/{repo}/codespaces -func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, body *CreateCodespaceOptions) (*Codespace, *Response, error) { +func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, body CreateCodespaceRequest) (*Codespace, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { @@ -446,7 +452,7 @@ func (s *CodespacesService) CheckPermissions(ctx context.Context, owner, repo, r // GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-from-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces -func (s *CodespacesService) CreateFromPullRequest(ctx context.Context, owner, repo string, pullNumber int, body *CreateCodespaceOptions) (*Codespace, *Response, error) { +func (s *CodespacesService) CreateFromPullRequest(ctx context.Context, owner, repo string, pullNumber int, body CreateCodespaceRequest) (*Codespace, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/codespaces", owner, repo, pullNumber) req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { @@ -464,12 +470,12 @@ func (s *CodespacesService) CreateFromPullRequest(ctx context.Context, owner, re // Create creates a new codespace, owned by the authenticated user. // -// This method requires either RepositoryId OR a PullRequest but not both. +// This method requires either RepositoryID or PullRequest to be set, but not both. // // GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-for-the-authenticated-user // //meta:operation POST /user/codespaces -func (s *CodespacesService) Create(ctx context.Context, body *CodespaceCreateForUserOptions) (*Codespace, *Response, error) { +func (s *CodespacesService) Create(ctx context.Context, body CreateCodespaceForUserRequest) (*Codespace, *Response, error) { u := "user/codespaces" req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { @@ -513,7 +519,7 @@ func (s *CodespacesService) Get(ctx context.Context, codespaceName string) (*Cod // GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#update-a-codespace-for-the-authenticated-user // //meta:operation PATCH /user/codespaces/{codespace_name} -func (s *CodespacesService) Update(ctx context.Context, codespaceName string, body *UpdateCodespaceOptions) (*Codespace, *Response, error) { +func (s *CodespacesService) Update(ctx context.Context, codespaceName string, body UpdateCodespaceRequest) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v", codespaceName) req, err := s.client.NewRequest(ctx, "PATCH", u, body) if err != nil { @@ -576,7 +582,7 @@ func (s *CodespacesService) GetLatestCodespaceExport(ctx context.Context, codesp // GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-repository-from-an-unpublished-codespace // //meta:operation POST /user/codespaces/{codespace_name}/publish -func (s *CodespacesService) Publish(ctx context.Context, codespaceName string, body *PublishCodespaceOptions) (*Codespace, *Response, error) { +func (s *CodespacesService) Publish(ctx context.Context, codespaceName string, body PublishCodespaceRequest) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/publish", codespaceName) req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { diff --git a/github/codespaces_test.go b/github/codespaces_test.go index 3459356cb79..e8fdce22866 100644 --- a/github/codespaces_test.go +++ b/github/codespaces_test.go @@ -145,7 +145,7 @@ func TestCodespacesService_CreateInRepo(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &CreateCodespaceOptions{ + input := CreateCodespaceRequest{ Ref: new("main"), Geo: new("WestUs2"), Machine: new("standardLinux"), @@ -451,7 +451,7 @@ func TestCodespacesService_CreateFromPullRequest(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - input := &CreateCodespaceOptions{ + input := CreateCodespaceRequest{ Machine: new("standardLinux"), IdleTimeoutMinutes: new(60), } @@ -497,7 +497,7 @@ func TestCodespacesService_Create(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - opt := &CodespaceCreateForUserOptions{ + input := CreateCodespaceForUserRequest{ Ref: new("main"), Geo: new("WestUs2"), Machine: new("standardLinux"), @@ -508,14 +508,14 @@ func TestCodespacesService_Create(t *testing.T) { mux.HandleFunc("/user/codespaces", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - testJSONBody(t, r, opt) + testJSONBody(t, r, input) fmt.Fprint(w, `{"id":1,"repository":{"id":111}}`) }) ctx := t.Context() codespace, _, err := client.Codespaces.Create( ctx, - opt, + input, ) if err != nil { t.Fatalf("Codespaces.Create returned error: %v", err) @@ -536,7 +536,7 @@ func TestCodespacesService_Create(t *testing.T) { testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { got, resp, err := client.Codespaces.Create( ctx, - opt, + input, ) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) @@ -545,22 +545,22 @@ func TestCodespacesService_Create(t *testing.T) { }) } -func TestCodespaceCreateForUserOptions_Marshal(t *testing.T) { +func TestCreateCodespaceForUserRequest_Marshal(t *testing.T) { t.Parallel() - repoOpts := CodespaceCreateForUserOptions{ + repoInput := CreateCodespaceForUserRequest{ RepositoryID: new(int64(111)), Ref: new("main"), } - testJSONMarshal(t, repoOpts, `{"repository_id":111,"ref":"main"}`) + testJSONMarshal(t, repoInput, `{"repository_id":111,"ref":"main"}`) - pullRequestOpts := CodespaceCreateForUserOptions{ + pullRequestInput := CreateCodespaceForUserRequest{ PullRequest: &CodespacePullRequestOptions{ PullRequestNumber: 42, RepositoryID: 111, }, } - testJSONMarshal(t, pullRequestOpts, `{"pull_request":{"pull_request_number":42,"repository_id":111}}`) + testJSONMarshal(t, pullRequestInput, `{"pull_request":{"pull_request_number":42,"repository_id":111}}`) } func TestCodespacesService_Get(t *testing.T) { @@ -603,7 +603,7 @@ func TestCodespacesService_Update(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - opt := &UpdateCodespaceOptions{ + input := UpdateCodespaceRequest{ Machine: new("standardLinux"), DisplayName: new("my codespace"), RecentFolders: []string{ @@ -614,7 +614,7 @@ func TestCodespacesService_Update(t *testing.T) { mux.HandleFunc("/user/codespaces/codespace_1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") - testJSONBody(t, r, opt) + testJSONBody(t, r, input) fmt.Fprint(w, `{"id":1,"repository":{"id":111}}`) }) @@ -622,7 +622,7 @@ func TestCodespacesService_Update(t *testing.T) { codespace, _, err := client.Codespaces.Update( ctx, "codespace_1", - opt, + input, ) if err != nil { t.Fatalf("Codespaces.Update returned error: %v", err) @@ -644,7 +644,7 @@ func TestCodespacesService_Update(t *testing.T) { got, resp, err := client.Codespaces.Update( ctx, "codespace_1", - opt, + input, ) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) @@ -739,14 +739,14 @@ func TestCodespacesService_Publish(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - opt := &PublishCodespaceOptions{ + input := PublishCodespaceRequest{ Name: new("repo"), Private: new(true), } mux.HandleFunc("/user/codespaces/codespace_1/publish", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - testJSONBody(t, r, opt) + testJSONBody(t, r, input) fmt.Fprint(w, `{"id":1,"repository":{"id":111}}`) }) @@ -754,7 +754,7 @@ func TestCodespacesService_Publish(t *testing.T) { repo, _, err := client.Codespaces.Publish( ctx, "codespace_1", - opt, + input, ) if err != nil { t.Fatalf("Codespaces.Publish returned error: %v", err) @@ -775,7 +775,7 @@ func TestCodespacesService_Publish(t *testing.T) { got, resp, err := client.Codespaces.Publish( ctx, "codespace_1", - opt, + input, ) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) diff --git a/github/github-accessors.go b/github/github-accessors.go index eee670827e6..b4fe8c1295c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6318,110 +6318,6 @@ func (c *Codespace) GetWebURL() string { return *c.WebURL } -// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetClientIP() string { - if c == nil || c.ClientIP == nil { - return "" - } - return *c.ClientIP -} - -// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetDevcontainerPath() string { - if c == nil || c.DevcontainerPath == nil { - return "" - } - return *c.DevcontainerPath -} - -// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetDisplayName() string { - if c == nil || c.DisplayName == nil { - return "" - } - return *c.DisplayName -} - -// GetGeo returns the Geo field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetGeo() string { - if c == nil || c.Geo == nil { - return "" - } - return *c.Geo -} - -// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetIdleTimeoutMinutes() int { - if c == nil || c.IdleTimeoutMinutes == nil { - return 0 - } - return *c.IdleTimeoutMinutes -} - -// GetLocation returns the Location field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetLocation() string { - if c == nil || c.Location == nil { - return "" - } - return *c.Location -} - -// GetMachine returns the Machine field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetMachine() string { - if c == nil || c.Machine == nil { - return "" - } - return *c.Machine -} - -// GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetMultiRepoPermissionsOptOut() bool { - if c == nil || c.MultiRepoPermissionsOptOut == nil { - return false - } - return *c.MultiRepoPermissionsOptOut -} - -// GetPullRequest returns the PullRequest field. -func (c *CodespaceCreateForUserOptions) GetPullRequest() *CodespacePullRequestOptions { - if c == nil { - return nil - } - return c.PullRequest -} - -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetRef() string { - if c == nil || c.Ref == nil { - return "" - } - return *c.Ref -} - -// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetRepositoryID() int64 { - if c == nil || c.RepositoryID == nil { - return 0 - } - return *c.RepositoryID -} - -// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetRetentionPeriodMinutes() int { - if c == nil || c.RetentionPeriodMinutes == nil { - return 0 - } - return *c.RetentionPeriodMinutes -} - -// GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise. -func (c *CodespaceCreateForUserOptions) GetWorkingDirectory() string { - if c == nil || c.WorkingDirectory == nil { - return "" - } - return *c.WorkingDirectory -} - // GetBillableOwner returns the BillableOwner field. func (c *CodespaceDefaultAttributes) GetBillableOwner() *User { if c == nil { @@ -11759,7 +11655,111 @@ func (c *CreateCheckSuiteOptions) GetHeadSHA() string { } // GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetClientIP() string { +func (c *CreateCodespaceForUserRequest) GetClientIP() string { + if c == nil || c.ClientIP == nil { + return "" + } + return *c.ClientIP +} + +// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetDevcontainerPath() string { + if c == nil || c.DevcontainerPath == nil { + return "" + } + return *c.DevcontainerPath +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetDisplayName() string { + if c == nil || c.DisplayName == nil { + return "" + } + return *c.DisplayName +} + +// GetGeo returns the Geo field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetGeo() string { + if c == nil || c.Geo == nil { + return "" + } + return *c.Geo +} + +// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetIdleTimeoutMinutes() int { + if c == nil || c.IdleTimeoutMinutes == nil { + return 0 + } + return *c.IdleTimeoutMinutes +} + +// GetLocation returns the Location field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetLocation() string { + if c == nil || c.Location == nil { + return "" + } + return *c.Location +} + +// GetMachine returns the Machine field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetMachine() string { + if c == nil || c.Machine == nil { + return "" + } + return *c.Machine +} + +// GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetMultiRepoPermissionsOptOut() bool { + if c == nil || c.MultiRepoPermissionsOptOut == nil { + return false + } + return *c.MultiRepoPermissionsOptOut +} + +// GetPullRequest returns the PullRequest field. +func (c *CreateCodespaceForUserRequest) GetPullRequest() *CodespacePullRequestOptions { + if c == nil { + return nil + } + return c.PullRequest +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetRef() string { + if c == nil || c.Ref == nil { + return "" + } + return *c.Ref +} + +// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetRepositoryID() int64 { + if c == nil || c.RepositoryID == nil { + return 0 + } + return *c.RepositoryID +} + +// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetRetentionPeriodMinutes() int { + if c == nil || c.RetentionPeriodMinutes == nil { + return 0 + } + return *c.RetentionPeriodMinutes +} + +// GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceForUserRequest) GetWorkingDirectory() string { + if c == nil || c.WorkingDirectory == nil { + return "" + } + return *c.WorkingDirectory +} + +// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceRequest) GetClientIP() string { if c == nil || c.ClientIP == nil { return "" } @@ -11767,7 +11767,7 @@ func (c *CreateCodespaceOptions) GetClientIP() string { } // GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetDevcontainerPath() string { +func (c *CreateCodespaceRequest) GetDevcontainerPath() string { if c == nil || c.DevcontainerPath == nil { return "" } @@ -11775,7 +11775,7 @@ func (c *CreateCodespaceOptions) GetDevcontainerPath() string { } // GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetDisplayName() string { +func (c *CreateCodespaceRequest) GetDisplayName() string { if c == nil || c.DisplayName == nil { return "" } @@ -11783,7 +11783,7 @@ func (c *CreateCodespaceOptions) GetDisplayName() string { } // GetGeo returns the Geo field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetGeo() string { +func (c *CreateCodespaceRequest) GetGeo() string { if c == nil || c.Geo == nil { return "" } @@ -11791,7 +11791,7 @@ func (c *CreateCodespaceOptions) GetGeo() string { } // GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetIdleTimeoutMinutes() int { +func (c *CreateCodespaceRequest) GetIdleTimeoutMinutes() int { if c == nil || c.IdleTimeoutMinutes == nil { return 0 } @@ -11799,7 +11799,7 @@ func (c *CreateCodespaceOptions) GetIdleTimeoutMinutes() int { } // GetLocation returns the Location field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetLocation() string { +func (c *CreateCodespaceRequest) GetLocation() string { if c == nil || c.Location == nil { return "" } @@ -11807,7 +11807,7 @@ func (c *CreateCodespaceOptions) GetLocation() string { } // GetMachine returns the Machine field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetMachine() string { +func (c *CreateCodespaceRequest) GetMachine() string { if c == nil || c.Machine == nil { return "" } @@ -11815,7 +11815,7 @@ func (c *CreateCodespaceOptions) GetMachine() string { } // GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetMultiRepoPermissionsOptOut() bool { +func (c *CreateCodespaceRequest) GetMultiRepoPermissionsOptOut() bool { if c == nil || c.MultiRepoPermissionsOptOut == nil { return false } @@ -11823,7 +11823,7 @@ func (c *CreateCodespaceOptions) GetMultiRepoPermissionsOptOut() bool { } // GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetRef() string { +func (c *CreateCodespaceRequest) GetRef() string { if c == nil || c.Ref == nil { return "" } @@ -11831,7 +11831,7 @@ func (c *CreateCodespaceOptions) GetRef() string { } // GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetRetentionPeriodMinutes() int { +func (c *CreateCodespaceRequest) GetRetentionPeriodMinutes() int { if c == nil || c.RetentionPeriodMinutes == nil { return 0 } @@ -11839,7 +11839,7 @@ func (c *CreateCodespaceOptions) GetRetentionPeriodMinutes() int { } // GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetWorkingDirectory() string { +func (c *CreateCodespaceRequest) GetWorkingDirectory() string { if c == nil || c.WorkingDirectory == nil { return "" } @@ -31815,7 +31815,7 @@ func (p *PublicKey) GetKeyID() string { } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *PublishCodespaceOptions) GetName() string { +func (p *PublishCodespaceRequest) GetName() string { if p == nil || p.Name == nil { return "" } @@ -31823,7 +31823,7 @@ func (p *PublishCodespaceOptions) GetName() string { } // GetPrivate returns the Private field if it's non-nil, zero value otherwise. -func (p *PublishCodespaceOptions) GetPrivate() bool { +func (p *PublishCodespaceRequest) GetPrivate() bool { if p == nil || p.Private == nil { return false } @@ -44567,7 +44567,7 @@ func (u *UpdateCheckRunOptions) GetStatus() string { } // GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. -func (u *UpdateCodespaceOptions) GetDisplayName() string { +func (u *UpdateCodespaceRequest) GetDisplayName() string { if u == nil || u.DisplayName == nil { return "" } @@ -44575,7 +44575,7 @@ func (u *UpdateCodespaceOptions) GetDisplayName() string { } // GetMachine returns the Machine field if it's non-nil, zero value otherwise. -func (u *UpdateCodespaceOptions) GetMachine() string { +func (u *UpdateCodespaceRequest) GetMachine() string { if u == nil || u.Machine == nil { return "" } @@ -44583,7 +44583,7 @@ func (u *UpdateCodespaceOptions) GetMachine() string { } // GetRecentFolders returns the RecentFolders slice if it's non-nil, nil otherwise. -func (u *UpdateCodespaceOptions) GetRecentFolders() []string { +func (u *UpdateCodespaceRequest) GetRecentFolders() []string { if u == nil || u.RecentFolders == nil { return nil } diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index be0f1559bde..0991b1858f7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8020,146 +8020,6 @@ func TestCodespace_GetWebURL(tt *testing.T) { c.GetWebURL() } -func TestCodespaceCreateForUserOptions_GetClientIP(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CodespaceCreateForUserOptions{ClientIP: &zeroValue} - c.GetClientIP() - c = &CodespaceCreateForUserOptions{} - c.GetClientIP() - c = nil - c.GetClientIP() -} - -func TestCodespaceCreateForUserOptions_GetDevcontainerPath(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CodespaceCreateForUserOptions{DevcontainerPath: &zeroValue} - c.GetDevcontainerPath() - c = &CodespaceCreateForUserOptions{} - c.GetDevcontainerPath() - c = nil - c.GetDevcontainerPath() -} - -func TestCodespaceCreateForUserOptions_GetDisplayName(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CodespaceCreateForUserOptions{DisplayName: &zeroValue} - c.GetDisplayName() - c = &CodespaceCreateForUserOptions{} - c.GetDisplayName() - c = nil - c.GetDisplayName() -} - -func TestCodespaceCreateForUserOptions_GetGeo(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CodespaceCreateForUserOptions{Geo: &zeroValue} - c.GetGeo() - c = &CodespaceCreateForUserOptions{} - c.GetGeo() - c = nil - c.GetGeo() -} - -func TestCodespaceCreateForUserOptions_GetIdleTimeoutMinutes(tt *testing.T) { - tt.Parallel() - var zeroValue int - c := &CodespaceCreateForUserOptions{IdleTimeoutMinutes: &zeroValue} - c.GetIdleTimeoutMinutes() - c = &CodespaceCreateForUserOptions{} - c.GetIdleTimeoutMinutes() - c = nil - c.GetIdleTimeoutMinutes() -} - -func TestCodespaceCreateForUserOptions_GetLocation(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CodespaceCreateForUserOptions{Location: &zeroValue} - c.GetLocation() - c = &CodespaceCreateForUserOptions{} - c.GetLocation() - c = nil - c.GetLocation() -} - -func TestCodespaceCreateForUserOptions_GetMachine(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CodespaceCreateForUserOptions{Machine: &zeroValue} - c.GetMachine() - c = &CodespaceCreateForUserOptions{} - c.GetMachine() - c = nil - c.GetMachine() -} - -func TestCodespaceCreateForUserOptions_GetMultiRepoPermissionsOptOut(tt *testing.T) { - tt.Parallel() - var zeroValue bool - c := &CodespaceCreateForUserOptions{MultiRepoPermissionsOptOut: &zeroValue} - c.GetMultiRepoPermissionsOptOut() - c = &CodespaceCreateForUserOptions{} - c.GetMultiRepoPermissionsOptOut() - c = nil - c.GetMultiRepoPermissionsOptOut() -} - -func TestCodespaceCreateForUserOptions_GetPullRequest(tt *testing.T) { - tt.Parallel() - c := &CodespaceCreateForUserOptions{} - c.GetPullRequest() - c = nil - c.GetPullRequest() -} - -func TestCodespaceCreateForUserOptions_GetRef(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CodespaceCreateForUserOptions{Ref: &zeroValue} - c.GetRef() - c = &CodespaceCreateForUserOptions{} - c.GetRef() - c = nil - c.GetRef() -} - -func TestCodespaceCreateForUserOptions_GetRepositoryID(tt *testing.T) { - tt.Parallel() - var zeroValue int64 - c := &CodespaceCreateForUserOptions{RepositoryID: &zeroValue} - c.GetRepositoryID() - c = &CodespaceCreateForUserOptions{} - c.GetRepositoryID() - c = nil - c.GetRepositoryID() -} - -func TestCodespaceCreateForUserOptions_GetRetentionPeriodMinutes(tt *testing.T) { - tt.Parallel() - var zeroValue int - c := &CodespaceCreateForUserOptions{RetentionPeriodMinutes: &zeroValue} - c.GetRetentionPeriodMinutes() - c = &CodespaceCreateForUserOptions{} - c.GetRetentionPeriodMinutes() - c = nil - c.GetRetentionPeriodMinutes() -} - -func TestCodespaceCreateForUserOptions_GetWorkingDirectory(tt *testing.T) { - tt.Parallel() - var zeroValue string - c := &CodespaceCreateForUserOptions{WorkingDirectory: &zeroValue} - c.GetWorkingDirectory() - c = &CodespaceCreateForUserOptions{} - c.GetWorkingDirectory() - c = nil - c.GetWorkingDirectory() -} - func TestCodespaceDefaultAttributes_GetBillableOwner(tt *testing.T) { tt.Parallel() c := &CodespaceDefaultAttributes{} @@ -14843,122 +14703,262 @@ func TestCreateCheckSuiteOptions_GetHeadSHA(tt *testing.T) { c.GetHeadSHA() } -func TestCreateCodespaceOptions_GetClientIP(tt *testing.T) { +func TestCreateCodespaceForUserRequest_GetClientIP(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateCodespaceForUserRequest{ClientIP: &zeroValue} + c.GetClientIP() + c = &CreateCodespaceForUserRequest{} + c.GetClientIP() + c = nil + c.GetClientIP() +} + +func TestCreateCodespaceForUserRequest_GetDevcontainerPath(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateCodespaceForUserRequest{DevcontainerPath: &zeroValue} + c.GetDevcontainerPath() + c = &CreateCodespaceForUserRequest{} + c.GetDevcontainerPath() + c = nil + c.GetDevcontainerPath() +} + +func TestCreateCodespaceForUserRequest_GetDisplayName(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateCodespaceForUserRequest{DisplayName: &zeroValue} + c.GetDisplayName() + c = &CreateCodespaceForUserRequest{} + c.GetDisplayName() + c = nil + c.GetDisplayName() +} + +func TestCreateCodespaceForUserRequest_GetGeo(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateCodespaceForUserRequest{Geo: &zeroValue} + c.GetGeo() + c = &CreateCodespaceForUserRequest{} + c.GetGeo() + c = nil + c.GetGeo() +} + +func TestCreateCodespaceForUserRequest_GetIdleTimeoutMinutes(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CreateCodespaceForUserRequest{IdleTimeoutMinutes: &zeroValue} + c.GetIdleTimeoutMinutes() + c = &CreateCodespaceForUserRequest{} + c.GetIdleTimeoutMinutes() + c = nil + c.GetIdleTimeoutMinutes() +} + +func TestCreateCodespaceForUserRequest_GetLocation(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateCodespaceForUserRequest{Location: &zeroValue} + c.GetLocation() + c = &CreateCodespaceForUserRequest{} + c.GetLocation() + c = nil + c.GetLocation() +} + +func TestCreateCodespaceForUserRequest_GetMachine(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateCodespaceForUserRequest{Machine: &zeroValue} + c.GetMachine() + c = &CreateCodespaceForUserRequest{} + c.GetMachine() + c = nil + c.GetMachine() +} + +func TestCreateCodespaceForUserRequest_GetMultiRepoPermissionsOptOut(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CreateCodespaceForUserRequest{MultiRepoPermissionsOptOut: &zeroValue} + c.GetMultiRepoPermissionsOptOut() + c = &CreateCodespaceForUserRequest{} + c.GetMultiRepoPermissionsOptOut() + c = nil + c.GetMultiRepoPermissionsOptOut() +} + +func TestCreateCodespaceForUserRequest_GetPullRequest(tt *testing.T) { + tt.Parallel() + c := &CreateCodespaceForUserRequest{} + c.GetPullRequest() + c = nil + c.GetPullRequest() +} + +func TestCreateCodespaceForUserRequest_GetRef(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateCodespaceForUserRequest{Ref: &zeroValue} + c.GetRef() + c = &CreateCodespaceForUserRequest{} + c.GetRef() + c = nil + c.GetRef() +} + +func TestCreateCodespaceForUserRequest_GetRepositoryID(tt *testing.T) { + tt.Parallel() + var zeroValue int64 + c := &CreateCodespaceForUserRequest{RepositoryID: &zeroValue} + c.GetRepositoryID() + c = &CreateCodespaceForUserRequest{} + c.GetRepositoryID() + c = nil + c.GetRepositoryID() +} + +func TestCreateCodespaceForUserRequest_GetRetentionPeriodMinutes(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CreateCodespaceForUserRequest{RetentionPeriodMinutes: &zeroValue} + c.GetRetentionPeriodMinutes() + c = &CreateCodespaceForUserRequest{} + c.GetRetentionPeriodMinutes() + c = nil + c.GetRetentionPeriodMinutes() +} + +func TestCreateCodespaceForUserRequest_GetWorkingDirectory(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateCodespaceForUserRequest{WorkingDirectory: &zeroValue} + c.GetWorkingDirectory() + c = &CreateCodespaceForUserRequest{} + c.GetWorkingDirectory() + c = nil + c.GetWorkingDirectory() +} + +func TestCreateCodespaceRequest_GetClientIP(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CreateCodespaceOptions{ClientIP: &zeroValue} + c := &CreateCodespaceRequest{ClientIP: &zeroValue} c.GetClientIP() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetClientIP() c = nil c.GetClientIP() } -func TestCreateCodespaceOptions_GetDevcontainerPath(tt *testing.T) { +func TestCreateCodespaceRequest_GetDevcontainerPath(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CreateCodespaceOptions{DevcontainerPath: &zeroValue} + c := &CreateCodespaceRequest{DevcontainerPath: &zeroValue} c.GetDevcontainerPath() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetDevcontainerPath() c = nil c.GetDevcontainerPath() } -func TestCreateCodespaceOptions_GetDisplayName(tt *testing.T) { +func TestCreateCodespaceRequest_GetDisplayName(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CreateCodespaceOptions{DisplayName: &zeroValue} + c := &CreateCodespaceRequest{DisplayName: &zeroValue} c.GetDisplayName() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetDisplayName() c = nil c.GetDisplayName() } -func TestCreateCodespaceOptions_GetGeo(tt *testing.T) { +func TestCreateCodespaceRequest_GetGeo(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CreateCodespaceOptions{Geo: &zeroValue} + c := &CreateCodespaceRequest{Geo: &zeroValue} c.GetGeo() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetGeo() c = nil c.GetGeo() } -func TestCreateCodespaceOptions_GetIdleTimeoutMinutes(tt *testing.T) { +func TestCreateCodespaceRequest_GetIdleTimeoutMinutes(tt *testing.T) { tt.Parallel() var zeroValue int - c := &CreateCodespaceOptions{IdleTimeoutMinutes: &zeroValue} + c := &CreateCodespaceRequest{IdleTimeoutMinutes: &zeroValue} c.GetIdleTimeoutMinutes() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetIdleTimeoutMinutes() c = nil c.GetIdleTimeoutMinutes() } -func TestCreateCodespaceOptions_GetLocation(tt *testing.T) { +func TestCreateCodespaceRequest_GetLocation(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CreateCodespaceOptions{Location: &zeroValue} + c := &CreateCodespaceRequest{Location: &zeroValue} c.GetLocation() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetLocation() c = nil c.GetLocation() } -func TestCreateCodespaceOptions_GetMachine(tt *testing.T) { +func TestCreateCodespaceRequest_GetMachine(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CreateCodespaceOptions{Machine: &zeroValue} + c := &CreateCodespaceRequest{Machine: &zeroValue} c.GetMachine() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetMachine() c = nil c.GetMachine() } -func TestCreateCodespaceOptions_GetMultiRepoPermissionsOptOut(tt *testing.T) { +func TestCreateCodespaceRequest_GetMultiRepoPermissionsOptOut(tt *testing.T) { tt.Parallel() var zeroValue bool - c := &CreateCodespaceOptions{MultiRepoPermissionsOptOut: &zeroValue} + c := &CreateCodespaceRequest{MultiRepoPermissionsOptOut: &zeroValue} c.GetMultiRepoPermissionsOptOut() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetMultiRepoPermissionsOptOut() c = nil c.GetMultiRepoPermissionsOptOut() } -func TestCreateCodespaceOptions_GetRef(tt *testing.T) { +func TestCreateCodespaceRequest_GetRef(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CreateCodespaceOptions{Ref: &zeroValue} + c := &CreateCodespaceRequest{Ref: &zeroValue} c.GetRef() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetRef() c = nil c.GetRef() } -func TestCreateCodespaceOptions_GetRetentionPeriodMinutes(tt *testing.T) { +func TestCreateCodespaceRequest_GetRetentionPeriodMinutes(tt *testing.T) { tt.Parallel() var zeroValue int - c := &CreateCodespaceOptions{RetentionPeriodMinutes: &zeroValue} + c := &CreateCodespaceRequest{RetentionPeriodMinutes: &zeroValue} c.GetRetentionPeriodMinutes() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetRetentionPeriodMinutes() c = nil c.GetRetentionPeriodMinutes() } -func TestCreateCodespaceOptions_GetWorkingDirectory(tt *testing.T) { +func TestCreateCodespaceRequest_GetWorkingDirectory(tt *testing.T) { tt.Parallel() var zeroValue string - c := &CreateCodespaceOptions{WorkingDirectory: &zeroValue} + c := &CreateCodespaceRequest{WorkingDirectory: &zeroValue} c.GetWorkingDirectory() - c = &CreateCodespaceOptions{} + c = &CreateCodespaceRequest{} c.GetWorkingDirectory() c = nil c.GetWorkingDirectory() @@ -39861,23 +39861,23 @@ func TestPublicKey_GetKeyID(tt *testing.T) { p.GetKeyID() } -func TestPublishCodespaceOptions_GetName(tt *testing.T) { +func TestPublishCodespaceRequest_GetName(tt *testing.T) { tt.Parallel() var zeroValue string - p := &PublishCodespaceOptions{Name: &zeroValue} + p := &PublishCodespaceRequest{Name: &zeroValue} p.GetName() - p = &PublishCodespaceOptions{} + p = &PublishCodespaceRequest{} p.GetName() p = nil p.GetName() } -func TestPublishCodespaceOptions_GetPrivate(tt *testing.T) { +func TestPublishCodespaceRequest_GetPrivate(tt *testing.T) { tt.Parallel() var zeroValue bool - p := &PublishCodespaceOptions{Private: &zeroValue} + p := &PublishCodespaceRequest{Private: &zeroValue} p.GetPrivate() - p = &PublishCodespaceOptions{} + p = &PublishCodespaceRequest{} p.GetPrivate() p = nil p.GetPrivate() @@ -55697,34 +55697,34 @@ func TestUpdateCheckRunOptions_GetStatus(tt *testing.T) { u.GetStatus() } -func TestUpdateCodespaceOptions_GetDisplayName(tt *testing.T) { +func TestUpdateCodespaceRequest_GetDisplayName(tt *testing.T) { tt.Parallel() var zeroValue string - u := &UpdateCodespaceOptions{DisplayName: &zeroValue} + u := &UpdateCodespaceRequest{DisplayName: &zeroValue} u.GetDisplayName() - u = &UpdateCodespaceOptions{} + u = &UpdateCodespaceRequest{} u.GetDisplayName() u = nil u.GetDisplayName() } -func TestUpdateCodespaceOptions_GetMachine(tt *testing.T) { +func TestUpdateCodespaceRequest_GetMachine(tt *testing.T) { tt.Parallel() var zeroValue string - u := &UpdateCodespaceOptions{Machine: &zeroValue} + u := &UpdateCodespaceRequest{Machine: &zeroValue} u.GetMachine() - u = &UpdateCodespaceOptions{} + u = &UpdateCodespaceRequest{} u.GetMachine() u = nil u.GetMachine() } -func TestUpdateCodespaceOptions_GetRecentFolders(tt *testing.T) { +func TestUpdateCodespaceRequest_GetRecentFolders(tt *testing.T) { tt.Parallel() zeroValue := []string{} - u := &UpdateCodespaceOptions{RecentFolders: zeroValue} + u := &UpdateCodespaceRequest{RecentFolders: zeroValue} u.GetRecentFolders() - u = &UpdateCodespaceOptions{} + u = &UpdateCodespaceRequest{} u.GetRecentFolders() u = nil u.GetRecentFolders() From ab89cb3100c2d133b37421e799a320522c8a8d56 Mon Sep 17 00:00:00 2001 From: JamBalaya56562 Date: Sat, 12 Sep 2026 17:38:47 +0900 Subject: [PATCH 4/4] refactor: Drop the `//meta:schema` annotations from the Codespaces request types They are only consumed by the tool proposed in #4375, which has not been merged yet. --- github/codespaces.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/github/codespaces.go b/github/codespaces.go index 4d7e482afd5..3299096ee55 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -151,8 +151,6 @@ func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOption } // CreateCodespaceRequest represents a request to create a codespace in a repository. -// -//meta:schema request POST /repos/{owner}/{repo}/codespaces type CreateCodespaceRequest struct { Ref *string `json:"ref,omitempty"` // Geo represents the geographic area for this codespace. @@ -233,8 +231,6 @@ type CreateCodespaceForUserRequest struct { } // UpdateCodespaceRequest represents a request to update a codespace. -// -//meta:schema request PATCH /user/codespaces/{codespace_name} type UpdateCodespaceRequest struct { // Machine represents a valid machine to transition this codespace to. Machine *string `json:"machine,omitempty"` @@ -258,8 +254,6 @@ type CodespaceExport struct { } // PublishCodespaceRequest represents a request to create a repository from an unpublished codespace. -// -//meta:schema request POST /user/codespaces/{codespace_name}/publish type PublishCodespaceRequest struct { // Name represents the name of the new repository. Name *string `json:"name,omitempty"`