Skip to content

Commit

Permalink
Renamed config struct
Browse files Browse the repository at this point in the history
Signed-off-by: Magnus Kulke <[email protected]>
  • Loading branch information
mkulke committed Jun 8, 2023
1 parent 9ed9008 commit 82526e3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions github/actions_runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, own
return rads, resp, nil
}

// GenerateRepoJITConfigRequest specifies body parameters to GenerateRepoJITConfig.
type GenerateRepoJITConfigRequest struct {
// GenerateJITConfigRequest specifies body parameters to GenerateRepoJITConfig.
type GenerateJITConfigRequest struct {
Name string `json:"name"`
RunnerGroupID int64 `json:"runner_group_id"`
WorkFolder *string `json:"work_folder,omitempty"`
Expand All @@ -64,7 +64,7 @@ type JITRunnerConfig struct {
// GenerateOrgJITConfig generate a just-in-time configuration for an organization.
//
// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization
func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateRepoJITConfigRequest) (*JITRunnerConfig, *Response, error) {
func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", owner)
req, err := s.client.NewRequest("POST", u, request)
if err != nil {
Expand All @@ -83,7 +83,7 @@ func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string,
// GenerateRepoJITConfig generates a just-in-time configuration for a repository.
//
// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository
func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateRepoJITConfigRequest) (*JITRunnerConfig, *Response, error) {
func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/actions/runners/generate-jitconfig", owner, repo)
req, err := s.client.NewRequest("POST", u, request)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions github/actions_runners_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ func TestActionsService_GenerateOrgJITConfig(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

input := &GenerateRepoJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}}
input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}}

mux.HandleFunc("/orgs/o/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) {
v := new(GenerateRepoJITConfigRequest)
v := new(GenerateJITConfigRequest)
json.NewDecoder(r.Body).Decode(v)

testMethod(t, r, "POST")
Expand Down Expand Up @@ -105,10 +105,10 @@ func TestActionsService_GenerateRepoJITConfig(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

input := &GenerateRepoJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}}
input := &GenerateJITConfigRequest{Name: "test", RunnerGroupID: 1, Labels: []string{"one", "two"}}

mux.HandleFunc("/repos/o/r/actions/runners/generate-jitconfig", func(w http.ResponseWriter, r *http.Request) {
v := new(GenerateRepoJITConfigRequest)
v := new(GenerateJITConfigRequest)
json.NewDecoder(r.Body).Decode(v)

testMethod(t, r, "POST")
Expand Down
16 changes: 8 additions & 8 deletions github/github-accessors.go

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

20 changes: 10 additions & 10 deletions github/github-accessors_test.go

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

0 comments on commit 82526e3

Please sign in to comment.