diff --git a/github/actions_hosted_runners.go b/github/actions_hosted_runners.go index 207b755fc30..e9ae9405a72 100644 --- a/github/actions_hosted_runners.go +++ b/github/actions_hosted_runners.go @@ -32,7 +32,7 @@ type HostedRunner struct { Name *string `json:"name,omitempty"` RunnerGroupID *int64 `json:"runner_group_id,omitempty"` Platform *string `json:"platform,omitempty"` - ImageDetails *HostedRunnerImageDetail `json:"image_details,omitempty"` + Image *HostedRunnerImageDetail `json:"image,omitempty"` MachineSizeDetails *HostedRunnerMachineSpec `json:"machine_size_details,omitempty"` Status *string `json:"status,omitempty"` MaximumRunners *int64 `json:"maximum_runners,omitempty"` @@ -44,7 +44,7 @@ type HostedRunner struct { // HostedRunnerImageDetail represents the image details of a GitHub-hosted runners. type HostedRunnerImageDetail struct { ID *string `json:"id"` // The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. Example: ubuntu-20.04 - SizeGB *int64 `json:"size_gb"` // Image size in GB. Example: 86 + Size *int64 `json:"size"` // Image size in GB. Example: 86 DisplayName *string `json:"display_name"` // Display name for this image. Example: 20.04 Source *string `json:"source"` // The image provider. Example: github, partner, custom Version *string `json:"version"` // The image version of the hosted runner pool. Example: latest diff --git a/github/actions_hosted_runners_test.go b/github/actions_hosted_runners_test.go index 2f5f62ea27d..122a738cebe 100644 --- a/github/actions_hosted_runners_test.go +++ b/github/actions_hosted_runners_test.go @@ -28,9 +28,9 @@ func TestActionsService_ListHostedRunners(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -55,9 +55,9 @@ func TestActionsService_ListHostedRunners(t *testing.T) { "name": "My hosted Windows runner", "runner_group_id": 2, "platform": "win-x64", - "image_details": { + "image": { "id": "windows-latest", - "size_gb": 256 + "size": 256 }, "machine_size_details": { "id": "8-core", @@ -91,9 +91,9 @@ func TestActionsService_ListHostedRunners(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", @@ -118,9 +118,9 @@ func TestActionsService_ListHostedRunners(t *testing.T) { Name: Ptr("My hosted Windows runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("win-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("windows-latest"), - SizeGB: Ptr(int64(256)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("windows-latest"), + Size: Ptr(int64(256)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "8-core", @@ -166,9 +166,9 @@ func TestActionsService_CreateHostedRunner(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -215,9 +215,9 @@ func TestActionsService_CreateHostedRunner(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", @@ -617,9 +617,9 @@ func TestActionsService_GetHostedRunner(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -653,9 +653,9 @@ func TestActionsService_GetHostedRunner(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", @@ -706,9 +706,9 @@ func TestActionsService_UpdateHostedRunner(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -749,9 +749,9 @@ func TestActionsService_UpdateHostedRunner(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", @@ -843,9 +843,9 @@ func TestActionsService_DeleteHostedRunner(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -879,9 +879,9 @@ func TestActionsService_DeleteHostedRunner(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index b2ee32f6145..dc54a84853d 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -18,6 +18,8 @@ type RunnerGroup struct { Default *bool `json:"default,omitempty"` SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` RunnersURL *string `json:"runners_url,omitempty"` + HostedRunnersURL *string `json:"hosted_runners_url,omitempty"` + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` Inherited *bool `json:"inherited,omitempty"` AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` @@ -45,6 +47,8 @@ type CreateRunnerGroupRequest struct { RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` // List of workflows the runner group should be allowed to run. This setting will be ignored unless RestrictedToWorkflows is set to true. SelectedWorkflows []string `json:"selected_workflows,omitempty"` + // The identifier of a hosted compute network configuration. + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` } // UpdateRunnerGroupRequest represents a request to update a Runner group for an organization. @@ -54,6 +58,7 @@ type UpdateRunnerGroupRequest struct { AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"` SelectedWorkflows []string `json:"selected_workflows,omitempty"` + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` } // SetRepoAccessRunnerGroupRequest represents a request to replace the list of repositories diff --git a/github/actions_runner_groups_test.go b/github/actions_runner_groups_test.go index 42eff9a933a..c5c83001457 100644 --- a/github/actions_runner_groups_test.go +++ b/github/actions_runner_groups_test.go @@ -107,7 +107,7 @@ func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","hosted_runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners","network_configuration_id":"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) }) ctx := t.Context() @@ -123,6 +123,8 @@ func TestActionsService_GetOrganizationRunnerGroup(t *testing.T) { Default: Ptr(false), SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), + HostedRunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners"), + NetworkConfigurationID: Ptr("EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), @@ -179,7 +181,7 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { mux.HandleFunc("/orgs/o/actions/runner-groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","hosted_runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners","network_configuration_id":"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) }) ctx := t.Context() @@ -189,6 +191,7 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, + NetworkConfigurationID: Ptr("EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA"), } group, _, err := client.Actions.CreateOrganizationRunnerGroup(ctx, "o", req) if err != nil { @@ -202,6 +205,8 @@ func TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) { Default: Ptr(false), SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), + HostedRunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners"), + NetworkConfigurationID: Ptr("EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), @@ -233,7 +238,7 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") - fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) + fmt.Fprint(w, `{"id":2,"name":"octo-runner-group","visibility":"selected","default":false,"selected_repositories_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories","runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners","hosted_runners_url":"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners","network_configuration_id":"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA","inherited":false,"allows_public_repositories":true,"restricted_to_workflows":false,"selected_workflows":[]}`) }) ctx := t.Context() @@ -243,6 +248,7 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, + NetworkConfigurationID: Ptr("EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA"), } group, _, err := client.Actions.UpdateOrganizationRunnerGroup(ctx, "o", 2, req) if err != nil { @@ -256,6 +262,8 @@ func TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) { Default: Ptr(false), SelectedRepositoriesURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories"), RunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners"), + HostedRunnersURL: Ptr("https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners"), + NetworkConfigurationID: Ptr("EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), @@ -541,6 +549,8 @@ func TestRunnerGroup_Marshal(t *testing.T) { Default: Ptr(true), SelectedRepositoriesURL: Ptr("s"), RunnersURL: Ptr("r"), + HostedRunnersURL: Ptr("h"), + NetworkConfigurationID: Ptr("nc"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), @@ -554,6 +564,8 @@ func TestRunnerGroup_Marshal(t *testing.T) { "default": true, "selected_repositories_url": "s", "runners_url": "r", + "hosted_runners_url": "h", + "network_configuration_id": "nc", "inherited": true, "allows_public_repositories": true, "restricted_to_workflows": false, @@ -577,6 +589,8 @@ func TestRunnerGroups_Marshal(t *testing.T) { Default: Ptr(true), SelectedRepositoriesURL: Ptr("s"), RunnersURL: Ptr("r"), + HostedRunnersURL: Ptr("h"), + NetworkConfigurationID: Ptr("nc"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), @@ -594,6 +608,8 @@ func TestRunnerGroups_Marshal(t *testing.T) { "default": true, "selected_repositories_url": "s", "runners_url": "r", + "hosted_runners_url": "h", + "network_configuration_id": "nc", "inherited": true, "allows_public_repositories": true, "restricted_to_workflows": false, @@ -616,6 +632,7 @@ func TestCreateRunnerGroupRequest_Marshal(t *testing.T) { AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(true), SelectedWorkflows: []string{"a", "b"}, + NetworkConfigurationID: Ptr("nc"), } want := `{ @@ -625,7 +642,8 @@ func TestCreateRunnerGroupRequest_Marshal(t *testing.T) { "runners": [1], "allows_public_repositories": true, "restricted_to_workflows": true, - "selected_workflows": ["a","b"] + "selected_workflows": ["a","b"], + "network_configuration_id": "nc" }` testJSONMarshal(t, u, want) @@ -641,6 +659,7 @@ func TestUpdateRunnerGroupRequest_Marshal(t *testing.T) { AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}, + NetworkConfigurationID: Ptr("nc"), } want := `{ @@ -648,7 +667,8 @@ func TestUpdateRunnerGroupRequest_Marshal(t *testing.T) { "visibility": "v", "allows_public_repositories": true, "restricted_to_workflows": false, - "selected_workflows": [] + "selected_workflows": [], + "network_configuration_id": "nc" }` testJSONMarshal(t, u, want) diff --git a/github/enterprise_actions_hosted_runners_test.go b/github/enterprise_actions_hosted_runners_test.go index 740e41a5b6f..7d6a4ed9041 100644 --- a/github/enterprise_actions_hosted_runners_test.go +++ b/github/enterprise_actions_hosted_runners_test.go @@ -28,9 +28,9 @@ func TestEnterpriseService_ListHostedRunners(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -55,9 +55,9 @@ func TestEnterpriseService_ListHostedRunners(t *testing.T) { "name": "My hosted Windows runner", "runner_group_id": 2, "platform": "win-x64", - "image_details": { + "image": { "id": "windows-latest", - "size_gb": 256 + "size": 256 }, "machine_size_details": { "id": "8-core", @@ -91,9 +91,9 @@ func TestEnterpriseService_ListHostedRunners(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", @@ -118,9 +118,9 @@ func TestEnterpriseService_ListHostedRunners(t *testing.T) { Name: Ptr("My hosted Windows runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("win-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("windows-latest"), - SizeGB: Ptr(int64(256)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("windows-latest"), + Size: Ptr(int64(256)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "8-core", @@ -166,9 +166,9 @@ func TestEnterpriseService_CreateHostedRunner(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -214,9 +214,9 @@ func TestEnterpriseService_CreateHostedRunner(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", @@ -610,9 +610,9 @@ func TestEnterpriseService_GetHostedRunner(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -646,9 +646,9 @@ func TestEnterpriseService_GetHostedRunner(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", @@ -699,9 +699,9 @@ func TestEnterpriseService_UpdateHostedRunner(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -743,9 +743,9 @@ func TestEnterpriseService_UpdateHostedRunner(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", @@ -837,9 +837,9 @@ func TestEnterpriseService_DeleteHostedRunner(t *testing.T) { "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", - "image_details": { + "image": { "id": "ubuntu-20.04", - "size_gb": 86 + "size": 86 }, "machine_size_details": { "id": "4-core", @@ -873,9 +873,9 @@ func TestEnterpriseService_DeleteHostedRunner(t *testing.T) { Name: Ptr("My hosted ubuntu runner"), RunnerGroupID: Ptr(int64(2)), Platform: Ptr("linux-x64"), - ImageDetails: &HostedRunnerImageDetail{ - ID: Ptr("ubuntu-20.04"), - SizeGB: Ptr(int64(86)), + Image: &HostedRunnerImageDetail{ + ID: Ptr("ubuntu-20.04"), + Size: Ptr(int64(86)), }, MachineSizeDetails: &HostedRunnerMachineSpec{ ID: "4-core", diff --git a/github/github-accessors.go b/github/github-accessors.go index bba6f7a169a..cc07befd68c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6478,6 +6478,14 @@ func (c *CreateRunnerGroupRequest) GetName() string { return *c.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (c *CreateRunnerGroupRequest) GetNetworkConfigurationID() string { + if c == nil || c.NetworkConfigurationID == nil { + return "" + } + return *c.NetworkConfigurationID +} + // GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. func (c *CreateRunnerGroupRequest) GetRestrictedToWorkflows() bool { if c == nil || c.RestrictedToWorkflows == nil { @@ -10878,12 +10886,12 @@ func (h *HostedRunner) GetID() int64 { return *h.ID } -// GetImageDetails returns the ImageDetails field. -func (h *HostedRunner) GetImageDetails() *HostedRunnerImageDetail { +// GetImage returns the Image field. +func (h *HostedRunner) GetImage() *HostedRunnerImageDetail { if h == nil { return nil } - return h.ImageDetails + return h.Image } // GetLastActiveOn returns the LastActiveOn field if it's non-nil, zero value otherwise. @@ -10966,12 +10974,12 @@ func (h *HostedRunnerImageDetail) GetID() string { return *h.ID } -// GetSizeGB returns the SizeGB field if it's non-nil, zero value otherwise. -func (h *HostedRunnerImageDetail) GetSizeGB() int64 { - if h == nil || h.SizeGB == nil { +// GetSize returns the Size field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetSize() int64 { + if h == nil || h.Size == nil { return 0 } - return *h.SizeGB + return *h.Size } // GetSource returns the Source field if it's non-nil, zero value otherwise. @@ -25678,6 +25686,14 @@ func (r *RunnerGroup) GetDefault() bool { return *r.Default } +// GetHostedRunnersURL returns the HostedRunnersURL field if it's non-nil, zero value otherwise. +func (r *RunnerGroup) GetHostedRunnersURL() string { + if r == nil || r.HostedRunnersURL == nil { + return "" + } + return *r.HostedRunnersURL +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *RunnerGroup) GetID() int64 { if r == nil || r.ID == nil { @@ -25702,6 +25718,14 @@ func (r *RunnerGroup) GetName() string { return *r.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (r *RunnerGroup) GetNetworkConfigurationID() string { + if r == nil || r.NetworkConfigurationID == nil { + return "" + } + return *r.NetworkConfigurationID +} + // GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. func (r *RunnerGroup) GetRestrictedToWorkflows() bool { if r == nil || r.RestrictedToWorkflows == nil { @@ -29334,6 +29358,14 @@ func (u *UpdateRunnerGroupRequest) GetName() string { return *u.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (u *UpdateRunnerGroupRequest) GetNetworkConfigurationID() string { + if u == nil || u.NetworkConfigurationID == nil { + return "" + } + return *u.NetworkConfigurationID +} + // GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetRestrictedToWorkflows() bool { if u == nil || u.RestrictedToWorkflows == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 69d58790f66..fbb5585adf4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8465,6 +8465,17 @@ func TestCreateRunnerGroupRequest_GetName(tt *testing.T) { c.GetName() } +func TestCreateRunnerGroupRequest_GetNetworkConfigurationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CreateRunnerGroupRequest{NetworkConfigurationID: &zeroValue} + c.GetNetworkConfigurationID() + c = &CreateRunnerGroupRequest{} + c.GetNetworkConfigurationID() + c = nil + c.GetNetworkConfigurationID() +} + func TestCreateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -14116,12 +14127,12 @@ func TestHostedRunner_GetID(tt *testing.T) { h.GetID() } -func TestHostedRunner_GetImageDetails(tt *testing.T) { +func TestHostedRunner_GetImage(tt *testing.T) { tt.Parallel() h := &HostedRunner{} - h.GetImageDetails() + h.GetImage() h = nil - h.GetImageDetails() + h.GetImage() } func TestHostedRunner_GetLastActiveOn(tt *testing.T) { @@ -14231,15 +14242,15 @@ func TestHostedRunnerImageDetail_GetID(tt *testing.T) { h.GetID() } -func TestHostedRunnerImageDetail_GetSizeGB(tt *testing.T) { +func TestHostedRunnerImageDetail_GetSize(tt *testing.T) { tt.Parallel() var zeroValue int64 - h := &HostedRunnerImageDetail{SizeGB: &zeroValue} - h.GetSizeGB() + h := &HostedRunnerImageDetail{Size: &zeroValue} + h.GetSize() h = &HostedRunnerImageDetail{} - h.GetSizeGB() + h.GetSize() h = nil - h.GetSizeGB() + h.GetSize() } func TestHostedRunnerImageDetail_GetSource(tt *testing.T) { @@ -33104,6 +33115,17 @@ func TestRunnerGroup_GetDefault(tt *testing.T) { r.GetDefault() } +func TestRunnerGroup_GetHostedRunnersURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RunnerGroup{HostedRunnersURL: &zeroValue} + r.GetHostedRunnersURL() + r = &RunnerGroup{} + r.GetHostedRunnersURL() + r = nil + r.GetHostedRunnersURL() +} + func TestRunnerGroup_GetID(tt *testing.T) { tt.Parallel() var zeroValue int64 @@ -33137,6 +33159,17 @@ func TestRunnerGroup_GetName(tt *testing.T) { r.GetName() } +func TestRunnerGroup_GetNetworkConfigurationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + r := &RunnerGroup{NetworkConfigurationID: &zeroValue} + r.GetNetworkConfigurationID() + r = &RunnerGroup{} + r.GetNetworkConfigurationID() + r = nil + r.GetNetworkConfigurationID() +} + func TestRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -37798,6 +37831,17 @@ func TestUpdateRunnerGroupRequest_GetName(tt *testing.T) { u.GetName() } +func TestUpdateRunnerGroupRequest_GetNetworkConfigurationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + u := &UpdateRunnerGroupRequest{NetworkConfigurationID: &zeroValue} + u.GetNetworkConfigurationID() + u = &UpdateRunnerGroupRequest{} + u.GetNetworkConfigurationID() + u = nil + u.GetNetworkConfigurationID() +} + func TestUpdateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) { tt.Parallel() var zeroValue bool