diff --git a/go.mod b/go.mod index e77e4e59b..1b2bf12f1 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( code.gitea.io/sdk/gitea v0.23.2 github.com/Masterminds/semver/v3 v3.5.0 github.com/argoproj-labs/argocd-operator v0.17.0 - github.com/bradleyfalzon/ghinstallation/v2 v2.18.0 + github.com/bradleyfalzon/ghinstallation/v2 v2.19.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.19.1 github.com/go-logr/logr v1.4.3 @@ -110,7 +110,7 @@ require ( github.com/google/gnostic-models v0.7.0 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/go-github/v69 v69.2.0 // indirect - github.com/google/go-github/v84 v84.0.0 // indirect + github.com/google/go-github/v88 v88.0.0 // indirect github.com/google/go-querystring v1.2.0 // indirect github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect diff --git a/go.sum b/go.sum index 3763c2ee0..581b3dc8e 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4Yn github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bombsimon/logrusr/v4 v4.1.0 h1:uZNPbwusB0eUXlO8hIUwStE6Lr5bLN6IgYgG+75kuh4= github.com/bombsimon/logrusr/v4 v4.1.0/go.mod h1:pjfHC5e59CvjTBIU3V3sGhFWFAnsnhOR03TRc6im0l8= -github.com/bradleyfalzon/ghinstallation/v2 v2.18.0 h1:WPqnN6NS9XvYlOgZQAIseN7Z1uAiE+UxgDKlW7FvFuU= -github.com/bradleyfalzon/ghinstallation/v2 v2.18.0/go.mod h1:gpoSwwWc4biE49F7n+roCcpkEkZ1Qr9soZ2ESvMiouU= +github.com/bradleyfalzon/ghinstallation/v2 v2.19.0 h1:KQfD+43pRw9NUJhGycGrFr9vF1MubZacksKol1gomFI= +github.com/bradleyfalzon/ghinstallation/v2 v2.19.0/go.mod h1:fe5ECIhCdEnxwLiBlNTxx9CP455wt42BELnlDVMvaAA= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= @@ -247,8 +247,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-github/v69 v69.2.0 h1:wR+Wi/fN2zdUx9YxSmYE0ktiX9IAR/BeePzeaUUbEHE= github.com/google/go-github/v69 v69.2.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM= -github.com/google/go-github/v84 v84.0.0 h1:I/0Xn5IuChMe8TdmI2bbim5nyhaRFJ7DEdzmD2w+yVA= -github.com/google/go-github/v84 v84.0.0/go.mod h1:WwYL1z1ajRdlaPszjVu/47x1L0PXukJBn73xsiYrRRQ= +github.com/google/go-github/v88 v88.0.0 h1:dZA9IKkPK1eXZj4ypngnpRj5FwdpTv4whix2PrQMP7M= +github.com/google/go-github/v88 v88.0.0/go.mod h1:rufTDgn2N45wjhukLTyxmvc9nilSp3mr3Rgtt6b1MPw= github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= diff --git a/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go b/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go index 324239549..79a306a7a 100644 --- a/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go +++ b/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go @@ -13,7 +13,7 @@ import ( "sync" "time" - "github.com/google/go-github/v84/github" + "github.com/google/go-github/v88/github" ) const ( diff --git a/vendor/github.com/google/go-github/v84/github/copilot.go b/vendor/github.com/google/go-github/v84/github/copilot.go deleted file mode 100644 index 445b6dda0..000000000 --- a/vendor/github.com/google/go-github/v84/github/copilot.go +++ /dev/null @@ -1,786 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "time" -) - -// CopilotService provides access to the Copilot-related functions -// in the GitHub API. -// -// GitHub API docs: https://docs.github.com/en/rest/copilot/ -type CopilotService service - -// CopilotOrganizationDetails represents the details of an organization's Copilot for Business subscription. -type CopilotOrganizationDetails struct { - SeatBreakdown *CopilotSeatBreakdown `json:"seat_breakdown"` - PublicCodeSuggestions string `json:"public_code_suggestions"` - CopilotChat string `json:"copilot_chat"` - SeatManagementSetting string `json:"seat_management_setting"` -} - -// CopilotSeatBreakdown represents the breakdown of Copilot for Business seats for the organization. -type CopilotSeatBreakdown struct { - Total int `json:"total"` - AddedThisCycle int `json:"added_this_cycle"` - PendingCancellation int `json:"pending_cancellation"` - PendingInvitation int `json:"pending_invitation"` - ActiveThisCycle int `json:"active_this_cycle"` - InactiveThisCycle int `json:"inactive_this_cycle"` -} - -// ListCopilotSeatsResponse represents the Copilot for Business seat assignments for an organization. -type ListCopilotSeatsResponse struct { - TotalSeats int64 `json:"total_seats"` - Seats []*CopilotSeatDetails `json:"seats"` -} - -// CopilotSeatDetails represents the details of a Copilot for Business seat. -type CopilotSeatDetails struct { - // Assignee can either be a User, Team, or Organization. - Assignee any `json:"assignee"` - AssigningTeam *Team `json:"assigning_team,omitempty"` - PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` - LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` - LastActivityEditor *string `json:"last_activity_editor,omitempty"` - CreatedAt *Timestamp `json:"created_at"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PlanType *string `json:"plan_type,omitempty"` -} - -// SeatAssignments represents the number of seats assigned. -type SeatAssignments struct { - SeatsCreated int `json:"seats_created"` -} - -// SeatCancellations represents the number of seats cancelled. -type SeatCancellations struct { - SeatsCancelled int `json:"seats_cancelled"` -} - -// CopilotMetricsListOptions represents the optional parameters to the CopilotService get metrics methods. -type CopilotMetricsListOptions struct { - Since *time.Time `url:"since,omitempty"` - Until *time.Time `url:"until,omitempty"` - - ListOptions -} - -// CopilotIDECodeCompletionsLanguage represents Copilot usage metrics for completions in the IDE for a language. -type CopilotIDECodeCompletionsLanguage struct { - Name string `json:"name"` - TotalEngagedUsers int `json:"total_engaged_users"` -} - -// CopilotIDECodeCompletionsModelLanguage represents Copilot usage metrics for completions in the IDE for a model and language. -type CopilotIDECodeCompletionsModelLanguage struct { - Name string `json:"name"` - TotalEngagedUsers int `json:"total_engaged_users"` - TotalCodeSuggestions int `json:"total_code_suggestions"` - TotalCodeAcceptances int `json:"total_code_acceptances"` - TotalCodeLinesSuggested int `json:"total_code_lines_suggested"` - TotalCodeLinesAccepted int `json:"total_code_lines_accepted"` -} - -// CopilotIDECodeCompletionsModel represents Copilot usage metrics for completions in the IDE for a model. -type CopilotIDECodeCompletionsModel struct { - Name string `json:"name"` - IsCustomModel bool `json:"is_custom_model"` - CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` - TotalEngagedUsers int `json:"total_engaged_users"` - Languages []*CopilotIDECodeCompletionsModelLanguage `json:"languages"` -} - -// CopilotIDECodeCompletionsEditor represents Copilot usage metrics for completions in the IDE for an editor. -type CopilotIDECodeCompletionsEditor struct { - Name string `json:"name"` - TotalEngagedUsers int `json:"total_engaged_users"` - Models []*CopilotIDECodeCompletionsModel `json:"models"` -} - -// CopilotIDECodeCompletions represents Copilot usage metrics for Copilot code completions in the IDE, categorized by editor, model and language. -type CopilotIDECodeCompletions struct { - TotalEngagedUsers int `json:"total_engaged_users"` - Languages []*CopilotIDECodeCompletionsLanguage `json:"languages"` - Editors []*CopilotIDECodeCompletionsEditor `json:"editors"` -} - -// CopilotIDEChatModel represents Copilot usage metrics for chatting with a model in the IDE. -type CopilotIDEChatModel struct { - Name string `json:"name"` - IsCustomModel bool `json:"is_custom_model"` - CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` - TotalEngagedUsers int `json:"total_engaged_users"` - TotalChats int `json:"total_chats"` - TotalChatInsertionEvents int `json:"total_chat_insertion_events"` - TotalChatCopyEvents int `json:"total_chat_copy_events"` -} - -// CopilotIDEChatEditor represents Copilot usage metrics for chatting with a model in the IDE, categorized by editor and model. -type CopilotIDEChatEditor struct { - Name string `json:"name"` - TotalEngagedUsers int `json:"total_engaged_users"` - Models []*CopilotIDEChatModel `json:"models"` -} - -// CopilotIDEChat represents Copilot usage metrics for Copilot Chat in the IDE, categorized by editor and model. -type CopilotIDEChat struct { - TotalEngagedUsers int `json:"total_engaged_users"` - Editors []*CopilotIDEChatEditor `json:"editors"` -} - -// CopilotDotcomChatModel represents Copilot usage metrics for chatting with a model in the webbrowser. -type CopilotDotcomChatModel struct { - Name string `json:"name"` - IsCustomModel bool `json:"is_custom_model"` - CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` - TotalEngagedUsers int `json:"total_engaged_users"` - TotalChats int `json:"total_chats"` -} - -// CopilotDotcomChat represents Copilot usage metrics for Copilot Chat in the webbrowser, categorized by model. -type CopilotDotcomChat struct { - TotalEngagedUsers int `json:"total_engaged_users"` - Models []*CopilotDotcomChatModel `json:"models"` -} - -// CopilotDotcomPullRequestsModel represents Copilot usage metrics for pull requests in the webbrowser, categorized by model. -type CopilotDotcomPullRequestsModel struct { - Name string `json:"name"` - IsCustomModel bool `json:"is_custom_model"` - CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` - TotalPRSummariesCreated int `json:"total_pr_summaries_created"` - TotalEngagedUsers int `json:"total_engaged_users"` -} - -// CopilotDotcomPullRequestsRepository represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository. -type CopilotDotcomPullRequestsRepository struct { - Name string `json:"name"` - TotalEngagedUsers int `json:"total_engaged_users"` - Models []*CopilotDotcomPullRequestsModel `json:"models"` -} - -// CopilotDotcomPullRequests represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository and model. -type CopilotDotcomPullRequests struct { - TotalEngagedUsers int `json:"total_engaged_users"` - Repositories []*CopilotDotcomPullRequestsRepository `json:"repositories"` -} - -// CopilotMetrics represents Copilot usage metrics for a given day. -type CopilotMetrics struct { - Date string `json:"date"` - TotalActiveUsers *int `json:"total_active_users,omitempty"` - TotalEngagedUsers *int `json:"total_engaged_users,omitempty"` - CopilotIDECodeCompletions *CopilotIDECodeCompletions `json:"copilot_ide_code_completions,omitempty"` - CopilotIDEChat *CopilotIDEChat `json:"copilot_ide_chat,omitempty"` - CopilotDotcomChat *CopilotDotcomChat `json:"copilot_dotcom_chat,omitempty"` - CopilotDotcomPullRequests *CopilotDotcomPullRequests `json:"copilot_dotcom_pull_requests,omitempty"` -} - -// CopilotMetricsReportOptions specifies the optional parameters for single-day metrics report endpoints. -type CopilotMetricsReportOptions struct { - Day string `url:"day"` // Required, format: YYYY-MM-DD -} - -// CopilotDailyMetricsReport represents the response from 1-day Copilot metrics report endpoints. -type CopilotDailyMetricsReport struct { - DownloadLinks []string `json:"download_links"` - ReportDay string `json:"report_day"` -} - -// CopilotMetricsReport represents the response from 28-day Copilot metrics report endpoints. -type CopilotMetricsReport struct { - DownloadLinks []string `json:"download_links"` - ReportStartDay string `json:"report_start_day"` - ReportEndDay string `json:"report_end_day"` -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { - // Using an alias to avoid infinite recursion when calling json.Unmarshal - type alias CopilotSeatDetails - var seatDetail alias - - if err := json.Unmarshal(data, &seatDetail); err != nil { - return err - } - - cp.AssigningTeam = seatDetail.AssigningTeam - cp.PendingCancellationDate = seatDetail.PendingCancellationDate - cp.LastActivityAt = seatDetail.LastActivityAt - cp.LastActivityEditor = seatDetail.LastActivityEditor - cp.CreatedAt = seatDetail.CreatedAt - cp.UpdatedAt = seatDetail.UpdatedAt - cp.PlanType = seatDetail.PlanType - - switch v := seatDetail.Assignee.(type) { - case nil: - // Assignee can be null according to GitHub API specification. - // See: https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization - // Note: Copilot API is in public preview and subject to change. - cp.Assignee = nil - case map[string]any: - jsonData, err := json.Marshal(seatDetail.Assignee) - if err != nil { - return err - } - - if v["type"] == nil { - return errors.New("assignee type field is not set") - } - - if t, ok := v["type"].(string); ok && t == "User" { - user := &User{} - if err := json.Unmarshal(jsonData, user); err != nil { - return err - } - cp.Assignee = user - } else if t, ok := v["type"].(string); ok && t == "Team" { - team := &Team{} - if err := json.Unmarshal(jsonData, team); err != nil { - return err - } - cp.Assignee = team - } else if t, ok := v["type"].(string); ok && t == "Organization" { - organization := &Organization{} - if err := json.Unmarshal(jsonData, organization); err != nil { - return err - } - cp.Assignee = organization - } else { - return fmt.Errorf("unsupported assignee type %v", v["type"]) - } - default: - return fmt.Errorf("unsupported assignee type %T", v) - } - - return nil -} - -// GetUser gets the User from the CopilotSeatDetails if the assignee is a user. -func (cp *CopilotSeatDetails) GetUser() (*User, bool) { u, ok := cp.Assignee.(*User); return u, ok } - -// GetTeam gets the Team from the CopilotSeatDetails if the assignee is a team. -func (cp *CopilotSeatDetails) GetTeam() (*Team, bool) { t, ok := cp.Assignee.(*Team); return t, ok } - -// GetOrganization gets the Organization from the CopilotSeatDetails if the assignee is an organization. -func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { - o, ok := cp.Assignee.(*Organization) - return o, ok -} - -// GetCopilotBilling gets Copilot for Business billing information and settings for an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization -// -//meta:operation GET /orgs/{org}/copilot/billing -func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing", org) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var copilotDetails *CopilotOrganizationDetails - resp, err := s.client.Do(ctx, req, &copilotDetails) - if err != nil { - return nil, resp, err - } - - return copilotDetails, resp, nil -} - -// ListCopilotSeats lists Copilot for Business seat assignments for an organization. -// -// To paginate through all seats, populate 'Page' with the number of the last page. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization -// -//meta:operation GET /orgs/{org}/copilot/billing/seats -func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var copilotSeats *ListCopilotSeatsResponse - resp, err := s.client.Do(ctx, req, &copilotSeats) - if err != nil { - return nil, resp, err - } - - return copilotSeats, resp, nil -} - -// ListCopilotEnterpriseSeats lists Copilot for Business seat assignments for an enterprise. -// -// To paginate through all seats, populate 'Page' with the number of the last page. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/copilot/billing/seats -func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { - u := fmt.Sprintf("enterprises/%v/copilot/billing/seats", enterprise) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var copilotSeats *ListCopilotSeatsResponse - resp, err := s.client.Do(ctx, req, &copilotSeats) - if err != nil { - return nil, resp, err - } - - return copilotSeats, resp, nil -} - -// AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization -// -//meta:operation POST /orgs/{org}/copilot/billing/selected_teams -func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - - body := struct { - SelectedTeams []string `json:"selected_teams"` - }{ - SelectedTeams: teamNames, - } - - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - var seatAssignments *SeatAssignments - resp, err := s.client.Do(ctx, req, &seatAssignments) - if err != nil { - return nil, resp, err - } - - return seatAssignments, resp, nil -} - -// RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization -// -//meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams -func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - - body := struct { - SelectedTeams []string `json:"selected_teams"` - }{ - SelectedTeams: teamNames, - } - - req, err := s.client.NewRequest("DELETE", u, body) - if err != nil { - return nil, nil, err - } - - var seatCancellations *SeatCancellations - resp, err := s.client.Do(ctx, req, &seatCancellations) - if err != nil { - return nil, resp, err - } - - return seatCancellations, resp, nil -} - -// AddCopilotUsers adds users to the Copilot for Business subscription for an organization -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization -// -//meta:operation POST /orgs/{org}/copilot/billing/selected_users -func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - - body := struct { - SelectedUsernames []string `json:"selected_usernames"` - }{ - SelectedUsernames: users, - } - - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - var seatAssignments *SeatAssignments - resp, err := s.client.Do(ctx, req, &seatAssignments) - if err != nil { - return nil, resp, err - } - - return seatAssignments, resp, nil -} - -// RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization -// -//meta:operation DELETE /orgs/{org}/copilot/billing/selected_users -func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - - body := struct { - SelectedUsernames []string `json:"selected_usernames"` - }{ - SelectedUsernames: users, - } - - req, err := s.client.NewRequest("DELETE", u, body) - if err != nil { - return nil, nil, err - } - - var seatCancellations *SeatCancellations - resp, err := s.client.Do(ctx, req, &seatCancellations) - if err != nil { - return nil, resp, err - } - - return seatCancellations, resp, nil -} - -// GetSeatDetails gets Copilot for Business seat assignment details for a user. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user -// -//meta:operation GET /orgs/{org}/members/{username}/copilot -func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) { - u := fmt.Sprintf("orgs/%v/members/%v/copilot", org, user) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var seatDetails *CopilotSeatDetails - resp, err := s.client.Do(ctx, req, &seatDetails) - if err != nil { - return nil, resp, err - } - - return seatDetails, resp, nil -} - -// GetEnterpriseMetrics gets Copilot usage metrics for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/copilot/metrics -func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { - u := fmt.Sprintf("enterprises/%v/copilot/metrics", enterprise) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var metrics []*CopilotMetrics - resp, err := s.client.Do(ctx, req, &metrics) - if err != nil { - return nil, resp, err - } - - return metrics, resp, nil -} - -// GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team -// -//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics -func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { - u := fmt.Sprintf("enterprises/%v/team/%v/copilot/metrics", enterprise, team) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var metrics []*CopilotMetrics - resp, err := s.client.Do(ctx, req, &metrics) - if err != nil { - return nil, resp, err - } - - return metrics, resp, nil -} - -// GetOrganizationMetrics gets Copilot usage metrics for an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization -// -//meta:operation GET /orgs/{org}/copilot/metrics -func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/metrics", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var metrics []*CopilotMetrics - resp, err := s.client.Do(ctx, req, &metrics) - if err != nil { - return nil, resp, err - } - - return metrics, resp, nil -} - -// GetOrganizationTeamMetrics gets Copilot usage metrics for an organization team. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team -// -//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/metrics -func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { - u := fmt.Sprintf("orgs/%v/team/%v/copilot/metrics", org, team) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var metrics []*CopilotMetrics - resp, err := s.client.Do(ctx, req, &metrics) - if err != nil { - return nil, resp, err - } - - return metrics, resp, nil -} - -// GetEnterpriseDailyMetricsReport gets a report containing Copilot metrics for a single day for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics-for-a-specific-day -// -//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day -func (s *CopilotService) GetEnterpriseDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { - u := fmt.Sprintf("enterprises/%v/copilot/metrics/reports/enterprise-1-day", enterprise) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var report *CopilotDailyMetricsReport - resp, err := s.client.Do(ctx, req, &report) - if err != nil { - return nil, resp, err - } - - return report, resp, nil -} - -// GetEnterpriseMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics -// -//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest -func (s *CopilotService) GetEnterpriseMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) { - u := fmt.Sprintf("enterprises/%v/copilot/metrics/reports/enterprise-28-day/latest", enterprise) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var report *CopilotMetricsReport - resp, err := s.client.Do(ctx, req, &report) - if err != nil { - return nil, resp, err - } - - return report, resp, nil -} - -// GetEnterpriseUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics-for-a-specific-day -// -//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day -func (s *CopilotService) GetEnterpriseUsersDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { - u := fmt.Sprintf("enterprises/%v/copilot/metrics/reports/users-1-day", enterprise) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var report *CopilotDailyMetricsReport - resp, err := s.client.Do(ctx, req, &report) - if err != nil { - return nil, resp, err - } - - return report, resp, nil -} - -// GetEnterpriseUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics -// -//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest -func (s *CopilotService) GetEnterpriseUsersMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) { - u := fmt.Sprintf("enterprises/%v/copilot/metrics/reports/users-28-day/latest", enterprise) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var report *CopilotMetricsReport - resp, err := s.client.Do(ctx, req, &report) - if err != nil { - return nil, resp, err - } - - return report, resp, nil -} - -// GetOrganizationDailyMetricsReport gets a report containing Copilot metrics for a single day for an organization. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics-for-a-specific-day -// -//meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-1-day -func (s *CopilotService) GetOrganizationDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/metrics/reports/organization-1-day", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var report *CopilotDailyMetricsReport - resp, err := s.client.Do(ctx, req, &report) - if err != nil { - return nil, resp, err - } - - return report, resp, nil -} - -// GetOrganizationMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an organization. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics -// -//meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest -func (s *CopilotService) GetOrganizationMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/metrics/reports/organization-28-day/latest", org) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var report *CopilotMetricsReport - resp, err := s.client.Do(ctx, req, &report) - if err != nil { - return nil, resp, err - } - - return report, resp, nil -} - -// GetOrganizationUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an organization. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics-for-a-specific-day -// -//meta:operation GET /orgs/{org}/copilot/metrics/reports/users-1-day -func (s *CopilotService) GetOrganizationUsersDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/metrics/reports/users-1-day", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var report *CopilotDailyMetricsReport - resp, err := s.client.Do(ctx, req, &report) - if err != nil { - return nil, resp, err - } - - return report, resp, nil -} - -// GetOrganizationUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an organization. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics -// -//meta:operation GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest -func (s *CopilotService) GetOrganizationUsersMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/metrics/reports/users-28-day/latest", org) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var report *CopilotMetricsReport - resp, err := s.client.Do(ctx, req, &report) - if err != nil { - return nil, resp, err - } - - return report, resp, nil -} diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_actions_hosted_runners.go b/vendor/github.com/google/go-github/v84/github/enterprise_actions_hosted_runners.go deleted file mode 100644 index 746579644..000000000 --- a/vendor/github.com/google/go-github/v84/github/enterprise_actions_hosted_runners.go +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright 2025 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// ListHostedRunners lists all the GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners -func (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - runners := &HostedRunners{} - resp, err := s.client.Do(ctx, req, &runners) - if err != nil { - return nil, resp, err - } - - return runners, resp, nil -} - -// CreateHostedRunner creates a GitHub-hosted runner for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise -// -//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners -func (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request CreateHostedRunnerRequest) (*HostedRunner, *Response, error) { - if err := validateCreateHostedRunnerRequest(&request); err != nil { - return nil, nil, fmt.Errorf("validation failed: %w", err) - } - - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) - req, err := s.client.NewRequest("POST", u, request) - if err != nil { - return nil, nil, err - } - - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) - if err != nil { - return nil, resp, err - } - - return hostedRunner, resp, nil -} - -// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned -func (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/github-owned", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - hostedRunnerImages := new(HostedRunnerImages) - resp, err := s.client.Do(ctx, req, hostedRunnerImages) - if err != nil { - return nil, resp, err - } - - return hostedRunnerImages, resp, nil -} - -// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner -func (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/partner", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - hostedRunnerImages := new(HostedRunnerImages) - resp, err := s.client.Do(ctx, req, hostedRunnerImages) - if err != nil { - return nil, resp, err - } - - return hostedRunnerImages, resp, nil -} - -// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits -func (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/limits", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - publicIPLimits := new(HostedRunnerPublicIPLimits) - resp, err := s.client.Do(ctx, req, publicIPLimits) - if err != nil { - return nil, resp, err - } - - return publicIPLimits, resp, nil -} - -// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes -func (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/machine-sizes", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - machineSpecs := new(HostedRunnerMachineSpecs) - resp, err := s.client.Do(ctx, req, machineSpecs) - if err != nil { - return nil, resp, err - } - - return machineSpecs, resp, nil -} - -// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms -func (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/platforms", enterprise) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - platforms := new(HostedRunnerPlatforms) - resp, err := s.client.Do(ctx, req, platforms) - if err != nil { - return nil, resp, err - } - - return platforms, resp, nil -} - -// GetHostedRunner gets a GitHub-hosted runner in an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise -// -//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} -func (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) - if err != nil { - return nil, resp, err - } - - return hostedRunner, resp, nil -} - -// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise -// -//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} -func (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, request UpdateHostedRunnerRequest) (*HostedRunner, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) - req, err := s.client.NewRequest("PATCH", u, request) - if err != nil { - return nil, nil, err - } - - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) - if err != nil { - return nil, resp, err - } - - return hostedRunner, resp, nil -} - -// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise. -// -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise -// -//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} -func (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { - u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, nil, err - } - - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) - if err != nil { - return nil, resp, err - } - - return hostedRunner, resp, nil -} diff --git a/vendor/github.com/google/go-github/v84/github/repos_rules.go b/vendor/github.com/google/go-github/v84/github/repos_rules.go deleted file mode 100644 index b02df3131..000000000 --- a/vendor/github.com/google/go-github/v84/github/repos_rules.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// GetRulesForBranch gets all the repository rules that apply to the specified branch. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch -// -//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} -func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string, opts *ListOptions) (*BranchRules, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) - - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var rules *BranchRules - resp, err := s.client.Do(ctx, req, &rules) - if err != nil { - return nil, resp, err - } - - return rules, resp, nil -} - -// RepositoryListRulesetsOptions specifies optional parameters to the -// RepositoriesService.GetAllRulesets method. -type RepositoryListRulesetsOptions struct { - // IncludesParents indicates whether to include rulesets configured at the organization or enterprise level that apply to the repository. - IncludesParents *bool `url:"includes_parents,omitempty"` - ListOptions -} - -// GetAllRulesets gets all the repository rulesets for the specified repository. -// By default, this endpoint will include rulesets configured at the organization or enterprise level that apply to the repository. -// To exclude those rulesets, set the `RepositoryListRulesetsOptions.IncludesParents` parameter to `false`. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets -// -//meta:operation GET /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, opts *RepositoryListRulesetsOptions) ([]*RepositoryRuleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) - - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var ruleset []*RepositoryRuleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// CreateRuleset creates a repository ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset -// -//meta:operation POST /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) - - req, err := s.client.NewRequest("POST", u, ruleset) - if err != nil { - return nil, nil, err - } - - var rs *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &rs) - if err != nil { - return nil, resp, err - } - - return rs, resp, nil -} - -// GetRuleset gets a repository ruleset for the specified repository. -// If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset -// -//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*RepositoryRuleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var ruleset *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// UpdateRuleset updates a repository ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset -// -//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - - req, err := s.client.NewRequest("PUT", u, ruleset) - if err != nil { - return nil, nil, err - } - - var rs *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &rs) - if err != nil { - return nil, resp, err - } - - return rs, resp, nil -} - -// DeleteRuleset deletes a repository ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset -// -//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/google/go-github/v84/github/with_appengine.go b/vendor/github.com/google/go-github/v84/github/with_appengine.go deleted file mode 100644 index 9bb95b8c8..000000000 --- a/vendor/github.com/google/go-github/v84/github/with_appengine.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build appengine - -// This file provides glue for making github work on App Engine. - -package github - -import ( - "context" - "net/http" -) - -func withContext(ctx context.Context, req *http.Request) *http.Request { - // No-op because App Engine adds context to a request differently. - return req -} diff --git a/vendor/github.com/google/go-github/v84/github/without_appengine.go b/vendor/github.com/google/go-github/v84/github/without_appengine.go deleted file mode 100644 index bfdb18ecb..000000000 --- a/vendor/github.com/google/go-github/v84/github/without_appengine.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !appengine - -// This file provides glue for making github work without App Engine. - -package github - -import ( - "context" - "net/http" -) - -func withContext(ctx context.Context, req *http.Request) *http.Request { - return req.WithContext(ctx) -} diff --git a/vendor/github.com/google/go-github/v84/AUTHORS b/vendor/github.com/google/go-github/v88/AUTHORS similarity index 100% rename from vendor/github.com/google/go-github/v84/AUTHORS rename to vendor/github.com/google/go-github/v88/AUTHORS diff --git a/vendor/github.com/google/go-github/v84/LICENSE b/vendor/github.com/google/go-github/v88/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v84/LICENSE rename to vendor/github.com/google/go-github/v88/LICENSE diff --git a/vendor/github.com/google/go-github/v84/github/actions.go b/vendor/github.com/google/go-github/v88/github/actions.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/actions.go rename to vendor/github.com/google/go-github/v88/github/actions.go index 4b88a1e11..575a637a2 100644 --- a/vendor/github.com/google/go-github/v84/github/actions.go +++ b/vendor/github.com/google/go-github/v88/github/actions.go @@ -8,5 +8,5 @@ package github // ActionsService handles communication with the actions related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/actions/ +// GitHub API docs: https://docs.github.com/rest/actions?apiVersion=2022-11-28 type ActionsService service diff --git a/vendor/github.com/google/go-github/v84/github/actions_artifacts.go b/vendor/github.com/google/go-github/v88/github/actions_artifacts.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v88/github/actions_artifacts.go index 4185a1503..2a345edbc 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_artifacts.go +++ b/vendor/github.com/google/go-github/v88/github/actions_artifacts.go @@ -14,7 +14,7 @@ import ( // ArtifactWorkflowRun represents a GitHub artifact's workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28 type ArtifactWorkflowRun struct { ID *int64 `json:"id,omitempty"` RepositoryID *int64 `json:"repository_id,omitempty"` @@ -27,7 +27,7 @@ type ArtifactWorkflowRun struct { // data between jobs in a workflow and provide storage for data // once a workflow is complete. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28 type Artifact struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -48,7 +48,7 @@ type Artifact struct { // ArtifactList represents a list of GitHub artifacts. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#artifacts type ArtifactList struct { TotalCount *int64 `json:"total_count,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` @@ -81,7 +81,7 @@ type ArtifactPeriodOpt struct { // ListArtifacts lists all artifacts that belong to a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#list-artifacts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/artifacts func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListArtifactsOptions) (*ArtifactList, *Response, error) { @@ -91,13 +91,13 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - artifactList := new(ArtifactList) - resp, err := s.client.Do(ctx, req, artifactList) + var artifactList *ArtifactList + resp, err := s.client.Do(req, &artifactList) if err != nil { return nil, resp, err } @@ -107,7 +107,7 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, // ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) { @@ -117,13 +117,13 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - artifactList := new(ArtifactList) - resp, err := s.client.Do(ctx, req, artifactList) + var artifactList *ArtifactList + resp, err := s.client.Do(req, &artifactList) if err != nil { return nil, resp, err } @@ -133,19 +133,19 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re // GetArtifact gets a specific artifact for a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#get-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#get-an-artifact // //meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - artifact := new(Artifact) - resp, err := s.client.Do(ctx, req, artifact) + var artifact *Artifact + resp, err := s.client.Do(req, &artifact) if err != nil { return nil, resp, err } @@ -155,13 +155,13 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#download-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact // //meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) - if s.client.RateLimitRedirectionalEndpoints { + if s.client.rateLimitRedirectionalEndpoints { return s.downloadArtifactWithRateLimit(ctx, u, maxRedirects) } @@ -188,12 +188,12 @@ func (s *ActionsService) downloadArtifactWithoutRateLimit(ctx context.Context, u } func (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + url, resp, err := s.client.bareDoUntilFound(req, maxRedirects) if err != nil { return nil, resp, err } @@ -209,16 +209,16 @@ func (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u st // DeleteArtifact deletes a workflow run artifact. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact // //meta:operation DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/actions_cache.go b/vendor/github.com/google/go-github/v88/github/actions_cache.go similarity index 76% rename from vendor/github.com/google/go-github/v84/github/actions_cache.go rename to vendor/github.com/google/go-github/v88/github/actions_cache.go index c883effb9..73e827008 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_cache.go +++ b/vendor/github.com/google/go-github/v88/github/actions_cache.go @@ -12,7 +12,7 @@ import ( // ActionsCache represents a GitHub action cache. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#about-the-cache-api +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#about-the-cache-api type ActionsCache struct { ID *int64 `json:"id,omitempty" url:"-"` Ref *string `json:"ref,omitempty" url:"ref"` @@ -25,7 +25,7 @@ type ActionsCache struct { // ActionsCacheList represents a list of GitHub actions Cache. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository type ActionsCacheList struct { TotalCount int `json:"total_count"` ActionsCaches []*ActionsCache `json:"actions_caches,omitempty"` @@ -33,7 +33,7 @@ type ActionsCacheList struct { // ActionsCacheUsage represents a GitHub Actions Cache Usage object. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository type ActionsCacheUsage struct { FullName string `json:"full_name"` ActiveCachesSizeInBytes int64 `json:"active_caches_size_in_bytes"` @@ -42,7 +42,7 @@ type ActionsCacheUsage struct { // ActionsCacheUsageList represents a list of repositories with GitHub Actions cache usage for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository type ActionsCacheUsageList struct { TotalCount int `json:"total_count"` RepoCacheUsage []*ActionsCacheUsage `json:"repository_cache_usages,omitempty"` @@ -50,7 +50,7 @@ type ActionsCacheUsageList struct { // TotalCacheUsage represents total GitHub actions cache usage of an organization or enterprise. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise type TotalCacheUsage struct { TotalActiveCachesUsageSizeInBytes int64 `json:"total_active_caches_size_in_bytes"` TotalActiveCachesCount int `json:"total_active_caches_count"` @@ -58,7 +58,7 @@ type TotalCacheUsage struct { // ActionsCacheListOptions represents a list of all possible optional Query parameters for ListCaches method. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository type ActionsCacheListOptions struct { ListOptions // The Git reference for the results you want to list. @@ -77,7 +77,7 @@ type ActionsCacheListOptions struct { // // Permissions: must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/caches func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error) { @@ -87,13 +87,13 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - actionCacheList := new(ActionsCacheList) - resp, err := s.client.Do(ctx, req, actionCacheList) + var actionCacheList *ActionsCacheList + resp, err := s.client.Do(req, &actionCacheList) if err != nil { return nil, resp, err } @@ -109,7 +109,7 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key // //meta:operation DELETE /repos/{owner}/{repo}/actions/caches func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error) { @@ -119,29 +119,29 @@ func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key return nil, err } - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteCachesByID deletes a GitHub Actions cache for a repository, using a cache ID. // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id // //meta:operation DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches/%v", owner, repo, cacheID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetCacheUsageForRepo gets GitHub Actions cache usage for a repository. The data fetched using this API is refreshed approximately every 5 minutes, @@ -150,18 +150,18 @@ func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo strin // Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an // access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/cache/usage func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/cache/usage", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - cacheUsage := new(ActionsCacheUsage) - res, err := s.client.Do(ctx, req, cacheUsage) + var cacheUsage *ActionsCacheUsage + res, err := s.client.Do(req, &cacheUsage) if err != nil { return nil, res, err } @@ -175,7 +175,7 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_administration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#list-repositories-with-github-actions-cache-usage-for-an-organization // //meta:operation GET /orgs/{org}/actions/cache/usage-by-repository func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error) { @@ -185,13 +185,13 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - cacheUsage := new(ActionsCacheUsageList) - res, err := s.client.Do(ctx, req, cacheUsage) + var cacheUsage *ActionsCacheUsageList + res, err := s.client.Do(req, &cacheUsage) if err != nil { return nil, res, err } @@ -205,18 +205,18 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_administration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-organization // //meta:operation GET /orgs/{org}/actions/cache/usage func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - cacheUsage := new(TotalCacheUsage) - res, err := s.client.Do(ctx, req, cacheUsage) + var cacheUsage *TotalCacheUsage + res, err := s.client.Do(req, &cacheUsage) if err != nil { return nil, res, err } @@ -229,18 +229,18 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin // // Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/cache/usage func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/cache/usage", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - cacheUsage := new(TotalCacheUsage) - res, err := s.client.Do(ctx, req, cacheUsage) + var cacheUsage *TotalCacheUsage + res, err := s.client.Do(req, &cacheUsage) if err != nil { return nil, res, err } diff --git a/vendor/github.com/google/go-github/v84/github/actions_hosted_runners.go b/vendor/github.com/google/go-github/v88/github/actions_hosted_runners.go similarity index 60% rename from vendor/github.com/google/go-github/v84/github/actions_hosted_runners.go rename to vendor/github.com/google/go-github/v88/github/actions_hosted_runners.go index eb805393f..6b46f3a3c 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_hosted_runners.go +++ b/vendor/github.com/google/go-github/v88/github/actions_hosted_runners.go @@ -58,7 +58,7 @@ type HostedRunners struct { // ListHostedRunners lists all the GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-github-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error) { @@ -68,13 +68,13 @@ func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runners := &HostedRunners{} - resp, err := s.client.Do(ctx, req, &runners) + var runners *HostedRunners + resp, err := s.client.Do(req, &runners) if err != nil { return nil, resp, err } @@ -137,7 +137,7 @@ func validateCreateHostedRunnerRequest(request *CreateHostedRunnerRequest) error // CreateHostedRunner creates a GitHub-hosted runner for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#create-a-github-hosted-runner-for-an-organization // //meta:operation POST /orgs/{org}/actions/hosted-runners func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request CreateHostedRunnerRequest) (*HostedRunner, *Response, error) { @@ -146,13 +146,13 @@ func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, req } u := fmt.Sprintf("orgs/%v/actions/hosted-runners", org) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) + var hostedRunner *HostedRunner + resp, err := s.client.Do(req, &hostedRunner) if err != nil { return nil, resp, err } @@ -160,6 +160,39 @@ func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, req return hostedRunner, resp, nil } +// HostedRunnerCustomImage represents a custom image definition for GitHub-hosted runners. +type HostedRunnerCustomImage struct { + ID int64 `json:"id"` + Platform string `json:"platform"` + Name string `json:"name"` + Source string `json:"source"` + VersionsCount int `json:"versions_count"` + TotalVersionsSize int `json:"total_versions_size"` + LatestVersion string `json:"latest_version"` + State string `json:"state"` +} + +// HostedRunnerCustomImages represents a collection of custom images for GitHub-hosted runners. +type HostedRunnerCustomImages struct { + TotalCount int `json:"total_count"` + Images []*HostedRunnerCustomImage `json:"images"` +} + +// HostedRunnerCustomImageVersion represents a version of a custom image for GitHub-hosted runners. +type HostedRunnerCustomImageVersion struct { + Version string `json:"version"` + SizeGB int `json:"size_gb"` + State string `json:"state"` + StateDetails string `json:"state_details"` + CreatedOn Timestamp `json:"created_on"` +} + +// HostedRunnerCustomImageVersions represents a collection of versions of a custom image. +type HostedRunnerCustomImageVersions struct { + TotalCount int `json:"total_count"` + ImageVersions []*HostedRunnerCustomImageVersion `json:"image_versions"` +} + // HostedRunnerImageSpecs represents the details of a GitHub-hosted runner image. type HostedRunnerImageSpecs struct { ID string `json:"id"` @@ -177,18 +210,18 @@ type HostedRunnerImages struct { // GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-owned-images-for-github-hosted-runners-in-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/images/github-owned func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/github-owned", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - hostedRunnerImages := new(HostedRunnerImages) - resp, err := s.client.Do(ctx, req, hostedRunnerImages) + var hostedRunnerImages *HostedRunnerImages + resp, err := s.client.Do(req, &hostedRunnerImages) if err != nil { return nil, resp, err } @@ -198,18 +231,18 @@ func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, o // GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-partner-images-for-github-hosted-runners-in-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/images/partner func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/partner", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - hostedRunnerImages := new(HostedRunnerImages) - resp, err := s.client.Do(ctx, req, hostedRunnerImages) + var hostedRunnerImages *HostedRunnerImages + resp, err := s.client.Do(req, &hostedRunnerImages) if err != nil { return nil, resp, err } @@ -230,18 +263,18 @@ type PublicIPUsage struct { // GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-limits-on-github-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/limits func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/limits", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - publicIPLimits := new(HostedRunnerPublicIPLimits) - resp, err := s.client.Do(ctx, req, publicIPLimits) + var publicIPLimits *HostedRunnerPublicIPLimits + resp, err := s.client.Do(req, &publicIPLimits) if err != nil { return nil, resp, err } @@ -257,18 +290,18 @@ type HostedRunnerMachineSpecs struct { // GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-hosted-runners-machine-specs-for-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/machine-sizes func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/machine-sizes", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - machineSpecs := new(HostedRunnerMachineSpecs) - resp, err := s.client.Do(ctx, req, machineSpecs) + var machineSpecs *HostedRunnerMachineSpecs + resp, err := s.client.Do(req, &machineSpecs) if err != nil { return nil, resp, err } @@ -284,18 +317,18 @@ type HostedRunnerPlatforms struct { // GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-platforms-for-github-hosted-runners-in-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/platforms func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/platforms", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - platforms := new(HostedRunnerPlatforms) - resp, err := s.client.Do(ctx, req, platforms) + var platforms *HostedRunnerPlatforms + resp, err := s.client.Do(req, &platforms) if err != nil { return nil, resp, err } @@ -305,18 +338,18 @@ func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org strin // GetHostedRunner gets a GitHub-hosted runner in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-a-github-hosted-runner-for-an-organization // //meta:operation GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id} func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) + var hostedRunner *HostedRunner + resp, err := s.client.Do(req, &hostedRunner) if err != nil { return nil, resp, err } @@ -326,18 +359,18 @@ func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runner // UpdateHostedRunner updates a GitHub-hosted runner for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#update-a-github-hosted-runner-for-an-organization // //meta:operation PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id} func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, request UpdateHostedRunnerRequest) (*HostedRunner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) - req, err := s.client.NewRequest("PATCH", u, request) + req, err := s.client.NewRequest(ctx, "PATCH", u, request) if err != nil { return nil, nil, err } - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) + var hostedRunner *HostedRunner + resp, err := s.client.Do(req, &hostedRunner) if err != nil { return nil, resp, err } @@ -347,21 +380,135 @@ func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, run // DeleteHostedRunner deletes GitHub-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-github-hosted-runner-for-an-organization // //meta:operation DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id} func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, nil, err } - hostedRunner := new(HostedRunner) - resp, err := s.client.Do(ctx, req, hostedRunner) + var hostedRunner *HostedRunner + resp, err := s.client.Do(req, &hostedRunner) if err != nil { return nil, resp, err } return hostedRunner, resp, nil } + +// ListHostedRunnerCustomImages lists custom images for GitHub-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-custom-images-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom +func (s *ActionsService) ListHostedRunnerCustomImages(ctx context.Context, org string) (*HostedRunnerCustomImages, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom", org) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var images *HostedRunnerCustomImages + resp, err := s.client.Do(req, &images) + if err != nil { + return nil, resp, err + } + + return images, resp, nil +} + +// GetHostedRunnerCustomImage gets a custom image definition for GitHub-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-a-custom-image-definition-for-github-actions-hosted-runners +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id} +func (s *ActionsService) GetHostedRunnerCustomImage(ctx context.Context, org string, imageDefinitionID int64) (*HostedRunnerCustomImage, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v", org, imageDefinitionID) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var image *HostedRunnerCustomImage + resp, err := s.client.Do(req, &image) + if err != nil { + return nil, resp, err + } + + return image, resp, nil +} + +// DeleteHostedRunnerCustomImage deletes a custom image from the organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-custom-image-from-the-organization +// +//meta:operation DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id} +func (s *ActionsService) DeleteHostedRunnerCustomImage(ctx context.Context, org string, imageDefinitionID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v", org, imageDefinitionID) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} + +// ListHostedRunnerCustomImageVersions lists image versions of a custom image for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#list-image-versions-of-a-custom-image-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions +func (s *ActionsService) ListHostedRunnerCustomImageVersions(ctx context.Context, org string, imageDefinitionID int64) (*HostedRunnerCustomImageVersions, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v/versions", org, imageDefinitionID) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var versions *HostedRunnerCustomImageVersions + resp, err := s.client.Do(req, &versions) + if err != nil { + return nil, resp, err + } + + return versions, resp, nil +} + +// GetHostedRunnerCustomImageVersion gets an image version of a custom image for GitHub-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#get-an-image-version-of-a-custom-image-for-github-actions-hosted-runners +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} +func (s *ActionsService) GetHostedRunnerCustomImageVersion(ctx context.Context, org string, imageDefinitionID int64, version string) (*HostedRunnerCustomImageVersion, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v/versions/%v", org, imageDefinitionID, version) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var imageVersion *HostedRunnerCustomImageVersion + resp, err := s.client.Do(req, &imageVersion) + if err != nil { + return nil, resp, err + } + + return imageVersion, resp, nil +} + +// DeleteHostedRunnerCustomImageVersion deletes an image version of a custom image from the organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-an-image-version-of-custom-image-from-the-organization +// +//meta:operation DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} +func (s *ActionsService) DeleteHostedRunnerCustomImageVersion(ctx context.Context, org string, imageDefinitionID int64, version string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/custom/%v/versions/%v", org, imageDefinitionID, version) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} diff --git a/vendor/github.com/google/go-github/v84/github/actions_oidc.go b/vendor/github.com/google/go-github/v88/github/actions_oidc.go similarity index 76% rename from vendor/github.com/google/go-github/v84/github/actions_oidc.go rename to vendor/github.com/google/go-github/v88/github/actions_oidc.go index 596aa9d98..06ec8cec4 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_oidc.go +++ b/vendor/github.com/google/go-github/v88/github/actions_oidc.go @@ -18,7 +18,7 @@ type OIDCSubjectClaimCustomTemplate struct { // GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization // //meta:operation GET /orgs/{org}/actions/oidc/customization/sub func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { @@ -28,7 +28,7 @@ func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/oidc/customization/sub func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { @@ -37,13 +37,13 @@ func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Conte } func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, url string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - tmpl := new(OIDCSubjectClaimCustomTemplate) - resp, err := s.client.Do(ctx, req, tmpl) + var tmpl *OIDCSubjectClaimCustomTemplate + resp, err := s.client.Do(req, &tmpl) if err != nil { return nil, resp, err } @@ -53,7 +53,7 @@ func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, // SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization // //meta:operation PUT /orgs/{org}/actions/oidc/customization/sub func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { @@ -63,7 +63,7 @@ func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/oidc/customization/sub func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { @@ -72,10 +72,10 @@ func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Conte } func (s *ActionsService) setOIDCSubjectClaimCustomTemplate(ctx context.Context, url string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { - req, err := s.client.NewRequest("PUT", url, template) + req, err := s.client.NewRequest(ctx, "PUT", url, template) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/actions_permissions_enterprise.go b/vendor/github.com/google/go-github/v88/github/actions_permissions_enterprise.go similarity index 75% rename from vendor/github.com/google/go-github/v84/github/actions_permissions_enterprise.go rename to vendor/github.com/google/go-github/v88/github/actions_permissions_enterprise.go index 326230d64..4508c4309 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_permissions_enterprise.go +++ b/vendor/github.com/google/go-github/v88/github/actions_permissions_enterprise.go @@ -18,7 +18,7 @@ type ActionsEnabledOnEnterpriseRepos struct { // ActionsPermissionsEnterprise represents a policy for allowed actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28 type ActionsPermissionsEnterprise struct { EnabledOrganizations *string `json:"enabled_organizations,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -31,7 +31,7 @@ func (a ActionsPermissionsEnterprise) String() string { // DefaultWorkflowPermissionEnterprise represents the default permissions for GitHub Actions workflows for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28 type DefaultWorkflowPermissionEnterprise struct { DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` @@ -48,19 +48,19 @@ func (a SelfHostRunnerPermissionsEnterprise) String() string { // GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, enterprise string) (*ActionsPermissionsEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(ActionsPermissionsEnterprise) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *ActionsPermissionsEnterprise + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -70,18 +70,18 @@ func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, // UpdateActionsPermissionsInEnterprise sets the permissions policy in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-github-actions-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions func (s *ActionsService) UpdateActionsPermissionsInEnterprise(ctx context.Context, enterprise string, actionsPermissionsEnterprise ActionsPermissionsEnterprise) (*ActionsPermissionsEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions", enterprise) - req, err := s.client.NewRequest("PUT", u, actionsPermissionsEnterprise) + req, err := s.client.NewRequest(ctx, "PUT", u, actionsPermissionsEnterprise) if err != nil { return nil, nil, err } - p := new(ActionsPermissionsEnterprise) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsPermissionsEnterprise + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -91,7 +91,7 @@ func (s *ActionsService) UpdateActionsPermissionsInEnterprise(ctx context.Contex // ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#list-selected-organizations-enabled-for-github-actions-in-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/organizations func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnEnterpriseRepos, *Response, error) { @@ -101,13 +101,13 @@ func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - orgs := &ActionsEnabledOnEnterpriseRepos{} - resp, err := s.client.Do(ctx, req, orgs) + var orgs *ActionsEnabledOnEnterpriseRepos + resp, err := s.client.Do(req, &orgs) if err != nil { return nil, resp, err } @@ -117,20 +117,20 @@ func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner // SetEnabledOrgsInEnterprise replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-selected-organizations-enabled-for-github-actions-in-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner string, organizationIDs []int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", owner) - req, err := s.client.NewRequest("PUT", u, struct { + req, err := s.client.NewRequest(ctx, "PUT", u, struct { IDs []int64 `json:"selected_organization_ids"` }{IDs: organizationIDs}) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -140,18 +140,18 @@ func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner s // AddEnabledOrgInEnterprise adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#enable-a-selected-organization-for-github-actions-in-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", owner, organizationID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -161,18 +161,18 @@ func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner st // RemoveEnabledOrgInEnterprise removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#disable-a-selected-organization-for-github-actions-in-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", owner, organizationID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -182,19 +182,19 @@ func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner // GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/selected-actions func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, enterprise string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - actionsAllowed := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, actionsAllowed) + var actionsAllowed *ActionsAllowed + resp, err := s.client.Do(req, &actionsAllowed) if err != nil { return nil, resp, err } @@ -204,18 +204,18 @@ func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, ente // UpdateActionsAllowedInEnterprise sets the actions that are allowed in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/selected-actions func (s *ActionsService) UpdateActionsAllowedInEnterprise(ctx context.Context, enterprise string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", enterprise) - req, err := s.client.NewRequest("PUT", u, actionsAllowed) + req, err := s.client.NewRequest(ctx, "PUT", u, actionsAllowed) if err != nil { return nil, nil, err } - p := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsAllowed + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -225,19 +225,19 @@ func (s *ActionsService) UpdateActionsAllowedInEnterprise(ctx context.Context, e // GetDefaultWorkflowPermissionsInEnterprise gets the GitHub Actions default workflow permissions for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-default-workflow-permissions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/workflow func (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string) (*DefaultWorkflowPermissionEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/workflow", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(DefaultWorkflowPermissionEnterprise) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *DefaultWorkflowPermissionEnterprise + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -247,18 +247,18 @@ func (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.C // UpdateDefaultWorkflowPermissionsInEnterprise sets the GitHub Actions default workflow permissions for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/workflow func (s *ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string, permissions DefaultWorkflowPermissionEnterprise) (*DefaultWorkflowPermissionEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/workflow", enterprise) - req, err := s.client.NewRequest("PUT", u, permissions) + req, err := s.client.NewRequest(ctx, "PUT", u, permissions) if err != nil { return nil, nil, err } - p := new(DefaultWorkflowPermissionEnterprise) - resp, err := s.client.Do(ctx, req, p) + var p *DefaultWorkflowPermissionEnterprise + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -268,19 +268,19 @@ func (s *ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise(ctx contex // GetArtifactAndLogRetentionPeriodInEnterprise gets the artifact and log retention period for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-artifact-and-log-retention-settings-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention func (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string) (*ArtifactPeriod, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/artifact-and-log-retention", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - arp := new(ArtifactPeriod) - resp, err := s.client.Do(ctx, req, arp) + var arp *ArtifactPeriod + resp, err := s.client.Do(req, &arp) if err != nil { return nil, resp, err } @@ -290,33 +290,33 @@ func (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx contex // UpdateArtifactAndLogRetentionPeriodInEnterprise sets the artifact and log retention period for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-artifact-and-log-retention-settings-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string, period ArtifactPeriodOpt) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/artifact-and-log-retention", enterprise) - req, err := s.client.NewRequest("PUT", u, period) + req, err := s.client.NewRequest(ctx, "PUT", u, period) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetSelfHostedRunnerPermissionsInEnterprise gets the self-hosted runner permissions for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-self-hosted-runners-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-self-hosted-runners-permissions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/self-hosted-runners func (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string) (*SelfHostRunnerPermissionsEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/self-hosted-runners", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(SelfHostRunnerPermissionsEnterprise) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *SelfHostRunnerPermissionsEnterprise + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -326,34 +326,34 @@ func (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context. // UpdateSelfHostedRunnerPermissionsInEnterprise sets the self-hosted runner permissions for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-self-hosted-runners-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-self-hosted-runners-permissions-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/self-hosted-runners func (s *ActionsService) UpdateSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string, permissions SelfHostRunnerPermissionsEnterprise) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/self-hosted-runners", enterprise) - req, err := s.client.NewRequest("PUT", u, permissions) + req, err := s.client.NewRequest(ctx, "PUT", u, permissions) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetPrivateRepoForkPRWorkflowSettingsInEnterprise gets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-private-repo-fork-pr-workflow-settings-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string) (*WorkflowsPermissions, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/fork-pr-workflows-private-repos", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(WorkflowsPermissions) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *WorkflowsPermissions + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -363,34 +363,34 @@ func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx co // UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise sets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string, permissions *WorkflowsPermissionsOpt) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/fork-pr-workflows-private-repos", enterprise) - req, err := s.client.NewRequest("PUT", u, permissions) + req, err := s.client.NewRequest(ctx, "PUT", u, permissions) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetEnterpriseForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) GetEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string) (*ContributorApprovalPermissions, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/fork-pr-contributor-approval", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - policy := new(ContributorApprovalPermissions) - resp, err := s.client.Do(ctx, req, policy) + var policy *ContributorApprovalPermissions + resp, err := s.client.Do(req, &policy) if err != nil { return nil, resp, err } @@ -400,15 +400,15 @@ func (s *ActionsService) GetEnterpriseForkPRContributorApprovalPermissions(ctx c // UpdateEnterpriseForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) UpdateEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string, policy ContributorApprovalPermissions) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/fork-pr-contributor-approval", enterprise) - req, err := s.client.NewRequest("PUT", u, policy) + req, err := s.client.NewRequest(ctx, "PUT", u, policy) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/actions_permissions_orgs.go b/vendor/github.com/google/go-github/v88/github/actions_permissions_orgs.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/actions_permissions_orgs.go rename to vendor/github.com/google/go-github/v88/github/actions_permissions_orgs.go index 626e39983..ecf93a779 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_permissions_orgs.go +++ b/vendor/github.com/google/go-github/v88/github/actions_permissions_orgs.go @@ -12,7 +12,7 @@ import ( // ActionsPermissions represents a policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type ActionsPermissions struct { EnabledRepositories *string `json:"enabled_repositories,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -32,7 +32,7 @@ type ActionsEnabledOnOrgRepos struct { // ActionsAllowed represents selected actions that are allowed. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type ActionsAllowed struct { GithubOwnedAllowed *bool `json:"github_owned_allowed,omitempty"` VerifiedAllowed *bool `json:"verified_allowed,omitempty"` @@ -45,7 +45,7 @@ func (a ActionsAllowed) String() string { // DefaultWorkflowPermissionOrganization represents the default permissions for GitHub Actions workflows for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type DefaultWorkflowPermissionOrganization struct { DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` @@ -68,19 +68,19 @@ type SelfHostedRunnersSettingsOrganizationOpt struct { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(ActionsPermissions) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *ActionsPermissions + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -90,18 +90,18 @@ func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) // UpdateActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions func (s *ActionsService) UpdateActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) - req, err := s.client.NewRequest("PUT", u, actionsPermissions) + req, err := s.client.NewRequest(ctx, "PUT", u, actionsPermissions) if err != nil { return nil, nil, err } - p := new(ActionsPermissions) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsPermissions + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -111,7 +111,7 @@ func (s *ActionsService) UpdateActionsPermissions(ctx context.Context, org strin // ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#list-selected-repositories-enabled-for-github-actions-in-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/repositories func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { @@ -121,13 +121,13 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - repos := &ActionsEnabledOnOrgRepos{} - resp, err := s.client.Do(ctx, req, repos) + var repos *ActionsEnabledOnOrgRepos + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -137,20 +137,20 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string // SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-selected-repositories-enabled-for-github-actions-in-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/repositories func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) - req, err := s.client.NewRequest("PUT", u, struct { + req, err := s.client.NewRequest(ctx, "PUT", u, struct { IDs []int64 `json:"selected_repository_ids"` }{IDs: repositoryIDs}) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -160,18 +160,18 @@ func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, // AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#enable-a-selected-repository-for-github-actions-in-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/repositories/{repository_id} func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -181,18 +181,18 @@ func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, // RemoveEnabledReposInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#disable-a-selected-repository-for-github-actions-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -202,19 +202,19 @@ func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner stri // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/selected-actions func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - actionsAllowed := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, actionsAllowed) + var actionsAllowed *ActionsAllowed + resp, err := s.client.Do(req, &actionsAllowed) if err != nil { return nil, resp, err } @@ -224,18 +224,18 @@ func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*Ac // UpdateActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/selected-actions func (s *ActionsService) UpdateActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) - req, err := s.client.NewRequest("PUT", u, actionsAllowed) + req, err := s.client.NewRequest(ctx, "PUT", u, actionsAllowed) if err != nil { return nil, nil, err } - p := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsAllowed + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -245,19 +245,19 @@ func (s *ActionsService) UpdateActionsAllowed(ctx context.Context, org string, a // GetDefaultWorkflowPermissionsInOrganization gets the GitHub Actions default workflow permissions for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-default-workflow-permissions-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/workflow func (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string) (*DefaultWorkflowPermissionOrganization, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/workflow", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(DefaultWorkflowPermissionOrganization) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *DefaultWorkflowPermissionOrganization + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -267,18 +267,18 @@ func (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context // UpdateDefaultWorkflowPermissionsInOrganization sets the GitHub Actions default workflow permissions for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/workflow func (s *ActionsService) UpdateDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string, permissions DefaultWorkflowPermissionOrganization) (*DefaultWorkflowPermissionOrganization, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/workflow", org) - req, err := s.client.NewRequest("PUT", u, permissions) + req, err := s.client.NewRequest(ctx, "PUT", u, permissions) if err != nil { return nil, nil, err } - p := new(DefaultWorkflowPermissionOrganization) - resp, err := s.client.Do(ctx, req, p) + var p *DefaultWorkflowPermissionOrganization + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -288,19 +288,19 @@ func (s *ActionsService) UpdateDefaultWorkflowPermissionsInOrganization(ctx cont // GetArtifactAndLogRetentionPeriodInOrganization gets the artifact and log retention period for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-artifact-and-log-retention-settings-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/artifact-and-log-retention func (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string) (*ArtifactPeriod, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/artifact-and-log-retention", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - arp := new(ArtifactPeriod) - resp, err := s.client.Do(ctx, req, arp) + var arp *ArtifactPeriod + resp, err := s.client.Do(req, &arp) if err != nil { return nil, resp, err } @@ -310,34 +310,34 @@ func (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx cont // UpdateArtifactAndLogRetentionPeriodInOrganization sets the artifact and log retention period for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-artifact-and-log-retention-settings-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/artifact-and-log-retention func (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string, period ArtifactPeriodOpt) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/artifact-and-log-retention", org) - req, err := s.client.NewRequest("PUT", u, period) + req, err := s.client.NewRequest(ctx, "PUT", u, period) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetSelfHostedRunnersSettingsInOrganization gets the self-hosted runners permissions settings for repositories in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-self-hosted-runners-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-self-hosted-runners-settings-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/self-hosted-runners func (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string) (*SelfHostedRunnersSettingsOrganization, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - settings := new(SelfHostedRunnersSettingsOrganization) - resp, err := s.client.Do(ctx, req, settings) + var settings *SelfHostedRunnersSettingsOrganization + resp, err := s.client.Do(req, &settings) if err != nil { return nil, resp, err } @@ -347,18 +347,18 @@ func (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context. // UpdateSelfHostedRunnersSettingsInOrganization sets the self-hosted runners permissions settings for repositories in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-self-hosted-runners-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-self-hosted-runners-settings-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners func (s *ActionsService) UpdateSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string, opt SelfHostedRunnersSettingsOrganizationOpt) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners", org) - req, err := s.client.NewRequest("PUT", u, opt) + req, err := s.client.NewRequest(ctx, "PUT", u, opt) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // SelfHostedRunnersAllowedRepos represents the repositories that are allowed to use self-hosted runners in an organization. @@ -369,7 +369,7 @@ type SelfHostedRunnersAllowedRepos struct { // ListRepositoriesSelfHostedRunnersAllowedInOrganization lists the repositories that are allowed to use self-hosted runners in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#list-repositories-allowed-to-use-self-hosted-runners-in-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, opts *ListOptions) (*SelfHostedRunnersAllowedRepos, *Response, error) { @@ -379,13 +379,13 @@ func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization( return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - settings := new(SelfHostedRunnersAllowedRepos) - resp, err := s.client.Do(ctx, req, settings) + var settings *SelfHostedRunnersAllowedRepos + resp, err := s.client.Do(req, &settings) if err != nil { return nil, resp, err } @@ -395,52 +395,52 @@ func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization( // SetRepositoriesSelfHostedRunnersAllowedInOrganization allows the list of repositories to use self-hosted runners in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-repositories-allowed-to-use-self-hosted-runners-in-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories func (s *ActionsService) SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryIDs []int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners/repositories", org) - req, err := s.client.NewRequest("PUT", u, struct { + req, err := s.client.NewRequest(ctx, "PUT", u, struct { IDs []int64 `json:"selected_repository_ids"` }{IDs: repositoryIDs}) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddRepositorySelfHostedRunnersAllowedInOrganization adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#add-a-repository-to-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#add-a-repository-to-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id} func (s *ActionsService) AddRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners/repositories/%v", org, repositoryID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveRepositorySelfHostedRunnersAllowedInOrganization removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#remove-a-repository-from-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#remove-a-repository-from-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id} func (s *ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners/repositories/%v", org, repositoryID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -450,19 +450,19 @@ func (s *ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization( // GetPrivateRepoForkPRWorkflowSettingsInOrganization gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-private-repo-fork-pr-workflow-settings-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string) (*WorkflowsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/fork-pr-workflows-private-repos", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(WorkflowsPermissions) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *WorkflowsPermissions + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -472,34 +472,34 @@ func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx // UpdatePrivateRepoForkPRWorkflowSettingsInOrganization sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string, permissions *WorkflowsPermissionsOpt) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/fork-pr-workflows-private-repos", org) - req, err := s.client.NewRequest("PUT", u, permissions) + req, err := s.client.NewRequest(ctx, "PUT", u, permissions) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetOrganizationForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) GetOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string) (*ContributorApprovalPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/fork-pr-contributor-approval", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - policy := new(ContributorApprovalPermissions) - resp, err := s.client.Do(ctx, req, policy) + var policy *ContributorApprovalPermissions + resp, err := s.client.Do(req, &policy) if err != nil { return nil, resp, err } @@ -509,15 +509,15 @@ func (s *ActionsService) GetOrganizationForkPRContributorApprovalPermissions(ctx // UpdateOrganizationForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) UpdateOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string, policy ContributorApprovalPermissions) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/fork-pr-contributor-approval", org) - req, err := s.client.NewRequest("PUT", u, policy) + req, err := s.client.NewRequest(ctx, "PUT", u, policy) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v88/github/actions_runner_groups.go similarity index 77% rename from vendor/github.com/google/go-github/v84/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v88/github/actions_runner_groups.go index dc54a8485..fad13db6b 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_runner_groups.go +++ b/vendor/github.com/google/go-github/v88/github/actions_runner_groups.go @@ -85,7 +85,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { @@ -95,13 +95,13 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - groups := &RunnerGroups{} - resp, err := s.client.Do(ctx, req, &groups) + var groups *RunnerGroups + resp, err := s.client.Do(req, &groups) if err != nil { return nil, resp, err } @@ -111,18 +111,18 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runnerGroup := new(RunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *RunnerGroup + resp, err := s.client.Do(req, &runnerGroup) if err != nil { return nil, resp, err } @@ -132,34 +132,34 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-organization // //meta:operation POST /orgs/{org}/actions/runner-groups func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) - req, err := s.client.NewRequest("POST", u, createReq) + req, err := s.client.NewRequest(ctx, "POST", u, createReq) if err != nil { return nil, nil, err } - runnerGroup := new(RunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *RunnerGroup + resp, err := s.client.Do(req, &runnerGroup) if err != nil { return nil, resp, err } @@ -169,18 +169,18 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-organization // //meta:operation PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) - req, err := s.client.NewRequest("PATCH", u, updateReq) + req, err := s.client.NewRequest(ctx, "PATCH", u, updateReq) if err != nil { return nil, nil, err } - runnerGroup := new(RunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *RunnerGroup + resp, err := s.client.Do(req, &runnerGroup) if err != nil { return nil, resp, err } @@ -190,7 +190,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -200,13 +200,13 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - repos := &ListRepositories{} - resp, err := s.client.Do(ctx, req, &repos) + var repos *ListRepositories + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -217,57 +217,83 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-repository-access-for-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) - req, err := s.client.NewRequest("PUT", u, ids) + req, err := s.client.NewRequest(ctx, "PUT", u, ids) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) +} + +// ListRunnerGroupHostedRunners lists the GitHub-hosted runners in an organization runner group. +// +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-github-hosted-runners-in-a-group-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners +func (s *ActionsService) ListRunnerGroupHostedRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/hosted-runners", org, groupID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var runners *HostedRunners + resp, err := s.client.Do(req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil } // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { @@ -277,13 +303,13 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runners := &Runners{} - resp, err := s.client.Do(ctx, req, &runners) + var runners *Runners + resp, err := s.client.Do(req, &runners) if err != nil { return nil, resp, err } @@ -294,49 +320,49 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) - req, err := s.client.NewRequest("PUT", u, ids) + req, err := s.client.NewRequest(ctx, "PUT", u, ids) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/actions_runners.go b/vendor/github.com/google/go-github/v88/github/actions_runners.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/actions_runners.go rename to vendor/github.com/google/go-github/v88/github/actions_runners.go index c4ae48232..32b35c75f 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_runners.go +++ b/vendor/github.com/google/go-github/v88/github/actions_runners.go @@ -22,18 +22,18 @@ type RunnerApplicationDownload struct { // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runners/downloads func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/downloads", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var rads []*RunnerApplicationDownload - resp, err := s.client.Do(ctx, req, &rads) + resp, err := s.client.Do(req, &rads) if err != nil { return nil, resp, err } @@ -60,18 +60,18 @@ type JITRunnerConfig struct { // GenerateOrgJITConfig generate a just-in-time configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/generate-jitconfig func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", org) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - jitConfig := new(JITRunnerConfig) - resp, err := s.client.Do(ctx, req, jitConfig) + var jitConfig *JITRunnerConfig + resp, err := s.client.Do(req, &jitConfig) if err != nil { return nil, resp, err } @@ -81,18 +81,18 @@ func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, r // GenerateRepoJITConfig generates a just-in-time configuration for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig 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) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - jitConfig := new(JITRunnerConfig) - resp, err := s.client.Do(ctx, req, jitConfig) + var jitConfig *JITRunnerConfig + resp, err := s.client.Do(req, &jitConfig) if err != nil { return nil, resp, err } @@ -108,19 +108,19 @@ type RegistrationToken struct { // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/actions/runners/registration-token func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/registration-token", owner, repo) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - registrationToken := new(RegistrationToken) - resp, err := s.client.Do(ctx, req, registrationToken) + var registrationToken *RegistrationToken + resp, err := s.client.Do(req, ®istrationToken) if err != nil { return nil, resp, err } @@ -159,7 +159,7 @@ type ListRunnersOptions struct { // ListRunners lists all the self-hosted runners for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runners func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListRunnersOptions) (*Runners, *Response, error) { @@ -169,13 +169,13 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runners := &Runners{} - resp, err := s.client.Do(ctx, req, &runners) + var runners *Runners + resp, err := s.client.Do(req, &runners) if err != nil { return nil, resp, err } @@ -185,18 +185,18 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op // GetRunner gets a specific self-hosted runner for a repository using its runner ID. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runners/{runner_id} func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runner := new(Runner) - resp, err := s.client.Do(ctx, req, runner) + var runner *Runner + resp, err := s.client.Do(req, &runner) if err != nil { return nil, resp, err } @@ -212,19 +212,19 @@ type RemoveToken struct { // CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-remove-token-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/actions/runners/remove-token func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/remove-token", owner, repo) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - removeToken := new(RemoveToken) - resp, err := s.client.Do(ctx, req, removeToken) + var removeToken *RemoveToken + resp, err := s.client.Do(req, &removeToken) if err != nil { return nil, resp, err } @@ -234,34 +234,34 @@ func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo stri // RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners/downloads func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, org string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/downloads", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var rads []*RunnerApplicationDownload - resp, err := s.client.Do(ctx, req, &rads) + resp, err := s.client.Do(req, &rads) if err != nil { return nil, resp, err } @@ -271,19 +271,19 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/registration-token func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, org string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", org) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - registrationToken := new(RegistrationToken) - resp, err := s.client.Do(ctx, req, registrationToken) + var registrationToken *RegistrationToken + resp, err := s.client.Do(req, ®istrationToken) if err != nil { return nil, resp, err } @@ -293,7 +293,7 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // ListOrganizationRunners lists all the self-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListRunnersOptions) (*Runners, *Response, error) { @@ -303,13 +303,13 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runners := &Runners{} - resp, err := s.client.Do(ctx, req, &runners) + var runners *Runners + resp, err := s.client.Do(req, &runners) if err != nil { return nil, resp, err } @@ -319,18 +319,18 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners/{runner_id} func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", org, runnerID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runner := new(Runner) - resp, err := s.client.Do(ctx, req, runner) + var runner *Runner + resp, err := s.client.Do(req, &runner) if err != nil { return nil, resp, err } @@ -340,19 +340,19 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, // CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-remove-token-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/remove-token func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", org) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - removeToken := new(RemoveToken) - resp, err := s.client.Do(ctx, req, removeToken) + var removeToken *RemoveToken + resp, err := s.client.Do(req, &removeToken) if err != nil { return nil, resp, err } @@ -362,16 +362,16 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org // RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runners/{runner_id} func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", org, runnerID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/actions_secrets.go b/vendor/github.com/google/go-github/v88/github/actions_secrets.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/actions_secrets.go rename to vendor/github.com/google/go-github/v88/github/actions_secrets.go index f03d3fd19..1f5dae4e8 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_secrets.go +++ b/vendor/github.com/google/go-github/v88/github/actions_secrets.go @@ -49,13 +49,13 @@ func (p *PublicKey) UnmarshalJSON(data []byte) error { } func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - pubKey := new(PublicKey) - resp, err := s.client.Do(ctx, req, pubKey) + var pubKey *PublicKey + resp, err := s.client.Do(req, &pubKey) if err != nil { return nil, resp, err } @@ -65,7 +65,7 @@ func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicK // GetRepoPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-a-repository-public-key // //meta:operation GET /repos/{owner}/{repo}/actions/secrets/public-key func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { @@ -75,7 +75,7 @@ func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo strin // GetOrgPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-an-organization-public-key // //meta:operation GET /orgs/{org}/actions/secrets/public-key func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { @@ -114,13 +114,13 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - secrets := new(Secrets) - resp, err := s.client.Do(ctx, req, &secrets) + var secrets *Secrets + resp, err := s.client.Do(req, &secrets) if err != nil { return nil, resp, err } @@ -131,7 +131,7 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List // ListRepoSecrets lists all secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-repository-secrets // //meta:operation GET /repos/{owner}/{repo}/actions/secrets func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { @@ -142,7 +142,7 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string // ListRepoOrgSecrets lists all organization secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-repository-organization-secrets // //meta:operation GET /repos/{owner}/{repo}/actions/organization-secrets func (s *ActionsService) ListRepoOrgSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { @@ -153,7 +153,7 @@ func (s *ActionsService) ListRepoOrgSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-organization-secrets // //meta:operation GET /orgs/{org}/actions/secrets func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { @@ -172,13 +172,13 @@ func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env str } func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - secret := new(Secret) - resp, err := s.client.Do(ctx, req, secret) + var secret *Secret + resp, err := s.client.Do(req, &secret) if err != nil { return nil, resp, err } @@ -188,7 +188,7 @@ func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *R // GetRepoSecret gets a single repository secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-a-repository-secret // //meta:operation GET /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { @@ -198,7 +198,7 @@ func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name st // GetOrgSecret gets a single organization secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#get-an-organization-secret // //meta:operation GET /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { @@ -233,17 +233,17 @@ type EncryptedSecret struct { } func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) { - req, err := s.client.NewRequest("PUT", url, eSecret) + req, err := s.client.NewRequest(ctx, "PUT", url, eSecret) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret // //meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { @@ -257,7 +257,7 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re // CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret // //meta:operation PUT /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { @@ -284,17 +284,17 @@ func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int } func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteRepoSecret deletes a secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#delete-a-repository-secret // //meta:operation DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -304,7 +304,7 @@ func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name // DeleteOrgSecret deletes a secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#delete-an-organization-secret // //meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { @@ -334,13 +334,13 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - result := new(SelectedReposList) - resp, err := s.client.Do(ctx, req, result) + var result *SelectedReposList + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -350,7 +350,7 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str // ListSelectedReposForOrgSecret lists all repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret // //meta:operation GET /orgs/{org}/actions/secrets/{secret_name}/repositories func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -363,17 +363,17 @@ func (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url stri SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` } - req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) + req, err := s.client.NewRequest(ctx, "PUT", url, repoIDs{SelectedIDs: ids}) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // SetSelectedReposForOrgSecret sets the repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-secret // //meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { @@ -382,17 +382,17 @@ func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, } func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("PUT", url, nil) + req, err := s.client.NewRequest(ctx, "PUT", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddSelectedRepoToOrgSecret adds a repository to an organization secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret // //meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -405,17 +405,17 @@ func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, na } func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret // //meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v84/github/actions_variables.go b/vendor/github.com/google/go-github/v88/github/actions_variables.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/actions_variables.go rename to vendor/github.com/google/go-github/v88/github/actions_variables.go index b192ba703..f41384e37 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_variables.go +++ b/vendor/github.com/google/go-github/v88/github/actions_variables.go @@ -36,13 +36,13 @@ func (s *ActionsService) listVariables(ctx context.Context, url string, opts *Li return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - variables := new(ActionsVariables) - resp, err := s.client.Do(ctx, req, &variables) + var variables *ActionsVariables + resp, err := s.client.Do(req, &variables) if err != nil { return nil, resp, err } @@ -52,7 +52,7 @@ func (s *ActionsService) listVariables(ctx context.Context, url string, opts *Li // ListRepoVariables lists all variables available in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-repository-variables // //meta:operation GET /repos/{owner}/{repo}/actions/variables func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { @@ -62,7 +62,7 @@ func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo stri // ListRepoOrgVariables lists all organization variables available in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-organization-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-repository-organization-variables // //meta:operation GET /repos/{owner}/{repo}/actions/organization-variables func (s *ActionsService) ListRepoOrgVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { @@ -72,7 +72,7 @@ func (s *ActionsService) ListRepoOrgVariables(ctx context.Context, owner, repo s // ListOrgVariables lists all variables available in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-organization-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-organization-variables // //meta:operation GET /orgs/{org}/actions/variables func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error) { @@ -82,7 +82,7 @@ func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts // ListEnvVariables lists all variables available in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-environment-variables // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables func (s *ActionsService) ListEnvVariables(ctx context.Context, owner, repo, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { @@ -91,13 +91,13 @@ func (s *ActionsService) ListEnvVariables(ctx context.Context, owner, repo, env } func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsVariable, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - variable := new(ActionsVariable) - resp, err := s.client.Do(ctx, req, variable) + var variable *ActionsVariable + resp, err := s.client.Do(req, &variable) if err != nil { return nil, resp, err } @@ -107,7 +107,7 @@ func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsV // GetRepoVariable gets a single repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-a-repository-variable // //meta:operation GET /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error) { @@ -117,7 +117,7 @@ func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name // GetOrgVariable gets a single organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-an-organization-variable // //meta:operation GET /orgs/{org}/actions/variables/{name} func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error) { @@ -127,7 +127,7 @@ func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) ( // GetEnvVariable gets a single environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#get-an-environment-variable // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} func (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*ActionsVariable, *Response, error) { @@ -136,16 +136,16 @@ func (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, v } func (s *ActionsService) postVariable(ctx context.Context, url string, variable *ActionsVariable) (*Response, error) { - req, err := s.client.NewRequest("POST", url, variable) + req, err := s.client.NewRequest(ctx, "POST", url, variable) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CreateRepoVariable creates a repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-a-repository-variable // //meta:operation POST /repos/{owner}/{repo}/actions/variables func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { @@ -155,7 +155,7 @@ func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo str // CreateOrgVariable creates an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-organization-variable // //meta:operation POST /orgs/{org}/actions/variables func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { @@ -165,7 +165,7 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, vari // CreateEnvVariable creates an environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable // //meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/variables func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) { @@ -174,16 +174,16 @@ func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env } func (s *ActionsService) patchVariable(ctx context.Context, url string, variable *ActionsVariable) (*Response, error) { - req, err := s.client.NewRequest("PATCH", url, variable) + req, err := s.client.NewRequest(ctx, "PATCH", url, variable) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UpdateRepoVariable updates a repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-a-repository-variable // //meta:operation PATCH /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { @@ -197,7 +197,7 @@ func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo str // UpdateOrgVariable updates an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-an-organization-variable // //meta:operation PATCH /orgs/{org}/actions/variables/{name} func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { @@ -211,7 +211,7 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // UpdateEnvVariable updates an environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#update-an-environment-variable // //meta:operation PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) { @@ -224,17 +224,17 @@ func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env } func (s *ActionsService) deleteVariable(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteRepoVariable deletes a variable in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-a-repository-variable // //meta:operation DELETE /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -244,7 +244,7 @@ func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, na // DeleteOrgVariable deletes a variable in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-an-organization-variable // //meta:operation DELETE /orgs/{org}/actions/variables/{name} func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error) { @@ -254,7 +254,7 @@ func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string // DeleteEnvVariable deletes a variable in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#delete-an-environment-variable // //meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} func (s *ActionsService) DeleteEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*Response, error) { @@ -268,13 +268,13 @@ func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url s return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - result := new(SelectedReposList) - resp, err := s.client.Do(ctx, req, result) + var result *SelectedReposList + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -284,7 +284,7 @@ func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url s // ListSelectedReposForOrgVariable lists all repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-variable // //meta:operation GET /orgs/{org}/actions/variables/{name}/repositories func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -297,17 +297,17 @@ func (s *ActionsService) setSelectedReposForVariable(ctx context.Context, url st SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` } - req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) + req, err := s.client.NewRequest(ctx, "PUT", url, repoIDs{SelectedIDs: ids}) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // SetSelectedReposForOrgVariable sets the repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-variable // //meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { @@ -316,17 +316,17 @@ func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org } func (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("PUT", url, nil) + req, err := s.client.NewRequest(ctx, "PUT", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddSelectedRepoToOrgVariable adds a repository to an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#add-selected-repository-to-an-organization-variable // //meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -342,17 +342,17 @@ func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, } func (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-variable // //meta:operation DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v84/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v88/github/actions_workflow_jobs.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v88/github/actions_workflow_jobs.go index dabc80917..9419cf897 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_workflow_jobs.go +++ b/vendor/github.com/google/go-github/v88/github/actions_workflow_jobs.go @@ -70,7 +70,7 @@ type ListWorkflowJobsOptions struct { // ListWorkflowJobs lists all jobs for a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) { @@ -80,13 +80,13 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - jobs := new(Jobs) - resp, err := s.client.Do(ctx, req, &jobs) + var jobs *Jobs + resp, err := s.client.Do(req, &jobs) if err != nil { return nil, resp, err } @@ -96,7 +96,7 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin // ListWorkflowJobsAttempt lists jobs for a workflow run Attempt. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run-attempt // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, repo string, runID, attemptNumber int64, opts *ListOptions) (*Jobs, *Response, error) { @@ -106,13 +106,13 @@ func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, rep return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - jobs := new(Jobs) - resp, err := s.client.Do(ctx, req, &jobs) + var jobs *Jobs + resp, err := s.client.Do(req, &jobs) if err != nil { return nil, resp, err } @@ -122,19 +122,19 @@ func (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, rep // GetWorkflowJobByID gets a specific job in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#get-a-job-for-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id} func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v", owner, repo, jobID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - job := new(WorkflowJob) - resp, err := s.client.Do(ctx, req, job) + var job *WorkflowJob + resp, err := s.client.Do(req, &job) if err != nil { return nil, resp, err } @@ -144,13 +144,13 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str // GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs?apiVersion=2022-11-28#download-job-logs-for-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) - if s.client.RateLimitRedirectionalEndpoints { + if s.client.rateLimitRedirectionalEndpoints { return s.getWorkflowJobLogsWithRateLimit(ctx, u, maxRedirects) } @@ -173,12 +173,12 @@ func (s *ActionsService) getWorkflowJobLogsWithoutRateLimit(ctx context.Context, } func (s *ActionsService) getWorkflowJobLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + url, resp, err := s.client.bareDoUntilFound(req, maxRedirects) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v88/github/actions_workflow_runs.go similarity index 88% rename from vendor/github.com/google/go-github/v84/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v88/github/actions_workflow_runs.go index 7b13a23ef..6e46328df 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v88/github/actions_workflow_runs.go @@ -144,13 +144,13 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runs := new(WorkflowRuns) - resp, err := s.client.Do(ctx, req, &runs) + var runs *WorkflowRuns + resp, err := s.client.Do(req, &runs) if err != nil { return nil, resp, err } @@ -160,7 +160,7 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, // ListWorkflowRunsByID lists all workflow runs by workflow ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { @@ -170,7 +170,7 @@ func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo s // ListWorkflowRunsByFileName lists all workflow runs by workflow file name. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { @@ -180,7 +180,7 @@ func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, // ListRepositoryWorkflowRuns lists all workflow runs for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runs func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { @@ -190,13 +190,13 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runs := new(WorkflowRuns) - resp, err := s.client.Do(ctx, req, &runs) + var runs *WorkflowRuns + resp, err := s.client.Do(req, &runs) if err != nil { return nil, resp, err } @@ -207,19 +207,19 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, // GetWorkflowRunByID gets a specific workflow run by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id} func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - run := new(WorkflowRun) - resp, err := s.client.Do(ctx, req, run) + var run *WorkflowRun + resp, err := s.client.Do(req, &run) if err != nil { return nil, resp, err } @@ -230,7 +230,7 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str // GetWorkflowRunAttempt gets a specific workflow run attempt. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run-attempt // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error) { @@ -240,13 +240,13 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - run := new(WorkflowRun) - resp, err := s.client.Do(ctx, req, run) + var run *WorkflowRun + resp, err := s.client.Do(req, &run) if err != nil { return nil, resp, err } @@ -257,13 +257,13 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve a workflow run ID from the DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#download-workflow-run-attempt-logs // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) - if s.client.RateLimitRedirectionalEndpoints { + if s.client.rateLimitRedirectionalEndpoints { return s.getWorkflowRunAttemptLogsWithRateLimit(ctx, u, maxRedirects) } @@ -286,12 +286,12 @@ func (s *ActionsService) getWorkflowRunAttemptLogsWithoutRateLimit(ctx context.C } func (s *ActionsService) getWorkflowRunAttemptLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + url, resp, err := s.client.bareDoUntilFound(req, maxRedirects) if err != nil { return nil, resp, err } @@ -308,82 +308,82 @@ func (s *ActionsService) getWorkflowRunAttemptLogsWithRateLimit(ctx context.Cont // RerunWorkflowByID re-runs a workflow by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID of a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-workflow // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun", owner, repo, runID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-failed-jobs-from-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun-failed-jobs", owner, repo, runID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID. // // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-job-from-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/rerun", owner, repo, jobID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CancelWorkflowRunByID cancels a workflow run by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/cancel", owner, repo, runID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#download-workflow-run-logs // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) - if s.client.RateLimitRedirectionalEndpoints { + if s.client.rateLimitRedirectionalEndpoints { return s.getWorkflowRunLogsWithRateLimit(ctx, u, maxRedirects) } @@ -406,12 +406,12 @@ func (s *ActionsService) getWorkflowRunLogsWithoutRateLimit(ctx context.Context, } func (s *ActionsService) getWorkflowRunLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + url, resp, err := s.client.bareDoUntilFound(req, maxRedirects) if err != nil { return nil, resp, err } @@ -428,53 +428,53 @@ func (s *ActionsService) getWorkflowRunLogsWithRateLimit(ctx context.Context, u // DeleteWorkflowRun deletes a workflow run by ID. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#delete-a-workflow-run // //meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id} func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteWorkflowRunLogs deletes all logs for a workflow run. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#delete-workflow-run-logs // //meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-workflow-run-usage // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/timing", owner, repo, runID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - workflowRunUsage := new(WorkflowRunUsage) - resp, err := s.client.Do(ctx, req, workflowRunUsage) + var workflowRunUsage *WorkflowRunUsage + resp, err := s.client.Do(req, &workflowRunUsage) if err != nil { return nil, resp, err } @@ -485,19 +485,19 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep // GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#get-pending-deployments-for-a-workflow-run // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo string, runID int64) ([]*PendingDeployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var deployments []*PendingDeployment - resp, err := s.client.Do(ctx, req, &deployments) + resp, err := s.client.Do(req, &deployments) if err != nil { return nil, resp, err } @@ -508,19 +508,19 @@ func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#review-pending-deployments-for-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } var deployments []*Deployment - resp, err := s.client.Do(ctx, req, &deployments) + resp, err := s.client.Do(req, &deployments) if err != nil { return nil, resp, err } @@ -531,17 +531,17 @@ func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo str // ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run. // You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs?apiVersion=2022-11-28#review-custom-deployment-protection-rules-for-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule func (s *ActionsService) ReviewCustomDeploymentProtectionRule(ctx context.Context, owner, repo string, runID int64, request *ReviewCustomDeploymentProtectionRuleRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/deployment_protection_rule", owner, repo, runID) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/actions_workflows.go b/vendor/github.com/google/go-github/v88/github/actions_workflows.go similarity index 90% rename from vendor/github.com/google/go-github/v84/github/actions_workflows.go rename to vendor/github.com/google/go-github/v88/github/actions_workflows.go index 582949f4d..bcd79c5e2 100644 --- a/vendor/github.com/google/go-github/v84/github/actions_workflows.go +++ b/vendor/github.com/google/go-github/v88/github/actions_workflows.go @@ -99,7 +99,7 @@ func (p ContributorApprovalPermissions) String() string { // ListWorkflows lists all workflows in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#list-repository-workflows +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows // //meta:operation GET /repos/{owner}/{repo}/actions/workflows func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error) { @@ -109,13 +109,13 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - workflows := new(Workflows) - resp, err := s.client.Do(ctx, req, &workflows) + var workflows *Workflows + resp, err := s.client.Do(req, &workflows) if err != nil { return nil, resp, err } @@ -125,7 +125,7 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, // GetWorkflowByID gets a specific workflow by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error) { @@ -136,7 +136,7 @@ func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string // GetWorkflowByFileName gets a specific workflow by file name. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-a-workflow // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error) { @@ -146,13 +146,13 @@ func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, } func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - workflow := new(Workflow) - resp, err := s.client.Do(ctx, req, workflow) + var workflow *Workflow + resp, err := s.client.Do(req, &workflow) if err != nil { return nil, resp, err } @@ -162,7 +162,7 @@ func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow // GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-workflow-usage // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error) { @@ -173,7 +173,7 @@ func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo s // GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#get-workflow-usage // //meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error) { @@ -183,13 +183,13 @@ func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, } func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*WorkflowUsage, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - workflowUsage := new(WorkflowUsage) - resp, err := s.client.Do(ctx, req, workflowUsage) + var workflowUsage *WorkflowUsage + resp, err := s.client.Do(req, &workflowUsage) if err != nil { return nil, resp, err } @@ -199,7 +199,7 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor // CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event // //meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) { @@ -210,7 +210,7 @@ func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, ow // CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event // //meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) { @@ -220,13 +220,13 @@ func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Conte } func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url string, event *CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) { - req, err := s.client.NewRequest("POST", url, event) + req, err := s.client.NewRequest(ctx, "POST", url, event) if err != nil { return nil, nil, err } var dispatchRunDetails *WorkflowDispatchRunDetails - resp, err := s.client.Do(ctx, req, &dispatchRunDetails) + resp, err := s.client.Do(req, &dispatchRunDetails) if err != nil { return nil, resp, err } @@ -236,7 +236,7 @@ func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url st // EnableWorkflowByID enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#enable-a-workflow // //meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { @@ -246,7 +246,7 @@ func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo str // EnableWorkflowByFileName enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#enable-a-workflow // //meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { @@ -256,7 +256,7 @@ func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, re // DisableWorkflowByID disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#disable-a-workflow // //meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { @@ -266,7 +266,7 @@ func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo st // DisableWorkflowByFileName disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows?apiVersion=2022-11-28#disable-a-workflow // //meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { @@ -275,10 +275,10 @@ func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, r } func (s *ActionsService) doNewPutRequest(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("PUT", url, nil) + req, err := s.client.NewRequest(ctx, "PUT", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/activity.go b/vendor/github.com/google/go-github/v88/github/activity.go similarity index 90% rename from vendor/github.com/google/go-github/v84/github/activity.go rename to vendor/github.com/google/go-github/v88/github/activity.go index edf8cc439..f69bd3826 100644 --- a/vendor/github.com/google/go-github/v84/github/activity.go +++ b/vendor/github.com/google/go-github/v88/github/activity.go @@ -10,7 +10,7 @@ import "context" // ActivityService handles communication with the activity related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/activity/ +// GitHub API docs: https://docs.github.com/rest/activity?apiVersion=2022-11-28 type ActivityService service // FeedLink represents a link to a related resource. @@ -58,17 +58,17 @@ type FeedLinks struct { // Note: Private feeds are only returned when authenticating via Basic Auth // since current feed URIs use the older, non revocable auth tokens. // -// GitHub API docs: https://docs.github.com/rest/activity/feeds#get-feeds +// GitHub API docs: https://docs.github.com/rest/activity/feeds?apiVersion=2022-11-28#get-feeds // //meta:operation GET /feeds func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) { - req, err := s.client.NewRequest("GET", "feeds", nil) + req, err := s.client.NewRequest(ctx, "GET", "feeds", nil) if err != nil { return nil, nil, err } - f := &Feeds{} - resp, err := s.client.Do(ctx, req, f) + var f *Feeds + resp, err := s.client.Do(req, &f) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/activity_events.go b/vendor/github.com/google/go-github/v88/github/activity_events.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/activity_events.go rename to vendor/github.com/google/go-github/v88/github/activity_events.go index 597f79920..83635fbb7 100644 --- a/vendor/github.com/google/go-github/v84/github/activity_events.go +++ b/vendor/github.com/google/go-github/v88/github/activity_events.go @@ -12,7 +12,7 @@ import ( // ListEvents drinks from the firehose of all public events across GitHub. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events // //meta:operation GET /events func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { @@ -21,13 +21,13 @@ func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([] return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*Event - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -37,7 +37,7 @@ func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([] // ListRepositoryEvents lists events for a repository. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-repository-events +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-repository-events // //meta:operation GET /repos/{owner}/{repo}/events func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { @@ -47,13 +47,13 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*Event - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -63,7 +63,7 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo // ListIssueEventsForRepository lists issue events for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#list-issue-events-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/issues/events func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { @@ -73,13 +73,13 @@ func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owne return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*IssueEvent - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -89,7 +89,7 @@ func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owne // ListEventsForRepoNetwork lists public events for a network of repositories. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-network-of-repositories // //meta:operation GET /networks/{owner}/{repo}/events func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { @@ -99,13 +99,13 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*Event - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -115,7 +115,7 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r // ListEventsForOrganization lists public events for an organization. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-organization-events +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-organization-events // //meta:operation GET /orgs/{org}/events func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { @@ -125,13 +125,13 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*Event - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -142,9 +142,9 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str // ListEventsPerformedByUser lists the events performed by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-events-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-user // //meta:operation GET /users/{username}/events //meta:operation GET /users/{username}/events/public @@ -160,13 +160,13 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*Event - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -177,9 +177,9 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st // ListEventsReceivedByUser lists the events received by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-events-received-by-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-public-events-received-by-a-user // //meta:operation GET /users/{username}/received_events //meta:operation GET /users/{username}/received_events/public @@ -195,13 +195,13 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*Event - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -212,7 +212,7 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str // ListUserEventsForOrganization provides the user’s organization dashboard. You // must be authenticated as the user to view this. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events?apiVersion=2022-11-28#list-organization-events-for-the-authenticated-user // //meta:operation GET /users/{username}/events/orgs/{org} func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { @@ -222,13 +222,13 @@ func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*Event - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/activity_notifications.go b/vendor/github.com/google/go-github/v88/github/activity_notifications.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/activity_notifications.go rename to vendor/github.com/google/go-github/v88/github/activity_notifications.go index feb38ea33..95e6cf3d8 100644 --- a/vendor/github.com/google/go-github/v84/github/activity_notifications.go +++ b/vendor/github.com/google/go-github/v88/github/activity_notifications.go @@ -19,7 +19,7 @@ type Notification struct { // Reason identifies the event that triggered the notification. // - // GitHub API docs: https://docs.github.com/rest/activity#notification-reasons + // GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#notification-reasons Reason *string `json:"reason,omitempty"` Unread *bool `json:"unread,omitempty"` @@ -49,7 +49,7 @@ type NotificationListOptions struct { // ListNotifications lists all notifications for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#list-notifications-for-the-authenticated-user // //meta:operation GET /notifications func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) { @@ -59,13 +59,13 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var notifications []*Notification - resp, err := s.client.Do(ctx, req, ¬ifications) + resp, err := s.client.Do(req, ¬ifications) if err != nil { return nil, resp, err } @@ -76,7 +76,7 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat // ListRepositoryNotifications lists all notifications in a given repository // for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#list-repository-notifications-for-the-authenticated-user // //meta:operation GET /repos/{owner}/{repo}/notifications func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) { @@ -86,13 +86,13 @@ func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var notifications []*Notification - resp, err := s.client.Do(ctx, req, ¬ifications) + resp, err := s.client.Do(req, ¬ifications) if err != nil { return nil, resp, err } @@ -107,26 +107,26 @@ type markReadOptions struct { // MarkNotificationsRead marks all notifications up to lastRead as read. // If lastRead is the zero value, all notifications in the repository are marked as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-notifications-as-read // //meta:operation PUT /notifications func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, } - req, err := s.client.NewRequest("PUT", "notifications", opts) + req, err := s.client.NewRequest(ctx, "PUT", "notifications", opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // MarkRepositoryNotificationsRead marks all notifications up to lastRead in // the specified repository as read. // If lastRead is the zero value, all notifications in the repository are marked as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-repository-notifications-as-read // //meta:operation PUT /repos/{owner}/{repo}/notifications func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error) { @@ -134,29 +134,29 @@ func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, o LastReadAt: lastRead, } u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetThread gets the specified notification thread. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#get-a-thread // //meta:operation GET /notifications/threads/{thread_id} func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - notification := new(Notification) - resp, err := s.client.Do(ctx, req, notification) + var notification *Notification + resp, err := s.client.Do(req, ¬ification) if err != nil { return nil, resp, err } @@ -166,53 +166,53 @@ func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notificati // MarkThreadRead marks the specified thread as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-read // //meta:operation PATCH /notifications/threads/{thread_id} func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) - req, err := s.client.NewRequest("PATCH", u, nil) + req, err := s.client.NewRequest(ctx, "PATCH", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // MarkThreadDone marks the specified thread as done. // Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-done // //meta:operation DELETE /notifications/threads/{thread_id} -func (s *ActivityService) MarkThreadDone(ctx context.Context, id int64) (*Response, error) { +func (s *ActivityService) MarkThreadDone(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#get-a-thread-subscription-for-the-authenticated-user // //meta:operation GET /notifications/threads/{thread_id}/subscription func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - sub := new(Subscription) - resp, err := s.client.Do(ctx, req, sub) + var sub *Subscription + resp, err := s.client.Do(req, &sub) if err != nil { return nil, resp, err } @@ -223,19 +223,19 @@ func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) // SetThreadSubscription sets the subscription for the specified thread for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#set-a-thread-subscription // //meta:operation PUT /notifications/threads/{thread_id}/subscription func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) - req, err := s.client.NewRequest("PUT", u, subscription) + req, err := s.client.NewRequest(ctx, "PUT", u, subscription) if err != nil { return nil, nil, err } - sub := new(Subscription) - resp, err := s.client.Do(ctx, req, sub) + var sub *Subscription + resp, err := s.client.Do(req, &sub) if err != nil { return nil, resp, err } @@ -246,15 +246,15 @@ func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, // DeleteThreadSubscription deletes the subscription for the specified thread // for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications?apiVersion=2022-11-28#delete-a-thread-subscription // //meta:operation DELETE /notifications/threads/{thread_id}/subscription func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/activity_star.go b/vendor/github.com/google/go-github/v88/github/activity_star.go similarity index 82% rename from vendor/github.com/google/go-github/v84/github/activity_star.go rename to vendor/github.com/google/go-github/v88/github/activity_star.go index d9383e434..d405d85a2 100644 --- a/vendor/github.com/google/go-github/v84/github/activity_star.go +++ b/vendor/github.com/google/go-github/v88/github/activity_star.go @@ -25,7 +25,7 @@ type Stargazer struct { // ListStargazers lists people who have starred the specified repo. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-stargazers +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-stargazers // //meta:operation GET /repos/{owner}/{repo}/stargazers func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) { @@ -35,7 +35,7 @@ func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -43,7 +43,7 @@ func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string req.Header.Set("Accept", mediaTypeStarring) var stargazers []*Stargazer - resp, err := s.client.Do(ctx, req, &stargazers) + resp, err := s.client.Do(req, &stargazers) if err != nil { return nil, resp, err } @@ -68,9 +68,9 @@ type ActivityListStarredOptions struct { // ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-repositories-starred-by-a-user // -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#list-repositories-starred-by-the-authenticated-user // //meta:operation GET /user/starred //meta:operation GET /users/{username}/starred @@ -86,7 +86,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -95,7 +95,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var repos []*StarredRepository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -105,47 +105,47 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac // IsStarred checks if a repository is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#check-if-a-repository-is-starred-by-the-authenticated-user // //meta:operation GET /user/starred/{owner}/{repo} func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) starred, err := parseBoolResponse(err) return starred, resp, err } // Star a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#star-a-repository-for-the-authenticated-user // //meta:operation PUT /user/starred/{owner}/{repo} func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Unstar a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring?apiVersion=2022-11-28#unstar-a-repository-for-the-authenticated-user // //meta:operation DELETE /user/starred/{owner}/{repo} func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/activity_watching.go b/vendor/github.com/google/go-github/v88/github/activity_watching.go similarity index 83% rename from vendor/github.com/google/go-github/v84/github/activity_watching.go rename to vendor/github.com/google/go-github/v88/github/activity_watching.go index 8106d799c..04b64f99c 100644 --- a/vendor/github.com/google/go-github/v84/github/activity_watching.go +++ b/vendor/github.com/google/go-github/v88/github/activity_watching.go @@ -27,7 +27,7 @@ type Subscription struct { // ListWatchers lists watchers of a particular repo. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-watchers +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-watchers // //meta:operation GET /repos/{owner}/{repo}/subscribers func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { @@ -37,13 +37,13 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var watchers []*User - resp, err := s.client.Do(ctx, req, &watchers) + resp, err := s.client.Do(req, &watchers) if err != nil { return nil, resp, err } @@ -54,9 +54,9 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, // ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-repositories-watched-by-a-user // -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#list-repositories-watched-by-the-authenticated-user // //meta:operation GET /user/subscriptions //meta:operation GET /users/{username}/subscriptions @@ -72,13 +72,13 @@ func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *Li return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var watched []*Repository - resp, err := s.client.Do(ctx, req, &watched) + resp, err := s.client.Do(req, &watched) if err != nil { return nil, resp, err } @@ -90,19 +90,19 @@ func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *Li // repository for the authenticated user. If the authenticated user is not // watching the repository, a nil Subscription is returned. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#get-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#get-a-repository-subscription // //meta:operation GET /repos/{owner}/{repo}/subscription func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%v/%v/subscription", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - sub := new(Subscription) - resp, err := s.client.Do(ctx, req, sub) + var sub *Subscription + resp, err := s.client.Do(req, &sub) if err != nil { // if it's just a 404, don't return that as an error _, err = parseBoolResponse(err) @@ -119,19 +119,19 @@ func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, // To ignore notifications made within a repository, set subscription.Ignored to true. // To stop watching a repository, use DeleteRepositorySubscription. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#set-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#set-a-repository-subscription // //meta:operation PUT /repos/{owner}/{repo}/subscription func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%v/%v/subscription", owner, repo) - req, err := s.client.NewRequest("PUT", u, subscription) + req, err := s.client.NewRequest(ctx, "PUT", u, subscription) if err != nil { return nil, nil, err } - sub := new(Subscription) - resp, err := s.client.Do(ctx, req, sub) + var sub *Subscription + resp, err := s.client.Do(req, &sub) if err != nil { return nil, resp, err } @@ -145,15 +145,15 @@ func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, // This is used to stop watching a repository. To control whether or not to // receive notifications from a repository, use SetRepositorySubscription. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching?apiVersion=2022-11-28#delete-a-repository-subscription // //meta:operation DELETE /repos/{owner}/{repo}/subscription func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/subscription", owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/admin.go b/vendor/github.com/google/go-github/v88/github/admin.go similarity index 91% rename from vendor/github.com/google/go-github/v84/github/admin.go rename to vendor/github.com/google/go-github/v88/github/admin.go index 89b40ae26..b1713d5b9 100644 --- a/vendor/github.com/google/go-github/v84/github/admin.go +++ b/vendor/github.com/google/go-github/v88/github/admin.go @@ -14,7 +14,7 @@ import ( // GitHub API. These API routes are normally only accessible for GitHub // Enterprise installations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin +// GitHub API docs: https://docs.github.com/rest/enterprise-admin?apiVersion=2022-11-28 type AdminService service // TeamLDAPMapping represents the mapping between a GitHub team and an LDAP group. @@ -82,18 +82,18 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/users/%v/mapping", user) - req, err := s.client.NewRequest("PATCH", u, mapping) + req, err := s.client.NewRequest(ctx, "PATCH", u, mapping) if err != nil { return nil, nil, err } - m := new(UserLDAPMapping) - resp, err := s.client.Do(ctx, req, m) + var m *UserLDAPMapping + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -103,18 +103,18 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/teams/%v/mapping", team) - req, err := s.client.NewRequest("PATCH", u, mapping) + req, err := s.client.NewRequest(ctx, "PATCH", u, mapping) if err != nil { return nil, nil, err } - m := new(TeamLDAPMapping) - resp, err := s.client.Do(ctx, req, m) + var m *TeamLDAPMapping + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/admin_orgs.go b/vendor/github.com/google/go-github/v88/github/admin_orgs.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/admin_orgs.go rename to vendor/github.com/google/go-github/v88/github/admin_orgs.go index b06c5b71f..b9b19f893 100644 --- a/vendor/github.com/google/go-github/v84/github/admin_orgs.go +++ b/vendor/github.com/google/go-github/v88/github/admin_orgs.go @@ -23,7 +23,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -34,13 +34,13 @@ func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin s Admin: &admin, } - req, err := s.client.NewRequest("POST", u, orgReq) + req, err := s.client.NewRequest(ctx, "POST", u, orgReq) if err != nil { return nil, nil, err } - o := new(Organization) - resp, err := s.client.Do(ctx, req, o) + var o *Organization + resp, err := s.client.Do(req, &o) if err != nil { return nil, resp, err } @@ -62,7 +62,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -78,7 +78,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { @@ -88,13 +88,13 @@ func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) Login: &newName, } - req, err := s.client.NewRequest("PATCH", u, orgReq) + req, err := s.client.NewRequest(ctx, "PATCH", u, orgReq) if err != nil { return nil, nil, err } - o := new(RenameOrgResponse) - resp, err := s.client.Do(ctx, req, o) + var o *RenameOrgResponse + resp, err := s.client.Do(req, &o) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/admin_stats.go b/vendor/github.com/google/go-github/v88/github/admin_stats.go similarity index 96% rename from vendor/github.com/google/go-github/v84/github/admin_stats.go rename to vendor/github.com/google/go-github/v88/github/admin_stats.go index 17527e1fa..17816c500 100644 --- a/vendor/github.com/google/go-github/v84/github/admin_stats.go +++ b/vendor/github.com/google/go-github/v88/github/admin_stats.go @@ -152,18 +152,18 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { u := "enterprise/stats/all" - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - m := new(AdminStats) - resp, err := s.client.Do(ctx, req, m) + var m *AdminStats + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/admin_users.go b/vendor/github.com/google/go-github/v88/github/admin_users.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/admin_users.go rename to vendor/github.com/google/go-github/v88/github/admin_users.go index 05f123175..c2f331dee 100644 --- a/vendor/github.com/google/go-github/v84/github/admin_users.go +++ b/vendor/github.com/google/go-github/v88/github/admin_users.go @@ -20,19 +20,19 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { u := "admin/users" - req, err := s.client.NewRequest("POST", u, userReq) + req, err := s.client.NewRequest(ctx, "POST", u, userReq) if err != nil { return nil, nil, err } var user User - resp, err := s.client.Do(ctx, req, &user) + resp, err := s.client.Do(req, &user) if err != nil { return nil, resp, err } @@ -42,18 +42,18 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { u := "admin/users/" + username - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -95,19 +95,19 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - a := new(UserAuthorization) - resp, err := s.client.Do(ctx, req, a) + var a *UserAuthorization + resp, err := s.client.Do(req, &a) if err != nil { return nil, resp, err } @@ -117,18 +117,18 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/apps.go b/vendor/github.com/google/go-github/v88/github/apps.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/apps.go rename to vendor/github.com/google/go-github/v88/github/apps.go index eb78203a6..75844a29c 100644 --- a/vendor/github.com/google/go-github/v84/github/apps.go +++ b/vendor/github.com/google/go-github/v88/github/apps.go @@ -13,13 +13,14 @@ import ( // AppsService provides access to the installation related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/apps/ +// GitHub API docs: https://docs.github.com/rest/apps?apiVersion=2022-11-28 type AppsService service // App represents a GitHub App. type App struct { ID *int64 `json:"id,omitempty"` Slug *string `json:"slug,omitempty"` + ClientID *string `json:"client_id,omitempty"` NodeID *string `json:"node_id,omitempty"` Owner *User `json:"owner,omitempty"` Name *string `json:"name,omitempty"` @@ -77,7 +78,7 @@ type InstallationTokenListRepoOptions struct { // Permission names taken from: // // https://docs.github.com/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app -// https://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/rest/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` ActionsVariables *string `json:"actions_variables,omitempty"` @@ -215,9 +216,9 @@ func (i Installation) String() string { // You can find this on the settings page for your GitHub App // (e.g., https://github.com/settings/apps/:app_slug). // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-app // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-the-authenticated-app // //meta:operation GET /app //meta:operation GET /apps/{app_slug} @@ -229,13 +230,13 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, u = "app" } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - app := new(App) - resp, err := s.client.Do(ctx, req, app) + var app *App + resp, err := s.client.Do(req, &app) if err != nil { return nil, resp, err } @@ -245,7 +246,7 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, // ListInstallationRequests lists the pending installation requests that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#list-installation-requests-for-the-authenticated-app // //meta:operation GET /app/installation-requests func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOptions) ([]*InstallationRequest, *Response, error) { @@ -254,13 +255,13 @@ func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOp return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var i []*InstallationRequest - resp, err := s.client.Do(ctx, req, &i) + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } @@ -270,7 +271,7 @@ func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOp // ListInstallations lists the installations that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#list-installations-for-the-authenticated-app // //meta:operation GET /app/installations func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { @@ -279,13 +280,13 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var i []*Installation - resp, err := s.client.Do(ctx, req, &i) + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } @@ -295,7 +296,7 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) // GetInstallation returns the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-installation-for-the-authenticated-app // //meta:operation GET /app/installations/{installation_id} func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) { @@ -304,7 +305,7 @@ func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installat // ListUserInstallations lists installations that are accessible to the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-app-installations-accessible-to-the-user-access-token // //meta:operation GET /user/installations func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { @@ -313,7 +314,7 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -321,7 +322,7 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio var i struct { Installations []*Installation `json:"installations"` } - resp, err := s.client.Do(ctx, req, &i) + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } @@ -331,67 +332,67 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio // SuspendInstallation suspends the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#suspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#suspend-an-app-installation // //meta:operation PUT /app/installations/{installation_id}/suspended func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UnsuspendInstallation unsuspends the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#unsuspend-an-app-installation // //meta:operation DELETE /app/installations/{installation_id}/suspended func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteInstallation deletes the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#delete-an-installation-for-the-authenticated-app // //meta:operation DELETE /app/installations/{installation_id} func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CreateInstallationToken creates a new installation token. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app // //meta:operation POST /app/installations/{installation_id}/access_tokens func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error) { u := fmt.Sprintf("app/installations/%v/access_tokens", id) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - t := new(InstallationToken) - resp, err := s.client.Do(ctx, req, t) + var t *InstallationToken + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -403,19 +404,19 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // // It differs from CreateInstallationToken by taking InstallationTokenListRepoOptions as a parameter which does not omit RepositoryIDs if that field is nil or an empty array. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app // //meta:operation POST /app/installations/{installation_id}/access_tokens func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id int64, opts *InstallationTokenListRepoOptions) (*InstallationToken, *Response, error) { u := fmt.Sprintf("app/installations/%v/access_tokens", id) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - t := new(InstallationToken) - resp, err := s.client.Do(ctx, req, t) + var t *InstallationToken + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -430,16 +431,16 @@ func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id i //meta:operation POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) - payload := &Attachment{Title: Ptr(title), Body: Ptr(body)} - req, err := s.client.NewRequest("POST", u, payload) + payload := &Attachment{Title: &title, Body: &body} + req, err := s.client.NewRequest(ctx, "POST", u, payload) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeContentAttachmentsPreview) - m := &Attachment{} - resp, err := s.client.Do(ctx, req, m) + var m *Attachment + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -447,50 +448,59 @@ func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID i return m, resp, nil } -// FindOrganizationInstallation finds the organization's installation information. +// GetOrganizationInstallation finds the organization's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-an-organization-installation-for-the-authenticated-app // //meta:operation GET /orgs/{org}/installation -func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) { +func (s *AppsService) GetOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("orgs/%v/installation", org)) } -// FindRepositoryInstallation finds the repository's installation information. +// GetEnterpriseInstallation finds the enterprise's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/apps/apps?apiVersion=2022-11-28#get-an-enterprise-installation-for-the-authenticated-app +// +//meta:operation GET /enterprises/{enterprise}/installation +func (s *AppsService) GetEnterpriseInstallation(ctx context.Context, enterprise string) (*Installation, *Response, error) { + return s.getInstallation(ctx, fmt.Sprintf("enterprises/%v/installation", enterprise)) +} + +// GetRepositoryInstallation finds the repository's installation information. +// +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app // //meta:operation GET /repos/{owner}/{repo}/installation -func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) { +func (s *AppsService) GetRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repos/%v/%v/installation", owner, repo)) } -// FindRepositoryInstallationByID finds the repository's installation information. +// GetRepositoryInstallationByID finds the repository's installation information. // -// Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}/installation". +// Note: GetRepositoryInstallationByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}/installation". // //meta:operation GET /repositories/{repository_id}/installation -func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error) { +func (s *AppsService) GetRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repositories/%v/installation", id)) } -// FindUserInstallation finds the user's installation information. +// GetUserInstallation finds the user's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app // //meta:operation GET /users/{username}/installation -func (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) { +func (s *AppsService) GetUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("users/%v/installation", user)) } func (s *AppsService) getInstallation(ctx context.Context, url string) (*Installation, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - i := new(Installation) - resp, err := s.client.Do(ctx, req, i) + var i *Installation + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/apps_hooks.go b/vendor/github.com/google/go-github/v88/github/apps_hooks.go similarity index 66% rename from vendor/github.com/google/go-github/v84/github/apps_hooks.go rename to vendor/github.com/google/go-github/v88/github/apps_hooks.go index 6046827ef..fb9e31134 100644 --- a/vendor/github.com/google/go-github/v84/github/apps_hooks.go +++ b/vendor/github.com/google/go-github/v88/github/apps_hooks.go @@ -12,17 +12,17 @@ import ( // GetHookConfig returns the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-app // //meta:operation GET /app/hook/config func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { - req, err := s.client.NewRequest("GET", "app/hook/config", nil) + req, err := s.client.NewRequest(ctx, "GET", "app/hook/config", nil) if err != nil { return nil, nil, err } - config := new(HookConfig) - resp, err := s.client.Do(ctx, req, &config) + var config *HookConfig + resp, err := s.client.Do(req, &config) if err != nil { return nil, resp, err } @@ -33,17 +33,17 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response // UpdateHookConfig updates the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-app // //meta:operation PATCH /app/hook/config func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { - req, err := s.client.NewRequest("PATCH", "app/hook/config", config) + req, err := s.client.NewRequest(ctx, "PATCH", "app/hook/config", config) if err != nil { return nil, nil, err } - c := new(HookConfig) - resp, err := s.client.Do(ctx, req, c) + var c *HookConfig + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v88/github/apps_hooks_deliveries.go similarity index 69% rename from vendor/github.com/google/go-github/v84/github/apps_hooks_deliveries.go rename to vendor/github.com/google/go-github/v88/github/apps_hooks_deliveries.go index 59800a0ae..e737bbae0 100644 --- a/vendor/github.com/google/go-github/v84/github/apps_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v88/github/apps_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists deliveries of an App webhook. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#list-deliveries-for-an-app-webhook // //meta:operation GET /app/hook/deliveries func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { @@ -21,13 +21,13 @@ func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOp return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } deliveries := []*HookDelivery{} - resp, err := s.client.Do(ctx, req, &deliveries) + resp, err := s.client.Do(req, &deliveries) if err != nil { return nil, resp, err } @@ -37,18 +37,18 @@ func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOp // GetHookDelivery returns the App webhook delivery with the specified ID. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#get-a-delivery-for-an-app-webhook // //meta:operation GET /app/hook/deliveries/{delivery_id} func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v", deliveryID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -58,18 +58,18 @@ func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*H // RedeliverHookDelivery redelivers a delivery for an App webhook. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks?apiVersion=2022-11-28#redeliver-a-delivery-for-an-app-webhook // //meta:operation POST /app/hook/deliveries/{delivery_id}/attempts func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v/attempts", deliveryID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/apps_installation.go b/vendor/github.com/google/go-github/v88/github/apps_installation.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/apps_installation.go rename to vendor/github.com/google/go-github/v88/github/apps_installation.go index 57d6b4e76..7fbcc260d 100644 --- a/vendor/github.com/google/go-github/v84/github/apps_installation.go +++ b/vendor/github.com/google/go-github/v88/github/apps_installation.go @@ -18,7 +18,7 @@ type ListRepositories struct { // ListRepos lists the repositories that are accessible to the authenticated installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-repositories-accessible-to-the-app-installation // //meta:operation GET /installation/repositories func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -27,14 +27,13 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var r *ListRepositories - - resp, err := s.client.Do(ctx, req, &r) + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -45,7 +44,7 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe // ListUserRepos lists repositories that are accessible // to the authenticated user for an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#list-repositories-accessible-to-the-user-access-token // //meta:operation GET /user/installations/{installation_id}/repositories func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -55,13 +54,13 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var r *ListRepositories - resp, err := s.client.Do(ctx, req, &r) + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -71,18 +70,18 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt // AddRepository adds a single repository to an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#add-a-repository-to-an-app-installation // //meta:operation PUT /user/installations/{installation_id}/repositories/{repository_id} func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, nil, err } - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -92,30 +91,30 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // RemoveRepository removes a single repository from an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#remove-a-repository-from-an-app-installation // //meta:operation DELETE /user/installations/{installation_id}/repositories/{repository_id} func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RevokeInstallationToken revokes an installation token. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations?apiVersion=2022-11-28#revoke-an-installation-access-token // //meta:operation DELETE /installation/token func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) { u := "installation/token" - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/apps_manifest.go b/vendor/github.com/google/go-github/v88/github/apps_manifest.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/apps_manifest.go rename to vendor/github.com/google/go-github/v88/github/apps_manifest.go index fdd8d7b1e..af6c9a5a5 100644 --- a/vendor/github.com/google/go-github/v84/github/apps_manifest.go +++ b/vendor/github.com/google/go-github/v88/github/apps_manifest.go @@ -31,18 +31,18 @@ type AppConfig struct { // CompleteAppManifest completes the App manifest handshake flow for the given // code. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest +// GitHub API docs: https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-a-github-app-from-a-manifest // //meta:operation POST /app-manifests/{code}/conversions func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) { u := fmt.Sprintf("app-manifests/%v/conversions", code) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - cfg := new(AppConfig) - resp, err := s.client.Do(ctx, req, cfg) + var cfg *AppConfig + resp, err := s.client.Do(req, &cfg) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/apps_marketplace.go b/vendor/github.com/google/go-github/v88/github/apps_marketplace.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v88/github/apps_marketplace.go index 33382378e..ed545df09 100644 --- a/vendor/github.com/google/go-github/v84/github/apps_marketplace.go +++ b/vendor/github.com/google/go-github/v88/github/apps_marketplace.go @@ -13,7 +13,7 @@ import ( // MarketplaceService handles communication with the marketplace related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/apps#marketplace +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28 type MarketplaceService struct { client *Client // Stubbed controls whether endpoints that return stubbed data are used @@ -21,7 +21,7 @@ type MarketplaceService struct { // for testing your GitHub Apps. Stubbed data is hard-coded and will not // change based on actual subscriptions. // - // GitHub API docs: https://docs.github.com/rest/apps#testing-with-stubbed-endpoints + // GitHub API docs: https://docs.github.com/rest/apps?apiVersion=2022-11-28#testing-with-stubbed-endpoints Stubbed bool } @@ -89,9 +89,9 @@ type MarketplacePurchaseAccount struct { // ListPlans lists all plans for your Marketplace listing. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-plans // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-plans-stubbed // //meta:operation GET /marketplace_listing/plans //meta:operation GET /marketplace_listing/stubbed/plans @@ -102,13 +102,13 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var plans []*MarketplacePlan - resp, err := s.client.Do(ctx, req, &plans) + resp, err := s.client.Do(req, &plans) if err != nil { return nil, resp, err } @@ -118,9 +118,9 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( // ListPlanAccountsForPlan lists all GitHub accounts (user or organization) on a specific plan. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-accounts-for-a-plan // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-accounts-for-a-plan-stubbed // //meta:operation GET /marketplace_listing/plans/{plan_id}/accounts //meta:operation GET /marketplace_listing/stubbed/plans/{plan_id}/accounts @@ -131,13 +131,13 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var accounts []*MarketplacePlanAccount - resp, err := s.client.Do(ctx, req, &accounts) + resp, err := s.client.Do(req, &accounts) if err != nil { return nil, resp, err } @@ -147,22 +147,22 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID // GetPlanAccountForAccount get GitHub account (user or organization) associated with an account. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#get-a-subscription-plan-for-an-account // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#get-a-subscription-plan-for-an-account-stubbed // //meta:operation GET /marketplace_listing/accounts/{account_id} //meta:operation GET /marketplace_listing/stubbed/accounts/{account_id} func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accountID int64) (*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("accounts/%v", accountID)) - req, err := s.client.NewRequest("GET", uri, nil) + req, err := s.client.NewRequest(ctx, "GET", uri, nil) if err != nil { return nil, nil, err } var account *MarketplacePlanAccount - resp, err := s.client.Do(ctx, req, &account) + resp, err := s.client.Do(req, &account) if err != nil { return nil, resp, err } @@ -172,9 +172,9 @@ func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accou // ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-subscriptions-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed +// GitHub API docs: https://docs.github.com/rest/apps/marketplace?apiVersion=2022-11-28#list-subscriptions-for-the-authenticated-user-stubbed // //meta:operation GET /user/marketplace_purchases //meta:operation GET /user/marketplace_purchases/stubbed @@ -189,13 +189,13 @@ func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var purchases []*MarketplacePurchase - resp, err := s.client.Do(ctx, req, &purchases) + resp, err := s.client.Do(req, &purchases) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/attestations.go b/vendor/github.com/google/go-github/v88/github/attestations.go similarity index 100% rename from vendor/github.com/google/go-github/v84/github/attestations.go rename to vendor/github.com/google/go-github/v88/github/attestations.go diff --git a/vendor/github.com/google/go-github/v84/github/authorizations.go b/vendor/github.com/google/go-github/v88/github/authorizations.go similarity index 90% rename from vendor/github.com/google/go-github/v84/github/authorizations.go rename to vendor/github.com/google/go-github/v88/github/authorizations.go index 24bbc4d3a..1511687aa 100644 --- a/vendor/github.com/google/go-github/v84/github/authorizations.go +++ b/vendor/github.com/google/go-github/v88/github/authorizations.go @@ -50,7 +50,7 @@ const ( // This service requires HTTP Basic Authentication; it cannot be accessed using // an OAuth token. // -// GitHub API docs: https://docs.github.com/rest/oauth-authorizations +// GitHub API docs: https://docs.github.com/rest/oauth-authorizations?apiVersion=2022-11-28 type AuthorizationsService service // Authorization represents an individual GitHub authorization. @@ -121,7 +121,7 @@ func (a AuthorizationRequest) String() string { // fields. That is, you may provide only one of "Scopes", or "AddScopes", or // "RemoveScopes". // -// GitHub API docs: https://docs.github.com/rest/oauth-authorizations#update-an-existing-authorization +// GitHub API docs: https://docs.github.com/rest/oauth-authorizations?apiVersion=2022-11-28#update-an-existing-authorization type AuthorizationUpdateRequest struct { Scopes []string `json:"scopes,omitempty"` AddScopes []string `json:"add_scopes,omitempty"` @@ -143,7 +143,7 @@ func (a AuthorizationUpdateRequest) String() string { // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#check-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#check-a-token // //meta:operation POST /applications/{client_id}/token func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { @@ -153,14 +153,14 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken AccessToken string `json:"access_token"` }{AccessToken: accessToken} - req, err := s.client.NewRequest("POST", u, reqBody) + req, err := s.client.NewRequest(ctx, "POST", u, reqBody) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeOAuthAppPreview) - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) + var a *Authorization + resp, err := s.client.Do(req, &a) if err != nil { return nil, resp, err } @@ -178,7 +178,7 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#reset-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#reset-a-token // //meta:operation PATCH /applications/{client_id}/token func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { @@ -188,14 +188,14 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken AccessToken string `json:"access_token"` }{AccessToken: accessToken} - req, err := s.client.NewRequest("PATCH", u, reqBody) + req, err := s.client.NewRequest(ctx, "PATCH", u, reqBody) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeOAuthAppPreview) - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) + var a *Authorization + resp, err := s.client.Do(req, &a) if err != nil { return nil, resp, err } @@ -209,7 +209,7 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken // username is the OAuth application clientID, and the password is its // clientSecret. Invalid tokens will return a 404 Not Found. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#delete-an-app-token // //meta:operation DELETE /applications/{client_id}/token func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) { @@ -219,20 +219,20 @@ func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToke AccessToken string `json:"access_token"` }{AccessToken: accessToken} - req, err := s.client.NewRequest("DELETE", u, reqBody) + req, err := s.client.NewRequest(ctx, "DELETE", u, reqBody) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeOAuthAppPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteGrant deletes an OAuth application grant. Deleting an application's // grant will also delete all OAuth tokens associated with the application for // the user. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications?apiVersion=2022-11-28#delete-an-app-authorization // //meta:operation DELETE /applications/{client_id}/grant func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) { @@ -242,13 +242,13 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces AccessToken string `json:"access_token"` }{AccessToken: accessToken} - req, err := s.client.NewRequest("DELETE", u, reqBody) + req, err := s.client.NewRequest(ctx, "DELETE", u, reqBody) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeOAuthAppPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CreateImpersonation creates an impersonation OAuth token. @@ -257,18 +257,18 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) - req, err := s.client.NewRequest("POST", u, authReq) + req, err := s.client.NewRequest(ctx, "POST", u, authReq) if err != nil { return nil, nil, err } - a := new(Authorization) - resp, err := s.client.Do(ctx, req, a) + var a *Authorization + resp, err := s.client.Do(req, &a) if err != nil { return nil, resp, err } @@ -279,15 +279,15 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/billing.go b/vendor/github.com/google/go-github/v88/github/billing.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/billing.go rename to vendor/github.com/google/go-github/v88/github/billing.go index 29cccbaab..9e9d812a0 100644 --- a/vendor/github.com/google/go-github/v84/github/billing.go +++ b/vendor/github.com/google/go-github/v88/github/billing.go @@ -13,7 +13,7 @@ import ( // BillingService provides access to the billing related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/billing +// GitHub API docs: https://docs.github.com/rest/billing?apiVersion=2022-11-28 type BillingService service // MinutesUsedBreakdown counts the actions minutes used by machine type (e.g. UBUNTU, WINDOWS, MACOS). @@ -177,13 +177,13 @@ type PremiumRequestUsageReport struct { // See https://github.com/google/go-github/issues/3894 for details. func (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org string) (*PackagesBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/packages", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - result := new(PackagesBilling) - resp, err := s.client.Do(ctx, req, result) + var result *PackagesBilling + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -198,13 +198,13 @@ func (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org // See https://github.com/google/go-github/issues/3894 for details. func (s *BillingService) GetOrganizationStorageBilling(ctx context.Context, org string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - result := new(StorageBilling) - resp, err := s.client.Do(ctx, req, result) + var result *StorageBilling + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -214,7 +214,7 @@ func (s *BillingService) GetOrganizationStorageBilling(ctx context.Context, org // GetOrganizationAdvancedSecurityActiveCommitters returns the GitHub Advanced Security active committers for an organization per repository. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing?apiVersion=2022-11-28#get-github-advanced-security-active-committers-for-an-organization // //meta:operation GET /orgs/{org}/settings/billing/advanced-security func (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx context.Context, org string, opts *ActiveCommittersListOptions) (*ActiveCommitters, *Response, error) { @@ -224,13 +224,13 @@ func (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx con return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - result := new(ActiveCommitters) - resp, err := s.client.Do(ctx, req, result) + var result *ActiveCommitters + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -244,13 +244,13 @@ func (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx con // See https://github.com/google/go-github/issues/3894 for details. func (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (*PackagesBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/packages", user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - packagesUserBilling := new(PackagesBilling) - resp, err := s.client.Do(ctx, req, packagesUserBilling) + var packagesUserBilling *PackagesBilling + resp, err := s.client.Do(req, &packagesUserBilling) if err != nil { return nil, resp, err } @@ -265,13 +265,13 @@ func (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (* // See https://github.com/google/go-github/issues/3894 for details. func (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - storageUserBilling := new(StorageBilling) - resp, err := s.client.Do(ctx, req, storageUserBilling) + var storageUserBilling *StorageBilling + resp, err := s.client.Do(req, &storageUserBilling) if err != nil { return nil, resp, err } @@ -283,7 +283,7 @@ func (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*S // // Note: This endpoint is only available to organizations with access to the enhanced billing platform. // -// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-usage-report-for-an-organization // //meta:operation GET /organizations/{org}/settings/billing/usage func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org string, opts *UsageReportOptions) (*UsageReport, *Response, error) { @@ -293,13 +293,13 @@ func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org str return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - usageReport := new(UsageReport) - resp, err := s.client.Do(ctx, req, usageReport) + var usageReport *UsageReport + resp, err := s.client.Do(req, &usageReport) if err != nil { return nil, resp, err } @@ -311,7 +311,7 @@ func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org str // // Note: This endpoint is only available to users with access to the enhanced billing platform. // -// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-usage-report-for-a-user // //meta:operation GET /users/{username}/settings/billing/usage func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts *UsageReportOptions) (*UsageReport, *Response, error) { @@ -321,13 +321,13 @@ func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts * return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - usageReport := new(UsageReport) - resp, err := s.client.Do(ctx, req, usageReport) + var usageReport *UsageReport + resp, err := s.client.Do(req, &usageReport) if err != nil { return nil, resp, err } @@ -340,7 +340,7 @@ func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts * // // Note: This endpoint is only available to organizations with access to the enhanced billing platform. // -// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-premium-request-usage-report-for-an-organization // //meta:operation GET /organizations/{org}/settings/billing/premium_request/usage func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Context, org string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) { @@ -350,13 +350,13 @@ func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Co return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - premiumRequestUsageReport := new(PremiumRequestUsageReport) - resp, err := s.client.Do(ctx, req, premiumRequestUsageReport) + var premiumRequestUsageReport *PremiumRequestUsageReport + resp, err := s.client.Do(req, &premiumRequestUsageReport) if err != nil { return nil, resp, err } @@ -369,7 +369,7 @@ func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Co // // Note: This endpoint is only available to users with access to the enhanced billing platform. // -// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/usage?apiVersion=2022-11-28#get-billing-premium-request-usage-report-for-a-user // //meta:operation GET /users/{username}/settings/billing/premium_request/usage func (s *BillingService) GetPremiumRequestUsageReport(ctx context.Context, user string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) { @@ -379,13 +379,13 @@ func (s *BillingService) GetPremiumRequestUsageReport(ctx context.Context, user return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - premiumRequestUsageReport := new(PremiumRequestUsageReport) - resp, err := s.client.Do(ctx, req, premiumRequestUsageReport) + var premiumRequestUsageReport *PremiumRequestUsageReport + resp, err := s.client.Do(req, &premiumRequestUsageReport) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/checks.go b/vendor/github.com/google/go-github/v88/github/checks.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/checks.go rename to vendor/github.com/google/go-github/v88/github/checks.go index d39cfa536..aef9d8033 100644 --- a/vendor/github.com/google/go-github/v84/github/checks.go +++ b/vendor/github.com/google/go-github/v88/github/checks.go @@ -13,7 +13,7 @@ import ( // ChecksService provides access to the Checks API in the // GitHub API. // -// GitHub API docs: https://docs.github.com/rest/checks/ +// GitHub API docs: https://docs.github.com/rest/checks?apiVersion=2022-11-28 type ChecksService service // CheckRun represents a GitHub check run on a repository associated with a GitHub app. @@ -101,20 +101,20 @@ func (c CheckSuite) String() string { // GetCheckRun gets a check-run for a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#get-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#get-a-check-run // //meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id} func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkRun := new(CheckRun) - resp, err := s.client.Do(ctx, req, checkRun) + var checkRun *CheckRun + resp, err := s.client.Do(req, &checkRun) if err != nil { return nil, resp, err } @@ -124,20 +124,20 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che // GetCheckSuite gets a single check suite. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#get-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#get-a-check-suite // //meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id} func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v", owner, repo, checkSuiteID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkSuite := new(CheckSuite) - resp, err := s.client.Do(ctx, req, checkSuite) + var checkSuite *CheckSuite + resp, err := s.client.Do(req, &checkSuite) if err != nil { return nil, resp, err } @@ -168,20 +168,20 @@ type CheckRunAction struct { // CreateCheckRun creates a check run for repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#create-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run // //meta:operation POST /repos/{owner}/{repo}/check-runs func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs", owner, repo) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkRun := new(CheckRun) - resp, err := s.client.Do(ctx, req, checkRun) + var checkRun *CheckRun + resp, err := s.client.Do(req, &checkRun) if err != nil { return nil, resp, err } @@ -203,20 +203,20 @@ type UpdateCheckRunOptions struct { // UpdateCheckRun updates a check run for a specific commit in a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#update-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#update-a-check-run // //meta:operation PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkRun := new(CheckRun) - resp, err := s.client.Do(ctx, req, checkRun) + var checkRun *CheckRun + resp, err := s.client.Do(req, &checkRun) if err != nil { return nil, resp, err } @@ -226,7 +226,7 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, // ListCheckRunAnnotations lists the annotations for a check run. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-run-annotations +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-run-annotations // //meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) { @@ -236,7 +236,7 @@ func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -244,7 +244,7 @@ func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo req.Header.Set("Accept", mediaTypeCheckRunsPreview) var checkRunAnnotations []*CheckRunAnnotation - resp, err := s.client.Do(ctx, req, &checkRunAnnotations) + resp, err := s.client.Do(req, &checkRunAnnotations) if err != nil { return nil, resp, err } @@ -272,7 +272,7 @@ type ListCheckRunsResults struct { // The ref can be a commit SHA, branch name `heads/`, or tag name `tags/`. // For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-runs-for-a-git-reference // //meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-runs func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { @@ -282,7 +282,7 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -290,7 +290,7 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re req.Header.Set("Accept", mediaTypeCheckRunsPreview) var checkRunResults *ListCheckRunsResults - resp, err := s.client.Do(ctx, req, &checkRunResults) + resp, err := s.client.Do(req, &checkRunResults) if err != nil { return nil, resp, err } @@ -300,7 +300,7 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re // ListCheckRunsCheckSuite lists check runs for a check suite. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#list-check-runs-in-a-check-suite // //meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { @@ -310,7 +310,7 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -318,7 +318,7 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo req.Header.Set("Accept", mediaTypeCheckRunsPreview) var checkRunResults *ListCheckRunsResults - resp, err := s.client.Do(ctx, req, &checkRunResults) + resp, err := s.client.Do(req, &checkRunResults) if err != nil { return nil, resp, err } @@ -328,20 +328,20 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo // ReRequestCheckRun triggers GitHub to rerequest an existing check run. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#rerequest-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs?apiVersion=2022-11-28#rerequest-a-check-run // //meta:operation POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/rerequest", owner, repo, checkRunID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeCheckRunsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListCheckSuiteOptions represents parameters to list check suites. @@ -362,7 +362,7 @@ type ListCheckSuiteResults struct { // The ref can be a commit SHA, branch name `heads/`, or tag name `tags/`. // For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#list-check-suites-for-a-git-reference // //meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-suites func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { @@ -372,7 +372,7 @@ func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -380,7 +380,7 @@ func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, req.Header.Set("Accept", mediaTypeCheckRunsPreview) var checkSuiteResults *ListCheckSuiteResults - resp, err := s.client.Do(ctx, req, &checkSuiteResults) + resp, err := s.client.Do(req, &checkSuiteResults) if err != nil { return nil, resp, err } @@ -412,12 +412,12 @@ type PreferenceList struct { // SetCheckSuitePreferences changes the default automatic flow when creating check suites. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#update-repository-preferences-for-check-suites // //meta:operation PATCH /repos/{owner}/{repo}/check-suites/preferences func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/preferences", owner, repo) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } @@ -425,7 +425,7 @@ func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, rep req.Header.Set("Accept", mediaTypeCheckRunsPreview) var checkSuitePrefResults *CheckSuitePreferenceResults - resp, err := s.client.Do(ctx, req, &checkSuitePrefResults) + resp, err := s.client.Do(req, &checkSuitePrefResults) if err != nil { return nil, resp, err } @@ -433,7 +433,7 @@ func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, rep return checkSuitePrefResults, resp, nil } -// CreateCheckSuiteOptions sets up parameters to manually create a check suites. +// CreateCheckSuiteOptions sets up parameters to manually create a check suite. type CreateCheckSuiteOptions struct { HeadSHA string `json:"head_sha"` // The sha of the head commit. (Required.) HeadBranch *string `json:"head_branch,omitempty"` // The name of the head branch where the code changes are implemented. @@ -441,20 +441,20 @@ type CreateCheckSuiteOptions struct { // CreateCheckSuite manually creates a check suite for a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#create-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#create-a-check-suite // //meta:operation POST /repos/{owner}/{repo}/check-suites func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites", owner, repo) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeCheckRunsPreview) - checkSuite := new(CheckSuite) - resp, err := s.client.Do(ctx, req, checkSuite) + var checkSuite *CheckSuite + resp, err := s.client.Do(req, &checkSuite) if err != nil { return nil, resp, err } @@ -464,19 +464,19 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string // ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites?apiVersion=2022-11-28#rerequest-a-check-suite // //meta:operation POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/rerequest", owner, repo, checkSuiteID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeCheckRunsPreview) - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/classroom.go b/vendor/github.com/google/go-github/v88/github/classroom.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/classroom.go rename to vendor/github.com/google/go-github/v88/github/classroom.go index 47124dd4a..ddc9372ab 100644 --- a/vendor/github.com/google/go-github/v84/github/classroom.go +++ b/vendor/github.com/google/go-github/v88/github/classroom.go @@ -13,7 +13,7 @@ import ( // ClassroomService handles communication with the GitHub Classroom related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28 type ClassroomService service // ClassroomUser represents a GitHub user simplified for Classroom. @@ -107,19 +107,19 @@ func (g AssignmentGrade) String() string { // returned if the current user is an administrator of the GitHub Classroom // for the assignment. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-an-assignment +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-an-assignment // //meta:operation GET /assignments/{assignment_id} func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64) (*ClassroomAssignment, *Response, error) { u := fmt.Sprintf("assignments/%v", assignmentID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - assignment := new(ClassroomAssignment) - resp, err := s.client.Do(ctx, req, assignment) + var assignment *ClassroomAssignment + resp, err := s.client.Do(req, &assignment) if err != nil { return nil, resp, err } @@ -130,19 +130,19 @@ func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64 // GetClassroom gets a GitHub Classroom for the current user. Classroom will only be // returned if the current user is an administrator of the GitHub Classroom. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-a-classroom +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-a-classroom // //meta:operation GET /classrooms/{classroom_id} func (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) (*Classroom, *Response, error) { u := fmt.Sprintf("classrooms/%v", classroomID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - classroom := new(Classroom) - resp, err := s.client.Do(ctx, req, classroom) + var classroom *Classroom + resp, err := s.client.Do(req, &classroom) if err != nil { return nil, resp, err } @@ -153,7 +153,7 @@ func (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) // ListClassrooms lists GitHub Classrooms for the current user. Classrooms will only be // returned if the current user is an administrator of one or more GitHub Classrooms. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-classrooms +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-classrooms // //meta:operation GET /classrooms func (s *ClassroomService) ListClassrooms(ctx context.Context, opts *ListOptions) ([]*Classroom, *Response, error) { @@ -162,13 +162,13 @@ func (s *ClassroomService) ListClassrooms(ctx context.Context, opts *ListOptions return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var classrooms []*Classroom - resp, err := s.client.Do(ctx, req, &classrooms) + resp, err := s.client.Do(req, &classrooms) if err != nil { return nil, resp, err } @@ -179,7 +179,7 @@ func (s *ClassroomService) ListClassrooms(ctx context.Context, opts *ListOptions // ListClassroomAssignments lists GitHub Classroom assignments for a classroom. Assignments will only be // returned if the current user is an administrator of the GitHub Classroom. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-assignments-for-a-classroom +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-assignments-for-a-classroom // //meta:operation GET /classrooms/{classroom_id}/assignments func (s *ClassroomService) ListClassroomAssignments(ctx context.Context, classroomID int64, opts *ListOptions) ([]*ClassroomAssignment, *Response, error) { @@ -189,13 +189,13 @@ func (s *ClassroomService) ListClassroomAssignments(ctx context.Context, classro return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var assignments []*ClassroomAssignment - resp, err := s.client.Do(ctx, req, &assignments) + resp, err := s.client.Do(req, &assignments) if err != nil { return nil, resp, err } @@ -207,7 +207,7 @@ func (s *ClassroomService) ListClassroomAssignments(ctx context.Context, classro // Accepted assignments will only be returned if the current user is an administrator // of the GitHub Classroom for the assignment. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-accepted-assignments-for-an-assignment +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-accepted-assignments-for-an-assignment // //meta:operation GET /assignments/{assignment_id}/accepted_assignments func (s *ClassroomService) ListAcceptedAssignments(ctx context.Context, assignmentID int64, opts *ListOptions) ([]*AcceptedAssignment, *Response, error) { @@ -217,13 +217,13 @@ func (s *ClassroomService) ListAcceptedAssignments(ctx context.Context, assignme return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var acceptedAssignments []*AcceptedAssignment - resp, err := s.client.Do(ctx, req, &acceptedAssignments) + resp, err := s.client.Do(req, &acceptedAssignments) if err != nil { return nil, resp, err } @@ -235,19 +235,19 @@ func (s *ClassroomService) ListAcceptedAssignments(ctx context.Context, assignme // Grades will only be returned if the current user is an administrator // of the GitHub Classroom for the assignment. // -// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-assignment-grades +// GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#get-assignment-grades // //meta:operation GET /assignments/{assignment_id}/grades func (s *ClassroomService) GetAssignmentGrades(ctx context.Context, assignmentID int64) ([]*AssignmentGrade, *Response, error) { u := fmt.Sprintf("assignments/%v/grades", assignmentID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var grades []*AssignmentGrade - resp, err := s.client.Do(ctx, req, &grades) + resp, err := s.client.Do(req, &grades) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/code_scanning.go b/vendor/github.com/google/go-github/v88/github/code_scanning.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/code_scanning.go rename to vendor/github.com/google/go-github/v88/github/code_scanning.go index 982efc459..3aeaa8b70 100644 --- a/vendor/github.com/google/go-github/v84/github/code_scanning.go +++ b/vendor/github.com/google/go-github/v88/github/code_scanning.go @@ -17,7 +17,7 @@ import ( // CodeScanningService handles communication with the code scanning related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type CodeScanningService service // Rule represents the complete details of GitHub Code Scanning alert type. @@ -69,7 +69,7 @@ type Tool struct { // Alert represents an individual GitHub Code Scanning Alert on a single repository. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type Alert struct { Number *int `json:"number,omitempty"` Repository *Repository `json:"repository,omitempty"` @@ -171,7 +171,7 @@ type AnalysesListOptions struct { // CodeQLDatabase represents a metadata about the CodeQL database. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type CodeQLDatabase struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -186,7 +186,7 @@ type CodeQLDatabase struct { // ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type ScanningAnalysis struct { ID *int64 `json:"id,omitempty"` Ref *string `json:"ref,omitempty"` @@ -207,7 +207,7 @@ type ScanningAnalysis struct { // SarifAnalysis specifies the results of a code scanning job. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type SarifAnalysis struct { CommitSHA *string `json:"commit_sha,omitempty"` Ref *string `json:"ref,omitempty"` @@ -219,7 +219,7 @@ type SarifAnalysis struct { // CodeScanningAlertState specifies the state of a code scanning alert. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type CodeScanningAlertState struct { // State sets the state of the code scanning alert and is a required field. // You must also provide DismissedReason when you set the state to "dismissed". @@ -235,7 +235,7 @@ type CodeScanningAlertState struct { // SarifID identifies a sarif analysis upload. // -// GitHub API docs: https://docs.github.com/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28 type SarifID struct { ID *string `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -246,7 +246,7 @@ type SarifID struct { // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-alerts-for-an-organization // //meta:operation GET /orgs/{org}/code-scanning/alerts func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) { @@ -256,13 +256,13 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var alerts []*Alert - resp, err := s.client.Do(ctx, req, &alerts) + resp, err := s.client.Do(req, &alerts) if err != nil { return nil, resp, err } @@ -276,7 +276,7 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-alerts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { @@ -286,13 +286,13 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var alerts []*Alert - resp, err := s.client.Do(ctx, req, &alerts) + resp, err := s.client.Do(req, &alerts) if err != nil { return nil, resp, err } @@ -307,19 +307,19 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-alert // //meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - a := new(Alert) - resp, err := s.client.Do(ctx, req, a) + var a *Alert + resp, err := s.client.Do(req, &a) if err != nil { return nil, resp, err } @@ -334,19 +334,19 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-alert // //meta:operation PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) - req, err := s.client.NewRequest("PATCH", u, stateInfo) + req, err := s.client.NewRequest(ctx, "PATCH", u, stateInfo) if err != nil { return nil, nil, err } - a := new(Alert) - resp, err := s.client.Do(ctx, req, a) + var a *Alert + resp, err := s.client.Do(req, &a) if err != nil { return nil, resp, err } @@ -359,7 +359,7 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-instances-of-a-code-scanning-alert // //meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) { @@ -369,13 +369,13 @@ func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, rep return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var alertInstances []*MostRecentInstance - resp, err := s.client.Do(ctx, req, &alertInstances) + resp, err := s.client.Do(req, &alertInstances) if err != nil { return nil, resp, err } @@ -389,19 +389,19 @@ func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, rep // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#upload-an-analysis-as-sarif-data // //meta:operation POST /repos/{owner}/{repo}/code-scanning/sarifs func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) - req, err := s.client.NewRequest("POST", u, sarif) + req, err := s.client.NewRequest(ctx, "POST", u, sarif) if err != nil { return nil, nil, err } // This will always return an error without unmarshaling the data - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) // Even though there was an error, we still return the response // in case the caller wants to inspect it further. // However, if the error is AcceptedError, decode it below before @@ -410,8 +410,8 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin if !errors.As(err, &acceptedError) { return nil, resp, err } - sarifID := new(SarifID) - decErr := json.Unmarshal(acceptedError.Raw, sarifID) + var sarifID *SarifID + decErr := json.Unmarshal(acceptedError.Raw, &sarifID) if decErr != nil { return nil, resp, decErr } @@ -433,19 +433,19 @@ type SARIFUpload struct { // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-information-about-a-sarif-upload // //meta:operation GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs/%v", owner, repo, sarifID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - sarifUpload := new(SARIFUpload) - resp, err := s.client.Do(ctx, req, sarifUpload) + var sarifUpload *SARIFUpload + resp, err := s.client.Do(req, &sarifUpload) if err != nil { return nil, resp, err } @@ -459,7 +459,7 @@ func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-code-scanning-analyses-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { @@ -469,13 +469,13 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var analyses []*ScanningAnalysis - resp, err := s.client.Do(ctx, req, &analyses) + resp, err := s.client.Do(req, &analyses) if err != nil { return nil, resp, err } @@ -490,19 +490,19 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-analysis-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - analysis := new(ScanningAnalysis) - resp, err := s.client.Do(ctx, req, analysis) + var analysis *ScanningAnalysis + resp, err := s.client.Do(req, &analysis) if err != nil { return nil, resp, err } @@ -525,19 +525,19 @@ type DeleteAnalysis struct { // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#delete-a-code-scanning-analysis-from-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, nil, err } - deleteAnalysis := new(DeleteAnalysis) - resp, err := s.client.Do(ctx, req, deleteAnalysis) + var deleteAnalysis *DeleteAnalysis + resp, err := s.client.Do(req, &deleteAnalysis) if err != nil { return nil, resp, err } @@ -550,19 +550,19 @@ func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo st // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#list-codeql-databases-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var codeqlDatabases []*CodeQLDatabase - resp, err := s.client.Do(ctx, req, &codeqlDatabases) + resp, err := s.client.Do(req, &codeqlDatabases) if err != nil { return nil, resp, err } @@ -575,19 +575,19 @@ func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, re // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-codeql-database-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases/%v", owner, repo, language) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - codeqlDatabase := new(CodeQLDatabase) - resp, err := s.client.Do(ctx, req, codeqlDatabase) + var codeqlDatabase *CodeQLDatabase + resp, err := s.client.Do(req, &codeqlDatabase) if err != nil { return nil, resp, err } @@ -609,19 +609,19 @@ type DefaultSetupConfiguration struct { // endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write // permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-default-setup-configuration // //meta:operation GET /repos/{owner}/{repo}/code-scanning/default-setup func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/default-setup", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - cfg := new(DefaultSetupConfiguration) - resp, err := s.client.Do(ctx, req, cfg) + var cfg *DefaultSetupConfiguration + resp, err := s.client.Do(req, &cfg) if err != nil { return nil, resp, err } @@ -652,19 +652,19 @@ type UpdateDefaultSetupConfigurationResponse struct { // This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub // returns to signify that it has now scheduled the update of the pull request branch in a background task. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-default-setup-configuration // //meta:operation PATCH /repos/{owner}/{repo}/code-scanning/default-setup func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/default-setup", owner, repo) - req, err := s.client.NewRequest("PATCH", u, options) + req, err := s.client.NewRequest(ctx, "PATCH", u, options) if err != nil { return nil, nil, err } - a := new(UpdateDefaultSetupConfigurationResponse) - resp, err := s.client.Do(ctx, req, a) + var a *UpdateDefaultSetupConfigurationResponse + resp, err := s.client.Do(req, &a) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/codesofconduct.go b/vendor/github.com/google/go-github/v88/github/codesofconduct.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/codesofconduct.go rename to vendor/github.com/google/go-github/v88/github/codesofconduct.go index a514aac6b..882e732c3 100644 --- a/vendor/github.com/google/go-github/v84/github/codesofconduct.go +++ b/vendor/github.com/google/go-github/v88/github/codesofconduct.go @@ -27,11 +27,11 @@ func (c *CodeOfConduct) String() string { // List returns all codes of conduct. // -// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct?apiVersion=2022-11-28#get-all-codes-of-conduct // //meta:operation GET /codes_of_conduct func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Response, error) { - req, err := s.client.NewRequest("GET", "codes_of_conduct", nil) + req, err := s.client.NewRequest(ctx, "GET", "codes_of_conduct", nil) if err != nil { return nil, nil, err } @@ -39,7 +39,7 @@ func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Re req.Header.Set("Accept", mediaTypeCodesOfConductPreview) var cs []*CodeOfConduct - resp, err := s.client.Do(ctx, req, &cs) + resp, err := s.client.Do(req, &cs) if err != nil { return nil, resp, err } @@ -56,20 +56,20 @@ func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Res // Get returns an individual code of conduct. // -// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct?apiVersion=2022-11-28#get-a-code-of-conduct // //meta:operation GET /codes_of_conduct/{key} func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("codes_of_conduct/%v", key) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeCodesOfConductPreview) - coc := new(CodeOfConduct) - resp, err := s.client.Do(ctx, req, coc) + var coc *CodeOfConduct + resp, err := s.client.Do(req, &coc) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/codespaces.go b/vendor/github.com/google/go-github/v88/github/codespaces.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/codespaces.go rename to vendor/github.com/google/go-github/v88/github/codespaces.go index bc8d617f3..8a8ad888d 100644 --- a/vendor/github.com/google/go-github/v84/github/codespaces.go +++ b/vendor/github.com/google/go-github/v88/github/codespaces.go @@ -13,12 +13,12 @@ import ( // CodespacesService handles communication with the Codespaces related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/codespaces/ +// GitHub API docs: https://docs.github.com/rest/codespaces?apiVersion=2022-11-28 type CodespacesService service // Codespace represents a codespace. // -// GitHub API docs: https://docs.github.com/rest/codespaces +// GitHub API docs: https://docs.github.com/rest/codespaces?apiVersion=2022-11-28 type Codespace struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -90,7 +90,7 @@ type ListCodespaces struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-in-a-repository-for-the-authenticated-user // //meta:operation GET /repos/{owner}/{repo}/codespaces func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error) { @@ -100,13 +100,13 @@ func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var codespaces *ListCodespaces - resp, err := s.client.Do(ctx, req, &codespaces) + resp, err := s.client.Do(req, &codespaces) if err != nil { return nil, resp, err } @@ -126,7 +126,7 @@ type ListCodespacesOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user // //meta:operation GET /user/codespaces func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { @@ -136,13 +136,13 @@ func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOption return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var codespaces *ListCodespaces - resp, err := s.client.Do(ctx, req, &codespaces) + resp, err := s.client.Do(req, &codespaces) if err != nil { return nil, resp, err } @@ -270,18 +270,18 @@ type CodespacePermissions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository +// 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, request *CreateCodespaceOptions) (*Codespace, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } var codespace *Codespace - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -294,18 +294,18 @@ func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#start-a-codespace-for-the-authenticated-user // //meta:operation POST /user/codespaces/{codespace_name}/start func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/start", codespaceName) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } var codespace *Codespace - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -318,18 +318,18 @@ func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*C // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#stop-a-codespace-for-the-authenticated-user // //meta:operation POST /user/codespaces/{codespace_name}/stop func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/stop", codespaceName) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } var codespace *Codespace - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -342,22 +342,22 @@ func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Co // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#delete-a-codespace-for-the-authenticated-user // //meta:operation DELETE /user/codespaces/{codespace_name} func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error) { u := fmt.Sprintf("user/codespaces/%v", codespaceName) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListDevContainerConfigurations lists devcontainer configurations in a repository for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user // //meta:operation GET /repos/{owner}/{repo}/codespaces/devcontainers func (s *CodespacesService) ListDevContainerConfigurations(ctx context.Context, owner, repo string, opts *ListOptions) (*DevContainerConfigurations, *Response, error) { @@ -367,13 +367,13 @@ func (s *CodespacesService) ListDevContainerConfigurations(ctx context.Context, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var devcontainers *DevContainerConfigurations - resp, err := s.client.Do(ctx, req, &devcontainers) + resp, err := s.client.Do(req, &devcontainers) if err != nil { return nil, resp, err } @@ -383,7 +383,7 @@ func (s *CodespacesService) ListDevContainerConfigurations(ctx context.Context, // GetDefaultAttributes gets the default attributes for codespaces created by the user with the repository. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-default-attributes-for-a-codespace // //meta:operation GET /repos/{owner}/{repo}/codespaces/new func (s *CodespacesService) GetDefaultAttributes(ctx context.Context, owner, repo string, opts *CodespaceGetDefaultAttributesOptions) (*CodespaceDefaultAttributes, *Response, error) { @@ -393,13 +393,13 @@ func (s *CodespacesService) GetDefaultAttributes(ctx context.Context, owner, rep return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var attributes *CodespaceDefaultAttributes - resp, err := s.client.Do(ctx, req, &attributes) + resp, err := s.client.Do(req, &attributes) if err != nil { return nil, resp, err } @@ -409,7 +409,7 @@ func (s *CodespacesService) GetDefaultAttributes(ctx context.Context, owner, rep // CheckPermissions checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user // //meta:operation GET /repos/{owner}/{repo}/codespaces/permissions_check func (s *CodespacesService) CheckPermissions(ctx context.Context, owner, repo, ref, devcontainerPath string) (*CodespacePermissions, *Response, error) { @@ -425,13 +425,13 @@ func (s *CodespacesService) CheckPermissions(ctx context.Context, owner, repo, r return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var permissions *CodespacePermissions - resp, err := s.client.Do(ctx, req, &permissions) + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -441,18 +441,18 @@ func (s *CodespacesService) CheckPermissions(ctx context.Context, owner, repo, r // CreateFromPullRequest creates a codespace owned by the authenticated user for the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request +// 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, request *CreateCodespaceOptions) (*Codespace, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/codespaces", owner, repo, pullNumber) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } var codespace *Codespace - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -464,18 +464,18 @@ func (s *CodespacesService) CreateFromPullRequest(ctx context.Context, owner, re // // This method requires either RepositoryId OR a PullRequest but not both. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user +// 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, opts *CodespaceCreateForUserOptions) (*Codespace, *Response, error) { u := "user/codespaces" - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } var codespace *Codespace - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -485,18 +485,18 @@ func (s *CodespacesService) Create(ctx context.Context, opts *CodespaceCreateFor // Get gets information about a user's codespace. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-a-codespace-for-the-authenticated-user // //meta:operation GET /user/codespaces/{codespace_name} func (s *CodespacesService) Get(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v", codespaceName) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var codespace *Codespace - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -508,18 +508,18 @@ func (s *CodespacesService) Get(ctx context.Context, codespaceName string) (*Cod // // Only the codespace's machine type and recent folders can be modified using this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user +// 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, opts *UpdateCodespaceOptions) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v", codespaceName) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } var codespace *Codespace - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -529,18 +529,18 @@ func (s *CodespacesService) Update(ctx context.Context, codespaceName string, op // ExportCodespace triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#export-a-codespace-for-the-authenticated-user // //meta:operation POST /user/codespaces/{codespace_name}/exports func (s *CodespacesService) ExportCodespace(ctx context.Context, codespaceName string) (*CodespaceExport, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/exports", codespaceName) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } var codespace *CodespaceExport - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -550,18 +550,18 @@ func (s *CodespacesService) ExportCodespace(ctx context.Context, codespaceName s // GetLatestCodespaceExport gets information about an export of a codespace. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-details-about-a-codespace-export +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?apiVersion=2022-11-28#get-details-about-a-codespace-export // //meta:operation GET /user/codespaces/{codespace_name}/exports/{export_id} func (s *CodespacesService) GetLatestCodespaceExport(ctx context.Context, codespaceName string) (*CodespaceExport, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/exports/latest", codespaceName) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var codespace *CodespaceExport - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } @@ -571,18 +571,18 @@ func (s *CodespacesService) GetLatestCodespaceExport(ctx context.Context, codesp // Publish publishes an unpublished codespace, creating a new repository and assigning it to the codespace. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace +// 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, opts *PublishCodespaceOptions) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/publish", codespaceName) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } var codespace *Codespace - resp, err := s.client.Do(ctx, req, &codespace) + resp, err := s.client.Do(req, &codespace) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/codespaces_machines.go b/vendor/github.com/google/go-github/v88/github/codespaces_machines.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/codespaces_machines.go rename to vendor/github.com/google/go-github/v88/github/codespaces_machines.go index 5277b1f40..155beadd7 100644 --- a/vendor/github.com/google/go-github/v84/github/codespaces_machines.go +++ b/vendor/github.com/google/go-github/v88/github/codespaces_machines.go @@ -28,7 +28,7 @@ type ListRepoMachineTypesOptions struct { // ListRepositoryMachineTypes lists the machine types available for a given repository based on its configuration. // -// GitHub API docs: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository +// GitHub API docs: https://docs.github.com/rest/codespaces/machines?apiVersion=2022-11-28#list-available-machine-types-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/codespaces/machines func (s *CodespacesService) ListRepositoryMachineTypes(ctx context.Context, owner, repo string, opts *ListRepoMachineTypesOptions) (*CodespacesMachines, *Response, error) { @@ -38,13 +38,13 @@ func (s *CodespacesService) ListRepositoryMachineTypes(ctx context.Context, owne return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var machines *CodespacesMachines - resp, err := s.client.Do(ctx, req, &machines) + resp, err := s.client.Do(req, &machines) if err != nil { return nil, resp, err } @@ -54,18 +54,18 @@ func (s *CodespacesService) ListRepositoryMachineTypes(ctx context.Context, owne // ListCodespaceMachineTypes lists the machine types a codespace can transition to use. // -// GitHub API docs: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace +// GitHub API docs: https://docs.github.com/rest/codespaces/machines?apiVersion=2022-11-28#list-machine-types-for-a-codespace // //meta:operation GET /user/codespaces/{codespace_name}/machines func (s *CodespacesService) ListCodespaceMachineTypes(ctx context.Context, codespaceName string) (*CodespacesMachines, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/machines", codespaceName) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var machines *CodespacesMachines - resp, err := s.client.Do(ctx, req, &machines) + resp, err := s.client.Do(req, &machines) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/codespaces_orgs.go b/vendor/github.com/google/go-github/v88/github/codespaces_orgs.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/codespaces_orgs.go rename to vendor/github.com/google/go-github/v88/github/codespaces_orgs.go index 3aeb05f86..4bd28747e 100644 --- a/vendor/github.com/google/go-github/v84/github/codespaces_orgs.go +++ b/vendor/github.com/google/go-github/v88/github/codespaces_orgs.go @@ -22,7 +22,7 @@ type CodespacesOrgAccessControlRequest struct { // ListInOrg lists the codespaces associated to a specified organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#list-codespaces-for-the-organization // //meta:operation GET /orgs/{org}/codespaces func (s *CodespacesService) ListInOrg(ctx context.Context, org string, opts *ListOptions) (*ListCodespaces, *Response, error) { @@ -32,13 +32,13 @@ func (s *CodespacesService) ListInOrg(ctx context.Context, org string, opts *Lis return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var codespaces *ListCodespaces - resp, err := s.client.Do(ctx, req, &codespaces) + resp, err := s.client.Do(req, &codespaces) if err != nil { return nil, resp, err } @@ -48,17 +48,17 @@ func (s *CodespacesService) ListInOrg(ctx context.Context, org string, opts *Lis // SetOrgAccessControl sets which users can access codespaces in an organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#manage-access-control-for-organization-codespaces // //meta:operation PUT /orgs/{org}/codespaces/access func (s *CodespacesService) SetOrgAccessControl(ctx context.Context, org string, request CodespacesOrgAccessControlRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/access", org) - req, err := s.client.NewRequest("PUT", u, request) + req, err := s.client.NewRequest(ctx, "PUT", u, request) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -68,17 +68,17 @@ func (s *CodespacesService) SetOrgAccessControl(ctx context.Context, org string, // AddUsersToOrgAccess adds users to Codespaces access for an organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#add-users-to-codespaces-access-for-an-organization // //meta:operation POST /orgs/{org}/codespaces/access/selected_users func (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/access/selected_users", org) - req, err := s.client.NewRequest("POST", u, map[string][]string{"selected_usernames": usernames}) + req, err := s.client.NewRequest(ctx, "POST", u, map[string][]string{"selected_usernames": usernames}) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -88,17 +88,17 @@ func (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string, // RemoveUsersFromOrgAccess removes users from Codespaces access for an organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#remove-users-from-codespaces-access-for-an-organization // //meta:operation DELETE /orgs/{org}/codespaces/access/selected_users func (s *CodespacesService) RemoveUsersFromOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/access/selected_users", org) - req, err := s.client.NewRequest("DELETE", u, map[string][]string{"selected_usernames": usernames}) + req, err := s.client.NewRequest(ctx, "DELETE", u, map[string][]string{"selected_usernames": usernames}) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -108,7 +108,7 @@ func (s *CodespacesService) RemoveUsersFromOrgAccess(ctx context.Context, org st // ListUserCodespacesInOrg lists the codespaces that a member of an organization has for repositories in that organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#list-codespaces-for-a-user-in-organization // //meta:operation GET /orgs/{org}/members/{username}/codespaces func (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, username string, opts *ListOptions) (*ListCodespaces, *Response, error) { @@ -118,13 +118,13 @@ func (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, us return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var codespaces *ListCodespaces - resp, err := s.client.Do(ctx, req, &codespaces) + resp, err := s.client.Do(req, &codespaces) if err != nil { return nil, resp, err } @@ -134,17 +134,17 @@ func (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, us // DeleteUserCodespaceInOrg deletes a user's codespace from the organization. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#delete-a-codespace-from-the-organization // //meta:operation DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name} func (s *CodespacesService) DeleteUserCodespaceInOrg(ctx context.Context, org, username, codespaceName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/members/%v/codespaces/%v", org, username, codespaceName) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -154,17 +154,17 @@ func (s *CodespacesService) DeleteUserCodespaceInOrg(ctx context.Context, org, u // StopUserCodespaceInOrg stops a codespace for an organization user. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user +// GitHub API docs: https://docs.github.com/rest/codespaces/organizations?apiVersion=2022-11-28#stop-a-codespace-for-an-organization-user // //meta:operation POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop func (s *CodespacesService) StopUserCodespaceInOrg(ctx context.Context, org, username, codespaceName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/members/%v/codespaces/%v/stop", org, username, codespaceName) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/codespaces_secrets.go b/vendor/github.com/google/go-github/v88/github/codespaces_secrets.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/codespaces_secrets.go rename to vendor/github.com/google/go-github/v88/github/codespaces_secrets.go index ba4b9abd9..5ac7848c7 100644 --- a/vendor/github.com/google/go-github/v84/github/codespaces_secrets.go +++ b/vendor/github.com/google/go-github/v88/github/codespaces_secrets.go @@ -17,7 +17,7 @@ import ( // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#list-secrets-for-the-authenticated-user // //meta:operation GET /user/codespaces/secrets func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error) { @@ -32,7 +32,7 @@ func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptio // // Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets // //meta:operation GET /orgs/{org}/codespaces/secrets func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { @@ -48,7 +48,7 @@ func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts // // Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets // //meta:operation GET /repos/{owner}/{repo}/codespaces/secrets func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { @@ -61,13 +61,13 @@ func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo str } func (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secrets, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } var secrets *Secrets - resp, err := s.client.Do(ctx, req, &secrets) + resp, err := s.client.Do(req, &secrets) if err != nil { return nil, resp, err } @@ -81,7 +81,7 @@ func (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secre // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#get-public-key-for-the-authenticated-user // //meta:operation GET /user/codespaces/secrets/public-key func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error) { @@ -92,7 +92,7 @@ func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, * // // Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key // //meta:operation GET /orgs/{org}/codespaces/secrets/public-key func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { @@ -103,7 +103,7 @@ func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*P // // Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-public-key // //meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/public-key func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { @@ -111,13 +111,13 @@ func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo st } func (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } var publicKey *PublicKey - resp, err := s.client.Do(ctx, req, &publicKey) + resp, err := s.client.Do(req, &publicKey) if err != nil { return nil, resp, err } @@ -131,7 +131,7 @@ func (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*Publ // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#get-a-secret-for-the-authenticated-user // //meta:operation GET /user/codespaces/secrets/{secret_name} func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error) { @@ -143,7 +143,7 @@ func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Se // // Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret // //meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { @@ -155,7 +155,7 @@ func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) // // Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret // //meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { @@ -164,13 +164,13 @@ func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name } func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } var secret *Secret - resp, err := s.client.Do(ctx, req, &secret) + resp, err := s.client.Do(req, &secret) if err != nil { return nil, resp, err } @@ -184,7 +184,7 @@ func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user // //meta:operation PUT /user/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) { @@ -200,7 +200,7 @@ func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecre // // Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret // //meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { @@ -216,7 +216,7 @@ func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org str // // Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret // //meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { @@ -229,12 +229,12 @@ func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, } func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) { - req, err := s.client.NewRequest("PUT", url, eSecret) + req, err := s.client.NewRequest(ctx, "PUT", url, eSecret) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -248,7 +248,7 @@ func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#delete-a-secret-for-the-authenticated-user // //meta:operation DELETE /user/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error) { @@ -260,7 +260,7 @@ func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) ( // // Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret // //meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { @@ -272,7 +272,7 @@ func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name strin // // Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret // //meta:operation DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -281,12 +281,12 @@ func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, n } func (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -299,7 +299,7 @@ func (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Resp // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#list-selected-repositories-for-a-user-secret // //meta:operation GET /user/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -316,7 +316,7 @@ func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, // // Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret // //meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -330,13 +330,13 @@ func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, o } func (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url string) (*SelectedReposList, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } var repositories *SelectedReposList - resp, err := s.client.Do(ctx, req, &repositories) + resp, err := s.client.Do(req, &repositories) if err != nil { return nil, resp, err } @@ -349,7 +349,7 @@ func (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret // //meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, name string, ids SelectedRepoIDs) (*Response, error) { @@ -361,7 +361,7 @@ func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, n // // Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-secret // //meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { @@ -374,12 +374,12 @@ func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url st SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` } - req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) + req, err := s.client.NewRequest(ctx, "PUT", url, repoIDs{SelectedIDs: ids}) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -391,7 +391,7 @@ func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url st // // Adds a repository to the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on the referenced repository to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#add-a-selected-repository-to-a-user-secret // //meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { @@ -410,7 +410,7 @@ func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, nam // // Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret // //meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -426,12 +426,12 @@ func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, } func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("PUT", url, nil) + req, err := s.client.NewRequest(ctx, "PUT", url, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -443,7 +443,7 @@ func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url str // // Removes a repository from the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets?apiVersion=2022-11-28#remove-a-selected-repository-from-a-user-secret // //meta:operation DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { @@ -462,7 +462,7 @@ func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context // // Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret // //meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -478,12 +478,12 @@ func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, } func (s *CodespacesService) removeSelectedRepoFromSecret(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v88/github/copilot.go b/vendor/github.com/google/go-github/v88/github/copilot.go new file mode 100644 index 000000000..d5f0f085b --- /dev/null +++ b/vendor/github.com/google/go-github/v88/github/copilot.go @@ -0,0 +1,1251 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "time" +) + +// CopilotService provides access to the Copilot-related functions +// in the GitHub API. +// +// GitHub API docs: https://docs.github.com/rest/copilot?apiVersion=2022-11-28 +type CopilotService service + +// CopilotOrganizationDetails represents the details of an organization's Copilot for Business subscription. +type CopilotOrganizationDetails struct { + SeatBreakdown *CopilotSeatBreakdown `json:"seat_breakdown"` + PublicCodeSuggestions string `json:"public_code_suggestions"` + CopilotChat string `json:"copilot_chat"` + SeatManagementSetting string `json:"seat_management_setting"` +} + +// CopilotSeatBreakdown represents the breakdown of Copilot for Business seats for the organization. +type CopilotSeatBreakdown struct { + Total int `json:"total"` + AddedThisCycle int `json:"added_this_cycle"` + PendingCancellation int `json:"pending_cancellation"` + PendingInvitation int `json:"pending_invitation"` + ActiveThisCycle int `json:"active_this_cycle"` + InactiveThisCycle int `json:"inactive_this_cycle"` +} + +// ListCopilotSeatsResponse represents the Copilot for Business seat assignments for an organization. +type ListCopilotSeatsResponse struct { + TotalSeats int64 `json:"total_seats"` + Seats []*CopilotSeatDetails `json:"seats"` +} + +// CopilotSeatDetails represents the details of a Copilot for Business seat. +type CopilotSeatDetails struct { + // Assignee can either be a User, Team, or Organization. + Assignee any `json:"assignee"` + AssigningTeam *Team `json:"assigning_team,omitempty"` + PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` + LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` + LastActivityEditor *string `json:"last_activity_editor,omitempty"` + CreatedAt *Timestamp `json:"created_at"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + PlanType *string `json:"plan_type,omitempty"` +} + +// SeatAssignments represents the number of seats assigned. +type SeatAssignments struct { + SeatsCreated int `json:"seats_created"` +} + +// SeatCancellations represents the number of seats cancelled. +type SeatCancellations struct { + SeatsCancelled int `json:"seats_cancelled"` +} + +// CopilotMetricsListOptions represents the optional parameters to the CopilotService get metrics methods. +type CopilotMetricsListOptions struct { + Since *time.Time `url:"since,omitempty"` + Until *time.Time `url:"until,omitempty"` + + ListOptions +} + +// CopilotIDECodeCompletionsLanguage represents Copilot usage metrics for completions in the IDE for a language. +type CopilotIDECodeCompletionsLanguage struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` +} + +// CopilotIDECodeCompletionsModelLanguage represents Copilot usage metrics for completions in the IDE for a model and language. +type CopilotIDECodeCompletionsModelLanguage struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalCodeSuggestions int `json:"total_code_suggestions"` + TotalCodeAcceptances int `json:"total_code_acceptances"` + TotalCodeLinesSuggested int `json:"total_code_lines_suggested"` + TotalCodeLinesAccepted int `json:"total_code_lines_accepted"` +} + +// CopilotIDECodeCompletionsModel represents Copilot usage metrics for completions in the IDE for a model. +type CopilotIDECodeCompletionsModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + Languages []*CopilotIDECodeCompletionsModelLanguage `json:"languages"` +} + +// CopilotIDECodeCompletionsEditor represents Copilot usage metrics for completions in the IDE for an editor. +type CopilotIDECodeCompletionsEditor struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotIDECodeCompletionsModel `json:"models"` +} + +// CopilotIDECodeCompletions represents Copilot usage metrics for Copilot code completions in the IDE, categorized by editor, model and language. +type CopilotIDECodeCompletions struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Languages []*CopilotIDECodeCompletionsLanguage `json:"languages"` + Editors []*CopilotIDECodeCompletionsEditor `json:"editors"` +} + +// CopilotIDEChatModel represents Copilot usage metrics for chatting with a model in the IDE. +type CopilotIDEChatModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalChats int `json:"total_chats"` + TotalChatInsertionEvents int `json:"total_chat_insertion_events"` + TotalChatCopyEvents int `json:"total_chat_copy_events"` +} + +// CopilotIDEChatEditor represents Copilot usage metrics for chatting with a model in the IDE, categorized by editor and model. +type CopilotIDEChatEditor struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotIDEChatModel `json:"models"` +} + +// CopilotIDEChat represents Copilot usage metrics for Copilot Chat in the IDE, categorized by editor and model. +type CopilotIDEChat struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Editors []*CopilotIDEChatEditor `json:"editors"` +} + +// CopilotDotcomChatModel represents Copilot usage metrics for chatting with a model in the webbrowser. +type CopilotDotcomChatModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalChats int `json:"total_chats"` +} + +// CopilotDotcomChat represents Copilot usage metrics for Copilot Chat in the webbrowser, categorized by model. +type CopilotDotcomChat struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotDotcomChatModel `json:"models"` +} + +// CopilotDotcomPullRequestsModel represents Copilot usage metrics for pull requests in the webbrowser, categorized by model. +type CopilotDotcomPullRequestsModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalPRSummariesCreated int `json:"total_pr_summaries_created"` + TotalEngagedUsers int `json:"total_engaged_users"` +} + +// CopilotDotcomPullRequestsRepository represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository. +type CopilotDotcomPullRequestsRepository struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotDotcomPullRequestsModel `json:"models"` +} + +// CopilotDotcomPullRequests represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository and model. +type CopilotDotcomPullRequests struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Repositories []*CopilotDotcomPullRequestsRepository `json:"repositories"` +} + +// CopilotMetrics represents Copilot usage metrics for a given day. +type CopilotMetrics struct { + Date string `json:"date"` + TotalActiveUsers *int `json:"total_active_users,omitempty"` + TotalEngagedUsers *int `json:"total_engaged_users,omitempty"` + CopilotIDECodeCompletions *CopilotIDECodeCompletions `json:"copilot_ide_code_completions,omitempty"` + CopilotIDEChat *CopilotIDEChat `json:"copilot_ide_chat,omitempty"` + CopilotDotcomChat *CopilotDotcomChat `json:"copilot_dotcom_chat,omitempty"` + CopilotDotcomPullRequests *CopilotDotcomPullRequests `json:"copilot_dotcom_pull_requests,omitempty"` +} + +// CopilotMetricsReportOptions specifies the optional parameters for single-day metrics report endpoints. +type CopilotMetricsReportOptions struct { + Day string `url:"day"` // Required, format: YYYY-MM-DD +} + +// CopilotDailyMetricsReport represents the response from 1-day Copilot metrics report endpoints. +type CopilotDailyMetricsReport struct { + DownloadLinks []string `json:"download_links"` + ReportDay string `json:"report_day"` +} + +// CopilotMetricsReport represents the response from 28-day Copilot metrics report endpoints. +type CopilotMetricsReport struct { + DownloadLinks []string `json:"download_links"` + ReportStartDay string `json:"report_start_day"` + ReportEndDay string `json:"report_end_day"` +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { + // Using an alias to avoid infinite recursion when calling json.Unmarshal + type alias CopilotSeatDetails + var seatDetail alias + + if err := json.Unmarshal(data, &seatDetail); err != nil { + return err + } + + cp.AssigningTeam = seatDetail.AssigningTeam + cp.PendingCancellationDate = seatDetail.PendingCancellationDate + cp.LastActivityAt = seatDetail.LastActivityAt + cp.LastActivityEditor = seatDetail.LastActivityEditor + cp.CreatedAt = seatDetail.CreatedAt + cp.UpdatedAt = seatDetail.UpdatedAt + cp.PlanType = seatDetail.PlanType + + switch v := seatDetail.Assignee.(type) { + case nil: + // Assignee can be null according to GitHub API specification. + // See: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization + // Note: Copilot API is in public preview and subject to change. + cp.Assignee = nil + case map[string]any: + jsonData, err := json.Marshal(seatDetail.Assignee) + if err != nil { + return err + } + + if v["type"] == nil { + return errors.New("assignee type field is not set") + } + + if t, ok := v["type"].(string); ok && t == "User" { + var user *User + if err := json.Unmarshal(jsonData, &user); err != nil { + return err + } + cp.Assignee = user + } else if t, ok := v["type"].(string); ok && t == "Team" { + var team *Team + if err := json.Unmarshal(jsonData, &team); err != nil { + return err + } + cp.Assignee = team + } else if t, ok := v["type"].(string); ok && t == "Organization" { + var organization *Organization + if err := json.Unmarshal(jsonData, &organization); err != nil { + return err + } + cp.Assignee = organization + } else { + return fmt.Errorf("unsupported assignee type %v", v["type"]) + } + default: + return fmt.Errorf("unsupported assignee type %T", v) + } + + return nil +} + +// GetUser gets the User from the CopilotSeatDetails if the assignee is a user. +func (cp *CopilotSeatDetails) GetUser() (*User, bool) { u, ok := cp.Assignee.(*User); return u, ok } + +// GetTeam gets the Team from the CopilotSeatDetails if the assignee is a team. +func (cp *CopilotSeatDetails) GetTeam() (*Team, bool) { t, ok := cp.Assignee.(*Team); return t, ok } + +// GetOrganization gets the Organization from the CopilotSeatDetails if the assignee is an organization. +func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { + o, ok := cp.Assignee.(*Organization) + return o, ok +} + +// GetCopilotBilling gets Copilot for Business billing information and settings for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#get-copilot-seat-information-and-settings-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/billing +func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing", org) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var copilotDetails *CopilotOrganizationDetails + resp, err := s.client.Do(req, &copilotDetails) + if err != nil { + return nil, resp, err + } + + return copilotDetails, resp, nil +} + +// ListCopilotSeats lists Copilot for Business seat assignments for an organization. +// +// To paginate through all seats, populate 'Page' with the number of the last page. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/billing/seats +func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var copilotSeats *ListCopilotSeatsResponse + resp, err := s.client.Do(req, &copilotSeats) + if err != nil { + return nil, resp, err + } + + return copilotSeats, resp, nil +} + +// ListCopilotEnterpriseSeats lists Copilot for Business seat assignments for an enterprise. +// +// To paginate through all seats, populate 'Page' with the number of the last page. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/copilot/billing/seats +func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/billing/seats", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var copilotSeats *ListCopilotSeatsResponse + resp, err := s.client.Do(req, &copilotSeats) + if err != nil { + return nil, resp, err + } + + return copilotSeats, resp, nil +} + +// ListOrganizationCopilotCodingAgentRepositoriesResponse represents the response from listing +// repositories enabled for the Copilot coding agent in an organization. +type ListOrganizationCopilotCodingAgentRepositoriesResponse struct { + TotalCount int `json:"total_count"` + Repositories []*Repository `json:"repositories"` +} + +// ListOrganizationCodingAgentRepositories lists repositories enabled for the Copilot coding agent in an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-coding-agent-management?apiVersion=2022-11-28#list-repositories-enabled-for-copilot-cloud-agent-in-an-organization +// +//meta:operation GET /orgs/{org}/copilot/coding-agent/permissions/repositories +func (s *CopilotService) ListOrganizationCodingAgentRepositories(ctx context.Context, org string, opts *ListOptions) (*ListOrganizationCopilotCodingAgentRepositoriesResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/coding-agent/permissions/repositories", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var result *ListOrganizationCopilotCodingAgentRepositoriesResponse + resp, err := s.client.Do(req, &result) + if err != nil { + return nil, resp, err + } + + return result, resp, nil +} + +// CopilotOrganizationContentExclusionDetails lists all Copilot content exclusion +// rules for an organization, keyed by repository full name. Each value is the +// list of file paths excluded from Copilot for that repository. +type CopilotOrganizationContentExclusionDetails map[string][]string + +// GetOrganizationContentExclusionDetails gets the Copilot content exclusion rules for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-content-exclusion-management?apiVersion=2022-11-28#get-copilot-content-exclusion-rules-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/content_exclusion +func (s *CopilotService) GetOrganizationContentExclusionDetails(ctx context.Context, org string) (CopilotOrganizationContentExclusionDetails, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/content_exclusion", org) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + details := CopilotOrganizationContentExclusionDetails{} + resp, err := s.client.Do(req, &details) + if err != nil { + return nil, resp, err + } + + return details, resp, nil +} + +// AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#add-teams-to-the-copilot-subscription-for-an-organization +// +//meta:operation POST /orgs/{org}/copilot/billing/selected_teams +func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) + + body := struct { + SelectedTeams []string `json:"selected_teams"` + }{ + SelectedTeams: teamNames, + } + + req, err := s.client.NewRequest(ctx, "POST", u, body) + if err != nil { + return nil, nil, err + } + + var seatAssignments *SeatAssignments + resp, err := s.client.Do(req, &seatAssignments) + if err != nil { + return nil, resp, err + } + + return seatAssignments, resp, nil +} + +// RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#remove-teams-from-the-copilot-subscription-for-an-organization +// +//meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams +func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) + + body := struct { + SelectedTeams []string `json:"selected_teams"` + }{ + SelectedTeams: teamNames, + } + + req, err := s.client.NewRequest(ctx, "DELETE", u, body) + if err != nil { + return nil, nil, err + } + + var seatCancellations *SeatCancellations + resp, err := s.client.Do(req, &seatCancellations) + if err != nil { + return nil, resp, err + } + + return seatCancellations, resp, nil +} + +// AddCopilotUsers adds users to the Copilot for Business subscription for an organization +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#add-users-to-the-copilot-subscription-for-an-organization +// +//meta:operation POST /orgs/{org}/copilot/billing/selected_users +func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) + + body := struct { + SelectedUsernames []string `json:"selected_usernames"` + }{ + SelectedUsernames: users, + } + + req, err := s.client.NewRequest(ctx, "POST", u, body) + if err != nil { + return nil, nil, err + } + + var seatAssignments *SeatAssignments + resp, err := s.client.Do(req, &seatAssignments) + if err != nil { + return nil, resp, err + } + + return seatAssignments, resp, nil +} + +// RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#remove-users-from-the-copilot-subscription-for-an-organization +// +//meta:operation DELETE /orgs/{org}/copilot/billing/selected_users +func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) + + body := struct { + SelectedUsernames []string `json:"selected_usernames"` + }{ + SelectedUsernames: users, + } + + req, err := s.client.NewRequest(ctx, "DELETE", u, body) + if err != nil { + return nil, nil, err + } + + var seatCancellations *SeatCancellations + resp, err := s.client.Do(req, &seatCancellations) + if err != nil { + return nil, resp, err + } + + return seatCancellations, resp, nil +} + +// GetSeatDetails gets Copilot for Business seat assignment details for a user. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management?apiVersion=2022-11-28#get-copilot-seat-assignment-details-for-a-user +// +//meta:operation GET /orgs/{org}/members/{username}/copilot +func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) { + u := fmt.Sprintf("orgs/%v/members/%v/copilot", org, user) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var seatDetails *CopilotSeatDetails + resp, err := s.client.Do(req, &seatDetails) + if err != nil { + return nil, resp, err + } + + return seatDetails, resp, nil +} + +// GetEnterpriseMetrics gets Copilot usage metrics for an enterprise. +// +// Deprecated: This endpoint was closed down on April 2, 2026 for github.com. +// It may still be available for GitHub Enterprise Server. Use GetEnterpriseDailyMetricsReport +// or GetEnterpriseMetricsReport instead. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/copilot/metrics +func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/metrics", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var metrics []*CopilotMetrics + resp, err := s.client.Do(req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team. +// +// Deprecated: This endpoint was closed down on April 2, 2026 for github.com. +// It may still be available for GitHub Enterprise Server. Use GetEnterpriseDailyMetricsReport +// or GetEnterpriseMetricsReport instead. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-enterprise-team +// +//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics +func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("enterprises/%v/team/%v/copilot/metrics", enterprise, team) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var metrics []*CopilotMetrics + resp, err := s.client.Do(req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetOrganizationMetrics gets Copilot usage metrics for an organization. +// +// Deprecated: This endpoint was closed down on April 2, 2026 for github.com. +// It may still be available for GitHub Enterprise Server. Use GetOrganizationDailyMetricsReport +// or GetOrganizationMetricsReport instead. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/metrics +func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/metrics", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var metrics []*CopilotMetrics + resp, err := s.client.Do(req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetOrganizationTeamMetrics gets Copilot usage metrics for an organization team. +// +// Deprecated: This endpoint was closed down on April 2, 2026 for github.com. +// It may still be available for GitHub Enterprise Server. Use GetOrganizationDailyMetricsReport +// or GetOrganizationMetricsReport instead. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-a-team +// +//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/metrics +func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("orgs/%v/team/%v/copilot/metrics", org, team) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var metrics []*CopilotMetrics + resp, err := s.client.Do(req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetEnterpriseDailyMetricsReport gets a report containing Copilot metrics for a single day for an enterprise. +// +// Use DownloadDailyMetrics to decode the payloads served at the returned download links. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-enterprise-usage-metrics-for-a-specific-day +// +//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day +func (s *CopilotService) GetEnterpriseDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/metrics/reports/enterprise-1-day", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var report *CopilotDailyMetricsReport + resp, err := s.client.Do(req, &report) + if err != nil { + return nil, resp, err + } + + return report, resp, nil +} + +// GetEnterpriseMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an enterprise. +// +// Use DownloadPeriodicMetrics to decode the payloads served at the returned download links. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-enterprise-usage-metrics +// +//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest +func (s *CopilotService) GetEnterpriseMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/metrics/reports/enterprise-28-day/latest", enterprise) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var report *CopilotMetricsReport + resp, err := s.client.Do(req, &report) + if err != nil { + return nil, resp, err + } + + return report, resp, nil +} + +// GetEnterpriseUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an enterprise. +// +// Use DownloadUserDailyMetrics to decode the payloads served at the returned download links. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-users-usage-metrics-for-a-specific-day +// +//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day +func (s *CopilotService) GetEnterpriseUsersDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/metrics/reports/users-1-day", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var report *CopilotDailyMetricsReport + resp, err := s.client.Do(req, &report) + if err != nil { + return nil, resp, err + } + + return report, resp, nil +} + +// GetEnterpriseUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an enterprise. +// +// Use DownloadUserPeriodicMetrics to decode the payloads served at the returned download links. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-users-usage-metrics +// +//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest +func (s *CopilotService) GetEnterpriseUsersMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/metrics/reports/users-28-day/latest", enterprise) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var report *CopilotMetricsReport + resp, err := s.client.Do(req, &report) + if err != nil { + return nil, resp, err + } + + return report, resp, nil +} + +// GetOrganizationDailyMetricsReport gets a report containing Copilot metrics for a single day for an organization. +// +// Use DownloadDailyMetrics to decode the payloads served at the returned download links. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-usage-metrics-for-a-specific-day +// +//meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-1-day +func (s *CopilotService) GetOrganizationDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/metrics/reports/organization-1-day", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var report *CopilotDailyMetricsReport + resp, err := s.client.Do(req, &report) + if err != nil { + return nil, resp, err + } + + return report, resp, nil +} + +// GetOrganizationMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an organization. +// +// Use DownloadPeriodicMetrics to decode the payloads served at the returned download links. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-usage-metrics +// +//meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest +func (s *CopilotService) GetOrganizationMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/metrics/reports/organization-28-day/latest", org) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var report *CopilotMetricsReport + resp, err := s.client.Do(req, &report) + if err != nil { + return nil, resp, err + } + + return report, resp, nil +} + +// GetOrganizationUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an organization. +// +// Use DownloadUserDailyMetrics to decode the payloads served at the returned download links. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-users-usage-metrics-for-a-specific-day +// +//meta:operation GET /orgs/{org}/copilot/metrics/reports/users-1-day +func (s *CopilotService) GetOrganizationUsersDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/metrics/reports/users-1-day", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var report *CopilotDailyMetricsReport + resp, err := s.client.Do(req, &report) + if err != nil { + return nil, resp, err + } + + return report, resp, nil +} + +// GetOrganizationUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an organization. +// +// Use DownloadUserPeriodicMetrics to decode the payloads served at the returned download links. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-users-usage-metrics +// +//meta:operation GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest +func (s *CopilotService) GetOrganizationUsersMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/metrics/reports/users-28-day/latest", org) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var report *CopilotMetricsReport + resp, err := s.client.Do(req, &report) + if err != nil { + return nil, resp, err + } + + return report, resp, nil +} + +// DownloadCopilotMetrics downloads a Copilot metrics report from the provided download link +// and decodes it as a []*CopilotMetrics. +// +// Deprecated: Use DownloadDailyMetrics, +// DownloadPeriodicMetrics, DownloadUserDailyMetrics, DownloadUserPeriodicMetrics instead. +// The payloads served at the download links returned by the new +// Get*MetricsReport endpoints on GitHub.com do not match the CopilotMetrics shape +// (see https://github.com/google/go-github/issues/4136). +// This method is retained +// for GitHub Enterprise Server installations that may still serve the legacy shape. +func (s *CopilotService) DownloadCopilotMetrics(ctx context.Context, url string) ([]*CopilotMetrics, *Response, error) { + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, nil, err + } + + resp, err := s.client.BareDo(req) + if err != nil { + return nil, nil, err + } + defer resp.Body.Close() + + var metrics []*CopilotMetrics + if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// CopilotMetricsPullRequests represents pull request totals in a Copilot metrics report. +type CopilotMetricsPullRequests struct { + TotalReviewed *int `json:"total_reviewed,omitempty"` + TotalCreated *int `json:"total_created,omitempty"` + TotalCreatedByCopilot *int `json:"total_created_by_copilot,omitempty"` + TotalReviewedByCopilot *int `json:"total_reviewed_by_copilot,omitempty"` + TotalMerged *int `json:"total_merged,omitempty"` + MedianMinutesToMerge *float64 `json:"median_minutes_to_merge,omitempty"` + TotalSuggestions *int `json:"total_suggestions,omitempty"` + TotalAppliedSuggestions *int `json:"total_applied_suggestions,omitempty"` + TotalMergedCreatedByCopilot *int `json:"total_merged_created_by_copilot,omitempty"` + MedianMinutesToMergeCopilotAuthored *float64 `json:"median_minutes_to_merge_copilot_authored,omitempty"` + TotalCopilotSuggestions *int `json:"total_copilot_suggestions,omitempty"` + TotalCopilotAppliedSuggestions *int `json:"total_copilot_applied_suggestions,omitempty"` + MedianMinutesToMergeCopilotReviewed *float64 `json:"median_minutes_to_merge_copilot_reviewed,omitempty"` + TotalMergedReviewedByCopilot *int `json:"total_merged_reviewed_by_copilot,omitempty"` +} + +// CopilotMetricsCodeActivity captures the code-generation activity counts and lines-of-code (LOC) +// suggestion totals shared across the per-IDE, per-feature, per-language, and per-model breakdowns +// in a Copilot metrics report. +type CopilotMetricsCodeActivity struct { + CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"` + CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"` + LOCSuggestedToAddSum *int `json:"loc_suggested_to_add_sum,omitempty"` + LOCSuggestedToDeleteSum *int `json:"loc_suggested_to_delete_sum,omitempty"` + LOCAddedSum *int `json:"loc_added_sum,omitempty"` + LOCDeletedSum *int `json:"loc_deleted_sum,omitempty"` +} + +// CopilotMetricsChatPanel captures per-mode chat panel interaction counts shared across daily, +// periodic, and user metrics reports. Each field is a subset of user_initiated_interaction_count +// attributed to that chat panel mode. +type CopilotMetricsChatPanel struct { + ChatPanelAgentMode *int `json:"chat_panel_agent_mode,omitempty"` + ChatPanelAskMode *int `json:"chat_panel_ask_mode,omitempty"` + ChatPanelCustomMode *int `json:"chat_panel_custom_mode,omitempty"` + ChatPanelEditMode *int `json:"chat_panel_edit_mode,omitempty"` + ChatPanelUnknownMode *int `json:"chat_panel_unknown_mode,omitempty"` +} + +// CopilotMetricsIDE represents per-IDE aggregate totals in a Copilot metrics report. +type CopilotMetricsIDE struct { + IDE string `json:"ide"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsFeature represents per-feature aggregate totals in a Copilot metrics report. +type CopilotMetricsFeature struct { + Feature string `json:"feature"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsLanguageFeature represents per-language-feature totals in a Copilot metrics report. +type CopilotMetricsLanguageFeature struct { + Language string `json:"language"` + Feature string `json:"feature"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsLanguageModel represents per-language-model totals in a Copilot metrics report. +type CopilotMetricsLanguageModel struct { + Language string `json:"language"` + Model string `json:"model"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsModelFeature represents per-model-feature totals in a Copilot metrics report. +type CopilotMetricsModelFeature struct { + Model string `json:"model"` + Feature string `json:"feature"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsCLIVersion represents the last known Copilot CLI version seen in a metrics report. +type CopilotMetricsCLIVersion struct { + SampledAt *Timestamp `json:"sampled_at,omitempty"` + CLIVersion string `json:"cli_version"` +} + +// CopilotMetricsCLITokenUsage represents Copilot CLI token totals in a metrics report. +type CopilotMetricsCLITokenUsage struct { + AvgTokensPerRequest *float64 `json:"avg_tokens_per_request,omitempty"` + OutputTokensSum *int `json:"output_tokens_sum,omitempty"` + PromptTokensSum *int `json:"prompt_tokens_sum,omitempty"` +} + +// CopilotMetricsCLI represents Copilot CLI totals in a metrics report. +type CopilotMetricsCLI struct { + SessionCount *int `json:"session_count,omitempty"` + RequestCount *int `json:"request_count,omitempty"` + PromptCount *int `json:"prompt_count,omitempty"` + TokenUsage *CopilotMetricsCLITokenUsage `json:"token_usage,omitempty"` + LastKnownCLIVersion *CopilotMetricsCLIVersion `json:"last_known_cli_version,omitempty"` +} + +// CopilotDailyMetrics represents the payload downloaded from a 1-day Copilot usage metrics report. +type CopilotDailyMetrics struct { + Day string `json:"day"` + OrganizationID *string `json:"organization_id,omitempty"` + EnterpriseID *string `json:"enterprise_id,omitempty"` + DailyActiveCLIUsers *int `json:"daily_active_cli_users,omitempty"` + DailyActiveUsers *int `json:"daily_active_users,omitempty"` + DailyActiveCopilotCloudAgentUsers *int `json:"daily_active_copilot_cloud_agent_users,omitempty"` + WeeklyActiveUsers *int `json:"weekly_active_users,omitempty"` + WeeklyActiveCopilotCloudAgentUsers *int `json:"weekly_active_copilot_cloud_agent_users,omitempty"` + MonthlyActiveUsers *int `json:"monthly_active_users,omitempty"` + MonthlyActiveChatUsers *int `json:"monthly_active_chat_users,omitempty"` + MonthlyActiveAgentUsers *int `json:"monthly_active_agent_users,omitempty"` + MonthlyActiveCopilotCloudAgentUsers *int `json:"monthly_active_copilot_cloud_agent_users,omitempty"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsChatPanel + CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"` + CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"` + TotalsByIDE []*CopilotMetricsIDE `json:"totals_by_ide,omitempty"` + TotalsByFeature []*CopilotMetricsFeature `json:"totals_by_feature,omitempty"` + TotalsByLanguageFeature []*CopilotMetricsLanguageFeature `json:"totals_by_language_feature,omitempty"` + TotalsByLanguageModel []*CopilotMetricsLanguageModel `json:"totals_by_language_model,omitempty"` + TotalsByModelFeature []*CopilotMetricsModelFeature `json:"totals_by_model_feature,omitempty"` + TotalsByCLI *CopilotMetricsCLI `json:"totals_by_cli,omitempty"` + LOCSuggestedToAddSum *int `json:"loc_suggested_to_add_sum,omitempty"` + LOCSuggestedToDeleteSum *int `json:"loc_suggested_to_delete_sum,omitempty"` + LOCAddedSum *int `json:"loc_added_sum,omitempty"` + LOCDeletedSum *int `json:"loc_deleted_sum,omitempty"` + PullRequests *CopilotMetricsPullRequests `json:"pull_requests,omitempty"` +} + +// CopilotPeriodicMetrics represents the payload downloaded from a multi-day (e.g. 28-day rolling) +// Copilot usage metrics report. The DayTotals field contains one CopilotDailyMetrics entry per day +// in the reporting window. Window-level metadata (ReportStartDay, ReportEndDay, CreatedAt) lives on +// this parent struct; each DayTotals entry only populates fields scoped to that day. +type CopilotPeriodicMetrics struct { + ReportStartDay string `json:"report_start_day"` + ReportEndDay string `json:"report_end_day"` + OrganizationID *string `json:"organization_id,omitempty"` + EnterpriseID *string `json:"enterprise_id,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + DayTotals []*CopilotDailyMetrics `json:"day_totals,omitempty"` +} + +// CopilotUserMetricsPluginVersion represents the last known plugin version used in an IDE by a Copilot user. +type CopilotUserMetricsPluginVersion struct { + SampledAt *Timestamp `json:"sampled_at,omitempty"` + Plugin string `json:"plugin"` + PluginVersion string `json:"plugin_version"` +} + +// CopilotUserMetricsIDEVersion represents the last known IDE version used by a Copilot user. +type CopilotUserMetricsIDEVersion struct { + SampledAt *Timestamp `json:"sampled_at,omitempty"` + IDEVersion string `json:"ide_version"` +} + +// CopilotUserMetricsIDE represents per-IDE totals for a single Copilot user in a user metrics report. +type CopilotUserMetricsIDE struct { + IDE string `json:"ide"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsCodeActivity + LastKnownPluginVersion *CopilotUserMetricsPluginVersion `json:"last_known_plugin_version,omitempty"` + LastKnownIDEVersion *CopilotUserMetricsIDEVersion `json:"last_known_ide_version,omitempty"` +} + +// CopilotUserDailyMetrics represents a single user's per-day Copilot usage metrics record from a +// 1-day user metrics report. User metrics reports are served as newline-delimited JSON. +type CopilotUserDailyMetrics struct { + UserID int `json:"user_id"` + UserLogin string `json:"user_login"` + Day string `json:"day"` + OrganizationID *string `json:"organization_id,omitempty"` + EnterpriseID *string `json:"enterprise_id,omitempty"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsChatPanel + CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"` + CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"` + TotalsByIDE []*CopilotUserMetricsIDE `json:"totals_by_ide,omitempty"` + TotalsByFeature []*CopilotMetricsFeature `json:"totals_by_feature,omitempty"` + TotalsByLanguageFeature []*CopilotMetricsLanguageFeature `json:"totals_by_language_feature,omitempty"` + TotalsByLanguageModel []*CopilotMetricsLanguageModel `json:"totals_by_language_model,omitempty"` + TotalsByModelFeature []*CopilotMetricsModelFeature `json:"totals_by_model_feature,omitempty"` + TotalsByCLI *CopilotMetricsCLI `json:"totals_by_cli,omitempty"` + UsedAgent *bool `json:"used_agent,omitempty"` + UsedChat *bool `json:"used_chat,omitempty"` + UsedCLI *bool `json:"used_cli,omitempty"` + UsedCopilotCodeReviewActive *bool `json:"used_copilot_code_review_active,omitempty"` + UsedCopilotCodeReviewPassive *bool `json:"used_copilot_code_review_passive,omitempty"` + UsedCopilotCodingAgent *bool `json:"used_copilot_coding_agent,omitempty"` + LOCSuggestedToAddSum *int `json:"loc_suggested_to_add_sum,omitempty"` + LOCSuggestedToDeleteSum *int `json:"loc_suggested_to_delete_sum,omitempty"` + LOCAddedSum *int `json:"loc_added_sum,omitempty"` + LOCDeletedSum *int `json:"loc_deleted_sum,omitempty"` +} + +// CopilotUserPeriodicMetrics represents a single user's per-day Copilot usage metrics record from a +// multi-day (e.g. 28-day rolling) user metrics report. User metrics reports are served as +// newline-delimited JSON. +type CopilotUserPeriodicMetrics struct { + ReportStartDay string `json:"report_start_day"` + ReportEndDay string `json:"report_end_day"` + Day string `json:"day"` + OrganizationID *string `json:"organization_id,omitempty"` + EnterpriseID *string `json:"enterprise_id,omitempty"` + UserID int `json:"user_id"` + UserLogin string `json:"user_login"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsChatPanel + CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"` + CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"` + TotalsByIDE []*CopilotUserMetricsIDE `json:"totals_by_ide,omitempty"` + TotalsByFeature []*CopilotMetricsFeature `json:"totals_by_feature,omitempty"` + TotalsByLanguageFeature []*CopilotMetricsLanguageFeature `json:"totals_by_language_feature,omitempty"` + TotalsByLanguageModel []*CopilotMetricsLanguageModel `json:"totals_by_language_model,omitempty"` + TotalsByModelFeature []*CopilotMetricsModelFeature `json:"totals_by_model_feature,omitempty"` + TotalsByCLI *CopilotMetricsCLI `json:"totals_by_cli,omitempty"` + UsedAgent *bool `json:"used_agent,omitempty"` + UsedChat *bool `json:"used_chat,omitempty"` + UsedCLI *bool `json:"used_cli,omitempty"` + UsedCopilotCodeReviewActive *bool `json:"used_copilot_code_review_active,omitempty"` + UsedCopilotCodeReviewPassive *bool `json:"used_copilot_code_review_passive,omitempty"` + UsedCopilotCodingAgent *bool `json:"used_copilot_coding_agent,omitempty"` + LOCSuggestedToAddSum *int `json:"loc_suggested_to_add_sum,omitempty"` + LOCSuggestedToDeleteSum *int `json:"loc_suggested_to_delete_sum,omitempty"` + LOCAddedSum *int `json:"loc_added_sum,omitempty"` + LOCDeletedSum *int `json:"loc_deleted_sum,omitempty"` +} + +// fetchMetricsReport performs a GET against the provided download URL and returns the raw +// http.Response. The caller is responsible for closing the body. +func (s *CopilotService) fetchMetricsReport(ctx context.Context, url string) (*http.Response, *Response, error) { + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, nil, err + } + + resp, err := s.client.client.Do(req) + if err != nil { + return nil, nil, err + } + + if err := CheckResponse(resp); err != nil { + resp.Body.Close() + return nil, newResponse(resp), err + } + + return resp, newResponse(resp), nil +} + +// decodeNDJSONMetrics streams a newline-delimited JSON response body into a slice of *T, +// returning a nil slice when the body is empty. +func decodeNDJSONMetrics[T any](r io.Reader) ([]*T, error) { + var records []*T + dec := json.NewDecoder(r) + for { + var rec *T + if err := dec.Decode(&rec); err != nil { + if errors.Is(err, io.EOF) { + break + } + return nil, err + } + records = append(records, rec) + } + return records, nil +} + +// DownloadDailyMetrics downloads the payload of a 1-day Copilot usage metrics report from a +// download link returned by GetEnterpriseDailyMetricsReport or GetOrganizationDailyMetricsReport. +func (s *CopilotService) DownloadDailyMetrics(ctx context.Context, url string) (*CopilotDailyMetrics, *Response, error) { + resp, r, err := s.fetchMetricsReport(ctx, url) + if err != nil { + return nil, r, err + } + defer resp.Body.Close() + + var metrics *CopilotDailyMetrics + if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { + return nil, r, err + } + + return metrics, r, nil +} + +// DownloadPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot +// usage metrics report from a download link returned by GetEnterpriseMetricsReport or +// GetOrganizationMetricsReport. +func (s *CopilotService) DownloadPeriodicMetrics(ctx context.Context, url string) (*CopilotPeriodicMetrics, *Response, error) { + resp, r, err := s.fetchMetricsReport(ctx, url) + if err != nil { + return nil, r, err + } + defer resp.Body.Close() + + var metrics *CopilotPeriodicMetrics + if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { + return nil, r, err + } + + return metrics, r, nil +} + +// DownloadUserDailyMetrics downloads the payload of a 1-day Copilot user metrics report from a +// download link returned by GetEnterpriseUsersDailyMetricsReport or +// GetOrganizationUsersDailyMetricsReport. +// +// The response is newline-delimited JSON, with one CopilotUserDailyMetrics record per line. +func (s *CopilotService) DownloadUserDailyMetrics(ctx context.Context, url string) ([]*CopilotUserDailyMetrics, *Response, error) { + resp, r, err := s.fetchMetricsReport(ctx, url) + if err != nil { + return nil, r, err + } + defer resp.Body.Close() + + records, err := decodeNDJSONMetrics[CopilotUserDailyMetrics](resp.Body) + if err != nil { + return nil, r, err + } + return records, r, nil +} + +// DownloadUserPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot +// user metrics report from a download link returned by GetEnterpriseUsersMetricsReport or +// GetOrganizationUsersMetricsReport. +// +// The response is newline-delimited JSON, with one CopilotUserPeriodicMetrics record per +// user-day in the reporting window. +func (s *CopilotService) DownloadUserPeriodicMetrics(ctx context.Context, url string) ([]*CopilotUserPeriodicMetrics, *Response, error) { + resp, r, err := s.fetchMetricsReport(ctx, url) + if err != nil { + return nil, r, err + } + defer resp.Body.Close() + + records, err := decodeNDJSONMetrics[CopilotUserPeriodicMetrics](resp.Body) + if err != nil { + return nil, r, err + } + return records, r, nil +} diff --git a/vendor/github.com/google/go-github/v84/github/credentials.go b/vendor/github.com/google/go-github/v88/github/credentials.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/credentials.go rename to vendor/github.com/google/go-github/v88/github/credentials.go index ff6e6f691..d785edc0d 100644 --- a/vendor/github.com/google/go-github/v84/github/credentials.go +++ b/vendor/github.com/google/go-github/v88/github/credentials.go @@ -20,7 +20,7 @@ type revokeCredentialsRequest struct { // Revoke revokes a list of credentials. // -// GitHub API docs: https://docs.github.com/rest/credentials/revoke#revoke-a-list-of-credentials +// GitHub API docs: https://docs.github.com/rest/credentials/revoke?apiVersion=2022-11-28#revoke-a-list-of-credentials // //meta:operation POST /credentials/revoke func (s *CredentialsService) Revoke(ctx context.Context, credentials []string) (*Response, error) { @@ -28,10 +28,10 @@ func (s *CredentialsService) Revoke(ctx context.Context, credentials []string) ( reqBody := &revokeCredentialsRequest{Credentials: credentials} - req, err := s.client.NewRequest("POST", u, reqBody) + req, err := s.client.NewRequest(ctx, "POST", u, reqBody) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/dependabot.go b/vendor/github.com/google/go-github/v88/github/dependabot.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/dependabot.go rename to vendor/github.com/google/go-github/v88/github/dependabot.go index 2a11a9c95..5e4f73544 100644 --- a/vendor/github.com/google/go-github/v84/github/dependabot.go +++ b/vendor/github.com/google/go-github/v88/github/dependabot.go @@ -8,5 +8,5 @@ package github // DependabotService handles communication with the Dependabot related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/dependabot/ +// GitHub API docs: https://docs.github.com/rest/dependabot?apiVersion=2022-11-28 type DependabotService service diff --git a/vendor/github.com/google/go-github/v84/github/dependabot_alerts.go b/vendor/github.com/google/go-github/v88/github/dependabot_alerts.go similarity index 92% rename from vendor/github.com/google/go-github/v84/github/dependabot_alerts.go rename to vendor/github.com/google/go-github/v88/github/dependabot_alerts.go index 67e624c9e..dc4445dce 100644 --- a/vendor/github.com/google/go-github/v84/github/dependabot_alerts.go +++ b/vendor/github.com/google/go-github/v88/github/dependabot_alerts.go @@ -109,13 +109,13 @@ func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *Li return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var alerts []*DependabotAlert - resp, err := s.client.Do(ctx, req, &alerts) + resp, err := s.client.Do(req, &alerts) if err != nil { return nil, resp, err } @@ -125,7 +125,7 @@ func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *Li // ListRepoAlerts lists all Dependabot alerts of a repository. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts?apiVersion=2022-11-28#list-dependabot-alerts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/dependabot/alerts func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { @@ -135,7 +135,7 @@ func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo stri // ListOrgAlerts lists all Dependabot alerts of an organization. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts?apiVersion=2022-11-28#list-dependabot-alerts-for-an-organization // //meta:operation GET /orgs/{org}/dependabot/alerts func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { @@ -145,18 +145,18 @@ func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts // GetRepoAlert gets a single repository Dependabot alert. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts?apiVersion=2022-11-28#get-a-dependabot-alert // //meta:operation GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number) - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - alert := new(DependabotAlert) - resp, err := s.client.Do(ctx, req, alert) + var alert *DependabotAlert + resp, err := s.client.Do(req, &alert) if err != nil { return nil, resp, err } @@ -166,18 +166,18 @@ func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string // UpdateAlert updates a Dependabot alert. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts?apiVersion=2022-11-28#update-a-dependabot-alert // //meta:operation PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} func (s *DependabotService) UpdateAlert(ctx context.Context, owner, repo string, number int, stateInfo *DependabotAlertState) (*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number) - req, err := s.client.NewRequest("PATCH", url, stateInfo) + req, err := s.client.NewRequest(ctx, "PATCH", url, stateInfo) if err != nil { return nil, nil, err } - alert := new(DependabotAlert) - resp, err := s.client.Do(ctx, req, alert) + var alert *DependabotAlert + resp, err := s.client.Do(req, &alert) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v88/github/dependabot_secrets.go similarity index 84% rename from vendor/github.com/google/go-github/v84/github/dependabot_secrets.go rename to vendor/github.com/google/go-github/v88/github/dependabot_secrets.go index b4b3e0aa5..75e23ba5b 100644 --- a/vendor/github.com/google/go-github/v84/github/dependabot_secrets.go +++ b/vendor/github.com/google/go-github/v88/github/dependabot_secrets.go @@ -12,13 +12,13 @@ import ( ) func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - pubKey := new(PublicKey) - resp, err := s.client.Do(ctx, req, pubKey) + var pubKey *PublicKey + resp, err := s.client.Do(req, &pubKey) if err != nil { return nil, resp, err } @@ -28,7 +28,7 @@ func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*Publ // GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#get-a-repository-public-key // //meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/public-key func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { @@ -38,7 +38,7 @@ func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo st // GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#get-an-organization-public-key // //meta:operation GET /orgs/{org}/dependabot/secrets/public-key func (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { @@ -52,13 +52,13 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - secrets := new(Secrets) - resp, err := s.client.Do(ctx, req, &secrets) + var secrets *Secrets + resp, err := s.client.Do(req, &secrets) if err != nil { return nil, resp, err } @@ -69,7 +69,7 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L // ListRepoSecrets lists all Dependabot secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#list-repository-secrets // //meta:operation GET /repos/{owner}/{repo}/dependabot/secrets func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { @@ -80,7 +80,7 @@ func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all Dependabot secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#list-organization-secrets // //meta:operation GET /orgs/{org}/dependabot/secrets func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { @@ -89,13 +89,13 @@ func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts } func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - secret := new(Secret) - resp, err := s.client.Do(ctx, req, secret) + var secret *Secret + resp, err := s.client.Do(req, &secret) if err != nil { return nil, resp, err } @@ -105,7 +105,7 @@ func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, // GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#get-a-repository-secret // //meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { @@ -115,7 +115,7 @@ func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name // GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#get-an-organization-secret // //meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { @@ -137,17 +137,17 @@ type DependabotEncryptedSecret struct { } func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret *DependabotEncryptedSecret) (*Response, error) { - req, err := s.client.NewRequest("PUT", url, eSecret) + req, err := s.client.NewRequest(ctx, "PUT", url, eSecret) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret // //meta:operation PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { @@ -161,7 +161,7 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret // //meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { @@ -182,26 +182,26 @@ func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org str } url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, eSecret.Name) - req, err := s.client.NewRequest("PUT", url, params) + req, err := s.client.NewRequest(ctx, "PUT", url, params) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#delete-a-repository-secret // //meta:operation DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { @@ -211,7 +211,7 @@ func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, n // DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#delete-an-organization-secret // //meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { @@ -221,7 +221,7 @@ func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name strin // ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret // //meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { @@ -231,13 +231,13 @@ func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, o return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - result := new(SelectedReposList) - resp, err := s.client.Do(ctx, req, result) + var result *SelectedReposList + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -250,7 +250,7 @@ type DependabotSecretsSelectedRepoIDs []int64 // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-secret // //meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) { @@ -259,17 +259,17 @@ func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, or SelectedIDs DependabotSecretsSelectedRepoIDs `json:"selected_repository_ids"` } - req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) + req, err := s.client.NewRequest(ctx, "PUT", url, repoIDs{SelectedIDs: ids}) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret // //meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -281,17 +281,17 @@ func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, } url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) - req, err := s.client.NewRequest("PUT", url, nil) + req, err := s.client.NewRequest(ctx, "PUT", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret // //meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { @@ -303,10 +303,10 @@ func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, } url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/dependency_graph.go b/vendor/github.com/google/go-github/v88/github/dependency_graph.go similarity index 96% rename from vendor/github.com/google/go-github/v84/github/dependency_graph.go rename to vendor/github.com/google/go-github/v88/github/dependency_graph.go index 8d9a26313..f145799a1 100644 --- a/vendor/github.com/google/go-github/v84/github/dependency_graph.go +++ b/vendor/github.com/google/go-github/v88/github/dependency_graph.go @@ -13,7 +13,7 @@ import ( // DependencyGraphService handles communication with the dependency graph // related methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph +// GitHub API docs: https://docs.github.com/rest/dependency-graph?apiVersion=2022-11-28 type DependencyGraphService service // SBOM represents a software bill of materials, which describes the @@ -108,19 +108,19 @@ func (s SBOM) String() string { // GetSBOM fetches the software bill of materials for a repository. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms?apiVersion=2022-11-28#export-a-software-bill-of-materials-sbom-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var sbom *SBOM - resp, err := s.client.Do(ctx, req, &sbom) + resp, err := s.client.Do(req, &sbom) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/dependency_graph_snapshots.go b/vendor/github.com/google/go-github/v88/github/dependency_graph_snapshots.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/dependency_graph_snapshots.go rename to vendor/github.com/google/go-github/v88/github/dependency_graph_snapshots.go index ddfecf429..9bf920acb 100644 --- a/vendor/github.com/google/go-github/v84/github/dependency_graph_snapshots.go +++ b/vendor/github.com/google/go-github/v88/github/dependency_graph_snapshots.go @@ -12,7 +12,7 @@ import ( // DependencyGraphSnapshotResolvedDependency represents a resolved dependency in a dependency graph snapshot. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotResolvedDependency struct { PackageURL *string `json:"package_url,omitempty"` // User-defined metadata to store domain-specific information limited to 8 keys with scalar values. @@ -39,7 +39,7 @@ type DependencyGraphSnapshotResolvedDependency struct { // DependencyGraphSnapshotJob represents the job that created the snapshot. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotJob struct { Correlator *string `json:"correlator,omitempty"` ID *string `json:"id,omitempty"` @@ -48,7 +48,7 @@ type DependencyGraphSnapshotJob struct { // DependencyGraphSnapshotDetector represents a description of the detector used. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotDetector struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -57,14 +57,14 @@ type DependencyGraphSnapshotDetector struct { // DependencyGraphSnapshotManifestFile represents the file declaring the repository's dependencies. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotManifestFile struct { SourceLocation *string `json:"source_location,omitempty"` } // DependencyGraphSnapshotManifest represents a collection of related dependencies declared in a file or representing a logical group of dependencies. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotManifest struct { Name *string `json:"name,omitempty"` File *DependencyGraphSnapshotManifestFile `json:"file,omitempty"` @@ -74,7 +74,7 @@ type DependencyGraphSnapshotManifest struct { // DependencyGraphSnapshot represent a snapshot of a repository's dependencies. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshot struct { Version int `json:"version"` Sha *string `json:"sha,omitempty"` @@ -88,7 +88,7 @@ type DependencyGraphSnapshot struct { // DependencyGraphSnapshotCreationData represents the dependency snapshot's creation result. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository type DependencyGraphSnapshotCreationData struct { ID int64 `json:"id"` CreatedAt *Timestamp `json:"created_at,omitempty"` @@ -103,19 +103,19 @@ type DependencyGraphSnapshotCreationData struct { // CreateSnapshot creates a new snapshot of a repository's dependencies. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/dependency-graph/snapshots func (s *DependencyGraphService) CreateSnapshot(ctx context.Context, owner, repo string, dependencyGraphSnapshot *DependencyGraphSnapshot) (*DependencyGraphSnapshotCreationData, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependency-graph/snapshots", owner, repo) - req, err := s.client.NewRequest("POST", url, dependencyGraphSnapshot) + req, err := s.client.NewRequest(ctx, "POST", url, dependencyGraphSnapshot) if err != nil { return nil, nil, err } var snapshotCreationData *DependencyGraphSnapshotCreationData - resp, err := s.client.Do(ctx, req, &snapshotCreationData) + resp, err := s.client.Do(req, &snapshotCreationData) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/doc.go b/vendor/github.com/google/go-github/v88/github/doc.go similarity index 84% rename from vendor/github.com/google/go-github/v84/github/doc.go rename to vendor/github.com/google/go-github/v88/github/doc.go index 337c37900..783917d80 100644 --- a/vendor/github.com/google/go-github/v84/github/doc.go +++ b/vendor/github.com/google/go-github/v88/github/doc.go @@ -8,19 +8,25 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v84/github" + import "github.com/google/go-github/v88/github" -Construct a new GitHub client, then use the various services on the client to +Construct a new GitHub client using [NewClient], then use the various services on the client to access different parts of the GitHub API. For example: - client := github.NewClient(nil) + client, err := github.NewClient() + if err != nil { + // Handle error. + } // list all organizations for user "willnorris" orgs, _, err := client.Organizations.List(ctx, "willnorris", nil) Some API methods have optional parameters that can be passed. For example: - client := github.NewClient(nil) + client, err := github.NewClient() + if err != nil { + // Handle error. + } // list public repositories for org "github" opt := &github.RepositoryListByOrgOptions{Type: "public"} @@ -28,7 +34,7 @@ Some API methods have optional parameters that can be passed. For example: The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at -https://docs.github.com/rest . +https://docs.github.com/rest?apiVersion=2022-11-28. NOTE: Using the [context] package, one can easily pass cancellation signals and deadlines to various services of the client for @@ -39,11 +45,14 @@ For more sample code snippets, head over to the https://github.com/google/go-git # Authentication -Use [Client.WithAuthToken] to configure your client to authenticate using an OAuth token +Use [WithAuthToken] to configure your client to authenticate using an OAuth token (for example, a personal access token). This is what is needed for a majority of use cases aside from GitHub Apps. - client := github.NewClient(nil).WithAuthToken("... your access token ...") + client, err := github.NewClient(github.WithAuthToken("... your access token ...")) + if err != nil { + // Handle error. + } Note that when using an authenticated [Client], all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should @@ -55,7 +64,7 @@ For API methods that require HTTP Basic Authentication, use the GitHub Apps authentication can be provided by the https://github.com/bradleyfalzon/ghinstallation package. It supports both authentication as an installation, using an installation access token, -and as an app, using a JWT. +and as an app, using a JWT. Use the [WithTransport] option to configure your client to use the appropriate transport. To authenticate as an installation: @@ -69,7 +78,10 @@ To authenticate as an installation: } // Use installation transport with client - client := github.NewClient(&http.Client{Transport: itr}) + client, err := github.NewClient(github.WithTransport(itr)) + if err != nil { + // Handle error. + } // Use client... } @@ -86,7 +98,10 @@ To authenticate as an app, using a JWT: } // Use app transport with client - client := github.NewClient(&http.Client{Transport: atr}) + client, err := github.NewClient(github.WithTransport(atr)) + if err != nil { + // Handle error. + } // Use client... } @@ -118,7 +133,7 @@ For secondary rate limits, you can check if its type is *[AbuseRateLimitError]: } Learn more about GitHub rate limiting at -https://docs.github.com/rest/rate-limit . +https://docs.github.com/rest/rate-limit?apiVersion=2022-11-28. # Accepted Status @@ -150,7 +165,7 @@ recommended when making requests using short-lived credentials such as a GitHub App installation token. Learn more about GitHub conditional requests at -https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate. +https://docs.github.com/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate. # Creating and Updating Resources @@ -177,7 +192,10 @@ embedded type of a more specific list options struct (for example [PullRequestListOptions]). Pages information is available via the [Response] struct. - client := github.NewClient(nil) + client, err := github.NewClient() + if err != nil { + // Handle error. + } opt := &github.RepositoryListByOrgOptions{ ListOptions: github.ListOptions{PerPage: 10}, diff --git a/vendor/github.com/google/go-github/v84/github/emojis.go b/vendor/github.com/google/go-github/v88/github/emojis.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/emojis.go rename to vendor/github.com/google/go-github/v88/github/emojis.go index b7a03dd98..0bf9ed143 100644 --- a/vendor/github.com/google/go-github/v84/github/emojis.go +++ b/vendor/github.com/google/go-github/v88/github/emojis.go @@ -14,17 +14,17 @@ type EmojisService service // List returns the emojis available to use on GitHub. // -// GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis +// GitHub API docs: https://docs.github.com/rest/emojis/emojis?apiVersion=2022-11-28#get-emojis // //meta:operation GET /emojis func (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, error) { - req, err := s.client.NewRequest("GET", "emojis", nil) + req, err := s.client.NewRequest(ctx, "GET", "emojis", nil) if err != nil { return nil, nil, err } var emoji map[string]string - resp, err := s.client.Do(ctx, req, &emoji) + resp, err := s.client.Do(req, &emoji) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise.go b/vendor/github.com/google/go-github/v88/github/enterprise.go similarity index 94% rename from vendor/github.com/google/go-github/v84/github/enterprise.go rename to vendor/github.com/google/go-github/v88/github/enterprise.go index 2036f8bc7..f808a2926 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise.go @@ -8,5 +8,5 @@ package github // EnterpriseService provides access to the enterprise related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin/ +// GitHub API docs: https://docs.github.com/rest/enterprise-admin?apiVersion=2022-11-28 type EnterpriseService service diff --git a/vendor/github.com/google/go-github/v88/github/enterprise_actions_hosted_runners.go b/vendor/github.com/google/go-github/v88/github/enterprise_actions_hosted_runners.go new file mode 100644 index 000000000..08b470b31 --- /dev/null +++ b/vendor/github.com/google/go-github/v88/github/enterprise_actions_hosted_runners.go @@ -0,0 +1,344 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// ListHostedRunners lists all the GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#list-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var runners *HostedRunners + resp, err := s.client.Do(req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// CreateHostedRunner creates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#create-a-github-hosted-runner-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request CreateHostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(&request); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + req, err := s.client.NewRequest(ctx, "POST", u, request) + if err != nil { + return nil, nil, err + } + + var hostedRunner *HostedRunner + resp, err := s.client.Do(req, &hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-owned-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned +func (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/github-owned", enterprise) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var hostedRunnerImages *HostedRunnerImages + resp, err := s.client.Do(req, &hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-partner-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner +func (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/partner", enterprise) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var hostedRunnerImages *HostedRunnerImages + resp, err := s.client.Do(req, &hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-limits-on-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits +func (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/limits", enterprise) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var publicIPLimits *HostedRunnerPublicIPLimits + resp, err := s.client.Do(req, &publicIPLimits) + if err != nil { + return nil, resp, err + } + + return publicIPLimits, resp, nil +} + +// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-github-hosted-runners-machine-specs-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes +func (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/machine-sizes", enterprise) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var machineSpecs *HostedRunnerMachineSpecs + resp, err := s.client.Do(req, &machineSpecs) + if err != nil { + return nil, resp, err + } + + return machineSpecs, resp, nil +} + +// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-platforms-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms +func (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/platforms", enterprise) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var platforms *HostedRunnerPlatforms + resp, err := s.client.Do(req, &platforms) + if err != nil { + return nil, resp, err + } + + return platforms, resp, nil +} + +// GetHostedRunner gets a GitHub-hosted runner in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-a-github-hosted-runner-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var hostedRunner *HostedRunner + resp, err := s.client.Do(req, &hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#update-a-github-hosted-runner-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, request UpdateHostedRunnerRequest) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest(ctx, "PATCH", u, request) + if err != nil { + return nil, nil, err + } + + var hostedRunner *HostedRunner + resp, err := s.client.Do(req, &hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-github-hosted-runner-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + var hostedRunner *HostedRunner + resp, err := s.client.Do(req, &hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// ListHostedRunnerCustomImages lists custom images for GitHub-hosted runners in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#list-custom-images-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom +func (s *EnterpriseService) ListHostedRunnerCustomImages(ctx context.Context, enterprise string) (*HostedRunnerCustomImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom", enterprise) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var images *HostedRunnerCustomImages + resp, err := s.client.Do(req, &images) + if err != nil { + return nil, resp, err + } + + return images, resp, nil +} + +// GetHostedRunnerCustomImage gets a custom image definition for GitHub-hosted runners in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-an-enterprise-custom-image-definition-for-github-actions-hosted-runners +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id} +func (s *EnterpriseService) GetHostedRunnerCustomImage(ctx context.Context, enterprise string, imageDefinitionID int64) (*HostedRunnerCustomImage, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v", enterprise, imageDefinitionID) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var image *HostedRunnerCustomImage + resp, err := s.client.Do(req, &image) + if err != nil { + return nil, resp, err + } + + return image, resp, nil +} + +// DeleteHostedRunnerCustomImage deletes a custom image from the enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-a-custom-image-from-the-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id} +func (s *EnterpriseService) DeleteHostedRunnerCustomImage(ctx context.Context, enterprise string, imageDefinitionID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v", enterprise, imageDefinitionID) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} + +// ListHostedRunnerCustomImageVersions lists image versions of a custom image for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#list-image-versions-of-a-custom-image-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions +func (s *EnterpriseService) ListHostedRunnerCustomImageVersions(ctx context.Context, enterprise string, imageDefinitionID int64) (*HostedRunnerCustomImageVersions, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v/versions", enterprise, imageDefinitionID) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var versions *HostedRunnerCustomImageVersions + resp, err := s.client.Do(req, &versions) + if err != nil { + return nil, resp, err + } + + return versions, resp, nil +} + +// GetHostedRunnerCustomImageVersion gets an image version of a custom image for GitHub-hosted runners in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#get-an-image-version-of-an-enterprise-custom-image-for-github-actions-hosted-runners +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} +func (s *EnterpriseService) GetHostedRunnerCustomImageVersion(ctx context.Context, enterprise string, imageDefinitionID int64, version string) (*HostedRunnerCustomImageVersion, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v/versions/%v", enterprise, imageDefinitionID, version) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var imageVersion *HostedRunnerCustomImageVersion + resp, err := s.client.Do(req, &imageVersion) + if err != nil { + return nil, resp, err + } + + return imageVersion, resp, nil +} + +// DeleteHostedRunnerCustomImageVersion deletes an image version of a custom image from the enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners?apiVersion=2022-11-28#delete-an-image-version-of-custom-image-from-the-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} +func (s *EnterpriseService) DeleteHostedRunnerCustomImageVersion(ctx context.Context, enterprise string, imageDefinitionID int64, version string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/custom/%v/versions/%v", enterprise, imageDefinitionID, version) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_actions_runner_groups.go b/vendor/github.com/google/go-github/v88/github/enterprise_actions_runner_groups.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/enterprise_actions_runner_groups.go rename to vendor/github.com/google/go-github/v88/github/enterprise_actions_runner_groups.go index f171df757..b99481405 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_actions_runner_groups.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_actions_runner_groups.go @@ -24,6 +24,8 @@ type EnterpriseRunnerGroup struct { Default *bool `json:"default,omitempty"` SelectedOrganizationsURL *string `json:"selected_organizations_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"` @@ -51,6 +53,8 @@ type CreateEnterpriseRunnerGroupRequest 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"` } // UpdateEnterpriseRunnerGroupRequest represents a request to update a Runner group for an enterprise. @@ -60,6 +64,7 @@ type UpdateEnterpriseRunnerGroupRequest 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"` } // SetOrgAccessRunnerGroupRequest represents a request to replace the list of organizations @@ -79,7 +84,7 @@ type ListEnterpriseRunnerGroupOptions struct { // ListRunnerGroups lists all self-hosted runner groups configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runner-groups func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) (*EnterpriseRunnerGroups, *Response, error) { @@ -89,13 +94,13 @@ func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise str return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - groups := &EnterpriseRunnerGroups{} - resp, err := s.client.Do(ctx, req, &groups) + var groups *EnterpriseRunnerGroups + resp, err := s.client.Do(req, &groups) if err != nil { return nil, resp, err } @@ -105,18 +110,18 @@ func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise str // GetEnterpriseRunnerGroup gets a specific self-hosted runner group for an enterprise using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runnerGroup := new(EnterpriseRunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *EnterpriseRunnerGroup + resp, err := s.client.Do(req, &runnerGroup) if err != nil { return nil, resp, err } @@ -126,34 +131,34 @@ func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterp // DeleteEnterpriseRunnerGroup deletes a self-hosted runner group from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CreateEnterpriseRunnerGroup creates a new self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/actions/runner-groups func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, enterprise string, createReq CreateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) - req, err := s.client.NewRequest("POST", u, createReq) + req, err := s.client.NewRequest(ctx, "POST", u, createReq) if err != nil { return nil, nil, err } - runnerGroup := new(EnterpriseRunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *EnterpriseRunnerGroup + resp, err := s.client.Do(req, &runnerGroup) if err != nil { return nil, resp, err } @@ -163,18 +168,18 @@ func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, ent // UpdateEnterpriseRunnerGroup updates a self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64, updateReq UpdateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) - req, err := s.client.NewRequest("PATCH", u, updateReq) + req, err := s.client.NewRequest(ctx, "PATCH", u, updateReq) if err != nil { return nil, nil, err } - runnerGroup := new(EnterpriseRunnerGroup) - resp, err := s.client.Do(ctx, req, runnerGroup) + var runnerGroup *EnterpriseRunnerGroup + resp, err := s.client.Do(req, &runnerGroup) if err != nil { return nil, resp, err } @@ -184,7 +189,7 @@ func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, ent // ListOrganizationAccessRunnerGroup lists the organizations with access to a self-hosted runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*ListOrganizations, *Response, error) { @@ -194,13 +199,13 @@ func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Contex return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - orgs := &ListOrganizations{} - resp, err := s.client.Do(ctx, req, &orgs) + var orgs *ListOrganizations + resp, err := s.client.Do(req, &orgs) if err != nil { return nil, resp, err } @@ -211,57 +216,57 @@ func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Contex // SetOrganizationAccessRunnerGroup replaces the list of organizations that have access to a self-hosted runner group configured in an enterprise // with a new List of organizations. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, ids SetOrgAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) - req, err := s.client.NewRequest("PUT", u, ids) + req, err := s.client.NewRequest(ctx, "PUT", u, ids) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddOrganizationAccessRunnerGroup adds an organization to the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveOrganizationAccessRunnerGroup removes an organization from the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListRunnerGroupRunners lists self-hosted runners that are in a specific enterprise group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { @@ -271,13 +276,13 @@ func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterpri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runners := &Runners{} - resp, err := s.client.Do(ctx, req, &runners) + var runners *Runners + resp, err := s.client.Do(req, &runners) if err != nil { return nil, resp, err } @@ -288,49 +293,49 @@ func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterpri // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an enterprise runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) - req, err := s.client.NewRequest("PUT", u, ids) + req, err := s.client.NewRequest(ctx, "PUT", u, ids) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an enterprise. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *EnterpriseService) RemoveRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v88/github/enterprise_actions_runners.go similarity index 73% rename from vendor/github.com/google/go-github/v84/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v88/github/enterprise_actions_runners.go index 408dcfd84..c98ba62fa 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_actions_runners.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_actions_runners.go @@ -12,18 +12,18 @@ import ( // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runners/downloads func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/downloads", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var rads []*RunnerApplicationDownload - resp, err := s.client.Do(ctx, req, &rads) + resp, err := s.client.Do(req, &rads) if err != nil { return nil, resp, err } @@ -33,19 +33,19 @@ func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, // GenerateEnterpriseJITConfig generates a just-in-time configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/actions/runners/generate-jitconfig func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, enterprise string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/generate-jitconfig", enterprise) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - jitConfig := new(JITRunnerConfig) - resp, err := s.client.Do(ctx, req, jitConfig) + var jitConfig *JITRunnerConfig + resp, err := s.client.Do(req, &jitConfig) if err != nil { return nil, resp, err } @@ -55,19 +55,19 @@ func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, ent // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/actions/runners/registration-token func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/registration-token", enterprise) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - registrationToken := new(RegistrationToken) - resp, err := s.client.Do(ctx, req, registrationToken) + var registrationToken *RegistrationToken + resp, err := s.client.Do(req, ®istrationToken) if err != nil { return nil, resp, err } @@ -77,7 +77,7 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // ListRunners lists all the self-hosted runners for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runners func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListRunnersOptions) (*Runners, *Response, error) { @@ -87,13 +87,13 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runners := &Runners{} - resp, err := s.client.Do(ctx, req, &runners) + var runners *Runners + resp, err := s.client.Do(req, &runners) if err != nil { return nil, resp, err } @@ -103,18 +103,18 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, // GetRunner gets a specific self-hosted runner configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runners/{runner_id} func (s *EnterpriseService) GetRunner(ctx context.Context, enterprise string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - runner := new(Runner) - resp, err := s.client.Do(ctx, req, runner) + var runner *Runner + resp, err := s.client.Do(req, &runner) if err != nil { return nil, resp, err } @@ -124,16 +124,16 @@ func (s *EnterpriseService) GetRunner(ctx context.Context, enterprise string, ru // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/actions/runners/{runner_id} func (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_app_installation.go b/vendor/github.com/google/go-github/v88/github/enterprise_app_installation.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/enterprise_app_installation.go rename to vendor/github.com/google/go-github/v88/github/enterprise_app_installation.go index aed3ac753..495b6d839 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_app_installation.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_app_installation.go @@ -37,7 +37,7 @@ type InstallAppRequest struct { // ListAppInstallableOrganizations lists the organizations in an enterprise that are installable for an app. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-enterprise-owned-organizations-that-can-have-github-apps-installed +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#get-enterprise-owned-organizations-that-can-have-github-apps-installed // //meta:operation GET /enterprises/{enterprise}/apps/installable_organizations func (s *EnterpriseService) ListAppInstallableOrganizations(ctx context.Context, enterprise string, opts *ListOptions) ([]*InstallableOrganization, *Response, error) { @@ -48,13 +48,13 @@ func (s *EnterpriseService) ListAppInstallableOrganizations(ctx context.Context, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var orgs []*InstallableOrganization - resp, err := s.client.Do(ctx, req, &orgs) + resp, err := s.client.Do(req, &orgs) if err != nil { return nil, resp, err } @@ -64,7 +64,7 @@ func (s *EnterpriseService) ListAppInstallableOrganizations(ctx context.Context, // ListAppAccessibleOrganizationRepositories lists the repositories accessible to an app in an enterprise-owned organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-repositories-belonging-to-an-enterprise-owned-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#get-repositories-belonging-to-an-enterprise-owned-organization // //meta:operation GET /enterprises/{enterprise}/apps/installable_organizations/{org}/accessible_repositories func (s *EnterpriseService) ListAppAccessibleOrganizationRepositories(ctx context.Context, enterprise, org string, opts *ListOptions) ([]*AccessibleRepository, *Response, error) { @@ -75,13 +75,13 @@ func (s *EnterpriseService) ListAppAccessibleOrganizationRepositories(ctx contex return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var repos []*AccessibleRepository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -91,7 +91,7 @@ func (s *EnterpriseService) ListAppAccessibleOrganizationRepositories(ctx contex // ListAppInstallations lists the GitHub app installations associated with the given enterprise-owned organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#list-github-apps-installed-on-an-enterprise-owned-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#list-github-apps-installed-on-an-enterprise-owned-organization // //meta:operation GET /enterprises/{enterprise}/apps/organizations/{org}/installations func (s *EnterpriseService) ListAppInstallations(ctx context.Context, enterprise, org string, opts *ListOptions) ([]*Installation, *Response, error) { @@ -102,13 +102,13 @@ func (s *EnterpriseService) ListAppInstallations(ctx context.Context, enterprise return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var installation []*Installation - resp, err := s.client.Do(ctx, req, &installation) + resp, err := s.client.Do(req, &installation) if err != nil { return nil, resp, err } @@ -119,18 +119,18 @@ func (s *EnterpriseService) ListAppInstallations(ctx context.Context, enterprise // InstallApp installs any valid GitHub app on the specified organization owned by the enterprise. // If the app is already installed on the organization, and is suspended, it will be unsuspended. If the app has a pending installation request, they will all be approved. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#install-a-github-app-on-an-enterprise-owned-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#install-a-github-app-on-an-enterprise-owned-organization // //meta:operation POST /enterprises/{enterprise}/apps/organizations/{org}/installations func (s *EnterpriseService) InstallApp(ctx context.Context, enterprise, org string, request InstallAppRequest) (*Installation, *Response, error) { u := fmt.Sprintf("enterprises/%v/apps/organizations/%v/installations", enterprise, org) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } var installation *Installation - resp, err := s.client.Do(ctx, req, &installation) + resp, err := s.client.Do(req, &installation) if err != nil { return nil, resp, err } @@ -140,17 +140,17 @@ func (s *EnterpriseService) InstallApp(ctx context.Context, enterprise, org stri // UninstallApp uninstalls a GitHub app from an organization. Any app installed on the organization can be removed. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#uninstall-a-github-app-from-an-enterprise-owned-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#uninstall-a-github-app-from-an-enterprise-owned-organization // //meta:operation DELETE /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id} func (s *EnterpriseService) UninstallApp(ctx context.Context, enterprise, org string, installationID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/apps/organizations/%v/installations/%v", enterprise, org, installationID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_apps.go b/vendor/github.com/google/go-github/v88/github/enterprise_apps.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/enterprise_apps.go rename to vendor/github.com/google/go-github/v88/github/enterprise_apps.go index 3fc0df743..bd1e65734 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_apps.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_apps.go @@ -27,7 +27,7 @@ type UpdateAppInstallationRepositoriesOptions struct { // ListRepositoriesForOrgAppInstallation lists the repositories that an enterprise app installation // has access to on an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-the-repositories-accessible-to-a-given-github-app-installation +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#get-the-repositories-accessible-to-a-given-github-app-installation // //meta:operation GET /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories func (s *EnterpriseService) ListRepositoriesForOrgAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts *ListOptions) ([]*AccessibleRepository, *Response, error) { @@ -37,13 +37,13 @@ func (s *EnterpriseService) ListRepositoriesForOrgAppInstallation(ctx context.Co return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var r []*AccessibleRepository - resp, err := s.client.Do(ctx, req, &r) + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -54,18 +54,18 @@ func (s *EnterpriseService) ListRepositoriesForOrgAppInstallation(ctx context.Co // UpdateAppInstallationRepositories changes a GitHub App installation's repository access // between all repositories and a selected set. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#toggle-installation-repository-access-between-selected-and-all-repositories +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#toggle-installation-repository-access-between-selected-and-all-repositories // //meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories func (s *EnterpriseService) UpdateAppInstallationRepositories(ctx context.Context, enterprise, org string, installationID int64, opts UpdateAppInstallationRepositoriesOptions) (*Installation, *Response, error) { u := fmt.Sprintf("enterprises/%v/apps/organizations/%v/installations/%v/repositories", enterprise, org, installationID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } var r *Installation - resp, err := s.client.Do(ctx, req, &r) + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -75,18 +75,18 @@ func (s *EnterpriseService) UpdateAppInstallationRepositories(ctx context.Contex // AddRepositoriesToAppInstallation grants repository access for a GitHub App installation. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#grant-repository-access-to-an-organization-installation +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#grant-repository-access-to-an-organization-installation // //meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories/add func (s *EnterpriseService) AddRepositoriesToAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts AppInstallationRepositoriesOptions) ([]*AccessibleRepository, *Response, error) { u := fmt.Sprintf("enterprises/%v/apps/organizations/%v/installations/%v/repositories/add", enterprise, org, installationID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } var r []*AccessibleRepository - resp, err := s.client.Do(ctx, req, &r) + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -96,18 +96,18 @@ func (s *EnterpriseService) AddRepositoriesToAppInstallation(ctx context.Context // RemoveRepositoriesFromAppInstallation revokes repository access from a GitHub App installation. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#remove-repository-access-from-an-organization-installation +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations?apiVersion=2022-11-28#remove-repository-access-from-an-organization-installation // //meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories/remove func (s *EnterpriseService) RemoveRepositoriesFromAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts AppInstallationRepositoriesOptions) ([]*AccessibleRepository, *Response, error) { u := fmt.Sprintf("enterprises/%v/apps/organizations/%v/installations/%v/repositories/remove", enterprise, org, installationID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } var r []*AccessibleRepository - resp, err := s.client.Do(ctx, req, &r) + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v88/github/enterprise_audit_log.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v88/github/enterprise_audit_log.go index 058a7d177..afac46235 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_audit_log.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_audit_log.go @@ -12,7 +12,7 @@ import ( // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#get-the-audit-log-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/audit-log func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { @@ -22,13 +22,13 @@ func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var auditEntries []*AuditEntry - resp, err := s.client.Do(ctx, req, &auditEntries) + resp, err := s.client.Do(req, &auditEntries) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v88/github/enterprise_audit_log_stream.go b/vendor/github.com/google/go-github/v88/github/enterprise_audit_log_stream.go new file mode 100644 index 000000000..012d29754 --- /dev/null +++ b/vendor/github.com/google/go-github/v88/github/enterprise_audit_log_stream.go @@ -0,0 +1,287 @@ +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// AuditLogStream represents an audit log stream configuration for an enterprise. +type AuditLogStream struct { + ID int64 `json:"id"` + StreamType string `json:"stream_type"` + StreamDetails string `json:"stream_details"` + Enabled bool `json:"enabled"` + CreatedAt Timestamp `json:"created_at"` + UpdatedAt Timestamp `json:"updated_at"` + PausedAt *Timestamp `json:"paused_at,omitempty"` +} + +// AuditLogStreamConfig represents a configuration for creating or updating an audit log stream. +type AuditLogStreamConfig struct { + Enabled bool `json:"enabled"` + StreamType string `json:"stream_type"` + VendorSpecific AuditLogStreamVendorConfig `json:"vendor_specific"` +} + +// AuditLogStreamVendorConfig is a sealed marker interface for vendor-specific audit log +// stream configurations. Only this package can define implementations. +type AuditLogStreamVendorConfig interface { + isAuditLogStreamVendorConfig() +} + +// AuditLogStreamKey represents the public key used to encrypt secrets for audit log streaming. +type AuditLogStreamKey struct { + KeyID string `json:"key_id"` + Key string `json:"key"` +} + +// AzureBlobConfig represents vendor-specific config for Azure Blob Storage. +type AzureBlobConfig struct { + KeyID string `json:"key_id"` + EncryptedSASURL string `json:"encrypted_sas_url"` + Container string `json:"container"` +} + +// AzureHubConfig represents vendor-specific config for Azure Event Hubs. +type AzureHubConfig struct { + Name string `json:"name"` + EncryptedConnstring string `json:"encrypted_connstring"` + KeyID string `json:"key_id"` +} + +// AmazonS3OIDCConfig represents vendor-specific config for Amazon S3 with OIDC authentication. +type AmazonS3OIDCConfig struct { + Bucket string `json:"bucket"` + Region string `json:"region"` + KeyID string `json:"key_id"` + AuthenticationType string `json:"authentication_type"` // Value: "oidc" + ArnRole string `json:"arn_role"` +} + +// AmazonS3AccessKeysConfig represents vendor-specific config for Amazon S3 with access key authentication. +type AmazonS3AccessKeysConfig struct { + Bucket string `json:"bucket"` + Region string `json:"region"` + KeyID string `json:"key_id"` + AuthenticationType string `json:"authentication_type"` // Value: "access_keys" + EncryptedSecretKey string `json:"encrypted_secret_key"` + EncryptedAccessKeyID string `json:"encrypted_access_key_id"` +} + +// SplunkConfig represents vendor-specific config for Splunk. +type SplunkConfig struct { + Domain string `json:"domain"` + Port uint16 `json:"port"` + KeyID string `json:"key_id"` + EncryptedToken string `json:"encrypted_token"` + SSLVerify bool `json:"ssl_verify"` +} + +// HecConfig represents vendor-specific config for an HTTPS Event Collector (HEC) endpoint. +type HecConfig struct { + Domain string `json:"domain"` + Port uint16 `json:"port"` + KeyID string `json:"key_id"` + EncryptedToken string `json:"encrypted_token"` + Path string `json:"path"` + SSLVerify bool `json:"ssl_verify"` +} + +// GoogleCloudConfig represents vendor-specific config for Google Cloud Storage. +type GoogleCloudConfig struct { + Bucket string `json:"bucket"` + KeyID string `json:"key_id"` + EncryptedJSONCredentials string `json:"encrypted_json_credentials"` +} + +// DatadogConfig represents vendor-specific config for Datadog. +type DatadogConfig struct { + EncryptedToken string `json:"encrypted_token"` + Site string `json:"site"` // One of: US, US3, US5, EU1, US1-FED, AP1 + KeyID string `json:"key_id"` +} + +// Implement the sealed marker interface for all vendor config types. +func (*AzureBlobConfig) isAuditLogStreamVendorConfig() {} +func (*AzureHubConfig) isAuditLogStreamVendorConfig() {} +func (*AmazonS3OIDCConfig) isAuditLogStreamVendorConfig() {} +func (*AmazonS3AccessKeysConfig) isAuditLogStreamVendorConfig() {} +func (*SplunkConfig) isAuditLogStreamVendorConfig() {} +func (*HecConfig) isAuditLogStreamVendorConfig() {} +func (*GoogleCloudConfig) isAuditLogStreamVendorConfig() {} +func (*DatadogConfig) isAuditLogStreamVendorConfig() {} + +// NewAzureBlobStreamConfig returns an AuditLogStreamConfig for Azure Blob Storage. +func NewAzureBlobStreamConfig(enabled bool, cfg *AzureBlobConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Azure Blob Storage", VendorSpecific: cfg} +} + +// NewAzureHubStreamConfig returns an AuditLogStreamConfig for Azure Event Hubs. +func NewAzureHubStreamConfig(enabled bool, cfg *AzureHubConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Azure Event Hubs", VendorSpecific: cfg} +} + +// NewAmazonS3OIDCStreamConfig returns an AuditLogStreamConfig for Amazon S3 with OIDC auth. +func NewAmazonS3OIDCStreamConfig(enabled bool, cfg *AmazonS3OIDCConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Amazon S3", VendorSpecific: cfg} +} + +// NewAmazonS3AccessKeysStreamConfig returns an AuditLogStreamConfig for Amazon S3 with access key auth. +func NewAmazonS3AccessKeysStreamConfig(enabled bool, cfg *AmazonS3AccessKeysConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Amazon S3", VendorSpecific: cfg} +} + +// NewSplunkStreamConfig returns an AuditLogStreamConfig for Splunk. +func NewSplunkStreamConfig(enabled bool, cfg *SplunkConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Splunk", VendorSpecific: cfg} +} + +// NewHecStreamConfig returns an AuditLogStreamConfig for an HTTPS Event Collector endpoint. +func NewHecStreamConfig(enabled bool, cfg *HecConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "HTTPS Event Collector", VendorSpecific: cfg} +} + +// NewGoogleCloudStreamConfig returns an AuditLogStreamConfig for Google Cloud Storage. +func NewGoogleCloudStreamConfig(enabled bool, cfg *GoogleCloudConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Google Cloud Storage", VendorSpecific: cfg} +} + +// NewDatadogStreamConfig returns an AuditLogStreamConfig for Datadog. +func NewDatadogStreamConfig(enabled bool, cfg *DatadogConfig) *AuditLogStreamConfig { + return &AuditLogStreamConfig{Enabled: enabled, StreamType: "Datadog", VendorSpecific: cfg} +} + +// GetAuditLogStreamKey retrieves the public key used to encrypt secrets for audit log streaming. +// Credentials must be encrypted with this key before being submitted via CreateAuditLogStream +// or UpdateAuditLogStream. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#get-the-audit-log-stream-key-for-encrypting-secrets +// +//meta:operation GET /enterprises/{enterprise}/audit-log/stream-key +func (s *EnterpriseService) GetAuditLogStreamKey(ctx context.Context, enterprise string) (*AuditLogStreamKey, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/stream-key", enterprise) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var key *AuditLogStreamKey + resp, err := s.client.Do(req, &key) + if err != nil { + return nil, resp, err + } + + return key, resp, nil +} + +// ListAuditLogStreams lists the audit log stream configurations for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#list-audit-log-stream-configurations-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/audit-log/streams +func (s *EnterpriseService) ListAuditLogStreams(ctx context.Context, enterprise string) ([]*AuditLogStream, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams", enterprise) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var streams []*AuditLogStream + resp, err := s.client.Do(req, &streams) + if err != nil { + return nil, resp, err + } + + return streams, resp, nil +} + +// GetAuditLogStream gets a single audit log stream configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#list-one-audit-log-streaming-configuration-via-a-stream-id +// +//meta:operation GET /enterprises/{enterprise}/audit-log/streams/{stream_id} +func (s *EnterpriseService) GetAuditLogStream(ctx context.Context, enterprise string, streamID int64) (*AuditLogStream, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams/%v", enterprise, streamID) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var stream *AuditLogStream + resp, err := s.client.Do(req, &stream) + if err != nil { + return nil, resp, err + } + + return stream, resp, nil +} + +// CreateAuditLogStream creates an audit log streaming configuration for an enterprise. +// Credentials in the config must be encrypted using the key returned by GetAuditLogStreamKey. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#create-an-audit-log-streaming-configuration-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/audit-log/streams +func (s *EnterpriseService) CreateAuditLogStream(ctx context.Context, enterprise string, config AuditLogStreamConfig) (*AuditLogStream, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams", enterprise) + + req, err := s.client.NewRequest(ctx, "POST", u, config) + if err != nil { + return nil, nil, err + } + + var stream *AuditLogStream + resp, err := s.client.Do(req, &stream) + if err != nil { + return nil, resp, err + } + + return stream, resp, nil +} + +// UpdateAuditLogStream updates an existing audit log stream configuration for an enterprise. +// Credentials in the config must be encrypted using the key returned by GetAuditLogStreamKey. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#update-an-existing-audit-log-stream-configuration +// +//meta:operation PUT /enterprises/{enterprise}/audit-log/streams/{stream_id} +func (s *EnterpriseService) UpdateAuditLogStream(ctx context.Context, enterprise string, streamID int64, config AuditLogStreamConfig) (*AuditLogStream, *Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams/%v", enterprise, streamID) + + req, err := s.client.NewRequest(ctx, "PUT", u, config) + if err != nil { + return nil, nil, err + } + + var stream *AuditLogStream + resp, err := s.client.Do(req, &stream) + if err != nil { + return nil, resp, err + } + + return stream, resp, nil +} + +// DeleteAuditLogStream deletes an audit log stream configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28#delete-an-audit-log-streaming-configuration-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id} +func (s *EnterpriseService) DeleteAuditLogStream(ctx context.Context, enterprise string, streamID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/audit-log/streams/%v", enterprise, streamID) + + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_billing_cost_centers.go b/vendor/github.com/google/go-github/v88/github/enterprise_billing_cost_centers.go similarity index 82% rename from vendor/github.com/google/go-github/v84/github/enterprise_billing_cost_centers.go rename to vendor/github.com/google/go-github/v88/github/enterprise_billing_cost_centers.go index 3cc3279da..da232c3c2 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_billing_cost_centers.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_billing_cost_centers.go @@ -76,7 +76,7 @@ type DeleteCostCenterResponse struct { // ListCostCenters lists all cost centers for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-all-cost-centers-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#get-all-cost-centers-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise string, opts *ListCostCenterOptions) (*CostCenters, *Response, error) { @@ -86,13 +86,13 @@ func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - costCenters := &CostCenters{} - resp, err := s.client.Do(ctx, req, costCenters) + var costCenters *CostCenters + resp, err := s.client.Do(req, &costCenters) if err != nil { return nil, resp, err } @@ -102,19 +102,19 @@ func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise stri // CreateCostCenter creates a new cost center for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#create-a-new-cost-center +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#create-a-new-cost-center // //meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers func (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise string, costCenter CostCenterRequest) (*CostCenter, *Response, error) { u := fmt.Sprintf("enterprises/%v/settings/billing/cost-centers", enterprise) - req, err := s.client.NewRequest("POST", u, costCenter) + req, err := s.client.NewRequest(ctx, "POST", u, costCenter) if err != nil { return nil, nil, err } - result := &CostCenter{} - resp, err := s.client.Do(ctx, req, result) + var result *CostCenter + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -124,19 +124,19 @@ func (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise str // GetCostCenter gets a cost center by ID for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-a-cost-center-by-id +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#get-a-cost-center-by-id // //meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id} func (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costCenterID string) (*CostCenter, *Response, error) { u := fmt.Sprintf("enterprises/%v/settings/billing/cost-centers/%v", enterprise, costCenterID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - costCenter := &CostCenter{} - resp, err := s.client.Do(ctx, req, costCenter) + var costCenter *CostCenter + resp, err := s.client.Do(req, &costCenter) if err != nil { return nil, resp, err } @@ -146,19 +146,19 @@ func (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costC // UpdateCostCenter updates the name of a cost center. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#update-a-cost-center-name +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#update-a-cost-center-name // //meta:operation PATCH /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id} func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, costCenterID string, costCenter CostCenterRequest) (*CostCenter, *Response, error) { u := fmt.Sprintf("enterprises/%v/settings/billing/cost-centers/%v", enterprise, costCenterID) - req, err := s.client.NewRequest("PATCH", u, costCenter) + req, err := s.client.NewRequest(ctx, "PATCH", u, costCenter) if err != nil { return nil, nil, err } - result := &CostCenter{} - resp, err := s.client.Do(ctx, req, result) + var result *CostCenter + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -168,19 +168,19 @@ func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, co // DeleteCostCenter deletes a cost center. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#delete-a-cost-center +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#delete-a-cost-center // //meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id} func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, costCenterID string) (*DeleteCostCenterResponse, *Response, error) { u := fmt.Sprintf("enterprises/%v/settings/billing/cost-centers/%v", enterprise, costCenterID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, nil, err } - result := &DeleteCostCenterResponse{} - resp, err := s.client.Do(ctx, req, result) + var result *DeleteCostCenterResponse + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -190,19 +190,19 @@ func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, co // AddResourcesToCostCenter adds resources to a cost center. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#add-resources-to-a-cost-center +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#add-resources-to-a-cost-center // //meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*AddResourcesToCostCenterResponse, *Response, error) { u := fmt.Sprintf("enterprises/%v/settings/billing/cost-centers/%v/resource", enterprise, costCenterID) - req, err := s.client.NewRequest("POST", u, resources) + req, err := s.client.NewRequest(ctx, "POST", u, resources) if err != nil { return nil, nil, err } - result := &AddResourcesToCostCenterResponse{} - resp, err := s.client.Do(ctx, req, result) + var result *AddResourcesToCostCenterResponse + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -212,19 +212,19 @@ func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterp // RemoveResourcesFromCostCenter removes resources from a cost center. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#remove-resources-from-a-cost-center +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers?apiVersion=2022-11-28#remove-resources-from-a-cost-center // //meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource func (s *EnterpriseService) RemoveResourcesFromCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*RemoveResourcesFromCostCenterResponse, *Response, error) { u := fmt.Sprintf("enterprises/%v/settings/billing/cost-centers/%v/resource", enterprise, costCenterID) - req, err := s.client.NewRequest("DELETE", u, resources) + req, err := s.client.NewRequest(ctx, "DELETE", u, resources) if err != nil { return nil, nil, err } - result := &RemoveResourcesFromCostCenterResponse{} - resp, err := s.client.Do(ctx, req, result) + var result *RemoveResourcesFromCostCenterResponse + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v88/github/enterprise_budgets.go b/vendor/github.com/google/go-github/v88/github/enterprise_budgets.go new file mode 100644 index 000000000..d402671c4 --- /dev/null +++ b/vendor/github.com/google/go-github/v88/github/enterprise_budgets.go @@ -0,0 +1,198 @@ +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// BudgetScope constants represent the scope of the budget. +const ( + BudgetScopeEnterprise = "enterprise" + BudgetScopeOrganization = "organization" + BudgetScopeRepository = "repository" + BudgetScopeCostCenter = "cost_center" +) + +// BudgetType constants represent the type of pricing for the budget. +const ( + BudgetTypeProductPricing = "ProductPricing" + BudgetTypeSkuPricing = "SkuPricing" +) + +// EnterpriseBudgetAlerting represents alerting settings for a GitHub enterprise budget. +type EnterpriseBudgetAlerting struct { + WillAlert *bool `json:"will_alert,omitempty"` + AlertRecipients []string `json:"alert_recipients,omitempty"` +} + +// EnterpriseBudget represents a GitHub enterprise budget. +type EnterpriseBudget struct { + ID *string `json:"id,omitempty"` + BudgetType *string `json:"budget_type,omitempty"` + BudgetProductSKU *string `json:"budget_product_sku,omitempty"` + BudgetScope *string `json:"budget_scope,omitempty"` + BudgetEntityName *string `json:"budget_entity_name,omitempty"` + BudgetAmount *int `json:"budget_amount,omitempty"` + PreventFurtherUsage *bool `json:"prevent_further_usage,omitempty"` + BudgetAlerting *EnterpriseBudgetAlerting `json:"budget_alerting,omitempty"` +} + +func (b EnterpriseBudget) String() string { + return Stringify(b) +} + +// EnterpriseListBudgets represents a collection of GitHub enterprise budgets. +type EnterpriseListBudgets struct { + Budgets []*EnterpriseBudget `json:"budgets"` + HasNextPage *bool `json:"has_next_page,omitempty"` + TotalCount *int `json:"total_count,omitempty"` +} + +// EnterpriseCreateBudget represents the payload to create a GitHub enterprise budget. +type EnterpriseCreateBudget struct { + BudgetAmount int `json:"budget_amount"` + PreventFurtherUsage bool `json:"prevent_further_usage"` + BudgetAlerting *EnterpriseBudgetAlerting `json:"budget_alerting"` + BudgetScope string `json:"budget_scope"` + BudgetEntityName *string `json:"budget_entity_name,omitempty"` + BudgetType string `json:"budget_type"` + BudgetProductSKU *string `json:"budget_product_sku,omitempty"` +} + +// EnterpriseUpdateBudget represents the payload to update a GitHub enterprise budget. +type EnterpriseUpdateBudget struct { + BudgetAmount *int `json:"budget_amount,omitempty"` + PreventFurtherUsage *bool `json:"prevent_further_usage,omitempty"` + BudgetAlerting *EnterpriseBudgetAlerting `json:"budget_alerting,omitempty"` + BudgetScope *string `json:"budget_scope,omitempty"` + BudgetEntityName *string `json:"budget_entity_name,omitempty"` + BudgetType *string `json:"budget_type,omitempty"` + BudgetProductSKU *string `json:"budget_product_sku,omitempty"` +} + +// EnterpriseCreateOrUpdateBudgetResponse represents the response when creating or updating a budget. +type EnterpriseCreateOrUpdateBudgetResponse struct { + Message string `json:"message"` + Budget *EnterpriseBudget `json:"budget"` +} + +// EnterpriseDeleteBudgetResponse represents the response when deleting a budget. +type EnterpriseDeleteBudgetResponse struct { + Message string `json:"message"` + ID string `json:"id"` +} + +// ListBudgets gets all budgets for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#get-all-budgets +// +//meta:operation GET /enterprises/{enterprise}/settings/billing/budgets +func (s *EnterpriseService) ListBudgets(ctx context.Context, enterprise string) (*EnterpriseListBudgets, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets", enterprise) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var budgets *EnterpriseListBudgets + resp, err := s.client.Do(req, &budgets) + if err != nil { + return nil, resp, err + } + + return budgets, resp, nil +} + +// CreateBudget creates a new budget for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#create-a-budget +// +//meta:operation POST /enterprises/{enterprise}/settings/billing/budgets +func (s *EnterpriseService) CreateBudget(ctx context.Context, enterprise string, budget EnterpriseCreateBudget) (*EnterpriseCreateOrUpdateBudgetResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets", enterprise) + + req, err := s.client.NewRequest(ctx, "POST", u, budget) + if err != nil { + return nil, nil, err + } + + var createBudgetResponse *EnterpriseCreateOrUpdateBudgetResponse + resp, err := s.client.Do(req, &createBudgetResponse) + if err != nil { + return nil, resp, err + } + + return createBudgetResponse, resp, nil +} + +// GetBudget gets a budget by ID for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#get-a-budget-by-id +// +//meta:operation GET /enterprises/{enterprise}/settings/billing/budgets/{budget_id} +func (s *EnterpriseService) GetBudget(ctx context.Context, enterprise, budgetID string) (*EnterpriseBudget, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets/%v", enterprise, budgetID) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var budget *EnterpriseBudget + resp, err := s.client.Do(req, &budget) + if err != nil { + return nil, resp, err + } + + return budget, resp, nil +} + +// UpdateBudget updates an existing budget for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#update-a-budget +// +//meta:operation PATCH /enterprises/{enterprise}/settings/billing/budgets/{budget_id} +func (s *EnterpriseService) UpdateBudget(ctx context.Context, enterprise, budgetID string, budget EnterpriseUpdateBudget) (*EnterpriseCreateOrUpdateBudgetResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets/%v", enterprise, budgetID) + + req, err := s.client.NewRequest(ctx, "PATCH", u, budget) + if err != nil { + return nil, nil, err + } + + var updateBudgetResponse *EnterpriseCreateOrUpdateBudgetResponse + resp, err := s.client.Do(req, &updateBudgetResponse) + if err != nil { + return nil, resp, err + } + + return updateBudgetResponse, resp, nil +} + +// DeleteBudget deletes a budget by ID for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets?apiVersion=2022-11-28#delete-a-budget +// +//meta:operation DELETE /enterprises/{enterprise}/settings/billing/budgets/{budget_id} +func (s *EnterpriseService) DeleteBudget(ctx context.Context, enterprise, budgetID string) (*EnterpriseDeleteBudgetResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/settings/billing/budgets/%v", enterprise, budgetID) + + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + var deleteBudgetResponse *EnterpriseDeleteBudgetResponse + resp, err := s.client.Do(req, &deleteBudgetResponse) + if err != nil { + return nil, resp, err + } + + return deleteBudgetResponse, resp, nil +} diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_code_security_and_analysis.go b/vendor/github.com/google/go-github/v88/github/enterprise_code_security_and_analysis.go similarity index 80% rename from vendor/github.com/google/go-github/v84/github/enterprise_code_security_and_analysis.go rename to vendor/github.com/google/go-github/v88/github/enterprise_code_security_and_analysis.go index 159aeae4d..6b9ca1c5a 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_code_security_and_analysis.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_code_security_and_analysis.go @@ -21,19 +21,19 @@ type EnterpriseSecurityAnalysisSettings struct { // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#get-code-security-and-analysis-features-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/code_security_and_analysis func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - settings := new(EnterpriseSecurityAnalysisSettings) - resp, err := s.client.Do(ctx, req, settings) + var settings *EnterpriseSecurityAnalysisSettings + resp, err := s.client.Do(req, &settings) if err != nil { return nil, resp, err } @@ -43,17 +43,17 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente // UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#update-code-security-and-analysis-features-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/code_security_and_analysis func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) - req, err := s.client.NewRequest("PATCH", u, settings) + req, err := s.client.NewRequest(ctx, "PATCH", u, settings) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -66,17 +66,17 @@ func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, e // Valid values for securityProduct: "advanced_security", "secret_scanning", "secret_scanning_push_protection". // Valid values for enablement: "enable_all", "disable_all". // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#enable-or-disable-a-security-feature // //meta:operation POST /enterprises/{enterprise}/{security_product}/{enablement} func (s *EnterpriseService) EnableDisableSecurityFeature(ctx context.Context, enterprise, securityProduct, enablement string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/%v/%v", enterprise, securityProduct, enablement) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_codesecurity_configurations.go b/vendor/github.com/google/go-github/v88/github/enterprise_codesecurity_configurations.go similarity index 82% rename from vendor/github.com/google/go-github/v84/github/enterprise_codesecurity_configurations.go rename to vendor/github.com/google/go-github/v88/github/enterprise_codesecurity_configurations.go index 978a32ad8..3036cdf66 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_codesecurity_configurations.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_codesecurity_configurations.go @@ -32,7 +32,7 @@ type ListEnterpriseCodeSecurityConfigurationOptions struct { // ListCodeSecurityConfigurations lists all code security configurations available in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-code-security-configurations-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/code-security/configurations func (s *EnterpriseService) ListCodeSecurityConfigurations(ctx context.Context, enterprise string, opts *ListEnterpriseCodeSecurityConfigurationOptions) ([]*CodeSecurityConfiguration, *Response, error) { @@ -42,13 +42,13 @@ func (s *EnterpriseService) ListCodeSecurityConfigurations(ctx context.Context, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var configurations []*CodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &configurations) + resp, err := s.client.Do(req, &configurations) if err != nil { return nil, resp, err } @@ -57,19 +57,19 @@ func (s *EnterpriseService) ListCodeSecurityConfigurations(ctx context.Context, // CreateCodeSecurityConfiguration creates a code security configuration in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#create-a-code-security-configuration-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/code-security/configurations func (s *EnterpriseService) CreateCodeSecurityConfiguration(ctx context.Context, enterprise string, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { u := fmt.Sprintf("enterprises/%v/code-security/configurations", enterprise) - req, err := s.client.NewRequest("POST", u, config) + req, err := s.client.NewRequest(ctx, "POST", u, config) if err != nil { return nil, nil, err } var configuration *CodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &configuration) + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } @@ -78,19 +78,19 @@ func (s *EnterpriseService) CreateCodeSecurityConfiguration(ctx context.Context, // ListDefaultCodeSecurityConfigurations lists the default code security configurations for an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-default-code-security-configurations-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/code-security/configurations/defaults func (s *EnterpriseService) ListDefaultCodeSecurityConfigurations(ctx context.Context, enterprise string) ([]*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { u := fmt.Sprintf("enterprises/%v/code-security/configurations/defaults", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var configurations []*CodeSecurityConfigurationWithDefaultForNewRepos - resp, err := s.client.Do(ctx, req, &configurations) + resp, err := s.client.Do(req, &configurations) if err != nil { return nil, resp, err } @@ -99,19 +99,19 @@ func (s *EnterpriseService) ListDefaultCodeSecurityConfigurations(ctx context.Co // GetCodeSecurityConfiguration gets a code security configuration available in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#retrieve-a-code-security-configuration-of-an-enterprise // //meta:operation GET /enterprises/{enterprise}/code-security/configurations/{configuration_id} func (s *EnterpriseService) GetCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64) (*CodeSecurityConfiguration, *Response, error) { u := fmt.Sprintf("enterprises/%v/code-security/configurations/%v", enterprise, configurationID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var configuration *CodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &configuration) + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } @@ -120,19 +120,19 @@ func (s *EnterpriseService) GetCodeSecurityConfiguration(ctx context.Context, en // UpdateCodeSecurityConfiguration updates a code security configuration in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#update-a-custom-code-security-configuration-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id} func (s *EnterpriseService) UpdateCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { u := fmt.Sprintf("enterprises/%v/code-security/configurations/%v", enterprise, configurationID) - req, err := s.client.NewRequest("PATCH", u, config) + req, err := s.client.NewRequest(ctx, "PATCH", u, config) if err != nil { return nil, nil, err } var configuration *CodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &configuration) + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } @@ -141,17 +141,17 @@ func (s *EnterpriseService) UpdateCodeSecurityConfiguration(ctx context.Context, // DeleteCodeSecurityConfiguration deletes a code security configuration from an enterprise. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#delete-a-code-security-configuration-for-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id} func (s *EnterpriseService) DeleteCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/code-security/configurations/%v", enterprise, configurationID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -162,7 +162,7 @@ func (s *EnterpriseService) DeleteCodeSecurityConfiguration(ctx context.Context, // `scope` is the type of repositories to attach the configuration to. // Can be one of: `all`, `all_without_configurations`. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#attach-an-enterprise-configuration-to-repositories // //meta:operation POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach func (s *EnterpriseService) AttachCodeSecurityConfigurationToRepositories(ctx context.Context, enterprise string, configurationID int64, scope string) (*Response, error) { @@ -171,11 +171,11 @@ func (s *EnterpriseService) AttachCodeSecurityConfigurationToRepositories(ctx co Scope string `json:"scope"` } - req, err := s.client.NewRequest("POST", u, scopeType{Scope: scope}) + req, err := s.client.NewRequest(ctx, "POST", u, scopeType{Scope: scope}) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil && resp.StatusCode != http.StatusAccepted { // StatusAccepted(202) is the expected status code as job is queued for processing return resp, err } @@ -186,7 +186,7 @@ func (s *EnterpriseService) AttachCodeSecurityConfigurationToRepositories(ctx co // `defaultForNewRepos` specifies which types of repository this security configuration should be applied to by default. // Can be one of: `all`, `none`, `private_and_internal`, `public`. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#set-a-code-security-configuration-as-a-default-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults func (s *EnterpriseService) SetDefaultCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64, defaultForNewRepos string) (*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { @@ -195,12 +195,12 @@ func (s *EnterpriseService) SetDefaultCodeSecurityConfiguration(ctx context.Cont DefaultForNewRepos string `json:"default_for_new_repos"` } - req, err := s.client.NewRequest("PUT", u, configParam{DefaultForNewRepos: defaultForNewRepos}) + req, err := s.client.NewRequest(ctx, "PUT", u, configParam{DefaultForNewRepos: defaultForNewRepos}) if err != nil { return nil, nil, err } var config *CodeSecurityConfigurationWithDefaultForNewRepos - resp, err := s.client.Do(ctx, req, &config) + resp, err := s.client.Do(req, &config) if err != nil { return nil, resp, err } @@ -209,7 +209,7 @@ func (s *EnterpriseService) SetDefaultCodeSecurityConfiguration(ctx context.Cont // ListCodeSecurityConfigurationRepositories lists the repositories associated with an enterprise code security configuration. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-repositories-associated-with-an-enterprise-code-security-configuration // //meta:operation GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories func (s *EnterpriseService) ListCodeSecurityConfigurationRepositories(ctx context.Context, enterprise string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) ([]*RepositoryAttachment, *Response, error) { @@ -219,12 +219,12 @@ func (s *EnterpriseService) ListCodeSecurityConfigurationRepositories(ctx contex return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var attachments []*RepositoryAttachment - resp, err := s.client.Do(ctx, req, &attachments) + resp, err := s.client.Do(req, &attachments) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_licenses.go b/vendor/github.com/google/go-github/v88/github/enterprise_licenses.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/enterprise_licenses.go rename to vendor/github.com/google/go-github/v88/github/enterprise_licenses.go index e58fc07c6..73da6c5e6 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_licenses.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_licenses.go @@ -89,25 +89,25 @@ 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#list-enterprise-consumed-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 { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - consumedLicenses := &EnterpriseConsumedLicenses{} - resp, err := s.client.Do(ctx, req, &consumedLicenses) + var consumedLicenses *EnterpriseConsumedLicenses + resp, err := s.client.Do(req, &consumedLicenses) if err != nil { return nil, resp, err } @@ -117,19 +117,19 @@ func (s *EnterpriseService) GetConsumedLicenses(ctx context.Context, enterprise // GetLicenseSyncStatus collects information about the status of a license sync job for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing#get-a-license-sync-status +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing?apiVersion=2022-11-28#get-a-license-sync-status // //meta:operation GET /enterprises/{enterprise}/license-sync-status func (s *EnterpriseService) GetLicenseSyncStatus(ctx context.Context, enterprise string) (*EnterpriseLicenseSyncStatus, *Response, error) { u := fmt.Sprintf("enterprises/%v/license-sync-status", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - syncStatus := &EnterpriseLicenseSyncStatus{} - resp, err := s.client.Do(ctx, req, &syncStatus) + var syncStatus *EnterpriseLicenseSyncStatus + resp, err := s.client.Do(req, &syncStatus) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes.go b/vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes.go rename to vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes.go index 023c119d1..ad10ad8c5 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes.go @@ -74,18 +74,18 @@ type ReleaseVersion struct { // CheckSystemRequirements checks if GHES system nodes meet the system requirements. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes // //meta:operation GET /manage/v1/checks/system-requirements func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) { u := "manage/v1/checks/system-requirements" - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - systemRequirements := new(SystemRequirements) - resp, err := s.client.Do(ctx, req, systemRequirements) + var systemRequirements *SystemRequirements + resp, err := s.client.Do(req, &systemRequirements) if err != nil { return nil, resp, err } @@ -95,18 +95,18 @@ func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*Syste // ClusterStatus gets the status of all services running on each cluster node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes // //meta:operation GET /manage/v1/cluster/status func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) { u := "manage/v1/cluster/status" - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - clusterStatus := new(ClusterStatus) - resp, err := s.client.Do(ctx, req, clusterStatus) + var clusterStatus *ClusterStatus + resp, err := s.client.Do(req, &clusterStatus) if err != nil { return nil, resp, err } @@ -116,7 +116,7 @@ func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, // ReplicationStatus gets the status of all services running on each replica node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes // //meta:operation GET /manage/v1/replication/status func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) { @@ -124,13 +124,13 @@ func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQue if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - status := new(ClusterStatus) - resp, err := s.client.Do(ctx, req, status) + var status *ClusterStatus + resp, err := s.client.Do(req, &status) if err != nil { return nil, resp, err } @@ -140,7 +140,7 @@ func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQue // GetNodeReleaseVersions gets the version information deployed to each node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes // //meta:operation GET /manage/v1/version func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) { @@ -148,13 +148,13 @@ func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *No if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var releaseVersions []*NodeReleaseVersion - resp, err := s.client.Do(ctx, req, &releaseVersions) + resp, err := s.client.Do(req, &releaseVersions) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_config.go b/vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_config.go similarity index 91% rename from vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_config.go rename to vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_config.go index 92bf3d71a..9770d044a 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_config.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_config.go @@ -305,7 +305,7 @@ type NodeDetails struct { // ConfigApplyEvents gets events from the command ghe-config-apply. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply // //meta:operation GET /manage/v1/config/apply/events func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) { @@ -313,13 +313,13 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - configApplyEvents := new(ConfigApplyEvents) - resp, err := s.client.Do(ctx, req, configApplyEvents) + var configApplyEvents *ConfigApplyEvents + resp, err := s.client.Do(req, &configApplyEvents) if err != nil { return nil, resp, err } @@ -330,7 +330,7 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA // InitialConfig initializes the GitHub Enterprise instance with a license and password. // After initializing the instance, you need to run an apply to apply the configuration. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password // //meta:operation POST /manage/v1/config/init func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) { @@ -341,28 +341,28 @@ func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password Password: password, } - req, err := s.client.NewRequest("POST", u, payload) + req, err := s.client.NewRequest(ctx, "POST", u, payload) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // License gets the current license information for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information +// 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) { u := "manage/v1/config/license" - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var licenseStatus []*LicenseStatus - resp, err := s.client.Do(ctx, req, &licenseStatus) + resp, err := s.client.Do(req, &licenseStatus) if err != nil { return nil, resp, err } @@ -372,7 +372,7 @@ func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Res // UploadLicense uploads a new license to the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license // //meta:operation PUT /manage/v1/config/license func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) { @@ -380,28 +380,28 @@ func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) ( opts := &UploadLicenseOptions{ License: license, } - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // LicenseStatus gets the current license status for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#check-a-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#check-a-license // //meta:operation GET /manage/v1/config/license/check func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) { u := "manage/v1/config/license/check" - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var checks []*LicenseCheck - resp, err := s.client.Do(ctx, req, &checks) + resp, err := s.client.Do(req, &checks) if err != nil { return nil, resp, err } @@ -412,7 +412,7 @@ func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, // NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance. // This is required for clustered setups. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes // //meta:operation GET /manage/v1/config/nodes func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) { @@ -420,13 +420,13 @@ func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOpt if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - status := new(NodeMetadataStatus) - resp, err := s.client.Do(ctx, req, status) + var status *NodeMetadataStatus + resp, err := s.client.Do(req, &status) if err != nil { return nil, resp, err } @@ -436,18 +436,18 @@ func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOpt // Settings gets the current configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-ghes-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-ghes-settings // //meta:operation GET /manage/v1/config/settings func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) { u := "manage/v1/config/settings" - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - configSettings := new(ConfigSettings) - resp, err := s.client.Do(ctx, req, configSettings) + var configSettings *ConfigSettings + resp, err := s.client.Do(req, &configSettings) if err != nil { return nil, resp, err } @@ -457,7 +457,7 @@ func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Res // UpdateSettings updates the configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#set-settings // //meta:operation PUT /manage/v1/config/settings func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) { @@ -466,28 +466,28 @@ func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSett if opts == nil { return nil, errors.New("opts should not be nil") } - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ConfigApply triggers a configuration apply run on the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run // //meta:operation POST /manage/v1/config/apply func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) { u := "manage/v1/config/apply" - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - configApplyOptions := new(ConfigApplyOptions) - resp, err := s.client.Do(ctx, req, configApplyOptions) + var configApplyOptions *ConfigApplyOptions + resp, err := s.client.Do(req, &configApplyOptions) if err != nil { return nil, resp, err } @@ -497,18 +497,18 @@ func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOp // ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance. // You can request lat one or specific id one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run // //meta:operation GET /manage/v1/config/apply func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) { u := "manage/v1/config/apply" - req, err := s.client.NewRequest("GET", u, opts) + req, err := s.client.NewRequest(ctx, "GET", u, opts) if err != nil { return nil, nil, err } - status := new(ConfigApplyStatus) - resp, err := s.client.Do(ctx, req, status) + var status *ConfigApplyStatus + resp, err := s.client.Do(req, &status) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_maintenance.go b/vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_maintenance.go similarity index 91% rename from vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_maintenance.go rename to vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_maintenance.go index 9a4653303..3ee9369b0 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_maintenance.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_maintenance.go @@ -46,7 +46,7 @@ type MaintenanceOptions struct { // GetMaintenanceStatus gets the status of maintenance mode for all nodes. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode // //meta:operation GET /manage/v1/maintenance func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) { @@ -54,13 +54,13 @@ func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *Node if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var status []*MaintenanceStatus - resp, err := s.client.Do(ctx, req, &status) + resp, err := s.client.Do(req, &status) if err != nil { return nil, resp, err } @@ -71,7 +71,7 @@ func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *Node // CreateMaintenance sets the maintenance mode for the instance. // With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode // //meta:operation POST /manage/v1/maintenance func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) { @@ -79,13 +79,13 @@ func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts.Enabled = enable - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } var i []*MaintenanceOperationStatus - resp, err := s.client.Do(ctx, req, &i) + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_ssh.go b/vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_ssh.go similarity index 83% rename from vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_ssh.go rename to vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_ssh.go index 78dc2b35f..37c8089f3 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_manage_ghes_ssh.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_manage_ghes_ssh.go @@ -31,7 +31,7 @@ type ClusterSSHKey struct { // DeleteSSHKey deletes the SSH key from the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#delete-a-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#delete-a-ssh-key // //meta:operation DELETE /manage/v1/access/ssh func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { @@ -39,13 +39,13 @@ func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SS opts := &SSHKeyOptions{ Key: key, } - req, err := s.client.NewRequest("DELETE", u, opts) + req, err := s.client.NewRequest(ctx, "DELETE", u, opts) if err != nil { return nil, nil, err } var sshStatus []*SSHKeyStatus - resp, err := s.client.Do(ctx, req, &sshStatus) + resp, err := s.client.Do(req, &sshStatus) if err != nil { return nil, resp, err } @@ -55,18 +55,18 @@ func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SS // GetSSHKey gets the SSH keys configured for the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys // //meta:operation GET /manage/v1/access/ssh func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) { u := "manage/v1/access/ssh" - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var sshKeys []*ClusterSSHKey - resp, err := s.client.Do(ctx, req, &sshKeys) + resp, err := s.client.Do(req, &sshKeys) if err != nil { return nil, resp, err } @@ -76,7 +76,7 @@ func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *R // CreateSSHKey adds a new SSH key to the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key // //meta:operation POST /manage/v1/access/ssh func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { @@ -84,13 +84,13 @@ func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SS opts := &SSHKeyOptions{ Key: key, } - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } var sshKeyResponse []*SSHKeyStatus - resp, err := s.client.Do(ctx, req, &sshKeyResponse) + resp, err := s.client.Do(req, &sshKeyResponse) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_network_configurations.go b/vendor/github.com/google/go-github/v88/github/enterprise_network_configurations.go similarity index 73% rename from vendor/github.com/google/go-github/v84/github/enterprise_network_configurations.go rename to vendor/github.com/google/go-github/v88/github/enterprise_network_configurations.go index a6a690d78..eaf3f05b2 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_network_configurations.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_network_configurations.go @@ -12,7 +12,7 @@ import ( // ListEnterpriseNetworkConfigurations lists all hosted compute network configurations configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#list-hosted-compute-network-configurations-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-configurations func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { @@ -22,22 +22,23 @@ func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Cont return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - networks := &NetworkConfigurations{} - resp, err := s.client.Do(ctx, req, networks) + var networks *NetworkConfigurations + resp, err := s.client.Do(req, &networks) if err != nil { return nil, resp, err } + return networks, resp, nil } // CreateEnterpriseNetworkConfiguration creates a hosted compute network configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#create-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation POST /enterprises/{enterprise}/network-configurations func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { @@ -46,13 +47,13 @@ func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Con } u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise) - req, err := s.client.NewRequest("POST", u, createReq) + req, err := s.client.NewRequest(ctx, "POST", u, createReq) if err != nil { return nil, nil, err } - network := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, network) + var network *NetworkConfiguration + resp, err := s.client.Do(req, &network) if err != nil { return nil, resp, err } @@ -62,27 +63,28 @@ func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Con // GetEnterpriseNetworkConfiguration gets a hosted compute network configuration configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#get-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-configurations/{network_configuration_id} func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*NetworkConfiguration, *Response, error) { u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - network := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, network) + var network *NetworkConfiguration + resp, err := s.client.Do(req, &network) if err != nil { return nil, resp, err } + return network, resp, nil } // UpdateEnterpriseNetworkConfiguration updates a hosted compute network configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#update-a-hosted-compute-network-configuration-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id} func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { @@ -91,49 +93,52 @@ func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Con } u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) - req, err := s.client.NewRequest("PATCH", u, updateReq) + req, err := s.client.NewRequest(ctx, "PATCH", u, updateReq) if err != nil { return nil, nil, err } - network := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, network) + var network *NetworkConfiguration + resp, err := s.client.Do(req, &network) if err != nil { return nil, resp, err } + return network, resp, nil } // DeleteEnterpriseNetworkConfiguration deletes a hosted compute network configuration from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#delete-a-hosted-compute-network-configuration-from-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id} func (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + + return s.client.Do(req, nil) } // GetEnterpriseNetworkSettingsResource gets a hosted compute network settings resource configured for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations?apiVersion=2022-11-28#get-a-hosted-compute-network-settings-resource-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/network-settings/{network_settings_id} func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*NetworkSettingsResource, *Response, error) { u := fmt.Sprintf("enterprises/%v/network-settings/%v", enterprise, networkID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - resource := &NetworkSettingsResource{} - resp, err := s.client.Do(ctx, req, resource) + var resource *NetworkSettingsResource + resp, err := s.client.Do(req, &resource) if err != nil { return nil, resp, err } + return resource, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_organization_properties.go b/vendor/github.com/google/go-github/v88/github/enterprise_organization_properties.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/enterprise_organization_properties.go rename to vendor/github.com/google/go-github/v88/github/enterprise_organization_properties.go index 01a646b38..fcd782094 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_organization_properties.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_organization_properties.go @@ -37,19 +37,19 @@ type EnterpriseCustomPropertyValuesRequest struct { // GetOrganizationCustomPropertySchema gets all organization custom property definitions that are defined on an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#get-organization-custom-properties-schema-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#get-organization-custom-properties-schema-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/org-properties/schema func (s *EnterpriseService) GetOrganizationCustomPropertySchema(ctx context.Context, enterprise string) (*EnterpriseCustomPropertySchema, *Response, error) { u := fmt.Sprintf("enterprises/%v/org-properties/schema", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var schema *EnterpriseCustomPropertySchema - resp, err := s.client.Do(ctx, req, &schema) + resp, err := s.client.Do(req, &schema) if err != nil { return nil, resp, err } @@ -59,17 +59,17 @@ func (s *EnterpriseService) GetOrganizationCustomPropertySchema(ctx context.Cont // CreateOrUpdateOrganizationCustomPropertySchema creates new or updates existing organization custom properties defined on an enterprise in a batch. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#create-or-update-organization-custom-property-definitions-on-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#create-or-update-organization-custom-property-definitions-on-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/org-properties/schema func (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertySchema(ctx context.Context, enterprise string, schema EnterpriseCustomPropertySchema) (*Response, error) { u := fmt.Sprintf("enterprises/%v/org-properties/schema", enterprise) - req, err := s.client.NewRequest("PATCH", u, schema) + req, err := s.client.NewRequest(ctx, "PATCH", u, schema) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -79,19 +79,19 @@ func (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertySchema(ctx c // GetOrganizationCustomProperty retrieves a specific organization custom property definition from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#get-an-organization-custom-property-definition-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#get-an-organization-custom-property-definition-from-an-enterprise // //meta:operation GET /enterprises/{enterprise}/org-properties/schema/{custom_property_name} func (s *EnterpriseService) GetOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error) { u := fmt.Sprintf("enterprises/%v/org-properties/schema/%v", enterprise, customPropertyName) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var property *CustomProperty - resp, err := s.client.Do(ctx, req, &property) + resp, err := s.client.Do(req, &property) if err != nil { return nil, resp, err } @@ -101,17 +101,17 @@ func (s *EnterpriseService) GetOrganizationCustomProperty(ctx context.Context, e // CreateOrUpdateOrganizationCustomProperty creates a new or updates an existing organization custom property definition that is defined on an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#create-or-update-an-organization-custom-property-definition-on-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#create-or-update-an-organization-custom-property-definition-on-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/org-properties/schema/{custom_property_name} func (s *EnterpriseService) CreateOrUpdateOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string, property CustomProperty) (*Response, error) { u := fmt.Sprintf("enterprises/%v/org-properties/schema/%v", enterprise, customPropertyName) - req, err := s.client.NewRequest("PUT", u, property) + req, err := s.client.NewRequest(ctx, "PUT", u, property) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -121,17 +121,17 @@ func (s *EnterpriseService) CreateOrUpdateOrganizationCustomProperty(ctx context // DeleteOrganizationCustomProperty removes an organization custom property definition that is defined on an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#remove-an-organization-custom-property-definition-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#remove-an-organization-custom-property-definition-from-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/org-properties/schema/{custom_property_name} func (s *EnterpriseService) DeleteOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/org-properties/schema/%v", enterprise, customPropertyName) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -142,7 +142,7 @@ func (s *EnterpriseService) DeleteOrganizationCustomProperty(ctx context.Context // ListOrganizationCustomPropertyValues lists enterprise organizations with all of their custom property values. // Returns a list of organizations and their custom property values defined in the enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#list-custom-property-values-for-organizations-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#list-custom-property-values-for-organizations-in-an-enterprise // //meta:operation GET /enterprises/{enterprise}/org-properties/values func (s *EnterpriseService) ListOrganizationCustomPropertyValues(ctx context.Context, enterprise string, opts *ListOptions) ([]*EnterpriseCustomPropertiesValues, *Response, error) { @@ -153,13 +153,13 @@ func (s *EnterpriseService) ListOrganizationCustomPropertyValues(ctx context.Con return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var values []*EnterpriseCustomPropertiesValues - resp, err := s.client.Do(ctx, req, &values) + resp, err := s.client.Do(req, &values) if err != nil { return nil, resp, err } @@ -170,17 +170,17 @@ func (s *EnterpriseService) ListOrganizationCustomPropertyValues(ctx context.Con // CreateOrUpdateOrganizationCustomPropertyValues creates or updates custom property values for organizations in an enterprise. // To remove a custom property value from an organization, set the property value to null. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs#create-or-update-custom-property-values-for-organizations-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties-for-orgs?apiVersion=2022-11-28#create-or-update-custom-property-values-for-organizations-in-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/org-properties/values func (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertyValues(ctx context.Context, enterprise string, values EnterpriseCustomPropertyValuesRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/org-properties/values", enterprise) - req, err := s.client.NewRequest("PATCH", u, values) + req, err := s.client.NewRequest(ctx, "PATCH", u, values) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_properties.go b/vendor/github.com/google/go-github/v88/github/enterprise_properties.go similarity index 76% rename from vendor/github.com/google/go-github/v84/github/enterprise_properties.go rename to vendor/github.com/google/go-github/v88/github/enterprise_properties.go index bc5ab55a3..926cb6e2f 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_properties.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_properties.go @@ -12,19 +12,19 @@ import ( // GetAllCustomProperties gets all custom properties that are defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-custom-properties-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#get-custom-properties-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/properties/schema func (s *EnterpriseService) GetAllCustomProperties(ctx context.Context, enterprise string) ([]*CustomProperty, *Response, error) { u := fmt.Sprintf("enterprises/%v/properties/schema", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var customProperties []*CustomProperty - resp, err := s.client.Do(ctx, req, &customProperties) + resp, err := s.client.Do(req, &customProperties) if err != nil { return nil, resp, err } @@ -34,7 +34,7 @@ func (s *EnterpriseService) GetAllCustomProperties(ctx context.Context, enterpri // CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-custom-properties-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#create-or-update-custom-properties-for-an-enterprise // //meta:operation PATCH /enterprises/{enterprise}/properties/schema func (s *EnterpriseService) CreateOrUpdateCustomProperties(ctx context.Context, enterprise string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) { @@ -46,13 +46,13 @@ func (s *EnterpriseService) CreateOrUpdateCustomProperties(ctx context.Context, Properties: properties, } - req, err := s.client.NewRequest("PATCH", u, params) + req, err := s.client.NewRequest(ctx, "PATCH", u, params) if err != nil { return nil, nil, err } var customProperties []*CustomProperty - resp, err := s.client.Do(ctx, req, &customProperties) + resp, err := s.client.Do(req, &customProperties) if err != nil { return nil, resp, err } @@ -62,19 +62,19 @@ func (s *EnterpriseService) CreateOrUpdateCustomProperties(ctx context.Context, // GetCustomProperty gets a custom property that is defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-a-custom-property-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#get-a-custom-property-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/properties/schema/{custom_property_name} func (s *EnterpriseService) GetCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error) { u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var customProperty *CustomProperty - resp, err := s.client.Do(ctx, req, &customProperty) + resp, err := s.client.Do(req, &customProperty) if err != nil { return nil, resp, err } @@ -84,19 +84,19 @@ func (s *EnterpriseService) GetCustomProperty(ctx context.Context, enterprise, c // CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-a-custom-property-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#create-or-update-a-custom-property-for-an-enterprise // //meta:operation PUT /enterprises/{enterprise}/properties/schema/{custom_property_name} func (s *EnterpriseService) CreateOrUpdateCustomProperty(ctx context.Context, enterprise, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) { u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) - req, err := s.client.NewRequest("PUT", u, property) + req, err := s.client.NewRequest(ctx, "PUT", u, property) if err != nil { return nil, nil, err } var customProperty *CustomProperty - resp, err := s.client.Do(ctx, req, &customProperty) + resp, err := s.client.Do(req, &customProperty) if err != nil { return nil, resp, err } @@ -106,16 +106,16 @@ func (s *EnterpriseService) CreateOrUpdateCustomProperty(ctx context.Context, en // RemoveCustomProperty removes a custom property that is defined for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#remove-a-custom-property-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties?apiVersion=2022-11-28#remove-a-custom-property-for-an-enterprise // //meta:operation DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name} func (s *EnterpriseService) RemoveCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_rules.go b/vendor/github.com/google/go-github/v88/github/enterprise_rules.go similarity index 76% rename from vendor/github.com/google/go-github/v84/github/enterprise_rules.go rename to vendor/github.com/google/go-github/v88/github/enterprise_rules.go index 3cd3ee4e8..401ad94e7 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_rules.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_rules.go @@ -12,19 +12,19 @@ import ( // CreateRepositoryRuleset creates a repository ruleset for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#create-an-enterprise-repository-ruleset +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules?apiVersion=2022-11-28#create-an-enterprise-repository-ruleset // //meta:operation POST /enterprises/{enterprise}/rulesets func (s *EnterpriseService) CreateRepositoryRuleset(ctx context.Context, enterprise string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets", enterprise) - req, err := s.client.NewRequest("POST", u, ruleset) + req, err := s.client.NewRequest(ctx, "POST", u, ruleset) if err != nil { return nil, nil, err } var rs *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &rs) + resp, err := s.client.Do(req, &rs) if err != nil { return nil, resp, err } @@ -34,19 +34,19 @@ func (s *EnterpriseService) CreateRepositoryRuleset(ctx context.Context, enterpr // GetRepositoryRuleset gets a repository ruleset for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#get-an-enterprise-repository-ruleset +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules?apiVersion=2022-11-28#get-an-enterprise-repository-ruleset // //meta:operation GET /enterprises/{enterprise}/rulesets/{ruleset_id} func (s *EnterpriseService) GetRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var ruleset *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &ruleset) + resp, err := s.client.Do(req, &ruleset) if err != nil { return nil, resp, err } @@ -56,19 +56,19 @@ func (s *EnterpriseService) GetRepositoryRuleset(ctx context.Context, enterprise // UpdateRepositoryRuleset updates a repository ruleset for the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules?apiVersion=2022-11-28#update-an-enterprise-repository-ruleset // //meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id} func (s *EnterpriseService) UpdateRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) - req, err := s.client.NewRequest("PUT", u, ruleset) + req, err := s.client.NewRequest(ctx, "PUT", u, ruleset) if err != nil { return nil, nil, err } var rs *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &rs) + resp, err := s.client.Do(req, &rs) if err != nil { return nil, resp, err } @@ -78,16 +78,16 @@ func (s *EnterpriseService) UpdateRepositoryRuleset(ctx context.Context, enterpr // DeleteRepositoryRuleset deletes a repository ruleset from the specified enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#delete-an-enterprise-repository-ruleset +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules?apiVersion=2022-11-28#delete-an-enterprise-repository-ruleset // //meta:operation DELETE /enterprises/{enterprise}/rulesets/{ruleset_id} func (s *EnterpriseService) DeleteRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_scim.go b/vendor/github.com/google/go-github/v88/github/enterprise_scim.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/enterprise_scim.go rename to vendor/github.com/google/go-github/v88/github/enterprise_scim.go index 9f9e29694..acc5d2e4f 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_scim.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_scim.go @@ -28,7 +28,7 @@ const SCIMSchemasURINamespacesPatchOp = "urn:ietf:params:scim:api:messages:2.0:P // SCIMEnterpriseGroupAttributes represents supported SCIM Enterprise group attributes, and represents the result of calling UpdateSCIMGroupAttribute. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#supported-scim-group-attributes +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#supported-scim-group-attributes type SCIMEnterpriseGroupAttributes struct { DisplayName *string `json:"displayName,omitempty"` // Human-readable name for a group. Members []*SCIMEnterpriseDisplayReference `json:"members,omitempty"` // List of members who are assigned to the group in SCIM provider @@ -65,7 +65,7 @@ type SCIMEnterpriseGroups struct { // ListProvisionedSCIMGroupsEnterpriseOptions represents query parameters for ListProvisionedSCIMGroups. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise--parameters +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#list-provisioned-scim-groups-for-an-enterprise--parameters type ListProvisionedSCIMGroupsEnterpriseOptions struct { // If specified, only results that match the specified filter will be returned. // Possible filters are `externalId`, `id`, and `displayName`. For example, `externalId eq "a123"`. @@ -82,7 +82,7 @@ type ListProvisionedSCIMGroupsEnterpriseOptions struct { // GetProvisionedSCIMGroupEnterpriseOptions represents query parameters for GetProvisionedSCIMGroup. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#get-scim-provisioning-information-for-an-enterprise-group type GetProvisionedSCIMGroupEnterpriseOptions struct { // Excludes the specified attributes from being returned in the results. ExcludedAttributes *string `url:"excludedAttributes,omitempty"` @@ -90,7 +90,7 @@ type GetProvisionedSCIMGroupEnterpriseOptions struct { // SCIMEnterpriseUserAttributes represents supported SCIM enterprise user attributes, and represents the result of calling UpdateSCIMUserAttribute. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#supported-scim-user-attributes +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#supported-scim-user-attributes type SCIMEnterpriseUserAttributes struct { DisplayName string `json:"displayName"` // Human-readable name for a user Name *SCIMEnterpriseUserName `json:"name,omitempty"` // The user's full name @@ -140,7 +140,7 @@ type SCIMEnterpriseUsers struct { // ListProvisionedSCIMUsersEnterpriseOptions represents query parameters for ListProvisionedSCIMUsers. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#list-scim-provisioned-identities-for-an-enterprise type ListProvisionedSCIMUsersEnterpriseOptions struct { // If specified, only results that match the specified filter will be returned. // Possible filters are `userName`, `externalId`, `id`, and `displayName`. For example, `externalId eq "a123"`. @@ -155,7 +155,7 @@ type ListProvisionedSCIMUsersEnterpriseOptions struct { // SCIMEnterpriseAttribute represents attribute operations for UpdateSCIMGroupAttribute or UpdateSCIMUserAttribute. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#update-an-attribute-for-a-scim-enterprise-group type SCIMEnterpriseAttribute struct { Schemas []string `json:"schemas"` // The URIs that are used to indicate the namespaces for a SCIM patch operation. Operations []*SCIMEnterpriseAttributeOperation `json:"Operations"` // Set of operations to be performed. @@ -174,7 +174,7 @@ type SCIMEnterpriseAttributeOperation struct { // exclude the specified attributes, e.g. `members` to exclude members from the // response. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#list-provisioned-scim-groups-for-an-enterprise // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups func (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enterprise string, opts *ListProvisionedSCIMGroupsEnterpriseOptions) (*SCIMEnterpriseGroups, *Response, error) { @@ -184,14 +184,14 @@ func (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enter return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - groups := new(SCIMEnterpriseGroups) - resp, err := s.client.Do(ctx, req, groups) + var groups *SCIMEnterpriseGroups + resp, err := s.client.Do(req, &groups) if err != nil { return nil, resp, err } @@ -205,7 +205,7 @@ func (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enter // as external group members. Providers are responsible for maintaining a // mapping between the `externalId` and `id` for each user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#list-scim-provisioned-identities-for-an-enterprise // //meta:operation GET /scim/v2/enterprises/{enterprise}/Users func (s *EnterpriseService) ListProvisionedSCIMUsers(ctx context.Context, enterprise string, opts *ListProvisionedSCIMUsersEnterpriseOptions) (*SCIMEnterpriseUsers, *Response, error) { @@ -215,14 +215,14 @@ func (s *EnterpriseService) ListProvisionedSCIMUsers(ctx context.Context, enterp return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - users := new(SCIMEnterpriseUsers) - resp, err := s.client.Do(ctx, req, users) + var users *SCIMEnterpriseUsers + resp, err := s.client.Do(req, &users) if err != nil { return nil, resp, err } @@ -236,19 +236,19 @@ func (s *EnterpriseService) ListProvisionedSCIMUsers(ctx context.Context, enterp // existing group information that you don't provide will be removed, including group membership. To update only // specific attributes, refer to the `Enterprise.UpdateSCIMGroupAttribute()` method. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#set-scim-information-for-a-provisioned-enterprise-group // //meta:operation PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) SetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID string, group SCIMEnterpriseGroupAttributes) (*SCIMEnterpriseGroupAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Groups/%v", enterprise, scimGroupID) - req, err := s.client.NewRequest("PUT", u, group) + req, err := s.client.NewRequest(ctx, "PUT", u, group) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - groupNew := new(SCIMEnterpriseGroupAttributes) - resp, err := s.client.Do(ctx, req, groupNew) + var groupNew *SCIMEnterpriseGroupAttributes + resp, err := s.client.Do(req, &groupNew) if err != nil { return nil, resp, err } @@ -264,19 +264,19 @@ func (s *EnterpriseService) SetProvisionedSCIMGroup(ctx context.Context, enterpr // // **Warning**: Setting `active: false` will suspend a user, and their handle and email will be obfuscated. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#set-scim-information-for-a-provisioned-enterprise-user // //meta:operation PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) SetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string, user SCIMEnterpriseUserAttributes) (*SCIMEnterpriseUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Users/%v", enterprise, scimUserID) - req, err := s.client.NewRequest("PUT", u, user) + req, err := s.client.NewRequest(ctx, "PUT", u, user) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - userNew := new(SCIMEnterpriseUserAttributes) - resp, err := s.client.Do(ctx, req, userNew) + var userNew *SCIMEnterpriseUserAttributes + resp, err := s.client.Do(req, &userNew) if err != nil { return nil, resp, err } @@ -294,19 +294,19 @@ func (s *EnterpriseService) SetProvisionedSCIMUser(ctx context.Context, enterpri // You can submit group memberships individually or in batches for improved // efficiency. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#update-an-attribute-for-a-scim-enterprise-group // //meta:operation PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) UpdateSCIMGroupAttribute(ctx context.Context, enterprise, scimGroupID string, attribute SCIMEnterpriseAttribute) (*SCIMEnterpriseGroupAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Groups/%v", enterprise, scimGroupID) - req, err := s.client.NewRequest("PATCH", u, attribute) + req, err := s.client.NewRequest(ctx, "PATCH", u, attribute) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - group := new(SCIMEnterpriseGroupAttributes) - resp, err := s.client.Do(ctx, req, group) + var group *SCIMEnterpriseGroupAttributes + resp, err := s.client.Do(req, &group) if err != nil { return nil, resp, err } @@ -326,19 +326,19 @@ func (s *EnterpriseService) UpdateSCIMGroupAttribute(ctx context.Context, enterp // Warning: Setting `active: false` will suspend a user, and their handle and // email will be obfuscated. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#update-an-attribute-for-a-scim-enterprise-user // //meta:operation PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) UpdateSCIMUserAttribute(ctx context.Context, enterprise, scimUserID string, attribute SCIMEnterpriseAttribute) (*SCIMEnterpriseUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Users/%v", enterprise, scimUserID) - req, err := s.client.NewRequest("PATCH", u, attribute) + req, err := s.client.NewRequest(ctx, "PATCH", u, attribute) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - user := new(SCIMEnterpriseUserAttributes) - resp, err := s.client.Do(ctx, req, user) + var user *SCIMEnterpriseUserAttributes + resp, err := s.client.Do(req, &user) if err != nil { return nil, resp, err } @@ -348,19 +348,19 @@ func (s *EnterpriseService) UpdateSCIMUserAttribute(ctx context.Context, enterpr // ProvisionSCIMGroup creates a SCIM group for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#provision-a-scim-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#provision-a-scim-enterprise-group // //meta:operation POST /scim/v2/enterprises/{enterprise}/Groups func (s *EnterpriseService) ProvisionSCIMGroup(ctx context.Context, enterprise string, group SCIMEnterpriseGroupAttributes) (*SCIMEnterpriseGroupAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Groups", enterprise) - req, err := s.client.NewRequest("POST", u, group) + req, err := s.client.NewRequest(ctx, "POST", u, group) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - groupProvisioned := new(SCIMEnterpriseGroupAttributes) - resp, err := s.client.Do(ctx, req, groupProvisioned) + var groupProvisioned *SCIMEnterpriseGroupAttributes + resp, err := s.client.Do(req, &groupProvisioned) if err != nil { return nil, resp, err } @@ -370,19 +370,19 @@ func (s *EnterpriseService) ProvisionSCIMGroup(ctx context.Context, enterprise s // ProvisionSCIMUser creates an external identity for a new SCIM enterprise user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#provision-a-scim-enterprise-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#provision-a-scim-enterprise-user // //meta:operation POST /scim/v2/enterprises/{enterprise}/Users func (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise string, user SCIMEnterpriseUserAttributes) (*SCIMEnterpriseUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Users", enterprise) - req, err := s.client.NewRequest("POST", u, user) + req, err := s.client.NewRequest(ctx, "POST", u, user) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - userProvisioned := new(SCIMEnterpriseUserAttributes) - resp, err := s.client.Do(ctx, req, userProvisioned) + var userProvisioned *SCIMEnterpriseUserAttributes + resp, err := s.client.Do(req, &userProvisioned) if err != nil { return nil, resp, err } @@ -396,7 +396,7 @@ func (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise st // attributes from being returned in the results. Using this parameter can // speed up response time. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#get-scim-provisioning-information-for-an-enterprise-group // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID string, opts *GetProvisionedSCIMGroupEnterpriseOptions) (*SCIMEnterpriseGroupAttributes, *Response, error) { @@ -406,14 +406,14 @@ func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterpr return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - group := new(SCIMEnterpriseGroupAttributes) - resp, err := s.client.Do(ctx, req, group) + var group *SCIMEnterpriseGroupAttributes + resp, err := s.client.Do(req, &group) if err != nil { return nil, resp, err } @@ -423,20 +423,20 @@ func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterpr // GetProvisionedSCIMUser gets information about a SCIM user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#get-scim-provisioning-information-for-an-enterprise-user // //meta:operation GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string) (*SCIMEnterpriseUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Users/%v", enterprise, scimUserID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSCIM) - user := new(SCIMEnterpriseUserAttributes) - resp, err := s.client.Do(ctx, req, user) + var user *SCIMEnterpriseUserAttributes + resp, err := s.client.Do(req, &user) if err != nil { return nil, resp, err } @@ -446,17 +446,17 @@ func (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterpri // DeleteSCIMGroup deletes a SCIM group from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#delete-a-scim-group-from-an-enterprise // //meta:operation DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) DeleteSCIMGroup(ctx context.Context, enterprise, scimGroupID string) (*Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Groups/%v", enterprise, scimGroupID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteSCIMUser deletes a SCIM user from an enterprise. @@ -467,15 +467,15 @@ func (s *EnterpriseService) DeleteSCIMGroup(ctx context.Context, enterprise, sci // avatar, PATs, SSH keys, OAuth authorizations, GPG keys, and SAML mappings. // This action is irreversible. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#delete-a-scim-user-from-an-enterprise // //meta:operation DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) DeleteSCIMUser(ctx context.Context, enterprise, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Users/%v", enterprise, scimUserID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/enterprise_team.go b/vendor/github.com/google/go-github/v88/github/enterprise_team.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/enterprise_team.go rename to vendor/github.com/google/go-github/v88/github/enterprise_team.go index e9317b077..4f267b61a 100644 --- a/vendor/github.com/google/go-github/v84/github/enterprise_team.go +++ b/vendor/github.com/google/go-github/v88/github/enterprise_team.go @@ -40,7 +40,7 @@ type EnterpriseTeamCreateOrUpdateRequest struct { // ListTeams lists all teams in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#list-enterprise-teams +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#list-enterprise-teams // //meta:operation GET /enterprises/{enterprise}/teams func (s *EnterpriseService) ListTeams(ctx context.Context, enterprise string, opts *ListOptions) ([]*EnterpriseTeam, *Response, error) { @@ -50,13 +50,13 @@ func (s *EnterpriseService) ListTeams(ctx context.Context, enterprise string, op return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*EnterpriseTeam - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -66,19 +66,19 @@ func (s *EnterpriseService) ListTeams(ctx context.Context, enterprise string, op // CreateTeam creates a new team in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#create-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#create-an-enterprise-team // //meta:operation POST /enterprises/{enterprise}/teams func (s *EnterpriseService) CreateTeam(ctx context.Context, enterprise string, team EnterpriseTeamCreateOrUpdateRequest) (*EnterpriseTeam, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams", enterprise) - req, err := s.client.NewRequest("POST", u, team) + req, err := s.client.NewRequest(ctx, "POST", u, team) if err != nil { return nil, nil, err } var createdTeam *EnterpriseTeam - resp, err := s.client.Do(ctx, req, &createdTeam) + resp, err := s.client.Do(req, &createdTeam) if err != nil { return nil, resp, err } @@ -88,19 +88,19 @@ func (s *EnterpriseService) CreateTeam(ctx context.Context, enterprise string, t // GetTeam retrieves a team in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#get-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#get-an-enterprise-team // //meta:operation GET /enterprises/{enterprise}/teams/{team_slug} func (s *EnterpriseService) GetTeam(ctx context.Context, enterprise, teamSlug string) (*EnterpriseTeam, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v", enterprise, teamSlug) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var team *EnterpriseTeam - resp, err := s.client.Do(ctx, req, &team) + resp, err := s.client.Do(req, &team) if err != nil { return nil, resp, err } @@ -110,19 +110,19 @@ func (s *EnterpriseService) GetTeam(ctx context.Context, enterprise, teamSlug st // UpdateTeam updates a team in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#update-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#update-an-enterprise-team // //meta:operation PATCH /enterprises/{enterprise}/teams/{team_slug} func (s *EnterpriseService) UpdateTeam(ctx context.Context, enterprise, teamSlug string, team EnterpriseTeamCreateOrUpdateRequest) (*EnterpriseTeam, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v", enterprise, teamSlug) - req, err := s.client.NewRequest("PATCH", u, team) + req, err := s.client.NewRequest(ctx, "PATCH", u, team) if err != nil { return nil, nil, err } var updatedTeam *EnterpriseTeam - resp, err := s.client.Do(ctx, req, &updatedTeam) + resp, err := s.client.Do(req, &updatedTeam) if err != nil { return nil, resp, err } @@ -132,18 +132,18 @@ func (s *EnterpriseService) UpdateTeam(ctx context.Context, enterprise, teamSlug // DeleteTeam deletes a team in an enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#delete-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams?apiVersion=2022-11-28#delete-an-enterprise-team // //meta:operation DELETE /enterprises/{enterprise}/teams/{team_slug} func (s *EnterpriseService) DeleteTeam(ctx context.Context, enterprise, teamSlug string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v", enterprise, teamSlug) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -153,7 +153,7 @@ func (s *EnterpriseService) DeleteTeam(ctx context.Context, enterprise, teamSlug // ListTeamMembers lists all members of an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#list-members-in-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#list-members-in-an-enterprise-team // //meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships func (s *EnterpriseService) ListTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, opts *ListOptions) ([]*User, *Response, error) { @@ -163,13 +163,13 @@ func (s *EnterpriseService) ListTeamMembers(ctx context.Context, enterprise, ent return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var members []*User - resp, err := s.client.Do(ctx, req, &members) + resp, err := s.client.Do(req, &members) if err != nil { return nil, resp, err } @@ -179,18 +179,18 @@ func (s *EnterpriseService) ListTeamMembers(ctx context.Context, enterprise, ent // BulkAddTeamMembers adds multiple members to an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-add-team-members +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#bulk-add-team-members // //meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add func (s *EnterpriseService) BulkAddTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/add", enterprise, enterpriseTeam) - req, err := s.client.NewRequest("POST", u, map[string][]string{"usernames": username}) + req, err := s.client.NewRequest(ctx, "POST", u, map[string][]string{"usernames": username}) if err != nil { return nil, nil, err } var members []*User - resp, err := s.client.Do(ctx, req, &members) + resp, err := s.client.Do(req, &members) if err != nil { return nil, resp, err } @@ -200,18 +200,18 @@ func (s *EnterpriseService) BulkAddTeamMembers(ctx context.Context, enterprise, // BulkRemoveTeamMembers removes multiple members from an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-remove-team-members +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#bulk-remove-team-members // //meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove func (s *EnterpriseService) BulkRemoveTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/remove", enterprise, enterpriseTeam) - req, err := s.client.NewRequest("POST", u, map[string][]string{"usernames": username}) + req, err := s.client.NewRequest(ctx, "POST", u, map[string][]string{"usernames": username}) if err != nil { return nil, nil, err } var members []*User - resp, err := s.client.Do(ctx, req, &members) + resp, err := s.client.Do(req, &members) if err != nil { return nil, resp, err } @@ -221,19 +221,19 @@ func (s *EnterpriseService) BulkRemoveTeamMembers(ctx context.Context, enterpris // GetTeamMembership retrieves a team membership for a user in an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#get-enterprise-team-membership +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#get-enterprise-team-membership // //meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username} func (s *EnterpriseService) GetTeamMembership(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/%v", enterprise, enterpriseTeam, username) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var membership *User - resp, err := s.client.Do(ctx, req, &membership) + resp, err := s.client.Do(req, &membership) if err != nil { return nil, resp, err } @@ -243,19 +243,19 @@ func (s *EnterpriseService) GetTeamMembership(ctx context.Context, enterprise, e // AddTeamMember adds a member to an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#add-team-member +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#add-team-member // //meta:operation PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username} func (s *EnterpriseService) AddTeamMember(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/%v", enterprise, enterpriseTeam, username) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, nil, err } var member *User - resp, err := s.client.Do(ctx, req, &member) + resp, err := s.client.Do(req, &member) if err != nil { return nil, resp, err } @@ -265,18 +265,18 @@ func (s *EnterpriseService) AddTeamMember(ctx context.Context, enterprise, enter // RemoveTeamMember removes a member from an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#remove-team-membership +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members?apiVersion=2022-11-28#remove-team-membership // //meta:operation DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username} func (s *EnterpriseService) RemoveTeamMember(ctx context.Context, enterprise, enterpriseTeam, username string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/%v", enterprise, enterpriseTeam, username) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -286,7 +286,7 @@ func (s *EnterpriseService) RemoveTeamMember(ctx context.Context, enterprise, en // ListAssignments gets all organizations assigned to an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#get-organization-assignments +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#get-organization-assignments // //meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations func (s *EnterpriseService) ListAssignments(ctx context.Context, enterprise, enterpriseTeam string, opts *ListOptions) ([]*Organization, *Response, error) { @@ -296,13 +296,13 @@ func (s *EnterpriseService) ListAssignments(ctx context.Context, enterprise, ent return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var orgs []*Organization - resp, err := s.client.Do(ctx, req, &orgs) + resp, err := s.client.Do(req, &orgs) if err != nil { return nil, resp, err } @@ -312,19 +312,19 @@ func (s *EnterpriseService) ListAssignments(ctx context.Context, enterprise, ent // AddMultipleAssignments assigns an enterprise team to multiple organizations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-organization-assignments +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#add-organization-assignments // //meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add func (s *EnterpriseService) AddMultipleAssignments(ctx context.Context, enterprise, enterpriseTeam string, organizationSlugs []string) ([]*Organization, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/organizations/add", enterprise, enterpriseTeam) - req, err := s.client.NewRequest("POST", u, map[string][]string{"organization_slugs": organizationSlugs}) + req, err := s.client.NewRequest(ctx, "POST", u, map[string][]string{"organization_slugs": organizationSlugs}) if err != nil { return nil, nil, err } var orgs []*Organization - resp, err := s.client.Do(ctx, req, &orgs) + resp, err := s.client.Do(req, &orgs) if err != nil { return nil, resp, err } @@ -334,19 +334,19 @@ func (s *EnterpriseService) AddMultipleAssignments(ctx context.Context, enterpri // RemoveMultipleAssignments unassigns an enterprise team from multiple organizations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#remove-organization-assignments +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#remove-organization-assignments // //meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove func (s *EnterpriseService) RemoveMultipleAssignments(ctx context.Context, enterprise, enterpriseTeam string, organizationSlugs []string) ([]*Organization, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/organizations/remove", enterprise, enterpriseTeam) - req, err := s.client.NewRequest("POST", u, map[string][]string{"organization_slugs": organizationSlugs}) + req, err := s.client.NewRequest(ctx, "POST", u, map[string][]string{"organization_slugs": organizationSlugs}) if err != nil { return nil, nil, err } var orgs []*Organization - resp, err := s.client.Do(ctx, req, &orgs) + resp, err := s.client.Do(req, &orgs) if err != nil { return nil, resp, err } @@ -356,19 +356,19 @@ func (s *EnterpriseService) RemoveMultipleAssignments(ctx context.Context, enter // GetAssignment checks if an enterprise team is assigned to an organization. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#get-organization-assignment +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#get-organization-assignment // //meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org} func (s *EnterpriseService) GetAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Organization, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/organizations/%v", enterprise, enterpriseTeam, org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var organization *Organization - resp, err := s.client.Do(ctx, req, &organization) + resp, err := s.client.Do(req, &organization) if err != nil { return nil, resp, err } @@ -378,19 +378,19 @@ func (s *EnterpriseService) GetAssignment(ctx context.Context, enterprise, enter // AddAssignment assigns an enterprise team to an organizations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-an-organization-assignment +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#add-an-organization-assignment // //meta:operation PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org} func (s *EnterpriseService) AddAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Organization, *Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/organizations/%v", enterprise, enterpriseTeam, org) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, nil, err } var organization *Organization - resp, err := s.client.Do(ctx, req, &organization) + resp, err := s.client.Do(req, &organization) if err != nil { return nil, resp, err } @@ -400,18 +400,18 @@ func (s *EnterpriseService) AddAssignment(ctx context.Context, enterprise, enter // RemoveAssignment unassigns an enterprise team from an organizations. // -// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#delete-an-organization-assignment +// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations?apiVersion=2022-11-28#delete-an-organization-assignment // //meta:operation DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org} func (s *EnterpriseService) RemoveAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/teams/%v/organizations/%v", enterprise, enterpriseTeam, org) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/event.go b/vendor/github.com/google/go-github/v88/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v84/github/event.go rename to vendor/github.com/google/go-github/v88/github/event.go diff --git a/vendor/github.com/google/go-github/v84/github/event_types.go b/vendor/github.com/google/go-github/v88/github/event_types.go similarity index 99% rename from vendor/github.com/google/go-github/v84/github/event_types.go rename to vendor/github.com/google/go-github/v88/github/event_types.go index 2a085d47b..de4223cdd 100644 --- a/vendor/github.com/google/go-github/v84/github/event_types.go +++ b/vendor/github.com/google/go-github/v88/github/event_types.go @@ -359,7 +359,7 @@ type CommentDiscussion struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Discussions REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/discussions/comments#get-a-discussion-comment + // See: https://docs.github.com/rest/discussions/comments?apiVersion=2022-11-28#get-a-discussion-comment AuthorAssociation *string `json:"author_association,omitempty"` Body *string `json:"body,omitempty"` ChildCommentCount *int `json:"child_comment_count,omitempty"` @@ -414,7 +414,7 @@ type Discussion struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Discussions REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/discussions/discussions#get-a-discussion + // See: https://docs.github.com/rest/discussions/discussions?apiVersion=2022-11-28#get-a-discussion AuthorAssociation *string `json:"author_association,omitempty"` ActiveLockReason *string `json:"active_lock_reason,omitempty"` Body *string `json:"body,omitempty"` @@ -1332,21 +1332,21 @@ type PushEvent struct { // // Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025. // Use the Commits REST API endpoint to get commit information. - // See: https://docs.github.com/rest/commits/commits#list-commits + // See: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-commits Size *int `json:"size,omitempty"` // Commits is the list of commits in the push event. // // This field is only populated for webhook events. // It has been removed from Events API payloads on October 7, 2025. // Use the Commits REST API endpoint to get detailed commit information. - // See: https://docs.github.com/rest/commits/commits#list-commits + // See: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-commits Commits []*HeadCommit `json:"commits,omitempty"` Before *string `json:"before,omitempty"` // DistinctSize is the number of distinct commits in the push. // // Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025. // Use the Compare REST API endpoint to get detailed comparison information. - // See: https://docs.github.com/rest/commits/commits#compare-two-commits + // See: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits DistinctSize *int `json:"distinct_size,omitempty"` // The following fields are only populated by Webhook events. @@ -1934,8 +1934,8 @@ type AdvisoryVulnerability struct { FirstPatchedVersion *FirstPatchedVersion `json:"first_patched_version,omitempty"` // PatchedVersions and VulnerableFunctions are used in the following APIs: - // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization - // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories + // - https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization + // - https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories PatchedVersions *string `json:"patched_versions,omitempty"` VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` } @@ -1984,7 +1984,7 @@ type CodeScanningAlertEvent struct { // SponsorshipEvent represents a sponsorship event in GitHub. // -// GitHub API docs: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent +// GitHub API docs: https://docs.github.com/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent type SponsorshipEvent struct { Action *string `json:"action,omitempty"` EffectiveDate *string `json:"effective_date,omitempty"` diff --git a/vendor/github.com/google/go-github/v84/github/gists.go b/vendor/github.com/google/go-github/v88/github/gists.go similarity index 73% rename from vendor/github.com/google/go-github/v84/github/gists.go rename to vendor/github.com/google/go-github/v88/github/gists.go index 8b5dd47d8..3994ea182 100644 --- a/vendor/github.com/google/go-github/v84/github/gists.go +++ b/vendor/github.com/google/go-github/v88/github/gists.go @@ -14,7 +14,7 @@ import ( // GistsService handles communication with the Gist related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/gists +// GitHub API docs: https://docs.github.com/rest/gists?apiVersion=2022-11-28 type GistsService service // Gist represents a GitHub's gist. @@ -96,9 +96,9 @@ type GistListOptions struct { // is authenticated, it will returns all gists for the authenticated // user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-a-user // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-gists-for-the-authenticated-user // //meta:operation GET /gists //meta:operation GET /users/{username}/gists @@ -114,13 +114,13 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var gists []*Gist - resp, err := s.client.Do(ctx, req, &gists) + resp, err := s.client.Do(req, &gists) if err != nil { return nil, resp, err } @@ -130,7 +130,7 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti // ListAll lists all public gists. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-public-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-public-gists // //meta:operation GET /gists/public func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { @@ -139,13 +139,13 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var gists []*Gist - resp, err := s.client.Do(ctx, req, &gists) + resp, err := s.client.Do(req, &gists) if err != nil { return nil, resp, err } @@ -155,7 +155,7 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G // ListStarred lists starred gists of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-starred-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-starred-gists // //meta:operation GET /gists/starred func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { @@ -164,13 +164,13 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var gists []*Gist - resp, err := s.client.Do(ctx, req, &gists) + resp, err := s.client.Do(req, &gists) if err != nil { return nil, resp, err } @@ -180,18 +180,18 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( // Get a single gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#get-a-gist // //meta:operation GET /gists/{gist_id} func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - gist := new(Gist) - resp, err := s.client.Do(ctx, req, gist) + var gist *Gist + resp, err := s.client.Do(req, &gist) if err != nil { return nil, resp, err } @@ -201,18 +201,18 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er // GetRevision gets a specific revision of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist-revision +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#get-a-gist-revision // //meta:operation GET /gists/{gist_id}/{sha} func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/%v", id, sha) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - gist := new(Gist) - resp, err := s.client.Do(ctx, req, gist) + var gist *Gist + resp, err := s.client.Do(req, &gist) if err != nil { return nil, resp, err } @@ -222,18 +222,18 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, // Create a gist for authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#create-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#create-a-gist // //meta:operation POST /gists func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error) { u := "gists" - req, err := s.client.NewRequest("POST", u, gist) + req, err := s.client.NewRequest(ctx, "POST", u, gist) if err != nil { return nil, nil, err } - g := new(Gist) - resp, err := s.client.Do(ctx, req, g) + var g *Gist + resp, err := s.client.Do(req, &g) if err != nil { return nil, resp, err } @@ -243,18 +243,18 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response // Edit a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#update-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#update-a-gist // //meta:operation PATCH /gists/{gist_id} func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) - req, err := s.client.NewRequest("PATCH", u, gist) + req, err := s.client.NewRequest(ctx, "PATCH", u, gist) if err != nil { return nil, nil, err } - g := new(Gist) - resp, err := s.client.Do(ctx, req, g) + var g *Gist + resp, err := s.client.Do(req, &g) if err != nil { return nil, resp, err } @@ -264,7 +264,7 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, // ListCommits lists commits of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-commits +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-gist-commits // //meta:operation GET /gists/{gist_id}/commits func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOptions) ([]*GistCommit, *Response, error) { @@ -274,13 +274,13 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOpt return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var gistCommits []*GistCommit - resp, err := s.client.Do(ctx, req, &gistCommits) + resp, err := s.client.Do(req, &gistCommits) if err != nil { return nil, resp, err } @@ -290,80 +290,80 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOpt // Delete a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#delete-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#delete-a-gist // //meta:operation DELETE /gists/{gist_id} func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Star a gist on behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#star-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#star-a-gist // //meta:operation PUT /gists/{gist_id}/star func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Unstar a gist on a behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#unstar-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#unstar-a-gist // //meta:operation DELETE /gists/{gist_id}/star func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // IsStarred checks if a gist is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#check-if-a-gist-is-starred // //meta:operation GET /gists/{gist_id}/star func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error) { u := fmt.Sprintf("gists/%v/star", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) starred, err := parseBoolResponse(err) return starred, resp, err } // Fork a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#fork-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#fork-a-gist // //meta:operation POST /gists/{gist_id}/forks func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - g := new(Gist) - resp, err := s.client.Do(ctx, req, g) + var g *Gist + resp, err := s.client.Do(req, &g) if err != nil { return nil, resp, err } @@ -373,7 +373,7 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e // ListForks lists forks of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-forks +// GitHub API docs: https://docs.github.com/rest/gists/gists?apiVersion=2022-11-28#list-gist-forks // //meta:operation GET /gists/{gist_id}/forks func (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptions) ([]*GistFork, *Response, error) { @@ -383,13 +383,13 @@ func (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptio return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var gistForks []*GistFork - resp, err := s.client.Do(ctx, req, &gistForks) + resp, err := s.client.Do(req, &gistForks) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/gists_comments.go b/vendor/github.com/google/go-github/v88/github/gists_comments.go similarity index 71% rename from vendor/github.com/google/go-github/v84/github/gists_comments.go rename to vendor/github.com/google/go-github/v88/github/gists_comments.go index 5e0614231..dc3082cf0 100644 --- a/vendor/github.com/google/go-github/v84/github/gists_comments.go +++ b/vendor/github.com/google/go-github/v88/github/gists_comments.go @@ -25,7 +25,7 @@ func (g GistComment) String() string { // ListComments lists all comments for a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#list-gist-comments +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#list-gist-comments // //meta:operation GET /gists/{gist_id}/comments func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error) { @@ -35,13 +35,13 @@ func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *Li return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var comments []*GistComment - resp, err := s.client.Do(ctx, req, &comments) + resp, err := s.client.Do(req, &comments) if err != nil { return nil, resp, err } @@ -51,18 +51,18 @@ func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *Li // GetComment retrieves a single comment from a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#get-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#get-a-gist-comment // //meta:operation GET /gists/{gist_id}/comments/{comment_id} func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - c := new(GistComment) - resp, err := s.client.Do(ctx, req, c) + var c *GistComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -72,18 +72,18 @@ func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID // CreateComment creates a comment for a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#create-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#create-a-gist-comment // //meta:operation POST /gists/{gist_id}/comments func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) - req, err := s.client.NewRequest("POST", u, comment) + req, err := s.client.NewRequest(ctx, "POST", u, comment) if err != nil { return nil, nil, err } - c := new(GistComment) - resp, err := s.client.Do(ctx, req, c) + var c *GistComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -93,18 +93,18 @@ func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment // EditComment edits an existing gist comment. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#update-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#update-a-gist-comment // //meta:operation PATCH /gists/{gist_id}/comments/{comment_id} func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) - req, err := s.client.NewRequest("PATCH", u, comment) + req, err := s.client.NewRequest(ctx, "PATCH", u, comment) if err != nil { return nil, nil, err } - c := new(GistComment) - resp, err := s.client.Do(ctx, req, c) + var c *GistComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -114,15 +114,15 @@ func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID // DeleteComment deletes a gist comment. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#delete-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments?apiVersion=2022-11-28#delete-a-gist-comment // //meta:operation DELETE /gists/{gist_id}/comments/{comment_id} func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/git.go b/vendor/github.com/google/go-github/v88/github/git.go similarity index 80% rename from vendor/github.com/google/go-github/v84/github/git.go rename to vendor/github.com/google/go-github/v88/github/git.go index 2ca835e1b..ce172cd06 100644 --- a/vendor/github.com/google/go-github/v84/github/git.go +++ b/vendor/github.com/google/go-github/v88/github/git.go @@ -8,5 +8,5 @@ package github // GitService handles communication with the git data related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/git/ +// GitHub API docs: https://docs.github.com/rest/git?apiVersion=2022-11-28 type GitService service diff --git a/vendor/github.com/google/go-github/v84/github/git_blobs.go b/vendor/github.com/google/go-github/v88/github/git_blobs.go similarity index 75% rename from vendor/github.com/google/go-github/v84/github/git_blobs.go rename to vendor/github.com/google/go-github/v88/github/git_blobs.go index c734d595b..cbba9bd79 100644 --- a/vendor/github.com/google/go-github/v84/github/git_blobs.go +++ b/vendor/github.com/google/go-github/v88/github/git_blobs.go @@ -23,18 +23,18 @@ type Blob struct { // GetBlob fetches a blob from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs?apiVersion=2022-11-28#get-a-blob // //meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} func (s *GitService) GetBlob(ctx context.Context, owner, repo, sha string) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - blob := new(Blob) - resp, err := s.client.Do(ctx, req, blob) + var blob *Blob + resp, err := s.client.Do(req, &blob) if err != nil { return nil, resp, err } @@ -45,12 +45,12 @@ func (s *GitService) GetBlob(ctx context.Context, owner, repo, sha string) (*Blo // GetBlobRaw fetches a blob's contents from a repo. // Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs?apiVersion=2022-11-28#get-a-blob // //meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -58,7 +58,7 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ req.Header.Set("Accept", "application/vnd.github.v3.raw") var buf bytes.Buffer - resp, err := s.client.Do(ctx, req, &buf) + resp, err := s.client.Do(req, &buf) if err != nil { return nil, resp, err } @@ -68,21 +68,21 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ // CreateBlob creates a blob object. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs?apiVersion=2022-11-28#create-a-blob // //meta:operation POST /repos/{owner}/{repo}/git/blobs func (s *GitService) CreateBlob(ctx context.Context, owner, repo string, blob Blob) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo) - req, err := s.client.NewRequest("POST", u, blob) + req, err := s.client.NewRequest(ctx, "POST", u, blob) if err != nil { return nil, nil, err } - t := new(Blob) - resp, err := s.client.Do(ctx, req, t) + var v *Blob + resp, err := s.client.Do(req, &v) if err != nil { return nil, resp, err } - return t, resp, nil + return v, resp, nil } diff --git a/vendor/github.com/google/go-github/v84/github/git_commits.go b/vendor/github.com/google/go-github/v88/github/git_commits.go similarity index 94% rename from vendor/github.com/google/go-github/v84/github/git_commits.go rename to vendor/github.com/google/go-github/v88/github/git_commits.go index 5bf6cf7aa..0efad197c 100644 --- a/vendor/github.com/google/go-github/v84/github/git_commits.go +++ b/vendor/github.com/google/go-github/v88/github/git_commits.go @@ -82,18 +82,18 @@ func (c CommitAuthor) String() string { // GetCommit fetches the Commit object for a given SHA. // -// GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object +// GitHub API docs: https://docs.github.com/rest/git/commits?apiVersion=2022-11-28#get-a-commit-object // //meta:operation GET /repos/{owner}/{repo}/git/commits/{commit_sha} func (s *GitService) GetCommit(ctx context.Context, owner, repo, sha string) (*Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - c := new(Commit) - resp, err := s.client.Do(ctx, req, c) + var c *Commit + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -126,7 +126,7 @@ type CreateCommitOptions struct { // data if omitted. If the commit.Author is omitted, it will be filled in with // the authenticated user’s information and the current date. // -// GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit +// GitHub API docs: https://docs.github.com/rest/git/commits?apiVersion=2022-11-28#create-a-commit // //meta:operation POST /repos/{owner}/{repo}/git/commits func (s *GitService) CreateCommit(ctx context.Context, owner, repo string, commit Commit, opts *CreateCommitOptions) (*Commit, *Response, error) { @@ -161,13 +161,13 @@ func (s *GitService) CreateCommit(ctx context.Context, owner, repo string, commi body.Signature = &signature } - req, err := s.client.NewRequest("POST", u, body) + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } - c := new(Commit) - resp, err := s.client.Do(ctx, req, c) + var c *Commit + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/git_refs.go b/vendor/github.com/google/go-github/v88/github/git_refs.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/git_refs.go rename to vendor/github.com/google/go-github/v88/github/git_refs.go index bca7741d9..36dc52937 100644 --- a/vendor/github.com/google/go-github/v84/github/git_refs.go +++ b/vendor/github.com/google/go-github/v88/github/git_refs.go @@ -52,19 +52,19 @@ type UpdateRef struct { // GetRef fetches a single reference in a repository. // The ref must be formatted as `heads/` for branches and `tags/` for tags. // -// GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#get-a-reference // //meta:operation GET /repos/{owner}/{repo}/git/ref/{ref} func (s *GitService) GetRef(ctx context.Context, owner, repo, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/ref/%v", owner, repo, refURLEscape(ref)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - r := new(Reference) - resp, err := s.client.Do(ctx, req, r) + var r *Reference + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -87,20 +87,20 @@ func refURLEscape(ref string) string { // If the ref doesn't exist in the repository, but existing refs start with ref, they will be returned as an array. // Use an empty ref to list all references. // -// GitHub API docs: https://docs.github.com/rest/git/refs#list-matching-references +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#list-matching-references // //meta:operation GET /repos/{owner}/{repo}/git/matching-refs/{ref} func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo, ref string) ([]*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") // API expects no "refs/" prefix u := fmt.Sprintf("repos/%v/%v/git/matching-refs/%v", owner, repo, refURLEscape(ref)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var rs []*Reference - resp, err := s.client.Do(ctx, req, &rs) + resp, err := s.client.Do(req, &rs) if err != nil { return nil, resp, err } @@ -110,7 +110,7 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo, ref stri // CreateRef creates a new ref in a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#create-a-reference // //meta:operation POST /repos/{owner}/{repo}/git/refs func (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref CreateRef) (*Reference, *Response, error) { @@ -126,13 +126,13 @@ func (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref Crea ref.Ref = "refs/" + strings.TrimPrefix(ref.Ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) - req, err := s.client.NewRequest("POST", u, ref) + req, err := s.client.NewRequest(ctx, "POST", u, ref) if err != nil { return nil, nil, err } - r := new(Reference) - resp, err := s.client.Do(ctx, req, r) + var r *Reference + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -142,7 +142,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref Crea // UpdateRef updates an existing ref in a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#update-a-reference // //meta:operation PATCH /repos/{owner}/{repo}/git/refs/{ref} func (s *GitService) UpdateRef(ctx context.Context, owner, repo, ref string, updateRef UpdateRef) (*Reference, *Response, error) { @@ -156,13 +156,13 @@ func (s *GitService) UpdateRef(ctx context.Context, owner, repo, ref string, upd refPath := strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(refPath)) - req, err := s.client.NewRequest("PATCH", u, updateRef) + req, err := s.client.NewRequest(ctx, "PATCH", u, updateRef) if err != nil { return nil, nil, err } - r := new(Reference) - resp, err := s.client.Do(ctx, req, r) + var r *Reference + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -172,16 +172,16 @@ func (s *GitService) UpdateRef(ctx context.Context, owner, repo, ref string, upd // DeleteRef deletes a ref from a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#delete-a-reference // //meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref} func (s *GitService) DeleteRef(ctx context.Context, owner, repo, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/git_tags.go b/vendor/github.com/google/go-github/v88/github/git_tags.go similarity index 82% rename from vendor/github.com/google/go-github/v84/github/git_tags.go rename to vendor/github.com/google/go-github/v88/github/git_tags.go index 750b03760..13a86a369 100644 --- a/vendor/github.com/google/go-github/v84/github/git_tags.go +++ b/vendor/github.com/google/go-github/v88/github/git_tags.go @@ -33,18 +33,18 @@ type CreateTag struct { // GetTag fetches a tag from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag +// GitHub API docs: https://docs.github.com/rest/git/tags?apiVersion=2022-11-28#get-a-tag // //meta:operation GET /repos/{owner}/{repo}/git/tags/{tag_sha} func (s *GitService) GetTag(ctx context.Context, owner, repo, sha string) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - tag := new(Tag) - resp, err := s.client.Do(ctx, req, tag) + var tag *Tag + resp, err := s.client.Do(req, &tag) if err != nil { return nil, resp, err } @@ -54,19 +54,19 @@ func (s *GitService) GetTag(ctx context.Context, owner, repo, sha string) (*Tag, // CreateTag creates a tag object. // -// GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object +// GitHub API docs: https://docs.github.com/rest/git/tags?apiVersion=2022-11-28#create-a-tag-object // //meta:operation POST /repos/{owner}/{repo}/git/tags func (s *GitService) CreateTag(ctx context.Context, owner, repo string, tag CreateTag) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags", owner, repo) - req, err := s.client.NewRequest("POST", u, tag) + req, err := s.client.NewRequest(ctx, "POST", u, tag) if err != nil { return nil, nil, err } - t := new(Tag) - resp, err := s.client.Do(ctx, req, t) + var t *Tag + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/git_trees.go b/vendor/github.com/google/go-github/v88/github/git_trees.go similarity index 91% rename from vendor/github.com/google/go-github/v84/github/git_trees.go rename to vendor/github.com/google/go-github/v88/github/git_trees.go index 2ff0dc592..2e4b9dc21 100644 --- a/vendor/github.com/google/go-github/v84/github/git_trees.go +++ b/vendor/github.com/google/go-github/v88/github/git_trees.go @@ -66,7 +66,7 @@ type treeEntryWithFileDelete struct { } // MarshalJSON implements the json.Marshaler interface. -func (t *TreeEntry) MarshalJSON() ([]byte, error) { +func (t TreeEntry) MarshalJSON() ([]byte, error) { if t.SHA == nil && t.Content == nil { return json.Marshal(struct { SHA *string `json:"sha"` @@ -101,7 +101,7 @@ func (t *TreeEntry) MarshalJSON() ([]byte, error) { // GetTree fetches the Tree object for a given sha hash from a repository. // -// GitHub API docs: https://docs.github.com/rest/git/trees#get-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees?apiVersion=2022-11-28#get-a-tree // //meta:operation GET /repos/{owner}/{repo}/git/trees/{tree_sha} func (s *GitService) GetTree(ctx context.Context, owner, repo, sha string, recursive bool) (*Tree, *Response, error) { @@ -110,13 +110,13 @@ func (s *GitService) GetTree(ctx context.Context, owner, repo, sha string, recur u += "?recursive=1" } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - t := new(Tree) - resp, err := s.client.Do(ctx, req, t) + var t *Tree + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -140,7 +140,7 @@ type createTree struct { // include a [TreeEntry] with the path and both SHA and Content set to nil. // Entire directories can be deleted this way. // -// GitHub API docs: https://docs.github.com/rest/git/trees#create-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees?apiVersion=2022-11-28#create-a-tree // //meta:operation POST /repos/{owner}/{repo}/git/trees func (s *GitService) CreateTree(ctx context.Context, owner, repo, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { @@ -165,13 +165,13 @@ func (s *GitService) CreateTree(ctx context.Context, owner, repo, baseTree strin BaseTree: baseTree, Entries: newEntries, } - req, err := s.client.NewRequest("POST", u, body) + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } - t := new(Tree) - resp, err := s.client.Do(ctx, req, t) + var t *Tree + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/github-accessors.go b/vendor/github.com/google/go-github/v88/github/github-accessors.go similarity index 75% rename from vendor/github.com/google/go-github/v84/github/github-accessors.go rename to vendor/github.com/google/go-github/v88/github/github-accessors.go index 70b20e70d..5636e7d3f 100644 --- a/vendor/github.com/google/go-github/v84/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v88/github/github-accessors.go @@ -14,6 +14,14 @@ import ( "time" ) +// GetMessage returns the Message field. +func (a *AbuseRateLimitError) GetMessage() string { + if a == nil { + return "" + } + return a.Message +} + // GetRetryAfter returns the RetryAfter field if it's non-nil, zero value otherwise. func (a *AbuseRateLimitError) GetRetryAfter() time.Duration { if a == nil || a.RetryAfter == nil { @@ -70,6 +78,14 @@ func (a *AcceptedAssignment) GetRepository() *Repository { return a.Repository } +// GetStudents returns the Students slice if it's non-nil, nil otherwise. +func (a *AcceptedAssignment) GetStudents() []*ClassroomUser { + if a == nil || a.Students == nil { + return nil + } + return a.Students +} + // GetSubmitted returns the Submitted field if it's non-nil, zero value otherwise. func (a *AcceptedAssignment) GetSubmitted() bool { if a == nil || a.Submitted == nil { @@ -78,6 +94,38 @@ func (a *AcceptedAssignment) GetSubmitted() bool { return *a.Submitted } +// GetRaw returns the Raw slice if it's non-nil, nil otherwise. +func (a *AcceptedError) GetRaw() []byte { + if a == nil || a.Raw == nil { + return nil + } + return a.Raw +} + +// GetFullName returns the FullName field. +func (a *AccessibleRepository) GetFullName() string { + if a == nil { + return "" + } + return a.FullName +} + +// GetID returns the ID field. +func (a *AccessibleRepository) GetID() int64 { + if a == nil { + return 0 + } + return a.ID +} + +// GetName returns the Name field. +func (a *AccessibleRepository) GetName() string { + if a == nil { + return "" + } + return a.Name +} + // GetGithubOwnedAllowed returns the GithubOwnedAllowed field if it's non-nil, zero value otherwise. func (a *ActionsAllowed) GetGithubOwnedAllowed() bool { if a == nil || a.GithubOwnedAllowed == nil { @@ -86,6 +134,14 @@ func (a *ActionsAllowed) GetGithubOwnedAllowed() bool { return *a.GithubOwnedAllowed } +// GetPatternsAllowed returns the PatternsAllowed slice if it's non-nil, nil otherwise. +func (a *ActionsAllowed) GetPatternsAllowed() []string { + if a == nil || a.PatternsAllowed == nil { + return nil + } + return a.PatternsAllowed +} + // GetVerifiedAllowed returns the VerifiedAllowed field if it's non-nil, zero value otherwise. func (a *ActionsAllowed) GetVerifiedAllowed() bool { if a == nil || a.VerifiedAllowed == nil { @@ -150,6 +206,22 @@ func (a *ActionsCache) GetVersion() string { return *a.Version } +// GetActionsCaches returns the ActionsCaches slice if it's non-nil, nil otherwise. +func (a *ActionsCacheList) GetActionsCaches() []*ActionsCache { + if a == nil || a.ActionsCaches == nil { + return nil + } + return a.ActionsCaches +} + +// GetTotalCount returns the TotalCount field. +func (a *ActionsCacheList) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + // GetDirection returns the Direction field if it's non-nil, zero value otherwise. func (a *ActionsCacheListOptions) GetDirection() string { if a == nil || a.Direction == nil { @@ -182,6 +254,94 @@ func (a *ActionsCacheListOptions) GetSort() string { return *a.Sort } +// GetActiveCachesCount returns the ActiveCachesCount field. +func (a *ActionsCacheUsage) GetActiveCachesCount() int { + if a == nil { + return 0 + } + return a.ActiveCachesCount +} + +// GetActiveCachesSizeInBytes returns the ActiveCachesSizeInBytes field. +func (a *ActionsCacheUsage) GetActiveCachesSizeInBytes() int64 { + if a == nil { + return 0 + } + return a.ActiveCachesSizeInBytes +} + +// GetFullName returns the FullName field. +func (a *ActionsCacheUsage) GetFullName() string { + if a == nil { + return "" + } + return a.FullName +} + +// GetRepoCacheUsage returns the RepoCacheUsage slice if it's non-nil, nil otherwise. +func (a *ActionsCacheUsageList) GetRepoCacheUsage() []*ActionsCacheUsage { + if a == nil || a.RepoCacheUsage == nil { + return nil + } + return a.RepoCacheUsage +} + +// GetTotalCount returns the TotalCount field. +func (a *ActionsCacheUsageList) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + +// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise. +func (a *ActionsEnabledOnEnterpriseRepos) GetOrganizations() []*Organization { + if a == nil || a.Organizations == nil { + return nil + } + return a.Organizations +} + +// GetTotalCount returns the TotalCount field. +func (a *ActionsEnabledOnEnterpriseRepos) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (a *ActionsEnabledOnOrgRepos) GetRepositories() []*Repository { + if a == nil || a.Repositories == nil { + return nil + } + return a.Repositories +} + +// GetTotalCount returns the TotalCount field. +func (a *ActionsEnabledOnOrgRepos) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + +// GetFullDomains returns the FullDomains slice if it's non-nil, nil otherwise. +func (a *ActionsInboundDomains) GetFullDomains() []string { + if a == nil || a.FullDomains == nil { + return nil + } + return a.FullDomains +} + +// GetWildcardDomains returns the WildcardDomains slice if it's non-nil, nil otherwise. +func (a *ActionsInboundDomains) GetWildcardDomains() []string { + if a == nil || a.WildcardDomains == nil { + return nil + } + return a.WildcardDomains +} + // GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise. func (a *ActionsPermissions) GetAllowedActions() string { if a == nil || a.AllowedActions == nil { @@ -278,6 +438,14 @@ func (a *ActionsVariable) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetName returns the Name field. +func (a *ActionsVariable) GetName() string { + if a == nil { + return "" + } + return a.Name +} + // GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise. func (a *ActionsVariable) GetSelectedRepositoriesURL() string { if a == nil || a.SelectedRepositoriesURL == nil { @@ -302,6 +470,14 @@ func (a *ActionsVariable) GetUpdatedAt() Timestamp { return *a.UpdatedAt } +// GetValue returns the Value field. +func (a *ActionsVariable) GetValue() string { + if a == nil { + return "" + } + return a.Value +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (a *ActionsVariable) GetVisibility() string { if a == nil || a.Visibility == nil { @@ -310,6 +486,22 @@ func (a *ActionsVariable) GetVisibility() string { return *a.Visibility } +// GetTotalCount returns the TotalCount field. +func (a *ActionsVariables) GetTotalCount() int { + if a == nil { + return 0 + } + return a.TotalCount +} + +// GetVariables returns the Variables slice if it's non-nil, nil otherwise. +func (a *ActionsVariables) GetVariables() []*ActionsVariable { + if a == nil || a.Variables == nil { + return nil + } + return a.Variables +} + // GetMaximumAdvancedSecurityCommitters returns the MaximumAdvancedSecurityCommitters field if it's non-nil, zero value otherwise. func (a *ActiveCommitters) GetMaximumAdvancedSecurityCommitters() int { if a == nil || a.MaximumAdvancedSecurityCommitters == nil { @@ -326,6 +518,14 @@ func (a *ActiveCommitters) GetPurchasedAdvancedSecurityCommitters() int { return *a.PurchasedAdvancedSecurityCommitters } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (a *ActiveCommitters) GetRepositories() []*RepositoryActiveCommitters { + if a == nil || a.Repositories == nil { + return nil + } + return a.Repositories +} + // GetTotalAdvancedSecurityCommitters returns the TotalAdvancedSecurityCommitters field if it's non-nil, zero value otherwise. func (a *ActiveCommitters) GetTotalAdvancedSecurityCommitters() int { if a == nil || a.TotalAdvancedSecurityCommitters == nil { @@ -350,6 +550,22 @@ func (a *ActiveCommittersListOptions) GetAdvancedSecurityProduct() string { return *a.AdvancedSecurityProduct } +// GetDirection returns the Direction field. +func (a *ActivityListStarredOptions) GetDirection() string { + if a == nil { + return "" + } + return a.Direction +} + +// GetSort returns the Sort field. +func (a *ActivityListStarredOptions) GetSort() string { + if a == nil { + return "" + } + return a.Sort +} + // GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise. func (a *ActorLocation) GetCountryCode() string { if a == nil || a.CountryCode == nil { @@ -382,6 +598,14 @@ func (a *AddResourcesToCostCenterResponse) GetMessage() string { return *a.Message } +// GetReassignedResources returns the ReassignedResources slice if it's non-nil, nil otherwise. +func (a *AddResourcesToCostCenterResponse) GetReassignedResources() []*ReassignedResource { + if a == nil || a.ReassignedResources == nil { + return nil + } + return a.ReassignedResources +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *AdminEnforcedChanges) GetFrom() bool { if a == nil || a.From == nil { @@ -390,6 +614,14 @@ func (a *AdminEnforcedChanges) GetFrom() bool { return *a.From } +// GetEnabled returns the Enabled field. +func (a *AdminEnforcement) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (a *AdminEnforcement) GetURL() string { if a == nil || a.URL == nil { @@ -486,12 +718,36 @@ func (a *AdvancedSecurity) GetStatus() string { return *a.Status } -// GetScore returns the Score field. -func (a *AdvisoryCVSS) GetScore() *float64 { +// GetLastPushedDate returns the LastPushedDate field. +func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedDate() string { if a == nil { - return nil + return "" + } + return a.LastPushedDate +} + +// GetLastPushedEmail returns the LastPushedEmail field. +func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedEmail() string { + if a == nil { + return "" + } + return a.LastPushedEmail +} + +// GetUserLogin returns the UserLogin field. +func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string { + if a == nil { + return "" + } + return a.UserLogin +} + +// GetScore returns the Score field if it's non-nil, zero value otherwise. +func (a *AdvisoryCVSS) GetScore() float64 { + if a == nil || a.Score == nil { + return 0 } - return a.Score + return *a.Score } // GetVectorString returns the VectorString field if it's non-nil, zero value otherwise. @@ -518,6 +774,22 @@ func (a *AdvisoryCWEs) GetName() string { return *a.Name } +// GetPercentage returns the Percentage field. +func (a *AdvisoryEPSS) GetPercentage() float64 { + if a == nil { + return 0 + } + return a.Percentage +} + +// GetPercentile returns the Percentile field. +func (a *AdvisoryEPSS) GetPercentile() float64 { + if a == nil { + return 0 + } + return a.Percentile +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (a *AdvisoryIdentifier) GetType() string { if a == nil || a.Type == nil { @@ -574,6 +846,14 @@ func (a *AdvisoryVulnerability) GetSeverity() string { return *a.Severity } +// GetVulnerableFunctions returns the VulnerableFunctions slice if it's non-nil, nil otherwise. +func (a *AdvisoryVulnerability) GetVulnerableFunctions() []string { + if a == nil || a.VulnerableFunctions == nil { + return nil + } + return a.VulnerableFunctions +} + // GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise. func (a *AdvisoryVulnerability) GetVulnerableVersionRange() string { if a == nil || a.VulnerableVersionRange == nil { @@ -654,6 +934,14 @@ func (a *Alert) GetHTMLURL() string { return *a.HTMLURL } +// GetInstances returns the Instances slice if it's non-nil, nil otherwise. +func (a *Alert) GetInstances() []*MostRecentInstance { + if a == nil || a.Instances == nil { + return nil + } + return a.Instances +} + // GetInstancesURL returns the InstancesURL field if it's non-nil, zero value otherwise. func (a *Alert) GetInstancesURL() string { if a == nil || a.InstancesURL == nil { @@ -750,6 +1038,78 @@ func (a *Alert) GetURL() string { return *a.URL } +// GetRef returns the Ref field. +func (a *AlertInstancesListOptions) GetRef() string { + if a == nil { + return "" + } + return a.Ref +} + +// GetDirection returns the Direction field. +func (a *AlertListOptions) GetDirection() string { + if a == nil { + return "" + } + return a.Direction +} + +// GetRef returns the Ref field. +func (a *AlertListOptions) GetRef() string { + if a == nil { + return "" + } + return a.Ref +} + +// GetSeverity returns the Severity field. +func (a *AlertListOptions) GetSeverity() string { + if a == nil { + return "" + } + return a.Severity +} + +// GetSort returns the Sort field. +func (a *AlertListOptions) GetSort() string { + if a == nil { + return "" + } + return a.Sort +} + +// GetState returns the State field. +func (a *AlertListOptions) GetState() string { + if a == nil { + return "" + } + return a.State +} + +// GetToolGUID returns the ToolGUID field. +func (a *AlertListOptions) GetToolGUID() string { + if a == nil { + return "" + } + return a.ToolGUID +} + +// GetToolName returns the ToolName field. +func (a *AlertListOptions) GetToolName() string { + if a == nil { + return "" + } + return a.ToolName +} + +// GetEnabled returns the Enabled field. +func (a *AllowDeletions) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *AllowDeletionsEnforcementLevelChanges) GetFrom() string { if a == nil || a.From == nil { @@ -758,6 +1118,14 @@ func (a *AllowDeletionsEnforcementLevelChanges) GetFrom() string { return *a.From } +// GetEnabled returns the Enabled field. +func (a *AllowForcePushes) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + // GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. func (a *AllowForkSyncing) GetEnabled() bool { if a == nil || a.Enabled == nil { @@ -766,6 +1134,94 @@ func (a *AllowForkSyncing) GetEnabled() bool { return *a.Enabled } +// GetAuthenticationType returns the AuthenticationType field. +func (a *AmazonS3AccessKeysConfig) GetAuthenticationType() string { + if a == nil { + return "" + } + return a.AuthenticationType +} + +// GetBucket returns the Bucket field. +func (a *AmazonS3AccessKeysConfig) GetBucket() string { + if a == nil { + return "" + } + return a.Bucket +} + +// GetEncryptedAccessKeyID returns the EncryptedAccessKeyID field. +func (a *AmazonS3AccessKeysConfig) GetEncryptedAccessKeyID() string { + if a == nil { + return "" + } + return a.EncryptedAccessKeyID +} + +// GetEncryptedSecretKey returns the EncryptedSecretKey field. +func (a *AmazonS3AccessKeysConfig) GetEncryptedSecretKey() string { + if a == nil { + return "" + } + return a.EncryptedSecretKey +} + +// GetKeyID returns the KeyID field. +func (a *AmazonS3AccessKeysConfig) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + +// GetRegion returns the Region field. +func (a *AmazonS3AccessKeysConfig) GetRegion() string { + if a == nil { + return "" + } + return a.Region +} + +// GetArnRole returns the ArnRole field. +func (a *AmazonS3OIDCConfig) GetArnRole() string { + if a == nil { + return "" + } + return a.ArnRole +} + +// GetAuthenticationType returns the AuthenticationType field. +func (a *AmazonS3OIDCConfig) GetAuthenticationType() string { + if a == nil { + return "" + } + return a.AuthenticationType +} + +// GetBucket returns the Bucket field. +func (a *AmazonS3OIDCConfig) GetBucket() string { + if a == nil { + return "" + } + return a.Bucket +} + +// GetKeyID returns the KeyID field. +func (a *AmazonS3OIDCConfig) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + +// GetRegion returns the Region field. +func (a *AmazonS3OIDCConfig) GetRegion() string { + if a == nil { + return "" + } + return a.Region +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (a *AnalysesListOptions) GetRef() string { if a == nil || a.Ref == nil { @@ -782,6 +1238,54 @@ func (a *AnalysesListOptions) GetSarifID() string { return *a.SarifID } +// GetActions returns the Actions slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetActions() []string { + if a == nil || a.Actions == nil { + return nil + } + return a.Actions +} + +// GetActionsMacos returns the ActionsMacos slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetActionsMacos() []string { + if a == nil || a.ActionsMacos == nil { + return nil + } + return a.ActionsMacos +} + +// GetAPI returns the API slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetAPI() []string { + if a == nil || a.API == nil { + return nil + } + return a.API +} + +// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetCodespaces() []string { + if a == nil || a.Codespaces == nil { + return nil + } + return a.Codespaces +} + +// GetCopilot returns the Copilot slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetCopilot() []string { + if a == nil || a.Copilot == nil { + return nil + } + return a.Copilot +} + +// GetDependabot returns the Dependabot slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetDependabot() []string { + if a == nil || a.Dependabot == nil { + return nil + } + return a.Dependabot +} + // GetDomains returns the Domains field. func (a *APIMeta) GetDomains() *APIMetaDomains { if a == nil { @@ -790,6 +1294,54 @@ func (a *APIMeta) GetDomains() *APIMetaDomains { return a.Domains } +// GetGit returns the Git slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetGit() []string { + if a == nil || a.Git == nil { + return nil + } + return a.Git +} + +// GetGithubEnterpriseImporter returns the GithubEnterpriseImporter slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetGithubEnterpriseImporter() []string { + if a == nil || a.GithubEnterpriseImporter == nil { + return nil + } + return a.GithubEnterpriseImporter +} + +// GetHooks returns the Hooks slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetHooks() []string { + if a == nil || a.Hooks == nil { + return nil + } + return a.Hooks +} + +// GetImporter returns the Importer slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetImporter() []string { + if a == nil || a.Importer == nil { + return nil + } + return a.Importer +} + +// GetPackages returns the Packages slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetPackages() []string { + if a == nil || a.Packages == nil { + return nil + } + return a.Packages +} + +// GetPages returns the Pages slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetPages() []string { + if a == nil || a.Pages == nil { + return nil + } + return a.Pages +} + // GetSSHKeyFingerprints returns the SSHKeyFingerprints map if it's non-nil, an empty map otherwise. func (a *APIMeta) GetSSHKeyFingerprints() map[string]string { if a == nil || a.SSHKeyFingerprints == nil { @@ -798,6 +1350,14 @@ func (a *APIMeta) GetSSHKeyFingerprints() map[string]string { return a.SSHKeyFingerprints } +// GetSSHKeys returns the SSHKeys slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetSSHKeys() []string { + if a == nil || a.SSHKeys == nil { + return nil + } + return a.SSHKeys +} + // GetVerifiablePasswordAuthentication returns the VerifiablePasswordAuthentication field if it's non-nil, zero value otherwise. func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { if a == nil || a.VerifiablePasswordAuthentication == nil { @@ -806,6 +1366,38 @@ func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { return *a.VerifiablePasswordAuthentication } +// GetWeb returns the Web slice if it's non-nil, nil otherwise. +func (a *APIMeta) GetWeb() []string { + if a == nil || a.Web == nil { + return nil + } + return a.Web +} + +// GetServices returns the Services slice if it's non-nil, nil otherwise. +func (a *APIMetaArtifactAttestations) GetServices() []string { + if a == nil || a.Services == nil { + return nil + } + return a.Services +} + +// GetTrustDomain returns the TrustDomain field. +func (a *APIMetaArtifactAttestations) GetTrustDomain() string { + if a == nil { + return "" + } + return a.TrustDomain +} + +// GetActions returns the Actions slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetActions() []string { + if a == nil || a.Actions == nil { + return nil + } + return a.Actions +} + // GetActionsInbound returns the ActionsInbound field. func (a *APIMetaDomains) GetActionsInbound() *ActionsInboundDomains { if a == nil { @@ -822,6 +1414,46 @@ func (a *APIMetaDomains) GetArtifactAttestations() *APIMetaArtifactAttestations return a.ArtifactAttestations } +// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetCodespaces() []string { + if a == nil || a.Codespaces == nil { + return nil + } + return a.Codespaces +} + +// GetCopilot returns the Copilot slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetCopilot() []string { + if a == nil || a.Copilot == nil { + return nil + } + return a.Copilot +} + +// GetPackages returns the Packages slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetPackages() []string { + if a == nil || a.Packages == nil { + return nil + } + return a.Packages +} + +// GetWebsite returns the Website slice if it's non-nil, nil otherwise. +func (a *APIMetaDomains) GetWebsite() []string { + if a == nil || a.Website == nil { + return nil + } + return a.Website +} + +// GetClientID returns the ClientID field if it's non-nil, zero value otherwise. +func (a *App) GetClientID() string { + if a == nil || a.ClientID == nil { + return "" + } + return *a.ClientID +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (a *App) GetCreatedAt() Timestamp { if a == nil || a.CreatedAt == nil { @@ -838,6 +1470,14 @@ func (a *App) GetDescription() string { return *a.Description } +// GetEvents returns the Events slice if it's non-nil, nil otherwise. +func (a *App) GetEvents() []string { + if a == nil || a.Events == nil { + return nil + } + return a.Events +} + // GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise. func (a *App) GetExternalURL() string { if a == nil || a.ExternalURL == nil { @@ -1030,6 +1670,14 @@ func (a *AppConfig) GetWebhookSecret() string { return *a.WebhookSecret } +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (a *AppInstallationRepositoriesOptions) GetSelectedRepositoryIDs() []int64 { + if a == nil || a.SelectedRepositoryIDs == nil { + return nil + } + return a.SelectedRepositoryIDs +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *ArchivedAt) GetFrom() Timestamp { if a == nil || a.From == nil { @@ -1206,6 +1854,14 @@ func (a *ArtifactDeploymentRecord) GetPhysicalEnvironment() string { return *a.PhysicalEnvironment } +// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise. +func (a *ArtifactDeploymentRecord) GetRuntimeRisks() []DeploymentRuntimeRisk { + if a == nil || a.RuntimeRisks == nil { + return nil + } + return a.RuntimeRisks +} + // GetTags returns the Tags map if it's non-nil, an empty map otherwise. func (a *ArtifactDeploymentRecord) GetTags() map[string]string { if a == nil || a.Tags == nil { @@ -1222,6 +1878,14 @@ func (a *ArtifactDeploymentRecord) GetUpdatedAt() Timestamp { return *a.UpdatedAt } +// GetDeploymentRecords returns the DeploymentRecords slice if it's non-nil, nil otherwise. +func (a *ArtifactDeploymentResponse) GetDeploymentRecords() []*ArtifactDeploymentRecord { + if a == nil || a.DeploymentRecords == nil { + return nil + } + return a.DeploymentRecords +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (a *ArtifactDeploymentResponse) GetTotalCount() int { if a == nil || a.TotalCount == nil { @@ -1230,6 +1894,14 @@ func (a *ArtifactDeploymentResponse) GetTotalCount() int { return *a.TotalCount } +// GetArtifacts returns the Artifacts slice if it's non-nil, nil otherwise. +func (a *ArtifactList) GetArtifacts() []*Artifact { + if a == nil || a.Artifacts == nil { + return nil + } + return a.Artifacts +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (a *ArtifactList) GetTotalCount() int64 { if a == nil || a.TotalCount == nil { @@ -1334,6 +2006,14 @@ func (a *ArtifactStorageRecord) GetUpdatedAt() Timestamp { return *a.UpdatedAt } +// GetStorageRecords returns the StorageRecords slice if it's non-nil, nil otherwise. +func (a *ArtifactStorageResponse) GetStorageRecords() []*ArtifactStorageRecord { + if a == nil || a.StorageRecords == nil { + return nil + } + return a.StorageRecords +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (a *ArtifactStorageResponse) GetTotalCount() int { if a == nil || a.TotalCount == nil { @@ -1494,6 +2174,30 @@ func (a *Attachment) GetTitle() string { return *a.Title } +// GetBundle returns the Bundle field. +func (a *Attestation) GetBundle() json.RawMessage { + if a == nil { + return json.RawMessage{} + } + return a.Bundle +} + +// GetRepositoryID returns the RepositoryID field. +func (a *Attestation) GetRepositoryID() int64 { + if a == nil { + return 0 + } + return a.RepositoryID +} + +// GetAttestations returns the Attestations slice if it's non-nil, nil otherwise. +func (a *AttestationsResponse) GetAttestations() []*Attestation { + if a == nil || a.Attestations == nil { + return nil + } + return a.Attestations +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetAction() string { if a == nil || a.Action == nil { @@ -1654,6 +2358,102 @@ func (a *AuditEntry) GetUserID() int64 { return *a.UserID } +// GetCreatedAt returns the CreatedAt field. +func (a *AuditLogStream) GetCreatedAt() Timestamp { + if a == nil { + return Timestamp{} + } + return a.CreatedAt +} + +// GetEnabled returns the Enabled field. +func (a *AuditLogStream) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + +// GetID returns the ID field. +func (a *AuditLogStream) GetID() int64 { + if a == nil { + return 0 + } + return a.ID +} + +// GetPausedAt returns the PausedAt field if it's non-nil, zero value otherwise. +func (a *AuditLogStream) GetPausedAt() Timestamp { + if a == nil || a.PausedAt == nil { + return Timestamp{} + } + return *a.PausedAt +} + +// GetStreamDetails returns the StreamDetails field. +func (a *AuditLogStream) GetStreamDetails() string { + if a == nil { + return "" + } + return a.StreamDetails +} + +// GetStreamType returns the StreamType field. +func (a *AuditLogStream) GetStreamType() string { + if a == nil { + return "" + } + return a.StreamType +} + +// GetUpdatedAt returns the UpdatedAt field. +func (a *AuditLogStream) GetUpdatedAt() Timestamp { + if a == nil { + return Timestamp{} + } + return a.UpdatedAt +} + +// GetEnabled returns the Enabled field. +func (a *AuditLogStreamConfig) GetEnabled() bool { + if a == nil { + return false + } + return a.Enabled +} + +// GetStreamType returns the StreamType field. +func (a *AuditLogStreamConfig) GetStreamType() string { + if a == nil { + return "" + } + return a.StreamType +} + +// GetVendorSpecific returns the VendorSpecific field. +func (a *AuditLogStreamConfig) GetVendorSpecific() AuditLogStreamVendorConfig { + if a == nil { + return nil + } + return a.VendorSpecific +} + +// GetKey returns the Key field. +func (a *AuditLogStreamKey) GetKey() string { + if a == nil { + return "" + } + return a.Key +} + +// GetKeyID returns the KeyID field. +func (a *AuditLogStreamKey) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + // GetApp returns the App field. func (a *Authorization) GetApp() *AuthorizationApp { if a == nil { @@ -1710,6 +2510,14 @@ func (a *Authorization) GetNoteURL() string { return *a.NoteURL } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (a *Authorization) GetScopes() []Scope { + if a == nil || a.Scopes == nil { + return nil + } + return a.Scopes +} + // GetToken returns the Token field if it's non-nil, zero value otherwise. func (a *Authorization) GetToken() string { if a == nil || a.Token == nil { @@ -1814,6 +2622,22 @@ func (a *AuthorizationRequest) GetNoteURL() string { return *a.NoteURL } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (a *AuthorizationRequest) GetScopes() []Scope { + if a == nil || a.Scopes == nil { + return nil + } + return a.Scopes +} + +// GetAddScopes returns the AddScopes slice if it's non-nil, nil otherwise. +func (a *AuthorizationUpdateRequest) GetAddScopes() []string { + if a == nil || a.AddScopes == nil { + return nil + } + return a.AddScopes +} + // GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. func (a *AuthorizationUpdateRequest) GetFingerprint() string { if a == nil || a.Fingerprint == nil { @@ -1838,6 +2662,30 @@ func (a *AuthorizationUpdateRequest) GetNoteURL() string { return *a.NoteURL } +// GetRemoveScopes returns the RemoveScopes slice if it's non-nil, nil otherwise. +func (a *AuthorizationUpdateRequest) GetRemoveScopes() []string { + if a == nil || a.RemoveScopes == nil { + return nil + } + return a.RemoveScopes +} + +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (a *AuthorizationUpdateRequest) GetScopes() []string { + if a == nil || a.Scopes == nil { + return nil + } + return a.Scopes +} + +// GetFrom returns the From slice if it's non-nil, nil otherwise. +func (a *AuthorizedActorNames) GetFrom() []string { + if a == nil || a.From == nil { + return nil + } + return a.From +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (a *AuthorizedActorsOnly) GetFrom() bool { if a == nil || a.From == nil { @@ -1942,6 +2790,78 @@ func (a *AutoTriggerCheck) GetSetting() bool { return *a.Setting } +// GetContainer returns the Container field. +func (a *AzureBlobConfig) GetContainer() string { + if a == nil { + return "" + } + return a.Container +} + +// GetEncryptedSASURL returns the EncryptedSASURL field. +func (a *AzureBlobConfig) GetEncryptedSASURL() string { + if a == nil { + return "" + } + return a.EncryptedSASURL +} + +// GetKeyID returns the KeyID field. +func (a *AzureBlobConfig) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + +// GetEncryptedConnstring returns the EncryptedConnstring field. +func (a *AzureHubConfig) GetEncryptedConnstring() string { + if a == nil { + return "" + } + return a.EncryptedConnstring +} + +// GetKeyID returns the KeyID field. +func (a *AzureHubConfig) GetKeyID() string { + if a == nil { + return "" + } + return a.KeyID +} + +// GetName returns the Name field. +func (a *AzureHubConfig) GetName() string { + if a == nil { + return "" + } + return a.Name +} + +// GetOTP returns the OTP field. +func (b *BasicAuthTransport) GetOTP() string { + if b == nil { + return "" + } + return b.OTP +} + +// GetPassword returns the Password field. +func (b *BasicAuthTransport) GetPassword() string { + if b == nil { + return "" + } + return b.Password +} + +// GetUsername returns the Username field. +func (b *BasicAuthTransport) GetUsername() string { + if b == nil { + return "" + } + return b.Username +} + // GetContent returns the Content field if it's non-nil, zero value otherwise. func (b *Blob) GetContent() string { if b == nil || b.Content == nil { @@ -2158,6 +3078,14 @@ func (b *BranchProtectionRule) GetAllowForcePushesEnforcementLevel() string { return *b.AllowForcePushesEnforcementLevel } +// GetAuthorizedActorNames returns the AuthorizedActorNames slice if it's non-nil, nil otherwise. +func (b *BranchProtectionRule) GetAuthorizedActorNames() []string { + if b == nil || b.AuthorizedActorNames == nil { + return nil + } + return b.AuthorizedActorNames +} + // GetAuthorizedActorsOnly returns the AuthorizedActorsOnly field if it's non-nil, zero value otherwise. func (b *BranchProtectionRule) GetAuthorizedActorsOnly() bool { if b == nil || b.AuthorizedActorsOnly == nil { @@ -2278,6 +3206,14 @@ func (b *BranchProtectionRule) GetRequiredDeploymentsEnforcementLevel() string { return *b.RequiredDeploymentsEnforcementLevel } +// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise. +func (b *BranchProtectionRule) GetRequiredStatusChecks() []string { + if b == nil || b.RequiredStatusChecks == nil { + return nil + } + return b.RequiredStatusChecks +} + // GetRequiredStatusChecksEnforcementLevel returns the RequiredStatusChecksEnforcementLevel field if it's non-nil, zero value otherwise. func (b *BranchProtectionRule) GetRequiredStatusChecksEnforcementLevel() string { if b == nil || b.RequiredStatusChecksEnforcementLevel == nil { @@ -2374,6 +3310,254 @@ func (b *BranchProtectionRuleEvent) GetSender() *User { return b.Sender } +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (b *BranchRestrictions) GetApps() []*App { + if b == nil || b.Apps == nil { + return nil + } + return b.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (b *BranchRestrictions) GetTeams() []*Team { + if b == nil || b.Teams == nil { + return nil + } + return b.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (b *BranchRestrictions) GetUsers() []*User { + if b == nil || b.Users == nil { + return nil + } + return b.Users +} + +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (b *BranchRestrictionsRequest) GetApps() []string { + if b == nil || b.Apps == nil { + return nil + } + return b.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (b *BranchRestrictionsRequest) GetTeams() []string { + if b == nil || b.Teams == nil { + return nil + } + return b.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (b *BranchRestrictionsRequest) GetUsers() []string { + if b == nil || b.Users == nil { + return nil + } + return b.Users +} + +// GetRulesetID returns the RulesetID field. +func (b *BranchRuleMetadata) GetRulesetID() int64 { + if b == nil { + return 0 + } + return b.RulesetID +} + +// GetRulesetSource returns the RulesetSource field. +func (b *BranchRuleMetadata) GetRulesetSource() string { + if b == nil { + return "" + } + return b.RulesetSource +} + +// GetRulesetSourceType returns the RulesetSourceType field. +func (b *BranchRuleMetadata) GetRulesetSourceType() RulesetSourceType { + if b == nil { + return "" + } + return b.RulesetSourceType +} + +// GetBranchNamePattern returns the BranchNamePattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetBranchNamePattern() []*PatternBranchRule { + if b == nil || b.BranchNamePattern == nil { + return nil + } + return b.BranchNamePattern +} + +// GetCodeScanning returns the CodeScanning slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCodeScanning() []*CodeScanningBranchRule { + if b == nil || b.CodeScanning == nil { + return nil + } + return b.CodeScanning +} + +// GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCommitAuthorEmailPattern() []*PatternBranchRule { + if b == nil || b.CommitAuthorEmailPattern == nil { + return nil + } + return b.CommitAuthorEmailPattern +} + +// GetCommitMessagePattern returns the CommitMessagePattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCommitMessagePattern() []*PatternBranchRule { + if b == nil || b.CommitMessagePattern == nil { + return nil + } + return b.CommitMessagePattern +} + +// GetCommitterEmailPattern returns the CommitterEmailPattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCommitterEmailPattern() []*PatternBranchRule { + if b == nil || b.CommitterEmailPattern == nil { + return nil + } + return b.CommitterEmailPattern +} + +// GetCopilotCodeReview returns the CopilotCodeReview slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCopilotCodeReview() []*CopilotCodeReviewBranchRule { + if b == nil || b.CopilotCodeReview == nil { + return nil + } + return b.CopilotCodeReview +} + +// GetCreation returns the Creation slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetCreation() []*BranchRuleMetadata { + if b == nil || b.Creation == nil { + return nil + } + return b.Creation +} + +// GetDeletion returns the Deletion slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetDeletion() []*BranchRuleMetadata { + if b == nil || b.Deletion == nil { + return nil + } + return b.Deletion +} + +// GetFileExtensionRestriction returns the FileExtensionRestriction slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetFileExtensionRestriction() []*FileExtensionRestrictionBranchRule { + if b == nil || b.FileExtensionRestriction == nil { + return nil + } + return b.FileExtensionRestriction +} + +// GetFilePathRestriction returns the FilePathRestriction slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetFilePathRestriction() []*FilePathRestrictionBranchRule { + if b == nil || b.FilePathRestriction == nil { + return nil + } + return b.FilePathRestriction +} + +// GetMaxFilePathLength returns the MaxFilePathLength slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetMaxFilePathLength() []*MaxFilePathLengthBranchRule { + if b == nil || b.MaxFilePathLength == nil { + return nil + } + return b.MaxFilePathLength +} + +// GetMaxFileSize returns the MaxFileSize slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetMaxFileSize() []*MaxFileSizeBranchRule { + if b == nil || b.MaxFileSize == nil { + return nil + } + return b.MaxFileSize +} + +// GetMergeQueue returns the MergeQueue slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetMergeQueue() []*MergeQueueBranchRule { + if b == nil || b.MergeQueue == nil { + return nil + } + return b.MergeQueue +} + +// GetNonFastForward returns the NonFastForward slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetNonFastForward() []*BranchRuleMetadata { + if b == nil || b.NonFastForward == nil { + return nil + } + return b.NonFastForward +} + +// GetPullRequest returns the PullRequest slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetPullRequest() []*PullRequestBranchRule { + if b == nil || b.PullRequest == nil { + return nil + } + return b.PullRequest +} + +// GetRequiredDeployments returns the RequiredDeployments slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetRequiredDeployments() []*RequiredDeploymentsBranchRule { + if b == nil || b.RequiredDeployments == nil { + return nil + } + return b.RequiredDeployments +} + +// GetRequiredLinearHistory returns the RequiredLinearHistory slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetRequiredLinearHistory() []*BranchRuleMetadata { + if b == nil || b.RequiredLinearHistory == nil { + return nil + } + return b.RequiredLinearHistory +} + +// GetRequiredSignatures returns the RequiredSignatures slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetRequiredSignatures() []*BranchRuleMetadata { + if b == nil || b.RequiredSignatures == nil { + return nil + } + return b.RequiredSignatures +} + +// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetRequiredStatusChecks() []*RequiredStatusChecksBranchRule { + if b == nil || b.RequiredStatusChecks == nil { + return nil + } + return b.RequiredStatusChecks +} + +// GetTagNamePattern returns the TagNamePattern slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetTagNamePattern() []*PatternBranchRule { + if b == nil || b.TagNamePattern == nil { + return nil + } + return b.TagNamePattern +} + +// GetUpdate returns the Update slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetUpdate() []*UpdateBranchRule { + if b == nil || b.Update == nil { + return nil + } + return b.Update +} + +// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise. +func (b *BranchRules) GetWorkflows() []*WorkflowsBranchRule { + if b == nil || b.Workflows == nil { + return nil + } + return b.Workflows +} + // GetActorID returns the ActorID field if it's non-nil, zero value otherwise. func (b *BypassActor) GetActorID() int64 { if b == nil || b.ActorID == nil { @@ -2398,6 +3582,70 @@ func (b *BypassActor) GetBypassMode() *BypassMode { return b.BypassMode } +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowances) GetApps() []*App { + if b == nil || b.Apps == nil { + return nil + } + return b.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowances) GetTeams() []*Team { + if b == nil || b.Teams == nil { + return nil + } + return b.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowances) GetUsers() []*User { + if b == nil || b.Users == nil { + return nil + } + return b.Users +} + +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowancesRequest) GetApps() []string { + if b == nil || b.Apps == nil { + return nil + } + return b.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowancesRequest) GetTeams() []string { + if b == nil || b.Teams == nil { + return nil + } + return b.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (b *BypassPullRequestAllowancesRequest) GetUsers() []string { + if b == nil || b.Users == nil { + return nil + } + return b.Users +} + +// GetReviewerID returns the ReviewerID field. +func (b *BypassReviewer) GetReviewerID() int64 { + if b == nil { + return 0 + } + return b.ReviewerID +} + +// GetReviewerType returns the ReviewerType field. +func (b *BypassReviewer) GetReviewerType() string { + if b == nil { + return "" + } + return b.ReviewerType +} + // GetSecurityConfigurationID returns the SecurityConfigurationID field if it's non-nil, zero value otherwise. func (b *BypassReviewer) GetSecurityConfigurationID() int64 { if b == nil || b.SecurityConfigurationID == nil { @@ -2502,6 +3750,14 @@ func (c *CheckRun) GetOutput() *CheckRunOutput { return c.Output } +// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise. +func (c *CheckRun) GetPullRequests() []*PullRequest { + if c == nil || c.PullRequests == nil { + return nil + } + return c.PullRequests +} + // GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. func (c *CheckRun) GetStartedAt() Timestamp { if c == nil || c.StartedAt == nil { @@ -2526,6 +3782,30 @@ func (c *CheckRun) GetURL() string { return *c.URL } +// GetDescription returns the Description field. +func (c *CheckRunAction) GetDescription() string { + if c == nil { + return "" + } + return c.Description +} + +// GetIdentifier returns the Identifier field. +func (c *CheckRunAction) GetIdentifier() string { + if c == nil { + return "" + } + return c.Identifier +} + +// GetLabel returns the Label field. +func (c *CheckRunAction) GetLabel() string { + if c == nil { + return "" + } + return c.Label +} + // GetAnnotationLevel returns the AnnotationLevel field if it's non-nil, zero value otherwise. func (c *CheckRunAnnotation) GetAnnotationLevel() string { if c == nil || c.AnnotationLevel == nil { @@ -2678,6 +3958,14 @@ func (c *CheckRunImage) GetImageURL() string { return *c.ImageURL } +// GetAnnotations returns the Annotations slice if it's non-nil, nil otherwise. +func (c *CheckRunOutput) GetAnnotations() []*CheckRunAnnotation { + if c == nil || c.Annotations == nil { + return nil + } + return c.Annotations +} + // GetAnnotationsCount returns the AnnotationsCount field if it's non-nil, zero value otherwise. func (c *CheckRunOutput) GetAnnotationsCount() int { if c == nil || c.AnnotationsCount == nil { @@ -2694,6 +3982,14 @@ func (c *CheckRunOutput) GetAnnotationsURL() string { return *c.AnnotationsURL } +// GetImages returns the Images slice if it's non-nil, nil otherwise. +func (c *CheckRunOutput) GetImages() []*CheckRunImage { + if c == nil || c.Images == nil { + return nil + } + return c.Images +} + // GetSummary returns the Summary field if it's non-nil, zero value otherwise. func (c *CheckRunOutput) GetSummary() string { if c == nil || c.Summary == nil { @@ -2806,6 +4102,14 @@ func (c *CheckSuite) GetNodeID() string { return *c.NodeID } +// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise. +func (c *CheckSuite) GetPullRequests() []*PullRequest { + if c == nil || c.PullRequests == nil { + return nil + } + return c.PullRequests +} + // GetRepository returns the Repository field. func (c *CheckSuite) GetRepository() *Repository { if c == nil { @@ -2902,6 +4206,14 @@ func (c *CheckSuiteEvent) GetSender() *User { return c.Sender } +// GetAutoTriggerChecks returns the AutoTriggerChecks slice if it's non-nil, nil otherwise. +func (c *CheckSuitePreferenceOptions) GetAutoTriggerChecks() []*AutoTriggerCheck { + if c == nil || c.AutoTriggerChecks == nil { + return nil + } + return c.AutoTriggerChecks +} + // GetPreferences returns the Preferences field. func (c *CheckSuitePreferenceResults) GetPreferences() *PreferenceList { if c == nil { @@ -3142,6 +4454,22 @@ func (c *ClassroomUser) GetLogin() string { return *c.Login } +// GetDeploymentName returns the DeploymentName field. +func (c *ClusterArtifactDeployment) GetDeploymentName() string { + if c == nil { + return "" + } + return c.DeploymentName +} + +// GetDigest returns the Digest field. +func (c *ClusterArtifactDeployment) GetDigest() string { + if c == nil { + return "" + } + return c.Digest +} + // GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise. func (c *ClusterArtifactDeployment) GetGithubRepository() string { if c == nil || c.GithubRepository == nil { @@ -3150,6 +4478,30 @@ func (c *ClusterArtifactDeployment) GetGithubRepository() string { return *c.GithubRepository } +// GetName returns the Name field. +func (c *ClusterArtifactDeployment) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise. +func (c *ClusterArtifactDeployment) GetRuntimeRisks() []DeploymentRuntimeRisk { + if c == nil || c.RuntimeRisks == nil { + return nil + } + return c.RuntimeRisks +} + +// GetStatus returns the Status field. +func (c *ClusterArtifactDeployment) GetStatus() string { + if c == nil { + return "" + } + return c.Status +} + // GetTags returns the Tags map if it's non-nil, an empty map otherwise. func (c *ClusterArtifactDeployment) GetTags() map[string]string { if c == nil || c.Tags == nil { @@ -3166,6 +4518,22 @@ func (c *ClusterArtifactDeployment) GetVersion() string { return *c.Version } +// GetDeployments returns the Deployments slice if it's non-nil, nil otherwise. +func (c *ClusterDeploymentRecordsRequest) GetDeployments() []*ClusterArtifactDeployment { + if c == nil || c.Deployments == nil { + return nil + } + return c.Deployments +} + +// GetLogicalEnvironment returns the LogicalEnvironment field. +func (c *ClusterDeploymentRecordsRequest) GetLogicalEnvironment() string { + if c == nil { + return "" + } + return c.LogicalEnvironment +} + // GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise. func (c *ClusterDeploymentRecordsRequest) GetPhysicalEnvironment() string { if c == nil || c.PhysicalEnvironment == nil { @@ -3190,6 +4558,14 @@ func (c *ClusterSSHKey) GetKey() string { return *c.Key } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (c *ClusterStatus) GetNodes() []*ClusterStatusNode { + if c == nil || c.Nodes == nil { + return nil + } + return c.Nodes +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (c *ClusterStatus) GetStatus() string { if c == nil || c.Status == nil { @@ -3206,6 +4582,14 @@ func (c *ClusterStatusNode) GetHostname() string { return *c.Hostname } +// GetServices returns the Services slice if it's non-nil, nil otherwise. +func (c *ClusterStatusNode) GetServices() []*ClusterStatusNodeServiceItem { + if c == nil || c.Services == nil { + return nil + } + return c.Services +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (c *ClusterStatusNode) GetStatus() string { if c == nil || c.Status == nil { @@ -3270,6 +4654,54 @@ func (c *CodeOfConduct) GetURL() string { return *c.URL } +// GetColumn returns the Column field. +func (c *CodeownersError) GetColumn() int { + if c == nil { + return 0 + } + return c.Column +} + +// GetKind returns the Kind field. +func (c *CodeownersError) GetKind() string { + if c == nil { + return "" + } + return c.Kind +} + +// GetLine returns the Line field. +func (c *CodeownersError) GetLine() int { + if c == nil { + return 0 + } + return c.Line +} + +// GetMessage returns the Message field. +func (c *CodeownersError) GetMessage() string { + if c == nil { + return "" + } + return c.Message +} + +// GetPath returns the Path field. +func (c *CodeownersError) GetPath() string { + if c == nil { + return "" + } + return c.Path +} + +// GetSource returns the Source field. +func (c *CodeownersError) GetSource() string { + if c == nil { + return "" + } + return c.Source +} + // GetSuggestion returns the Suggestion field if it's non-nil, zero value otherwise. func (c *CodeownersError) GetSuggestion() string { if c == nil || c.Suggestion == nil { @@ -3278,6 +4710,14 @@ func (c *CodeownersError) GetSuggestion() string { return *c.Suggestion } +// GetErrors returns the Errors slice if it's non-nil, nil otherwise. +func (c *CodeownersErrors) GetErrors() []*CodeownersError { + if c == nil || c.Errors == nil { + return nil + } + return c.Errors +} + // GetContentType returns the ContentType field if it's non-nil, zero value otherwise. func (c *CodeQLDatabase) GetContentType() string { if c == nil || c.ContentType == nil { @@ -3390,6 +4830,14 @@ func (c *CodeResult) GetSHA() string { return *c.SHA } +// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise. +func (c *CodeResult) GetTextMatches() []*TextMatch { + if c == nil || c.TextMatches == nil { + return nil + } + return c.TextMatches +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (c *CodeScanningAlertEvent) GetAction() string { if c == nil || c.Action == nil { @@ -3470,6 +4918,22 @@ func (c *CodeScanningAlertState) GetDismissedReason() string { return *c.DismissedReason } +// GetState returns the State field. +func (c *CodeScanningAlertState) GetState() string { + if c == nil { + return "" + } + return c.State +} + +// GetParameters returns the Parameters field. +func (c *CodeScanningBranchRule) GetParameters() CodeScanningRuleParameters { + if c == nil { + return CodeScanningRuleParameters{} + } + return c.Parameters +} + // GetRunnerLabel returns the RunnerLabel field if it's non-nil, zero value otherwise. func (c *CodeScanningDefaultSetupOptions) GetRunnerLabel() string { if c == nil || c.RunnerLabel == nil { @@ -3478,6 +4942,14 @@ func (c *CodeScanningDefaultSetupOptions) GetRunnerLabel() string { return *c.RunnerLabel } +// GetRunnerType returns the RunnerType field. +func (c *CodeScanningDefaultSetupOptions) GetRunnerType() string { + if c == nil { + return "" + } + return c.RunnerType +} + // GetAllowAdvanced returns the AllowAdvanced field if it's non-nil, zero value otherwise. func (c *CodeScanningOptions) GetAllowAdvanced() bool { if c == nil || c.AllowAdvanced == nil { @@ -3486,6 +4958,22 @@ func (c *CodeScanningOptions) GetAllowAdvanced() bool { return *c.AllowAdvanced } +// GetCodeScanningTools returns the CodeScanningTools slice if it's non-nil, nil otherwise. +func (c *CodeScanningRuleParameters) GetCodeScanningTools() []*RuleCodeScanningTool { + if c == nil || c.CodeScanningTools == nil { + return nil + } + return c.CodeScanningTools +} + +// GetCodeResults returns the CodeResults slice if it's non-nil, nil otherwise. +func (c *CodeSearchResult) GetCodeResults() []*CodeResult { + if c == nil || c.CodeResults == nil { + return nil + } + return c.CodeResults +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (c *CodeSearchResult) GetIncompleteResults() bool { if c == nil || c.IncompleteResults == nil { @@ -3502,6 +4990,14 @@ func (c *CodeSearchResult) GetTotal() int { return *c.Total } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *CodeSecurity) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + // GetAdvancedSecurity returns the AdvancedSecurity field if it's non-nil, zero value otherwise. func (c *CodeSecurityConfiguration) GetAdvancedSecurity() string { if c == nil || c.AdvancedSecurity == nil { @@ -3566,6 +5062,14 @@ func (c *CodeSecurityConfiguration) GetDependabotAlerts() string { return *c.DependabotAlerts } +// GetDependabotDelegatedAlertDismissal returns the DependabotDelegatedAlertDismissal field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependabotDelegatedAlertDismissal() string { + if c == nil || c.DependabotDelegatedAlertDismissal == nil { + return "" + } + return *c.DependabotDelegatedAlertDismissal +} + // GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field if it's non-nil, zero value otherwise. func (c *CodeSecurityConfiguration) GetDependabotSecurityUpdates() string { if c == nil || c.DependabotSecurityUpdates == nil { @@ -3598,6 +5102,14 @@ func (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitActionOptions() return c.DependencyGraphAutosubmitActionOptions } +// GetDescription returns the Description field. +func (c *CodeSecurityConfiguration) GetDescription() string { + if c == nil { + return "" + } + return c.Description +} + // GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise. func (c *CodeSecurityConfiguration) GetEnforcement() string { if c == nil || c.Enforcement == nil { @@ -3622,6 +5134,14 @@ func (c *CodeSecurityConfiguration) GetID() int64 { return *c.ID } +// GetName returns the Name field. +func (c *CodeSecurityConfiguration) GetName() string { + if c == nil { + return "" + } + return c.Name +} + // GetPrivateVulnerabilityReporting returns the PrivateVulnerabilityReporting field if it's non-nil, zero value otherwise. func (c *CodeSecurityConfiguration) GetPrivateVulnerabilityReporting() string { if c == nil || c.PrivateVulnerabilityReporting == nil { @@ -3670,6 +5190,14 @@ func (c *CodeSecurityConfiguration) GetSecretScanningDelegatedBypassOptions() *S return c.SecretScanningDelegatedBypassOptions } +// GetSecretScanningExtendedMetadata returns the SecretScanningExtendedMetadata field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanningExtendedMetadata() string { + if c == nil || c.SecretScanningExtendedMetadata == nil { + return "" + } + return *c.SecretScanningExtendedMetadata +} + // GetSecretScanningGenericSecrets returns the SecretScanningGenericSecrets field if it's non-nil, zero value otherwise. func (c *CodeSecurityConfiguration) GetSecretScanningGenericSecrets() string { if c == nil || c.SecretScanningGenericSecrets == nil { @@ -3902,6 +5430,14 @@ func (c *Codespace) GetPullsURL() string { return *c.PullsURL } +// GetRecentFolders returns the RecentFolders slice if it's non-nil, nil otherwise. +func (c *Codespace) GetRecentFolders() []string { + if c == nil || c.RecentFolders == nil { + return nil + } + return c.RecentFolders +} + // GetRepository returns the Repository field. func (c *Codespace) GetRepository() *Repository { if c == nil { @@ -4062,6 +5598,14 @@ func (c *CodespaceCreateForUserOptions) GetRef() string { return *c.Ref } +// GetRepositoryID returns the RepositoryID field. +func (c *CodespaceCreateForUserOptions) GetRepositoryID() int64 { + if c == 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 { @@ -4102,6 +5646,14 @@ func (c *CodespaceDefaults) GetDevcontainerPath() string { return *c.DevcontainerPath } +// GetLocation returns the Location field. +func (c *CodespaceDefaults) GetLocation() string { + if c == nil { + return "" + } + return c.Location +} + // GetBranch returns the Branch field if it's non-nil, zero value otherwise. func (c *CodespaceExport) GetBranch() string { if c == nil || c.Branch == nil { @@ -4174,6 +5726,30 @@ func (c *CodespaceGetDefaultAttributesOptions) GetRef() string { return *c.Ref } +// GetAccepted returns the Accepted field. +func (c *CodespacePermissions) GetAccepted() bool { + if c == nil { + return false + } + return c.Accepted +} + +// GetPullRequestNumber returns the PullRequestNumber field. +func (c *CodespacePullRequestOptions) GetPullRequestNumber() int64 { + if c == nil { + return 0 + } + return c.PullRequestNumber +} + +// GetRepositoryID returns the RepositoryID field. +func (c *CodespacePullRequestOptions) GetRepositoryID() int64 { + if c == nil { + return 0 + } + return c.RepositoryID +} + // GetAhead returns the Ahead field if it's non-nil, zero value otherwise. func (c *CodespacesGitStatus) GetAhead() int { if c == nil || c.Ahead == nil { @@ -4270,6 +5846,46 @@ func (c *CodespacesMachine) GetStorageInBytes() int64 { return *c.StorageInBytes } +// GetMachines returns the Machines slice if it's non-nil, nil otherwise. +func (c *CodespacesMachines) GetMachines() []*CodespacesMachine { + if c == nil || c.Machines == nil { + return nil + } + return c.Machines +} + +// GetTotalCount returns the TotalCount field. +func (c *CodespacesMachines) GetTotalCount() int64 { + if c == nil { + return 0 + } + return c.TotalCount +} + +// GetSelectedUsernames returns the SelectedUsernames slice if it's non-nil, nil otherwise. +func (c *CodespacesOrgAccessControlRequest) GetSelectedUsernames() []string { + if c == nil || c.SelectedUsernames == nil { + return nil + } + return c.SelectedUsernames +} + +// GetVisibility returns the Visibility field. +func (c *CodespacesOrgAccessControlRequest) GetVisibility() string { + if c == nil { + return "" + } + return c.Visibility +} + +// GetAllowedPortPrivacySettings returns the AllowedPortPrivacySettings slice if it's non-nil, nil otherwise. +func (c *CodespacesRuntimeConstraints) GetAllowedPortPrivacySettings() []string { + if c == nil || c.AllowedPortPrivacySettings == nil { + return nil + } + return c.AllowedPortPrivacySettings +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (c *CollaboratorInvitation) GetCreatedAt() Timestamp { if c == nil || c.CreatedAt == nil { @@ -4374,6 +5990,14 @@ func (c *CombinedStatus) GetState() string { return *c.State } +// GetStatuses returns the Statuses slice if it's non-nil, nil otherwise. +func (c *CombinedStatus) GetStatuses() []*RepoStatus { + if c == nil || c.Statuses == nil { + return nil + } + return c.Statuses +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (c *CombinedStatus) GetTotalCount() int { if c == nil || c.TotalCount == nil { @@ -4382,6 +6006,14 @@ func (c *CombinedStatus) GetTotalCount() int { return *c.TotalCount } +// GetBody returns the Body field. +func (c *Comment) GetBody() string { + if c == nil { + return "" + } + return c.Body +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (c *Comment) GetCreatedAt() Timestamp { if c == nil || c.CreatedAt == nil { @@ -4574,6 +6206,14 @@ func (c *Commit) GetNodeID() string { return *c.NodeID } +// GetParents returns the Parents slice if it's non-nil, nil otherwise. +func (c *Commit) GetParents() []*Commit { + if c == nil || c.Parents == nil { + return nil + } + return c.Parents +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (c *Commit) GetSHA() string { if c == nil || c.SHA == nil { @@ -4814,6 +6454,14 @@ func (c *CommitResult) GetHTMLURL() string { return *c.HTMLURL } +// GetParents returns the Parents slice if it's non-nil, nil otherwise. +func (c *CommitResult) GetParents() []*Commit { + if c == nil || c.Parents == nil { + return nil + } + return c.Parents +} + // GetRepository returns the Repository field. func (c *CommitResult) GetRepository() *Repository { if c == nil { @@ -4822,12 +6470,12 @@ func (c *CommitResult) GetRepository() *Repository { return c.Repository } -// GetScore returns the Score field. -func (c *CommitResult) GetScore() *float64 { - if c == nil { - return nil +// GetScore returns the Score field if it's non-nil, zero value otherwise. +func (c *CommitResult) GetScore() float64 { + if c == nil || c.Score == nil { + return 0 } - return c.Score + return *c.Score } // GetSHA returns the SHA field if it's non-nil, zero value otherwise. @@ -4870,6 +6518,14 @@ func (c *CommitsComparison) GetBehindBy() int { return *c.BehindBy } +// GetCommits returns the Commits slice if it's non-nil, nil otherwise. +func (c *CommitsComparison) GetCommits() []*RepositoryCommit { + if c == nil || c.Commits == nil { + return nil + } + return c.Commits +} + // GetDiffURL returns the DiffURL field if it's non-nil, zero value otherwise. func (c *CommitsComparison) GetDiffURL() string { if c == nil || c.DiffURL == nil { @@ -4878,6 +6534,14 @@ func (c *CommitsComparison) GetDiffURL() string { return *c.DiffURL } +// GetFiles returns the Files slice if it's non-nil, nil otherwise. +func (c *CommitsComparison) GetFiles() []*CommitFile { + if c == nil || c.Files == nil { + return nil + } + return c.Files +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (c *CommitsComparison) GetHTMLURL() string { if c == nil || c.HTMLURL == nil { @@ -4934,6 +6598,54 @@ func (c *CommitsComparison) GetURL() string { return *c.URL } +// GetAuthor returns the Author field. +func (c *CommitsListOptions) GetAuthor() string { + if c == nil { + return "" + } + return c.Author +} + +// GetPath returns the Path field. +func (c *CommitsListOptions) GetPath() string { + if c == nil { + return "" + } + return c.Path +} + +// GetSHA returns the SHA field. +func (c *CommitsListOptions) GetSHA() string { + if c == nil { + return "" + } + return c.SHA +} + +// GetSince returns the Since field. +func (c *CommitsListOptions) GetSince() time.Time { + if c == nil { + return time.Time{} + } + return c.Since +} + +// GetUntil returns the Until field. +func (c *CommitsListOptions) GetUntil() time.Time { + if c == nil { + return time.Time{} + } + return c.Until +} + +// GetCommits returns the Commits slice if it's non-nil, nil otherwise. +func (c *CommitsSearchResult) GetCommits() []*CommitResult { + if c == nil || c.Commits == nil { + return nil + } + return c.Commits +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (c *CommitsSearchResult) GetIncompleteResults() bool { if c == nil || c.IncompleteResults == nil { @@ -5078,6 +6790,22 @@ func (c *CommunityHealthMetrics) GetUpdatedAt() Timestamp { return *c.UpdatedAt } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (c *ConfigApplyEvents) GetNodes() []*ConfigApplyEventsNode { + if c == nil || c.Nodes == nil { + return nil + } + return c.Nodes +} + +// GetEvents returns the Events slice if it's non-nil, nil otherwise. +func (c *ConfigApplyEventsNode) GetEvents() []*ConfigApplyEventsNodeEvent { + if c == nil || c.Events == nil { + return nil + } + return c.Events +} + // GetLastRequestID returns the LastRequestID field if it's non-nil, zero value otherwise. func (c *ConfigApplyEventsNode) GetLastRequestID() string { if c == nil || c.LastRequestID == nil { @@ -5198,6 +6926,14 @@ func (c *ConfigApplyOptions) GetRunID() string { return *c.RunID } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (c *ConfigApplyStatus) GetNodes() []*ConfigApplyStatusNode { + if c == nil || c.Nodes == nil { + return nil + } + return c.Nodes +} + // GetRunning returns the Running field if it's non-nil, zero value otherwise. func (c *ConfigApplyStatus) GetRunning() bool { if c == nil || c.Running == nil { @@ -5662,6 +7398,14 @@ func (c *ConfigSettingsLDAP) GetAdminGroup() string { return *c.AdminGroup } +// GetBase returns the Base slice if it's non-nil, nil otherwise. +func (c *ConfigSettingsLDAP) GetBase() []string { + if c == nil || c.Base == nil { + return nil + } + return c.Base +} + // GetBindDN returns the BindDN field if it's non-nil, zero value otherwise. func (c *ConfigSettingsLDAP) GetBindDN() string { if c == nil || c.BindDN == nil { @@ -5766,6 +7510,14 @@ func (c *ConfigSettingsLDAP) GetUID() string { return *c.UID } +// GetUserGroups returns the UserGroups slice if it's non-nil, nil otherwise. +func (c *ConfigSettingsLDAP) GetUserGroups() []string { + if c == nil || c.UserGroups == nil { + return nil + } + return c.UserGroups +} + // GetUserSyncEmails returns the UserSyncEmails field if it's non-nil, zero value otherwise. func (c *ConfigSettingsLDAP) GetUserSyncEmails() bool { if c == nil || c.UserSyncEmails == nil { @@ -6406,6 +8158,14 @@ func (c *Contributor) GetURL() string { return *c.URL } +// GetApprovalPolicy returns the ApprovalPolicy field. +func (c *ContributorApprovalPermissions) GetApprovalPolicy() string { + if c == nil { + return "" + } + return c.ApprovalPolicy +} + // GetAuthor returns the Author field. func (c *ContributorStats) GetAuthor() *Contributor { if c == nil { @@ -6422,6 +8182,278 @@ func (c *ContributorStats) GetTotal() int { return *c.Total } +// GetWeeks returns the Weeks slice if it's non-nil, nil otherwise. +func (c *ContributorStats) GetWeeks() []*WeeklyStats { + if c == nil || c.Weeks == nil { + return nil + } + return c.Weeks +} + +// GetParameters returns the Parameters field. +func (c *CopilotCodeReviewBranchRule) GetParameters() CopilotCodeReviewRuleParameters { + if c == nil { + return CopilotCodeReviewRuleParameters{} + } + return c.Parameters +} + +// GetReviewDraftPullRequests returns the ReviewDraftPullRequests field. +func (c *CopilotCodeReviewRuleParameters) GetReviewDraftPullRequests() bool { + if c == nil { + return false + } + return c.ReviewDraftPullRequests +} + +// GetReviewOnPush returns the ReviewOnPush field. +func (c *CopilotCodeReviewRuleParameters) GetReviewOnPush() bool { + if c == nil { + return false + } + return c.ReviewOnPush +} + +// GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetCodeAcceptanceActivityCount() int { + if c == nil || c.CodeAcceptanceActivityCount == nil { + return 0 + } + return *c.CodeAcceptanceActivityCount +} + +// GetCodeGenerationActivityCount returns the CodeGenerationActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetCodeGenerationActivityCount() int { + if c == nil || c.CodeGenerationActivityCount == nil { + return 0 + } + return *c.CodeGenerationActivityCount +} + +// GetDailyActiveCLIUsers returns the DailyActiveCLIUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetDailyActiveCLIUsers() int { + if c == nil || c.DailyActiveCLIUsers == nil { + return 0 + } + return *c.DailyActiveCLIUsers +} + +// GetDailyActiveCopilotCloudAgentUsers returns the DailyActiveCopilotCloudAgentUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetDailyActiveCopilotCloudAgentUsers() int { + if c == nil || c.DailyActiveCopilotCloudAgentUsers == nil { + return 0 + } + return *c.DailyActiveCopilotCloudAgentUsers +} + +// GetDailyActiveUsers returns the DailyActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetDailyActiveUsers() int { + if c == nil || c.DailyActiveUsers == nil { + return 0 + } + return *c.DailyActiveUsers +} + +// GetDay returns the Day field. +func (c *CopilotDailyMetrics) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetEnterpriseID returns the EnterpriseID field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetEnterpriseID() string { + if c == nil || c.EnterpriseID == nil { + return "" + } + return *c.EnterpriseID +} + +// GetLOCAddedSum returns the LOCAddedSum field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetLOCAddedSum() int { + if c == nil || c.LOCAddedSum == nil { + return 0 + } + return *c.LOCAddedSum +} + +// GetLOCDeletedSum returns the LOCDeletedSum field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetLOCDeletedSum() int { + if c == nil || c.LOCDeletedSum == nil { + return 0 + } + return *c.LOCDeletedSum +} + +// GetLOCSuggestedToAddSum returns the LOCSuggestedToAddSum field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetLOCSuggestedToAddSum() int { + if c == nil || c.LOCSuggestedToAddSum == nil { + return 0 + } + return *c.LOCSuggestedToAddSum +} + +// GetLOCSuggestedToDeleteSum returns the LOCSuggestedToDeleteSum field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetLOCSuggestedToDeleteSum() int { + if c == nil || c.LOCSuggestedToDeleteSum == nil { + return 0 + } + return *c.LOCSuggestedToDeleteSum +} + +// GetMonthlyActiveAgentUsers returns the MonthlyActiveAgentUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetMonthlyActiveAgentUsers() int { + if c == nil || c.MonthlyActiveAgentUsers == nil { + return 0 + } + return *c.MonthlyActiveAgentUsers +} + +// GetMonthlyActiveChatUsers returns the MonthlyActiveChatUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetMonthlyActiveChatUsers() int { + if c == nil || c.MonthlyActiveChatUsers == nil { + return 0 + } + return *c.MonthlyActiveChatUsers +} + +// GetMonthlyActiveCopilotCloudAgentUsers returns the MonthlyActiveCopilotCloudAgentUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetMonthlyActiveCopilotCloudAgentUsers() int { + if c == nil || c.MonthlyActiveCopilotCloudAgentUsers == nil { + return 0 + } + return *c.MonthlyActiveCopilotCloudAgentUsers +} + +// GetMonthlyActiveUsers returns the MonthlyActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetMonthlyActiveUsers() int { + if c == nil || c.MonthlyActiveUsers == nil { + return 0 + } + return *c.MonthlyActiveUsers +} + +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetOrganizationID() string { + if c == nil || c.OrganizationID == nil { + return "" + } + return *c.OrganizationID +} + +// GetPullRequests returns the PullRequests field. +func (c *CopilotDailyMetrics) GetPullRequests() *CopilotMetricsPullRequests { + if c == nil { + return nil + } + return c.PullRequests +} + +// GetTotalsByCLI returns the TotalsByCLI field. +func (c *CopilotDailyMetrics) GetTotalsByCLI() *CopilotMetricsCLI { + if c == nil { + return nil + } + return c.TotalsByCLI +} + +// GetTotalsByFeature returns the TotalsByFeature slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByFeature() []*CopilotMetricsFeature { + if c == nil || c.TotalsByFeature == nil { + return nil + } + return c.TotalsByFeature +} + +// GetTotalsByIDE returns the TotalsByIDE slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByIDE() []*CopilotMetricsIDE { + if c == nil || c.TotalsByIDE == nil { + return nil + } + return c.TotalsByIDE +} + +// GetTotalsByLanguageFeature returns the TotalsByLanguageFeature slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByLanguageFeature() []*CopilotMetricsLanguageFeature { + if c == nil || c.TotalsByLanguageFeature == nil { + return nil + } + return c.TotalsByLanguageFeature +} + +// GetTotalsByLanguageModel returns the TotalsByLanguageModel slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByLanguageModel() []*CopilotMetricsLanguageModel { + if c == nil || c.TotalsByLanguageModel == nil { + return nil + } + return c.TotalsByLanguageModel +} + +// GetTotalsByModelFeature returns the TotalsByModelFeature slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByModelFeature() []*CopilotMetricsModelFeature { + if c == nil || c.TotalsByModelFeature == nil { + return nil + } + return c.TotalsByModelFeature +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetWeeklyActiveCopilotCloudAgentUsers returns the WeeklyActiveCopilotCloudAgentUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetWeeklyActiveCopilotCloudAgentUsers() int { + if c == nil || c.WeeklyActiveCopilotCloudAgentUsers == nil { + return 0 + } + return *c.WeeklyActiveCopilotCloudAgentUsers +} + +// GetWeeklyActiveUsers returns the WeeklyActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetWeeklyActiveUsers() int { + if c == nil || c.WeeklyActiveUsers == nil { + return 0 + } + return *c.WeeklyActiveUsers +} + +// GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetricsReport) GetDownloadLinks() []string { + if c == nil || c.DownloadLinks == nil { + return nil + } + return c.DownloadLinks +} + +// GetReportDay returns the ReportDay field. +func (c *CopilotDailyMetricsReport) GetReportDay() string { + if c == nil { + return "" + } + return c.ReportDay +} + +// GetModels returns the Models slice if it's non-nil, nil otherwise. +func (c *CopilotDotcomChat) GetModels() []*CopilotDotcomChatModel { + if c == nil || c.Models == nil { + return nil + } + return c.Models +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomChat) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. func (c *CopilotDotcomChatModel) GetCustomModelTrainingDate() string { if c == nil || c.CustomModelTrainingDate == nil { @@ -6430,6 +8462,54 @@ func (c *CopilotDotcomChatModel) GetCustomModelTrainingDate() string { return *c.CustomModelTrainingDate } +// GetIsCustomModel returns the IsCustomModel field. +func (c *CopilotDotcomChatModel) GetIsCustomModel() bool { + if c == nil { + return false + } + return c.IsCustomModel +} + +// GetName returns the Name field. +func (c *CopilotDotcomChatModel) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalChats returns the TotalChats field. +func (c *CopilotDotcomChatModel) GetTotalChats() int { + if c == nil { + return 0 + } + return c.TotalChats +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomChatModel) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (c *CopilotDotcomPullRequests) GetRepositories() []*CopilotDotcomPullRequestsRepository { + if c == nil || c.Repositories == nil { + return nil + } + return c.Repositories +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomPullRequests) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. func (c *CopilotDotcomPullRequestsModel) GetCustomModelTrainingDate() string { if c == nil || c.CustomModelTrainingDate == nil { @@ -6438,6 +8518,102 @@ func (c *CopilotDotcomPullRequestsModel) GetCustomModelTrainingDate() string { return *c.CustomModelTrainingDate } +// GetIsCustomModel returns the IsCustomModel field. +func (c *CopilotDotcomPullRequestsModel) GetIsCustomModel() bool { + if c == nil { + return false + } + return c.IsCustomModel +} + +// GetName returns the Name field. +func (c *CopilotDotcomPullRequestsModel) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomPullRequestsModel) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetTotalPRSummariesCreated returns the TotalPRSummariesCreated field. +func (c *CopilotDotcomPullRequestsModel) GetTotalPRSummariesCreated() int { + if c == nil { + return 0 + } + return c.TotalPRSummariesCreated +} + +// GetModels returns the Models slice if it's non-nil, nil otherwise. +func (c *CopilotDotcomPullRequestsRepository) GetModels() []*CopilotDotcomPullRequestsModel { + if c == nil || c.Models == nil { + return nil + } + return c.Models +} + +// GetName returns the Name field. +func (c *CopilotDotcomPullRequestsRepository) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotDotcomPullRequestsRepository) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetEditors returns the Editors slice if it's non-nil, nil otherwise. +func (c *CopilotIDEChat) GetEditors() []*CopilotIDEChatEditor { + if c == nil || c.Editors == nil { + return nil + } + return c.Editors +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDEChat) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetModels returns the Models slice if it's non-nil, nil otherwise. +func (c *CopilotIDEChatEditor) GetModels() []*CopilotIDEChatModel { + if c == nil || c.Models == nil { + return nil + } + return c.Models +} + +// GetName returns the Name field. +func (c *CopilotIDEChatEditor) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDEChatEditor) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. func (c *CopilotIDEChatModel) GetCustomModelTrainingDate() string { if c == nil || c.CustomModelTrainingDate == nil { @@ -6446,6 +8622,118 @@ func (c *CopilotIDEChatModel) GetCustomModelTrainingDate() string { return *c.CustomModelTrainingDate } +// GetIsCustomModel returns the IsCustomModel field. +func (c *CopilotIDEChatModel) GetIsCustomModel() bool { + if c == nil { + return false + } + return c.IsCustomModel +} + +// GetName returns the Name field. +func (c *CopilotIDEChatModel) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalChatCopyEvents returns the TotalChatCopyEvents field. +func (c *CopilotIDEChatModel) GetTotalChatCopyEvents() int { + if c == nil { + return 0 + } + return c.TotalChatCopyEvents +} + +// GetTotalChatInsertionEvents returns the TotalChatInsertionEvents field. +func (c *CopilotIDEChatModel) GetTotalChatInsertionEvents() int { + if c == nil { + return 0 + } + return c.TotalChatInsertionEvents +} + +// GetTotalChats returns the TotalChats field. +func (c *CopilotIDEChatModel) GetTotalChats() int { + if c == nil { + return 0 + } + return c.TotalChats +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDEChatModel) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetEditors returns the Editors slice if it's non-nil, nil otherwise. +func (c *CopilotIDECodeCompletions) GetEditors() []*CopilotIDECodeCompletionsEditor { + if c == nil || c.Editors == nil { + return nil + } + return c.Editors +} + +// GetLanguages returns the Languages slice if it's non-nil, nil otherwise. +func (c *CopilotIDECodeCompletions) GetLanguages() []*CopilotIDECodeCompletionsLanguage { + if c == nil || c.Languages == nil { + return nil + } + return c.Languages +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletions) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetModels returns the Models slice if it's non-nil, nil otherwise. +func (c *CopilotIDECodeCompletionsEditor) GetModels() []*CopilotIDECodeCompletionsModel { + if c == nil || c.Models == nil { + return nil + } + return c.Models +} + +// GetName returns the Name field. +func (c *CopilotIDECodeCompletionsEditor) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletionsEditor) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetName returns the Name field. +func (c *CopilotIDECodeCompletionsLanguage) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletionsLanguage) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. func (c *CopilotIDECodeCompletionsModel) GetCustomModelTrainingDate() string { if c == nil || c.CustomModelTrainingDate == nil { @@ -6454,6 +8742,86 @@ func (c *CopilotIDECodeCompletionsModel) GetCustomModelTrainingDate() string { return *c.CustomModelTrainingDate } +// GetIsCustomModel returns the IsCustomModel field. +func (c *CopilotIDECodeCompletionsModel) GetIsCustomModel() bool { + if c == nil { + return false + } + return c.IsCustomModel +} + +// GetLanguages returns the Languages slice if it's non-nil, nil otherwise. +func (c *CopilotIDECodeCompletionsModel) GetLanguages() []*CopilotIDECodeCompletionsModelLanguage { + if c == nil || c.Languages == nil { + return nil + } + return c.Languages +} + +// GetName returns the Name field. +func (c *CopilotIDECodeCompletionsModel) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletionsModel) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + +// GetName returns the Name field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetTotalCodeAcceptances returns the TotalCodeAcceptances field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeAcceptances() int { + if c == nil { + return 0 + } + return c.TotalCodeAcceptances +} + +// GetTotalCodeLinesAccepted returns the TotalCodeLinesAccepted field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeLinesAccepted() int { + if c == nil { + return 0 + } + return c.TotalCodeLinesAccepted +} + +// GetTotalCodeLinesSuggested returns the TotalCodeLinesSuggested field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeLinesSuggested() int { + if c == nil { + return 0 + } + return c.TotalCodeLinesSuggested +} + +// GetTotalCodeSuggestions returns the TotalCodeSuggestions field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeSuggestions() int { + if c == nil { + return 0 + } + return c.TotalCodeSuggestions +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field. +func (c *CopilotIDECodeCompletionsModelLanguage) GetTotalEngagedUsers() int { + if c == nil { + return 0 + } + return c.TotalEngagedUsers +} + // GetCopilotDotcomChat returns the CopilotDotcomChat field. func (c *CopilotMetrics) GetCopilotDotcomChat() *CopilotDotcomChat { if c == nil { @@ -6486,6 +8854,14 @@ func (c *CopilotMetrics) GetCopilotIDECodeCompletions() *CopilotIDECodeCompletio return c.CopilotIDECodeCompletions } +// GetDate returns the Date field. +func (c *CopilotMetrics) GetDate() string { + if c == nil { + return "" + } + return c.Date +} + // GetTotalActiveUsers returns the TotalActiveUsers field if it's non-nil, zero value otherwise. func (c *CopilotMetrics) GetTotalActiveUsers() int { if c == nil || c.TotalActiveUsers == nil { @@ -6502,6 +8878,238 @@ func (c *CopilotMetrics) GetTotalEngagedUsers() int { return *c.TotalEngagedUsers } +// GetChatPanelAgentMode returns the ChatPanelAgentMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelAgentMode() int { + if c == nil || c.ChatPanelAgentMode == nil { + return 0 + } + return *c.ChatPanelAgentMode +} + +// GetChatPanelAskMode returns the ChatPanelAskMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelAskMode() int { + if c == nil || c.ChatPanelAskMode == nil { + return 0 + } + return *c.ChatPanelAskMode +} + +// GetChatPanelCustomMode returns the ChatPanelCustomMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelCustomMode() int { + if c == nil || c.ChatPanelCustomMode == nil { + return 0 + } + return *c.ChatPanelCustomMode +} + +// GetChatPanelEditMode returns the ChatPanelEditMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelEditMode() int { + if c == nil || c.ChatPanelEditMode == nil { + return 0 + } + return *c.ChatPanelEditMode +} + +// GetChatPanelUnknownMode returns the ChatPanelUnknownMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelUnknownMode() int { + if c == nil || c.ChatPanelUnknownMode == nil { + return 0 + } + return *c.ChatPanelUnknownMode +} + +// GetLastKnownCLIVersion returns the LastKnownCLIVersion field. +func (c *CopilotMetricsCLI) GetLastKnownCLIVersion() *CopilotMetricsCLIVersion { + if c == nil { + return nil + } + return c.LastKnownCLIVersion +} + +// GetPromptCount returns the PromptCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLI) GetPromptCount() int { + if c == nil || c.PromptCount == nil { + return 0 + } + return *c.PromptCount +} + +// GetRequestCount returns the RequestCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLI) GetRequestCount() int { + if c == nil || c.RequestCount == nil { + return 0 + } + return *c.RequestCount +} + +// GetSessionCount returns the SessionCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLI) GetSessionCount() int { + if c == nil || c.SessionCount == nil { + return 0 + } + return *c.SessionCount +} + +// GetTokenUsage returns the TokenUsage field. +func (c *CopilotMetricsCLI) GetTokenUsage() *CopilotMetricsCLITokenUsage { + if c == nil { + return nil + } + return c.TokenUsage +} + +// GetAvgTokensPerRequest returns the AvgTokensPerRequest field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLITokenUsage) GetAvgTokensPerRequest() float64 { + if c == nil || c.AvgTokensPerRequest == nil { + return 0 + } + return *c.AvgTokensPerRequest +} + +// GetOutputTokensSum returns the OutputTokensSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLITokenUsage) GetOutputTokensSum() int { + if c == nil || c.OutputTokensSum == nil { + return 0 + } + return *c.OutputTokensSum +} + +// GetPromptTokensSum returns the PromptTokensSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLITokenUsage) GetPromptTokensSum() int { + if c == nil || c.PromptTokensSum == nil { + return 0 + } + return *c.PromptTokensSum +} + +// GetCLIVersion returns the CLIVersion field. +func (c *CopilotMetricsCLIVersion) GetCLIVersion() string { + if c == nil { + return "" + } + return c.CLIVersion +} + +// GetSampledAt returns the SampledAt field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLIVersion) GetSampledAt() Timestamp { + if c == nil || c.SampledAt == nil { + return Timestamp{} + } + return *c.SampledAt +} + +// GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetCodeAcceptanceActivityCount() int { + if c == nil || c.CodeAcceptanceActivityCount == nil { + return 0 + } + return *c.CodeAcceptanceActivityCount +} + +// GetCodeGenerationActivityCount returns the CodeGenerationActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetCodeGenerationActivityCount() int { + if c == nil || c.CodeGenerationActivityCount == nil { + return 0 + } + return *c.CodeGenerationActivityCount +} + +// GetLOCAddedSum returns the LOCAddedSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetLOCAddedSum() int { + if c == nil || c.LOCAddedSum == nil { + return 0 + } + return *c.LOCAddedSum +} + +// GetLOCDeletedSum returns the LOCDeletedSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetLOCDeletedSum() int { + if c == nil || c.LOCDeletedSum == nil { + return 0 + } + return *c.LOCDeletedSum +} + +// GetLOCSuggestedToAddSum returns the LOCSuggestedToAddSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetLOCSuggestedToAddSum() int { + if c == nil || c.LOCSuggestedToAddSum == nil { + return 0 + } + return *c.LOCSuggestedToAddSum +} + +// GetLOCSuggestedToDeleteSum returns the LOCSuggestedToDeleteSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetLOCSuggestedToDeleteSum() int { + if c == nil || c.LOCSuggestedToDeleteSum == nil { + return 0 + } + return *c.LOCSuggestedToDeleteSum +} + +// GetFeature returns the Feature field. +func (c *CopilotMetricsFeature) GetFeature() string { + if c == nil { + return "" + } + return c.Feature +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsFeature) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetIDE returns the IDE field. +func (c *CopilotMetricsIDE) GetIDE() string { + if c == nil { + return "" + } + return c.IDE +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsIDE) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetFeature returns the Feature field. +func (c *CopilotMetricsLanguageFeature) GetFeature() string { + if c == nil { + return "" + } + return c.Feature +} + +// GetLanguage returns the Language field. +func (c *CopilotMetricsLanguageFeature) GetLanguage() string { + if c == nil { + return "" + } + return c.Language +} + +// GetLanguage returns the Language field. +func (c *CopilotMetricsLanguageModel) GetLanguage() string { + if c == nil { + return "" + } + return c.Language +} + +// GetModel returns the Model field. +func (c *CopilotMetricsLanguageModel) GetModel() string { + if c == nil { + return "" + } + return c.Model +} + // GetSince returns the Since field if it's non-nil, zero value otherwise. func (c *CopilotMetricsListOptions) GetSince() time.Time { if c == nil || c.Since == nil { @@ -6518,6 +9126,190 @@ func (c *CopilotMetricsListOptions) GetUntil() time.Time { return *c.Until } +// GetFeature returns the Feature field. +func (c *CopilotMetricsModelFeature) GetFeature() string { + if c == nil { + return "" + } + return c.Feature +} + +// GetModel returns the Model field. +func (c *CopilotMetricsModelFeature) GetModel() string { + if c == nil { + return "" + } + return c.Model +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsModelFeature) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetMedianMinutesToMerge returns the MedianMinutesToMerge field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetMedianMinutesToMerge() float64 { + if c == nil || c.MedianMinutesToMerge == nil { + return 0 + } + return *c.MedianMinutesToMerge +} + +// GetMedianMinutesToMergeCopilotAuthored returns the MedianMinutesToMergeCopilotAuthored field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetMedianMinutesToMergeCopilotAuthored() float64 { + if c == nil || c.MedianMinutesToMergeCopilotAuthored == nil { + return 0 + } + return *c.MedianMinutesToMergeCopilotAuthored +} + +// GetMedianMinutesToMergeCopilotReviewed returns the MedianMinutesToMergeCopilotReviewed field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetMedianMinutesToMergeCopilotReviewed() float64 { + if c == nil || c.MedianMinutesToMergeCopilotReviewed == nil { + return 0 + } + return *c.MedianMinutesToMergeCopilotReviewed +} + +// GetTotalAppliedSuggestions returns the TotalAppliedSuggestions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalAppliedSuggestions() int { + if c == nil || c.TotalAppliedSuggestions == nil { + return 0 + } + return *c.TotalAppliedSuggestions +} + +// GetTotalCopilotAppliedSuggestions returns the TotalCopilotAppliedSuggestions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalCopilotAppliedSuggestions() int { + if c == nil || c.TotalCopilotAppliedSuggestions == nil { + return 0 + } + return *c.TotalCopilotAppliedSuggestions +} + +// GetTotalCopilotSuggestions returns the TotalCopilotSuggestions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalCopilotSuggestions() int { + if c == nil || c.TotalCopilotSuggestions == nil { + return 0 + } + return *c.TotalCopilotSuggestions +} + +// GetTotalCreated returns the TotalCreated field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalCreated() int { + if c == nil || c.TotalCreated == nil { + return 0 + } + return *c.TotalCreated +} + +// GetTotalCreatedByCopilot returns the TotalCreatedByCopilot field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalCreatedByCopilot() int { + if c == nil || c.TotalCreatedByCopilot == nil { + return 0 + } + return *c.TotalCreatedByCopilot +} + +// GetTotalMerged returns the TotalMerged field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalMerged() int { + if c == nil || c.TotalMerged == nil { + return 0 + } + return *c.TotalMerged +} + +// GetTotalMergedCreatedByCopilot returns the TotalMergedCreatedByCopilot field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalMergedCreatedByCopilot() int { + if c == nil || c.TotalMergedCreatedByCopilot == nil { + return 0 + } + return *c.TotalMergedCreatedByCopilot +} + +// GetTotalMergedReviewedByCopilot returns the TotalMergedReviewedByCopilot field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalMergedReviewedByCopilot() int { + if c == nil || c.TotalMergedReviewedByCopilot == nil { + return 0 + } + return *c.TotalMergedReviewedByCopilot +} + +// GetTotalReviewed returns the TotalReviewed field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalReviewed() int { + if c == nil || c.TotalReviewed == nil { + return 0 + } + return *c.TotalReviewed +} + +// GetTotalReviewedByCopilot returns the TotalReviewedByCopilot field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalReviewedByCopilot() int { + if c == nil || c.TotalReviewedByCopilot == nil { + return 0 + } + return *c.TotalReviewedByCopilot +} + +// GetTotalSuggestions returns the TotalSuggestions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalSuggestions() int { + if c == nil || c.TotalSuggestions == nil { + return 0 + } + return *c.TotalSuggestions +} + +// GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise. +func (c *CopilotMetricsReport) GetDownloadLinks() []string { + if c == nil || c.DownloadLinks == nil { + return nil + } + return c.DownloadLinks +} + +// GetReportEndDay returns the ReportEndDay field. +func (c *CopilotMetricsReport) GetReportEndDay() string { + if c == nil { + return "" + } + return c.ReportEndDay +} + +// GetReportStartDay returns the ReportStartDay field. +func (c *CopilotMetricsReport) GetReportStartDay() string { + if c == nil { + return "" + } + return c.ReportStartDay +} + +// GetDay returns the Day field. +func (c *CopilotMetricsReportOptions) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetCopilotChat returns the CopilotChat field. +func (c *CopilotOrganizationDetails) GetCopilotChat() string { + if c == nil { + return "" + } + return c.CopilotChat +} + +// GetPublicCodeSuggestions returns the PublicCodeSuggestions field. +func (c *CopilotOrganizationDetails) GetPublicCodeSuggestions() string { + if c == nil { + return "" + } + return c.PublicCodeSuggestions +} + // GetSeatBreakdown returns the SeatBreakdown field. func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { if c == nil { @@ -6526,6 +9318,118 @@ func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { return c.SeatBreakdown } +// GetSeatManagementSetting returns the SeatManagementSetting field. +func (c *CopilotOrganizationDetails) GetSeatManagementSetting() string { + if c == nil { + return "" + } + return c.SeatManagementSetting +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotPeriodicMetrics) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDayTotals returns the DayTotals slice if it's non-nil, nil otherwise. +func (c *CopilotPeriodicMetrics) GetDayTotals() []*CopilotDailyMetrics { + if c == nil || c.DayTotals == nil { + return nil + } + return c.DayTotals +} + +// GetEnterpriseID returns the EnterpriseID field if it's non-nil, zero value otherwise. +func (c *CopilotPeriodicMetrics) GetEnterpriseID() string { + if c == nil || c.EnterpriseID == nil { + return "" + } + return *c.EnterpriseID +} + +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (c *CopilotPeriodicMetrics) GetOrganizationID() string { + if c == nil || c.OrganizationID == nil { + return "" + } + return *c.OrganizationID +} + +// GetReportEndDay returns the ReportEndDay field. +func (c *CopilotPeriodicMetrics) GetReportEndDay() string { + if c == nil { + return "" + } + return c.ReportEndDay +} + +// GetReportStartDay returns the ReportStartDay field. +func (c *CopilotPeriodicMetrics) GetReportStartDay() string { + if c == nil { + return "" + } + return c.ReportStartDay +} + +// GetActiveThisCycle returns the ActiveThisCycle field. +func (c *CopilotSeatBreakdown) GetActiveThisCycle() int { + if c == nil { + return 0 + } + return c.ActiveThisCycle +} + +// GetAddedThisCycle returns the AddedThisCycle field. +func (c *CopilotSeatBreakdown) GetAddedThisCycle() int { + if c == nil { + return 0 + } + return c.AddedThisCycle +} + +// GetInactiveThisCycle returns the InactiveThisCycle field. +func (c *CopilotSeatBreakdown) GetInactiveThisCycle() int { + if c == nil { + return 0 + } + return c.InactiveThisCycle +} + +// GetPendingCancellation returns the PendingCancellation field. +func (c *CopilotSeatBreakdown) GetPendingCancellation() int { + if c == nil { + return 0 + } + return c.PendingCancellation +} + +// GetPendingInvitation returns the PendingInvitation field. +func (c *CopilotSeatBreakdown) GetPendingInvitation() int { + if c == nil { + return 0 + } + return c.PendingInvitation +} + +// GetTotal returns the Total field. +func (c *CopilotSeatBreakdown) GetTotal() int { + if c == nil { + return 0 + } + return c.Total +} + +// GetAssignee returns the Assignee field. +func (c *CopilotSeatDetails) GetAssignee() any { + if c == nil { + return nil + } + return c.Assignee +} + // GetAssigningTeam returns the AssigningTeam field. func (c *CopilotSeatDetails) GetAssigningTeam() *Team { if c == nil { @@ -6582,6 +9486,478 @@ func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { return *c.UpdatedAt } +// GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetCodeAcceptanceActivityCount() int { + if c == nil || c.CodeAcceptanceActivityCount == nil { + return 0 + } + return *c.CodeAcceptanceActivityCount +} + +// GetCodeGenerationActivityCount returns the CodeGenerationActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetCodeGenerationActivityCount() int { + if c == nil || c.CodeGenerationActivityCount == nil { + return 0 + } + return *c.CodeGenerationActivityCount +} + +// GetDay returns the Day field. +func (c *CopilotUserDailyMetrics) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetEnterpriseID returns the EnterpriseID field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetEnterpriseID() string { + if c == nil || c.EnterpriseID == nil { + return "" + } + return *c.EnterpriseID +} + +// GetLOCAddedSum returns the LOCAddedSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetLOCAddedSum() int { + if c == nil || c.LOCAddedSum == nil { + return 0 + } + return *c.LOCAddedSum +} + +// GetLOCDeletedSum returns the LOCDeletedSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetLOCDeletedSum() int { + if c == nil || c.LOCDeletedSum == nil { + return 0 + } + return *c.LOCDeletedSum +} + +// GetLOCSuggestedToAddSum returns the LOCSuggestedToAddSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetLOCSuggestedToAddSum() int { + if c == nil || c.LOCSuggestedToAddSum == nil { + return 0 + } + return *c.LOCSuggestedToAddSum +} + +// GetLOCSuggestedToDeleteSum returns the LOCSuggestedToDeleteSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetLOCSuggestedToDeleteSum() int { + if c == nil || c.LOCSuggestedToDeleteSum == nil { + return 0 + } + return *c.LOCSuggestedToDeleteSum +} + +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetOrganizationID() string { + if c == nil || c.OrganizationID == nil { + return "" + } + return *c.OrganizationID +} + +// GetTotalsByCLI returns the TotalsByCLI field. +func (c *CopilotUserDailyMetrics) GetTotalsByCLI() *CopilotMetricsCLI { + if c == nil { + return nil + } + return c.TotalsByCLI +} + +// GetTotalsByFeature returns the TotalsByFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByFeature() []*CopilotMetricsFeature { + if c == nil || c.TotalsByFeature == nil { + return nil + } + return c.TotalsByFeature +} + +// GetTotalsByIDE returns the TotalsByIDE slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByIDE() []*CopilotUserMetricsIDE { + if c == nil || c.TotalsByIDE == nil { + return nil + } + return c.TotalsByIDE +} + +// GetTotalsByLanguageFeature returns the TotalsByLanguageFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByLanguageFeature() []*CopilotMetricsLanguageFeature { + if c == nil || c.TotalsByLanguageFeature == nil { + return nil + } + return c.TotalsByLanguageFeature +} + +// GetTotalsByLanguageModel returns the TotalsByLanguageModel slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByLanguageModel() []*CopilotMetricsLanguageModel { + if c == nil || c.TotalsByLanguageModel == nil { + return nil + } + return c.TotalsByLanguageModel +} + +// GetTotalsByModelFeature returns the TotalsByModelFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByModelFeature() []*CopilotMetricsModelFeature { + if c == nil || c.TotalsByModelFeature == nil { + return nil + } + return c.TotalsByModelFeature +} + +// GetUsedAgent returns the UsedAgent field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedAgent() bool { + if c == nil || c.UsedAgent == nil { + return false + } + return *c.UsedAgent +} + +// GetUsedChat returns the UsedChat field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedChat() bool { + if c == nil || c.UsedChat == nil { + return false + } + return *c.UsedChat +} + +// GetUsedCLI returns the UsedCLI field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedCLI() bool { + if c == nil || c.UsedCLI == nil { + return false + } + return *c.UsedCLI +} + +// GetUsedCopilotCodeReviewActive returns the UsedCopilotCodeReviewActive field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedCopilotCodeReviewActive() bool { + if c == nil || c.UsedCopilotCodeReviewActive == nil { + return false + } + return *c.UsedCopilotCodeReviewActive +} + +// GetUsedCopilotCodeReviewPassive returns the UsedCopilotCodeReviewPassive field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedCopilotCodeReviewPassive() bool { + if c == nil || c.UsedCopilotCodeReviewPassive == nil { + return false + } + return *c.UsedCopilotCodeReviewPassive +} + +// GetUsedCopilotCodingAgent returns the UsedCopilotCodingAgent field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedCopilotCodingAgent() bool { + if c == nil || c.UsedCopilotCodingAgent == nil { + return false + } + return *c.UsedCopilotCodingAgent +} + +// GetUserID returns the UserID field. +func (c *CopilotUserDailyMetrics) GetUserID() int { + if c == nil { + return 0 + } + return c.UserID +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetUserLogin returns the UserLogin field. +func (c *CopilotUserDailyMetrics) GetUserLogin() string { + if c == nil { + return "" + } + return c.UserLogin +} + +// GetIDE returns the IDE field. +func (c *CopilotUserMetricsIDE) GetIDE() string { + if c == nil { + return "" + } + return c.IDE +} + +// GetLastKnownIDEVersion returns the LastKnownIDEVersion field. +func (c *CopilotUserMetricsIDE) GetLastKnownIDEVersion() *CopilotUserMetricsIDEVersion { + if c == nil { + return nil + } + return c.LastKnownIDEVersion +} + +// GetLastKnownPluginVersion returns the LastKnownPluginVersion field. +func (c *CopilotUserMetricsIDE) GetLastKnownPluginVersion() *CopilotUserMetricsPluginVersion { + if c == nil { + return nil + } + return c.LastKnownPluginVersion +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserMetricsIDE) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetIDEVersion returns the IDEVersion field. +func (c *CopilotUserMetricsIDEVersion) GetIDEVersion() string { + if c == nil { + return "" + } + return c.IDEVersion +} + +// GetSampledAt returns the SampledAt field if it's non-nil, zero value otherwise. +func (c *CopilotUserMetricsIDEVersion) GetSampledAt() Timestamp { + if c == nil || c.SampledAt == nil { + return Timestamp{} + } + return *c.SampledAt +} + +// GetPlugin returns the Plugin field. +func (c *CopilotUserMetricsPluginVersion) GetPlugin() string { + if c == nil { + return "" + } + return c.Plugin +} + +// GetPluginVersion returns the PluginVersion field. +func (c *CopilotUserMetricsPluginVersion) GetPluginVersion() string { + if c == nil { + return "" + } + return c.PluginVersion +} + +// GetSampledAt returns the SampledAt field if it's non-nil, zero value otherwise. +func (c *CopilotUserMetricsPluginVersion) GetSampledAt() Timestamp { + if c == nil || c.SampledAt == nil { + return Timestamp{} + } + return *c.SampledAt +} + +// GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetCodeAcceptanceActivityCount() int { + if c == nil || c.CodeAcceptanceActivityCount == nil { + return 0 + } + return *c.CodeAcceptanceActivityCount +} + +// GetCodeGenerationActivityCount returns the CodeGenerationActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetCodeGenerationActivityCount() int { + if c == nil || c.CodeGenerationActivityCount == nil { + return 0 + } + return *c.CodeGenerationActivityCount +} + +// GetDay returns the Day field. +func (c *CopilotUserPeriodicMetrics) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetEnterpriseID returns the EnterpriseID field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetEnterpriseID() string { + if c == nil || c.EnterpriseID == nil { + return "" + } + return *c.EnterpriseID +} + +// GetLOCAddedSum returns the LOCAddedSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetLOCAddedSum() int { + if c == nil || c.LOCAddedSum == nil { + return 0 + } + return *c.LOCAddedSum +} + +// GetLOCDeletedSum returns the LOCDeletedSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetLOCDeletedSum() int { + if c == nil || c.LOCDeletedSum == nil { + return 0 + } + return *c.LOCDeletedSum +} + +// GetLOCSuggestedToAddSum returns the LOCSuggestedToAddSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetLOCSuggestedToAddSum() int { + if c == nil || c.LOCSuggestedToAddSum == nil { + return 0 + } + return *c.LOCSuggestedToAddSum +} + +// GetLOCSuggestedToDeleteSum returns the LOCSuggestedToDeleteSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetLOCSuggestedToDeleteSum() int { + if c == nil || c.LOCSuggestedToDeleteSum == nil { + return 0 + } + return *c.LOCSuggestedToDeleteSum +} + +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetOrganizationID() string { + if c == nil || c.OrganizationID == nil { + return "" + } + return *c.OrganizationID +} + +// GetReportEndDay returns the ReportEndDay field. +func (c *CopilotUserPeriodicMetrics) GetReportEndDay() string { + if c == nil { + return "" + } + return c.ReportEndDay +} + +// GetReportStartDay returns the ReportStartDay field. +func (c *CopilotUserPeriodicMetrics) GetReportStartDay() string { + if c == nil { + return "" + } + return c.ReportStartDay +} + +// GetTotalsByCLI returns the TotalsByCLI field. +func (c *CopilotUserPeriodicMetrics) GetTotalsByCLI() *CopilotMetricsCLI { + if c == nil { + return nil + } + return c.TotalsByCLI +} + +// GetTotalsByFeature returns the TotalsByFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByFeature() []*CopilotMetricsFeature { + if c == nil || c.TotalsByFeature == nil { + return nil + } + return c.TotalsByFeature +} + +// GetTotalsByIDE returns the TotalsByIDE slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByIDE() []*CopilotUserMetricsIDE { + if c == nil || c.TotalsByIDE == nil { + return nil + } + return c.TotalsByIDE +} + +// GetTotalsByLanguageFeature returns the TotalsByLanguageFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByLanguageFeature() []*CopilotMetricsLanguageFeature { + if c == nil || c.TotalsByLanguageFeature == nil { + return nil + } + return c.TotalsByLanguageFeature +} + +// GetTotalsByLanguageModel returns the TotalsByLanguageModel slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByLanguageModel() []*CopilotMetricsLanguageModel { + if c == nil || c.TotalsByLanguageModel == nil { + return nil + } + return c.TotalsByLanguageModel +} + +// GetTotalsByModelFeature returns the TotalsByModelFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByModelFeature() []*CopilotMetricsModelFeature { + if c == nil || c.TotalsByModelFeature == nil { + return nil + } + return c.TotalsByModelFeature +} + +// GetUsedAgent returns the UsedAgent field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedAgent() bool { + if c == nil || c.UsedAgent == nil { + return false + } + return *c.UsedAgent +} + +// GetUsedChat returns the UsedChat field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedChat() bool { + if c == nil || c.UsedChat == nil { + return false + } + return *c.UsedChat +} + +// GetUsedCLI returns the UsedCLI field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedCLI() bool { + if c == nil || c.UsedCLI == nil { + return false + } + return *c.UsedCLI +} + +// GetUsedCopilotCodeReviewActive returns the UsedCopilotCodeReviewActive field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedCopilotCodeReviewActive() bool { + if c == nil || c.UsedCopilotCodeReviewActive == nil { + return false + } + return *c.UsedCopilotCodeReviewActive +} + +// GetUsedCopilotCodeReviewPassive returns the UsedCopilotCodeReviewPassive field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedCopilotCodeReviewPassive() bool { + if c == nil || c.UsedCopilotCodeReviewPassive == nil { + return false + } + return *c.UsedCopilotCodeReviewPassive +} + +// GetUsedCopilotCodingAgent returns the UsedCopilotCodingAgent field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedCopilotCodingAgent() bool { + if c == nil || c.UsedCopilotCodingAgent == nil { + return false + } + return *c.UsedCopilotCodingAgent +} + +// GetUserID returns the UserID field. +func (c *CopilotUserPeriodicMetrics) GetUserID() int { + if c == nil { + return 0 + } + return c.UserID +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetUserLogin returns the UserLogin field. +func (c *CopilotUserPeriodicMetrics) GetUserLogin() string { + if c == nil { + return "" + } + return c.UserLogin +} + // GetAzureSubscription returns the AzureSubscription field if it's non-nil, zero value otherwise. func (c *CostCenter) GetAzureSubscription() string { if c == nil || c.AzureSubscription == nil { @@ -6590,6 +9966,30 @@ func (c *CostCenter) GetAzureSubscription() string { return *c.AzureSubscription } +// GetID returns the ID field. +func (c *CostCenter) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +// GetName returns the Name field. +func (c *CostCenter) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetResources returns the Resources slice if it's non-nil, nil otherwise. +func (c *CostCenter) GetResources() []*CostCenterResource { + if c == nil || c.Resources == nil { + return nil + } + return c.Resources +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (c *CostCenter) GetState() string { if c == nil || c.State == nil { @@ -6598,6 +9998,62 @@ func (c *CostCenter) GetState() string { return *c.State } +// GetName returns the Name field. +func (c *CostCenterRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetName returns the Name field. +func (c *CostCenterResource) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetType returns the Type field. +func (c *CostCenterResource) GetType() string { + if c == nil { + return "" + } + return c.Type +} + +// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise. +func (c *CostCenterResourceRequest) GetOrganizations() []string { + if c == nil || c.Organizations == nil { + return nil + } + return c.Organizations +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (c *CostCenterResourceRequest) GetRepositories() []string { + if c == nil || c.Repositories == nil { + return nil + } + return c.Repositories +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (c *CostCenterResourceRequest) GetUsers() []string { + if c == nil || c.Users == nil { + return nil + } + return c.Users +} + +// GetCostCenters returns the CostCenters slice if it's non-nil, nil otherwise. +func (c *CostCenters) GetCostCenters() []*CostCenter { + if c == nil || c.CostCenters == nil { + return nil + } + return c.CostCenters +} + // GetCluster returns the Cluster field if it's non-nil, zero value otherwise. func (c *CreateArtifactDeploymentRequest) GetCluster() string { if c == nil || c.Cluster == nil { @@ -6606,6 +10062,22 @@ func (c *CreateArtifactDeploymentRequest) GetCluster() string { return *c.Cluster } +// GetDeploymentName returns the DeploymentName field. +func (c *CreateArtifactDeploymentRequest) GetDeploymentName() string { + if c == nil { + return "" + } + return c.DeploymentName +} + +// GetDigest returns the Digest field. +func (c *CreateArtifactDeploymentRequest) GetDigest() string { + if c == nil { + return "" + } + return c.Digest +} + // GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise. func (c *CreateArtifactDeploymentRequest) GetGithubRepository() string { if c == nil || c.GithubRepository == nil { @@ -6614,6 +10086,22 @@ func (c *CreateArtifactDeploymentRequest) GetGithubRepository() string { return *c.GithubRepository } +// GetLogicalEnvironment returns the LogicalEnvironment field. +func (c *CreateArtifactDeploymentRequest) GetLogicalEnvironment() string { + if c == nil { + return "" + } + return c.LogicalEnvironment +} + +// GetName returns the Name field. +func (c *CreateArtifactDeploymentRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + // GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise. func (c *CreateArtifactDeploymentRequest) GetPhysicalEnvironment() string { if c == nil || c.PhysicalEnvironment == nil { @@ -6622,6 +10110,22 @@ func (c *CreateArtifactDeploymentRequest) GetPhysicalEnvironment() string { return *c.PhysicalEnvironment } +// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise. +func (c *CreateArtifactDeploymentRequest) GetRuntimeRisks() []DeploymentRuntimeRisk { + if c == nil || c.RuntimeRisks == nil { + return nil + } + return c.RuntimeRisks +} + +// GetStatus returns the Status field. +func (c *CreateArtifactDeploymentRequest) GetStatus() string { + if c == nil { + return "" + } + return c.Status +} + // GetTags returns the Tags map if it's non-nil, an empty map otherwise. func (c *CreateArtifactDeploymentRequest) GetTags() map[string]string { if c == nil || c.Tags == nil { @@ -6646,6 +10150,14 @@ func (c *CreateArtifactStorageRequest) GetArtifactURL() string { return *c.ArtifactURL } +// GetDigest returns the Digest field. +func (c *CreateArtifactStorageRequest) GetDigest() string { + if c == nil { + return "" + } + return c.Digest +} + // GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise. func (c *CreateArtifactStorageRequest) GetGithubRepository() string { if c == nil || c.GithubRepository == nil { @@ -6654,6 +10166,14 @@ func (c *CreateArtifactStorageRequest) GetGithubRepository() string { return *c.GithubRepository } +// GetName returns the Name field. +func (c *CreateArtifactStorageRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + // GetPath returns the Path field if it's non-nil, zero value otherwise. func (c *CreateArtifactStorageRequest) GetPath() string { if c == nil || c.Path == nil { @@ -6662,6 +10182,14 @@ func (c *CreateArtifactStorageRequest) GetPath() string { return *c.Path } +// GetRegistryURL returns the RegistryURL field. +func (c *CreateArtifactStorageRequest) GetRegistryURL() string { + if c == nil { + return "" + } + return c.RegistryURL +} + // GetRepository returns the Repository field if it's non-nil, zero value otherwise. func (c *CreateArtifactStorageRequest) GetRepository() string { if c == nil || c.Repository == nil { @@ -6686,6 +10214,14 @@ func (c *CreateArtifactStorageRequest) GetVersion() string { return *c.Version } +// GetActions returns the Actions slice if it's non-nil, nil otherwise. +func (c *CreateCheckRunOptions) GetActions() []*CheckRunAction { + if c == nil || c.Actions == nil { + return nil + } + return c.Actions +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { if c == nil || c.CompletedAt == nil { @@ -6718,6 +10254,22 @@ func (c *CreateCheckRunOptions) GetExternalID() string { return *c.ExternalID } +// GetHeadSHA returns the HeadSHA field. +func (c *CreateCheckRunOptions) GetHeadSHA() string { + if c == nil { + return "" + } + return c.HeadSHA +} + +// GetName returns the Name field. +func (c *CreateCheckRunOptions) GetName() string { + if c == nil { + return "" + } + return c.Name +} + // GetOutput returns the Output field. func (c *CreateCheckRunOptions) GetOutput() *CheckRunOutput { if c == nil { @@ -6750,6 +10302,14 @@ func (c *CreateCheckSuiteOptions) GetHeadBranch() string { return *c.HeadBranch } +// GetHeadSHA returns the HeadSHA field. +func (c *CreateCheckSuiteOptions) GetHeadSHA() string { + if c == nil { + return "" + } + return c.HeadSHA +} + // GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. func (c *CreateCodespaceOptions) GetClientIP() string { if c == nil || c.ClientIP == nil { @@ -6838,6 +10398,46 @@ func (c *CreateCodespaceOptions) GetWorkingDirectory() string { return *c.WorkingDirectory } +// GetSigner returns the Signer field. +func (c *CreateCommitOptions) GetSigner() MessageSigner { + if c == nil { + return nil + } + return c.Signer +} + +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CreateCustomOrgRoleRequest) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateCustomOrgRoleRequest) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetName returns the Name field. +func (c *CreateCustomOrgRoleRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (c *CreateCustomOrgRoleRequest) GetPermissions() []string { + if c == nil || c.Permissions == nil { + return nil + } + return c.Permissions +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (c *CreateEnterpriseRunnerGroupRequest) GetAllowsPublicRepositories() bool { if c == nil || c.AllowsPublicRepositories == nil { @@ -6854,6 +10454,14 @@ func (c *CreateEnterpriseRunnerGroupRequest) GetName() string { return *c.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) 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 *CreateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { if c == nil || c.RestrictedToWorkflows == nil { @@ -6862,6 +10470,30 @@ func (c *CreateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { return *c.RestrictedToWorkflows } +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetRunners() []int64 { + if c == nil || c.Runners == nil { + return nil + } + return c.Runners +} + +// GetSelectedOrganizationIDs returns the SelectedOrganizationIDs slice if it's non-nil, nil otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetSelectedOrganizationIDs() []int64 { + if c == nil || c.SelectedOrganizationIDs == nil { + return nil + } + return c.SelectedOrganizationIDs +} + +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetSelectedWorkflows() []string { + if c == nil || c.SelectedWorkflows == nil { + return nil + } + return c.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (c *CreateEnterpriseRunnerGroupRequest) GetVisibility() string { if c == nil || c.Visibility == nil { @@ -6950,6 +10582,14 @@ func (c *CreateHostedRunnerRequest) GetEnableStaticIP() bool { return *c.EnableStaticIP } +// GetImage returns the Image field. +func (c *CreateHostedRunnerRequest) GetImage() HostedRunnerImage { + if c == nil { + return HostedRunnerImage{} + } + return c.Image +} + // GetImageGen returns the ImageGen field if it's non-nil, zero value otherwise. func (c *CreateHostedRunnerRequest) GetImageGen() bool { if c == nil || c.ImageGen == nil { @@ -6966,6 +10606,166 @@ func (c *CreateHostedRunnerRequest) GetMaximumRunners() int64 { return *c.MaximumRunners } +// GetName returns the Name field. +func (c *CreateHostedRunnerRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +// GetRunnerGroupID returns the RunnerGroupID field. +func (c *CreateHostedRunnerRequest) GetRunnerGroupID() int64 { + if c == nil { + return 0 + } + return c.RunnerGroupID +} + +// GetSize returns the Size field. +func (c *CreateHostedRunnerRequest) GetSize() string { + if c == nil { + return "" + } + return c.Size +} + +// GetAccountID returns the AccountID field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetAccountID() string { + if c == nil || c.AccountID == nil { + return "" + } + return *c.AccountID +} + +// GetAudience returns the Audience field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetAudience() string { + if c == nil || c.Audience == nil { + return "" + } + return *c.Audience +} + +// GetAuthType returns the AuthType field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetAuthType() string { + if c == nil || c.AuthType == nil { + return "" + } + return *c.AuthType +} + +// GetAWSRegion returns the AWSRegion field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetAWSRegion() string { + if c == nil || c.AWSRegion == nil { + return "" + } + return *c.AWSRegion +} + +// GetClientID returns the ClientID field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetClientID() string { + if c == nil || c.ClientID == nil { + return "" + } + return *c.ClientID +} + +// GetDomain returns the Domain field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetDomain() string { + if c == nil || c.Domain == nil { + return "" + } + return *c.Domain +} + +// GetDomainOwner returns the DomainOwner field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetDomainOwner() string { + if c == nil || c.DomainOwner == nil { + return "" + } + return *c.DomainOwner +} + +// GetEncryptedValue returns the EncryptedValue field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetEncryptedValue() string { + if c == nil || c.EncryptedValue == nil { + return "" + } + return *c.EncryptedValue +} + +// GetIdentityMappingName returns the IdentityMappingName field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetIdentityMappingName() string { + if c == nil || c.IdentityMappingName == nil { + return "" + } + return *c.IdentityMappingName +} + +// GetJFrogOIDCProviderName returns the JFrogOIDCProviderName field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetJFrogOIDCProviderName() string { + if c == nil || c.JFrogOIDCProviderName == nil { + return "" + } + return *c.JFrogOIDCProviderName +} + +// GetKeyID returns the KeyID field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetKeyID() string { + if c == nil || c.KeyID == nil { + return "" + } + return *c.KeyID +} + +// GetRegistryType returns the RegistryType field. +func (c *CreateOrganizationPrivateRegistry) GetRegistryType() PrivateRegistryType { + if c == nil { + return "" + } + return c.RegistryType +} + +// GetReplacesBase returns the ReplacesBase field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetReplacesBase() bool { + if c == nil || c.ReplacesBase == nil { + return false + } + return *c.ReplacesBase +} + +// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetRoleName() string { + if c == nil || c.RoleName == nil { + return "" + } + return *c.RoleName +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (c *CreateOrganizationPrivateRegistry) GetSelectedRepositoryIDs() []int64 { + if c == nil || c.SelectedRepositoryIDs == nil { + return nil + } + return c.SelectedRepositoryIDs +} + +// GetTenantID returns the TenantID field if it's non-nil, zero value otherwise. +func (c *CreateOrganizationPrivateRegistry) GetTenantID() string { + if c == nil || c.TenantID == nil { + return "" + } + return *c.TenantID +} + +// GetURL returns the URL field. +func (c *CreateOrganizationPrivateRegistry) GetURL() string { + if c == nil { + return "" + } + return c.URL +} + // GetUsername returns the Username field if it's non-nil, zero value otherwise. func (c *CreateOrganizationPrivateRegistry) GetUsername() string { if c == nil || c.Username == nil { @@ -6974,6 +10774,14 @@ func (c *CreateOrganizationPrivateRegistry) GetUsername() string { return *c.Username } +// GetVisibility returns the Visibility field. +func (c *CreateOrganizationPrivateRegistry) GetVisibility() PrivateRegistryVisibility { + if c == nil { + return "" + } + return c.Visibility +} + // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (c *CreateOrgInvitationOptions) GetEmail() string { if c == nil || c.Email == nil { @@ -6998,6 +10806,14 @@ func (c *CreateOrgInvitationOptions) GetRole() string { return *c.Role } +// GetTeamID returns the TeamID slice if it's non-nil, nil otherwise. +func (c *CreateOrgInvitationOptions) GetTeamID() []int64 { + if c == nil || c.TeamID == nil { + return nil + } + return c.TeamID +} + // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateCustomRepoRoleOptions) GetBaseRole() string { if c == nil || c.BaseRole == nil { @@ -7022,6 +10838,14 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { return *c.Name } +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (c *CreateOrUpdateCustomRepoRoleOptions) GetPermissions() []string { + if c == nil || c.Permissions == nil { + return nil + } + return c.Permissions +} + // GetColor returns the Color field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateIssueTypesOptions) GetColor() string { if c == nil || c.Color == nil { @@ -7038,6 +10862,14 @@ func (c *CreateOrUpdateIssueTypesOptions) GetDescription() string { return *c.Description } +// GetIsEnabled returns the IsEnabled field. +func (c *CreateOrUpdateIssueTypesOptions) GetIsEnabled() bool { + if c == nil { + return false + } + return c.IsEnabled +} + // GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool { if c == nil || c.IsPrivate == nil { @@ -7046,36 +10878,36 @@ func (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool { return *c.IsPrivate } -// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { - if c == nil || c.BaseRole == nil { +// GetName returns the Name field. +func (c *CreateOrUpdateIssueTypesOptions) GetName() string { + if c == nil { return "" } - return *c.BaseRole + return c.Name } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { - if c == nil || c.Description == nil { - return "" +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (c *CreateProtectedChanges) GetFrom() bool { + if c == nil || c.From == nil { + return false } - return *c.Description + return *c.From } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetName() string { - if c == nil || c.Name == nil { +// GetRef returns the Ref field. +func (c *CreateRef) GetRef() string { + if c == nil { return "" } - return *c.Name + return c.Ref } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (c *CreateProtectedChanges) GetFrom() bool { - if c == nil || c.From == nil { - return false +// GetSHA returns the SHA field. +func (c *CreateRef) GetSHA() string { + if c == nil { + return "" } - return *c.From + return c.SHA } // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. @@ -7110,6 +10942,30 @@ func (c *CreateRunnerGroupRequest) GetRestrictedToWorkflows() bool { return *c.RestrictedToWorkflows } +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (c *CreateRunnerGroupRequest) GetRunners() []int64 { + if c == nil || c.Runners == nil { + return nil + } + return c.Runners +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (c *CreateRunnerGroupRequest) GetSelectedRepositoryIDs() []int64 { + if c == nil || c.SelectedRepositoryIDs == nil { + return nil + } + return c.SelectedRepositoryIDs +} + +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (c *CreateRunnerGroupRequest) GetSelectedWorkflows() []string { + if c == nil || c.SelectedWorkflows == nil { + return nil + } + return c.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (c *CreateRunnerGroupRequest) GetVisibility() string { if c == nil || c.Visibility == nil { @@ -7118,6 +10974,30 @@ func (c *CreateRunnerGroupRequest) GetVisibility() string { return *c.Visibility } +// GetMessage returns the Message field. +func (c *CreateTag) GetMessage() string { + if c == nil { + return "" + } + return c.Message +} + +// GetObject returns the Object field. +func (c *CreateTag) GetObject() string { + if c == nil { + return "" + } + return c.Object +} + +// GetTag returns the Tag field. +func (c *CreateTag) GetTag() string { + if c == nil { + return "" + } + return c.Tag +} + // GetTagger returns the Tagger field. func (c *CreateTag) GetTagger() *CommitAuthor { if c == nil { @@ -7126,6 +11006,14 @@ func (c *CreateTag) GetTagger() *CommitAuthor { return c.Tagger } +// GetType returns the Type field. +func (c *CreateTag) GetType() string { + if c == nil { + return "" + } + return c.Type +} + // GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. func (c *CreateUpdateEnvironment) GetCanAdminsBypass() bool { if c == nil || c.CanAdminsBypass == nil { @@ -7150,6 +11038,14 @@ func (c *CreateUpdateEnvironment) GetPreventSelfReview() bool { return *c.PreventSelfReview } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (c *CreateUpdateEnvironment) GetReviewers() []*EnvReviewers { + if c == nil || c.Reviewers == nil { + return nil + } + return c.Reviewers +} + // GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. func (c *CreateUpdateEnvironment) GetWaitTimer() int { if c == nil || c.WaitTimer == nil { @@ -7166,6 +11062,14 @@ func (c *CreateUserRequest) GetEmail() string { return *c.Email } +// GetLogin returns the Login field. +func (c *CreateUserRequest) GetLogin() string { + if c == nil { + return "" + } + return c.Login +} + // GetSuspended returns the Suspended field if it's non-nil, zero value otherwise. func (c *CreateUserRequest) GetSuspended() bool { if c == nil || c.Suspended == nil { @@ -7182,6 +11086,14 @@ func (c *CreateWorkflowDispatchEventRequest) GetInputs() map[string]any { return c.Inputs } +// GetRef returns the Ref field. +func (c *CreateWorkflowDispatchEventRequest) GetRef() string { + if c == nil { + return "" + } + return c.Ref +} + // GetReturnRunDetails returns the ReturnRunDetails field if it's non-nil, zero value otherwise. func (c *CreateWorkflowDispatchEventRequest) GetReturnRunDetails() bool { if c == nil || c.ReturnRunDetails == nil { @@ -7198,6 +11110,14 @@ func (c *CreationInfo) GetCreated() Timestamp { return *c.Created } +// GetCreators returns the Creators slice if it's non-nil, nil otherwise. +func (c *CreationInfo) GetCreators() []string { + if c == nil || c.Creators == nil { + return nil + } + return c.Creators +} + // GetAuthorizedCredentialExpiresAt returns the AuthorizedCredentialExpiresAt field if it's non-nil, zero value otherwise. func (c *CredentialAuthorization) GetAuthorizedCredentialExpiresAt() Timestamp { if c == nil || c.AuthorizedCredentialExpiresAt == nil { @@ -7278,6 +11198,14 @@ func (c *CredentialAuthorization) GetLogin() string { return *c.Login } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (c *CredentialAuthorization) GetScopes() []string { + if c == nil || c.Scopes == nil { + return nil + } + return c.Scopes +} + // GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise. func (c *CredentialAuthorization) GetTokenLastEight() string { if c == nil || c.TokenLastEight == nil { @@ -7286,6 +11214,14 @@ func (c *CredentialAuthorization) GetTokenLastEight() string { return *c.TokenLastEight } +// GetLogin returns the Login field. +func (c *CredentialAuthorizationsListOptions) GetLogin() string { + if c == nil { + return "" + } + return c.Login +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (c *Credit) GetType() string { if c == nil || c.Type == nil { @@ -7375,7 +11311,7 @@ func (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 { } // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetBaseRole() string { +func (c *CustomOrgRole) GetBaseRole() string { if c == nil || c.BaseRole == nil { return "" } @@ -7383,7 +11319,7 @@ func (c *CustomOrgRoles) GetBaseRole() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetCreatedAt() Timestamp { +func (c *CustomOrgRole) GetCreatedAt() Timestamp { if c == nil || c.CreatedAt == nil { return Timestamp{} } @@ -7391,7 +11327,7 @@ func (c *CustomOrgRoles) GetCreatedAt() Timestamp { } // GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetDescription() string { +func (c *CustomOrgRole) GetDescription() string { if c == nil || c.Description == nil { return "" } @@ -7399,7 +11335,7 @@ func (c *CustomOrgRoles) GetDescription() string { } // GetID returns the ID field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetID() int64 { +func (c *CustomOrgRole) GetID() int64 { if c == nil || c.ID == nil { return 0 } @@ -7407,7 +11343,7 @@ func (c *CustomOrgRoles) GetID() int64 { } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetName() string { +func (c *CustomOrgRole) GetName() string { if c == nil || c.Name == nil { return "" } @@ -7415,15 +11351,23 @@ func (c *CustomOrgRoles) GetName() string { } // GetOrg returns the Org field. -func (c *CustomOrgRoles) GetOrg() *Organization { +func (c *CustomOrgRole) GetOrg() *Organization { if c == nil { return nil } return c.Org } +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (c *CustomOrgRole) GetPermissions() []string { + if c == nil || c.Permissions == nil { + return nil + } + return c.Permissions +} + // GetSource returns the Source field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetSource() string { +func (c *CustomOrgRole) GetSource() string { if c == nil || c.Source == nil { return "" } @@ -7431,7 +11375,7 @@ func (c *CustomOrgRoles) GetSource() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetUpdatedAt() Timestamp { +func (c *CustomOrgRole) GetUpdatedAt() Timestamp { if c == nil || c.UpdatedAt == nil { return Timestamp{} } @@ -7454,6 +11398,22 @@ func (c *CustomPatternBackfillScan) GetPatternSlug() string { return *c.PatternSlug } +// GetAllowedValues returns the AllowedValues slice if it's non-nil, nil otherwise. +func (c *CustomProperty) GetAllowedValues() []string { + if c == nil || c.AllowedValues == nil { + return nil + } + return c.AllowedValues +} + +// GetDefaultValue returns the DefaultValue field. +func (c *CustomProperty) GetDefaultValue() any { + if c == nil { + return nil + } + return c.DefaultValue +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetDescription() string { if c == nil || c.Description == nil { @@ -7502,6 +11462,14 @@ func (c *CustomProperty) GetValuesEditableBy() string { return *c.ValuesEditableBy } +// GetValueType returns the ValueType field. +func (c *CustomProperty) GetValueType() PropertyValueType { + if c == nil { + return "" + } + return c.ValueType +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (c *CustomPropertyEvent) GetAction() string { if c == nil || c.Action == nil { @@ -7550,6 +11518,22 @@ func (c *CustomPropertyEvent) GetSender() *User { return c.Sender } +// GetPropertyName returns the PropertyName field. +func (c *CustomPropertyValue) GetPropertyName() string { + if c == nil { + return "" + } + return c.PropertyName +} + +// GetValue returns the Value field. +func (c *CustomPropertyValue) GetValue() any { + if c == nil { + return nil + } + return c.Value +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (c *CustomPropertyValuesEvent) GetAction() string { if c == nil || c.Action == nil { @@ -7574,6 +11558,22 @@ func (c *CustomPropertyValuesEvent) GetInstallation() *Installation { return c.Installation } +// GetNewPropertyValues returns the NewPropertyValues slice if it's non-nil, nil otherwise. +func (c *CustomPropertyValuesEvent) GetNewPropertyValues() []*CustomPropertyValue { + if c == nil || c.NewPropertyValues == nil { + return nil + } + return c.NewPropertyValues +} + +// GetOldPropertyValues returns the OldPropertyValues slice if it's non-nil, nil otherwise. +func (c *CustomPropertyValuesEvent) GetOldPropertyValues() []*CustomPropertyValue { + if c == nil || c.OldPropertyValues == nil { + return nil + } + return c.OldPropertyValues +} + // GetOrg returns the Org field. func (c *CustomPropertyValuesEvent) GetOrg() *Organization { if c == nil { @@ -7646,6 +11646,14 @@ func (c *CustomRepoRoles) GetOrg() *Organization { return c.Org } +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (c *CustomRepoRoles) GetPermissions() []string { + if c == nil || c.Permissions == nil { + return nil + } + return c.Permissions +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetUpdatedAt() Timestamp { if c == nil || c.UpdatedAt == nil { @@ -7654,6 +11662,38 @@ func (c *CustomRepoRoles) GetUpdatedAt() Timestamp { return *c.UpdatedAt } +// GetEncryptedToken returns the EncryptedToken field. +func (d *DatadogConfig) GetEncryptedToken() string { + if d == nil { + return "" + } + return d.EncryptedToken +} + +// GetKeyID returns the KeyID field. +func (d *DatadogConfig) GetKeyID() string { + if d == nil { + return "" + } + return d.KeyID +} + +// GetSite returns the Site field. +func (d *DatadogConfig) GetSite() string { + if d == nil { + return "" + } + return d.Site +} + +// GetLanguages returns the Languages slice if it's non-nil, nil otherwise. +func (d *DefaultSetupConfiguration) GetLanguages() []string { + if d == nil || d.Languages == nil { + return nil + } + return d.Languages +} + // GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. func (d *DefaultSetupConfiguration) GetQuerySuite() string { if d == nil || d.QuerySuite == nil { @@ -7742,6 +11782,38 @@ func (d *DeleteAnalysis) GetNextAnalysisURL() string { return *d.NextAnalysisURL } +// GetCostCenterState returns the CostCenterState field. +func (d *DeleteCostCenterResponse) GetCostCenterState() string { + if d == nil { + return "" + } + return d.CostCenterState +} + +// GetID returns the ID field. +func (d *DeleteCostCenterResponse) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +// GetMessage returns the Message field. +func (d *DeleteCostCenterResponse) GetMessage() string { + if d == nil { + return "" + } + return d.Message +} + +// GetName returns the Name field. +func (d *DeleteCostCenterResponse) GetName() string { + if d == nil { + return "" + } + return d.Name +} + // GetInstallation returns the Installation field. func (d *DeleteEvent) GetInstallation() *Installation { if d == nil { @@ -7998,6 +12070,54 @@ func (d *DependabotAlertState) GetDismissedReason() string { return *d.DismissedReason } +// GetState returns the State field. +func (d *DependabotAlertState) GetState() string { + if d == nil { + return "" + } + return d.State +} + +// GetEncryptedValue returns the EncryptedValue field. +func (d *DependabotEncryptedSecret) GetEncryptedValue() string { + if d == nil { + return "" + } + return d.EncryptedValue +} + +// GetKeyID returns the KeyID field. +func (d *DependabotEncryptedSecret) GetKeyID() string { + if d == nil { + return "" + } + return d.KeyID +} + +// GetName returns the Name field. +func (d *DependabotEncryptedSecret) GetName() string { + if d == nil { + return "" + } + return d.Name +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. +func (d *DependabotEncryptedSecret) GetSelectedRepositoryIDs() DependabotSecretsSelectedRepoIDs { + if d == nil { + return nil + } + return d.SelectedRepositoryIDs +} + +// GetVisibility returns the Visibility field. +func (d *DependabotEncryptedSecret) GetVisibility() string { + if d == nil { + return "" + } + return d.Visibility +} + // GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetCVEID() string { if d == nil || d.CVEID == nil { @@ -8014,6 +12134,14 @@ func (d *DependabotSecurityAdvisory) GetCVSS() *AdvisoryCVSS { return d.CVSS } +// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise. +func (d *DependabotSecurityAdvisory) GetCWEs() []*AdvisoryCWEs { + if d == nil || d.CWEs == nil { + return nil + } + return d.CWEs +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetDescription() string { if d == nil || d.Description == nil { @@ -8038,6 +12166,14 @@ func (d *DependabotSecurityAdvisory) GetGHSAID() string { return *d.GHSAID } +// GetIdentifiers returns the Identifiers slice if it's non-nil, nil otherwise. +func (d *DependabotSecurityAdvisory) GetIdentifiers() []*AdvisoryIdentifier { + if d == nil || d.Identifiers == nil { + return nil + } + return d.Identifiers +} + // GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp { if d == nil || d.PublishedAt == nil { @@ -8046,6 +12182,14 @@ func (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp { return *d.PublishedAt } +// GetReferences returns the References slice if it's non-nil, nil otherwise. +func (d *DependabotSecurityAdvisory) GetReferences() []*AdvisoryReference { + if d == nil || d.References == nil { + return nil + } + return d.References +} + // GetSeverity returns the Severity field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetSeverity() string { if d == nil || d.Severity == nil { @@ -8070,6 +12214,14 @@ func (d *DependabotSecurityAdvisory) GetUpdatedAt() Timestamp { return *d.UpdatedAt } +// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise. +func (d *DependabotSecurityAdvisory) GetVulnerabilities() []*AdvisoryVulnerability { + if d == nil || d.Vulnerabilities == nil { + return nil + } + return d.Vulnerabilities +} + // GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp { if d == nil || d.WithdrawnAt == nil { @@ -8166,6 +12318,14 @@ func (d *DependencyGraphSnapshot) GetSha() string { return *d.Sha } +// GetVersion returns the Version field. +func (d *DependencyGraphSnapshot) GetVersion() int { + if d == nil { + return 0 + } + return d.Version +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp { if d == nil || d.CreatedAt == nil { @@ -8174,6 +12334,14 @@ func (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp { return *d.CreatedAt } +// GetID returns the ID field. +func (d *DependencyGraphSnapshotCreationData) GetID() int64 { + if d == nil { + return 0 + } + return d.ID +} + // GetMessage returns the Message field if it's non-nil, zero value otherwise. func (d *DependencyGraphSnapshotCreationData) GetMessage() string { if d == nil || d.Message == nil { @@ -8270,6 +12438,14 @@ func (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string { return *d.SourceLocation } +// GetDependencies returns the Dependencies slice if it's non-nil, nil otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetDependencies() []string { + if d == nil || d.Dependencies == nil { + return nil + } + return d.Dependencies +} + // GetMetadata returns the Metadata map if it's non-nil, an empty map otherwise. func (d *DependencyGraphSnapshotResolvedDependency) GetMetadata() map[string]any { if d == nil || d.Metadata == nil { @@ -8398,6 +12574,14 @@ func (d *Deployment) GetNodeID() string { return *d.NodeID } +// GetPayload returns the Payload field. +func (d *Deployment) GetPayload() json.RawMessage { + if d == nil { + return json.RawMessage{} + } + return d.Payload +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (d *Deployment) GetRef() string { if d == nil || d.Ref == nil { @@ -8502,6 +12686,14 @@ func (d *DeploymentBranchPolicyRequest) GetType() string { return *d.Type } +// GetBranchPolicies returns the BranchPolicies slice if it's non-nil, nil otherwise. +func (d *DeploymentBranchPolicyResponse) GetBranchPolicies() []*DeploymentBranchPolicy { + if d == nil || d.BranchPolicies == nil { + return nil + } + return d.BranchPolicies +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (d *DeploymentBranchPolicyResponse) GetTotalCount() int { if d == nil || d.TotalCount == nil { @@ -8622,6 +12814,14 @@ func (d *DeploymentProtectionRuleEvent) GetOrganization() *Organization { return d.Organization } +// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise. +func (d *DeploymentProtectionRuleEvent) GetPullRequests() []*PullRequest { + if d == nil || d.PullRequests == nil { + return nil + } + return d.PullRequests +} + // GetRepo returns the Repo field. func (d *DeploymentProtectionRuleEvent) GetRepo() *Repository { if d == nil { @@ -8662,6 +12862,14 @@ func (d *DeploymentRequest) GetEnvironment() string { return *d.Environment } +// GetPayload returns the Payload field. +func (d *DeploymentRequest) GetPayload() any { + if d == nil { + return nil + } + return d.Payload +} + // GetProductionEnvironment returns the ProductionEnvironment field if it's non-nil, zero value otherwise. func (d *DeploymentRequest) GetProductionEnvironment() bool { if d == nil || d.ProductionEnvironment == nil { @@ -8774,6 +12982,14 @@ func (d *DeploymentReviewEvent) GetRequester() *User { return d.Requester } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (d *DeploymentReviewEvent) GetReviewers() []*RequiredReviewer { + if d == nil || d.Reviewers == nil { + return nil + } + return d.Reviewers +} + // GetSender returns the Sender field. func (d *DeploymentReviewEvent) GetSender() *User { if d == nil { @@ -8798,6 +13014,14 @@ func (d *DeploymentReviewEvent) GetWorkflowJobRun() *WorkflowJobRun { return d.WorkflowJobRun } +// GetWorkflowJobRuns returns the WorkflowJobRuns slice if it's non-nil, nil otherwise. +func (d *DeploymentReviewEvent) GetWorkflowJobRuns() []*WorkflowJobRun { + if d == nil || d.WorkflowJobRuns == nil { + return nil + } + return d.WorkflowJobRuns +} + // GetWorkflowRun returns the WorkflowRun field. func (d *DeploymentReviewEvent) GetWorkflowRun() *WorkflowRun { if d == nil { @@ -8806,6 +13030,38 @@ func (d *DeploymentReviewEvent) GetWorkflowRun() *WorkflowRun { return d.WorkflowRun } +// GetEnvironment returns the Environment field. +func (d *DeploymentsListOptions) GetEnvironment() string { + if d == nil { + return "" + } + return d.Environment +} + +// GetRef returns the Ref field. +func (d *DeploymentsListOptions) GetRef() string { + if d == nil { + return "" + } + return d.Ref +} + +// GetSHA returns the SHA field. +func (d *DeploymentsListOptions) GetSHA() string { + if d == nil { + return "" + } + return d.SHA +} + +// GetTask returns the Task field. +func (d *DeploymentsListOptions) GetTask() string { + if d == nil { + return "" + } + return d.Task +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (d *DeploymentStatus) GetCreatedAt() Timestamp { if d == nil || d.CreatedAt == nil { @@ -9038,6 +13294,30 @@ func (d *DevContainer) GetName() string { return *d.Name } +// GetPath returns the Path field. +func (d *DevContainer) GetPath() string { + if d == nil { + return "" + } + return d.Path +} + +// GetDevcontainers returns the Devcontainers slice if it's non-nil, nil otherwise. +func (d *DevContainerConfigurations) GetDevcontainers() []*DevContainer { + if d == nil || d.Devcontainers == nil { + return nil + } + return d.Devcontainers +} + +// GetTotalCount returns the TotalCount field. +func (d *DevContainerConfigurations) GetTotalCount() int64 { + if d == nil { + return 0 + } + return d.TotalCount +} + // GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise. func (d *Discussion) GetActiveLockReason() string { if d == nil || d.ActiveLockReason == nil { @@ -9430,6 +13710,14 @@ func (d *DiscussionCommentEvent) GetSender() *User { return d.Sender } +// GetDirection returns the Direction field. +func (d *DiscussionCommentListOptions) GetDirection() string { + if d == nil { + return "" + } + return d.Direction +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (d *DiscussionEvent) GetAction() string { if d == nil || d.Action == nil { @@ -9478,6 +13766,38 @@ func (d *DiscussionEvent) GetSender() *User { return d.Sender } +// GetDirection returns the Direction field. +func (d *DiscussionListOptions) GetDirection() string { + if d == nil { + return "" + } + return d.Direction +} + +// GetApps returns the Apps slice if it's non-nil, nil otherwise. +func (d *DismissalRestrictions) GetApps() []*App { + if d == nil || d.Apps == nil { + return nil + } + return d.Apps +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (d *DismissalRestrictions) GetTeams() []*Team { + if d == nil || d.Teams == nil { + return nil + } + return d.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (d *DismissalRestrictions) GetUsers() []*User { + if d == nil || d.Users == nil { + return nil + } + return d.Users +} + // GetApps returns the Apps field if it's non-nil, zero value otherwise. func (d *DismissalRestrictionsRequest) GetApps() []string { if d == nil || d.Apps == nil { @@ -9550,6 +13870,14 @@ func (d *DispatchRequestOptions) GetClientPayload() json.RawMessage { return *d.ClientPayload } +// GetEventType returns the EventType field. +func (d *DispatchRequestOptions) GetEventType() string { + if d == nil { + return "" + } + return d.EventType +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (d *DraftReviewComment) GetBody() string { if d == nil || d.Body == nil { @@ -9734,6 +14062,54 @@ func (e *EditTitle) GetFrom() string { return *e.From } +// GetFrom returns the From slice if it's non-nil, nil otherwise. +func (e *EditTopics) GetFrom() []string { + if e == nil || e.From == nil { + return nil + } + return e.From +} + +// GetEncryptedValue returns the EncryptedValue field. +func (e *EncryptedSecret) GetEncryptedValue() string { + if e == nil { + return "" + } + return e.EncryptedValue +} + +// GetKeyID returns the KeyID field. +func (e *EncryptedSecret) GetKeyID() string { + if e == nil { + return "" + } + return e.KeyID +} + +// GetName returns the Name field. +func (e *EncryptedSecret) GetName() string { + if e == nil { + return "" + } + return e.Name +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. +func (e *EncryptedSecret) GetSelectedRepositoryIDs() SelectedRepoIDs { + if e == nil { + return nil + } + return e.SelectedRepositoryIDs +} + +// GetVisibility returns the Visibility field. +func (e *EncryptedSecret) GetVisibility() string { + if e == nil { + return "" + } + return e.Visibility +} + // GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. func (e *Enterprise) GetAvatarURL() string { if e == nil || e.AvatarURL == nil { @@ -9814,6 +14190,182 @@ func (e *Enterprise) GetWebsiteURL() string { return *e.WebsiteURL } +// GetBudgetAlerting returns the BudgetAlerting field. +func (e *EnterpriseBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting { + if e == nil { + return nil + } + return e.BudgetAlerting +} + +// GetBudgetAmount returns the BudgetAmount field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetAmount() int { + if e == nil || e.BudgetAmount == nil { + return 0 + } + return *e.BudgetAmount +} + +// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetEntityName() string { + if e == nil || e.BudgetEntityName == nil { + return "" + } + return *e.BudgetEntityName +} + +// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetProductSKU() string { + if e == nil || e.BudgetProductSKU == nil { + return "" + } + return *e.BudgetProductSKU +} + +// GetBudgetScope returns the BudgetScope field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetScope() string { + if e == nil || e.BudgetScope == nil { + return "" + } + return *e.BudgetScope +} + +// GetBudgetType returns the BudgetType field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetBudgetType() string { + if e == nil || e.BudgetType == nil { + return "" + } + return *e.BudgetType +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetID() string { + if e == nil || e.ID == nil { + return "" + } + return *e.ID +} + +// GetPreventFurtherUsage returns the PreventFurtherUsage field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudget) GetPreventFurtherUsage() bool { + if e == nil || e.PreventFurtherUsage == nil { + return false + } + return *e.PreventFurtherUsage +} + +// GetAlertRecipients returns the AlertRecipients slice if it's non-nil, nil otherwise. +func (e *EnterpriseBudgetAlerting) GetAlertRecipients() []string { + if e == nil || e.AlertRecipients == nil { + return nil + } + return e.AlertRecipients +} + +// GetWillAlert returns the WillAlert field if it's non-nil, zero value otherwise. +func (e *EnterpriseBudgetAlerting) GetWillAlert() bool { + if e == nil || e.WillAlert == nil { + return false + } + return *e.WillAlert +} + +// GetTotalSeatsConsumed returns the TotalSeatsConsumed field. +func (e *EnterpriseConsumedLicenses) GetTotalSeatsConsumed() int { + if e == nil { + return 0 + } + return e.TotalSeatsConsumed +} + +// GetTotalSeatsPurchased returns the TotalSeatsPurchased field. +func (e *EnterpriseConsumedLicenses) GetTotalSeatsPurchased() int { + if e == nil { + return 0 + } + return e.TotalSeatsPurchased +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (e *EnterpriseConsumedLicenses) GetUsers() []*EnterpriseLicensedUsers { + if e == nil || e.Users == nil { + return nil + } + return e.Users +} + +// GetBudgetAlerting returns the BudgetAlerting field. +func (e *EnterpriseCreateBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting { + if e == nil { + return nil + } + return e.BudgetAlerting +} + +// GetBudgetAmount returns the BudgetAmount field. +func (e *EnterpriseCreateBudget) GetBudgetAmount() int { + if e == nil { + return 0 + } + return e.BudgetAmount +} + +// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise. +func (e *EnterpriseCreateBudget) GetBudgetEntityName() string { + if e == nil || e.BudgetEntityName == nil { + return "" + } + return *e.BudgetEntityName +} + +// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise. +func (e *EnterpriseCreateBudget) GetBudgetProductSKU() string { + if e == nil || e.BudgetProductSKU == nil { + return "" + } + return *e.BudgetProductSKU +} + +// GetBudgetScope returns the BudgetScope field. +func (e *EnterpriseCreateBudget) GetBudgetScope() string { + if e == nil { + return "" + } + return e.BudgetScope +} + +// GetBudgetType returns the BudgetType field. +func (e *EnterpriseCreateBudget) GetBudgetType() string { + if e == nil { + return "" + } + return e.BudgetType +} + +// GetPreventFurtherUsage returns the PreventFurtherUsage field. +func (e *EnterpriseCreateBudget) GetPreventFurtherUsage() bool { + if e == nil { + return false + } + return e.PreventFurtherUsage +} + +// GetBudget returns the Budget field. +func (e *EnterpriseCreateOrUpdateBudgetResponse) GetBudget() *EnterpriseBudget { + if e == nil { + return nil + } + return e.Budget +} + +// GetMessage returns the Message field. +func (e *EnterpriseCreateOrUpdateBudgetResponse) GetMessage() string { + if e == nil { + return "" + } + return e.Message +} + // GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. func (e *EnterpriseCustomPropertiesValues) GetOrganizationID() int64 { if e == nil || e.OrganizationID == nil { @@ -9830,6 +14382,62 @@ func (e *EnterpriseCustomPropertiesValues) GetOrganizationLogin() string { return *e.OrganizationLogin } +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (e *EnterpriseCustomPropertiesValues) GetProperties() []*CustomPropertyValue { + if e == nil || e.Properties == nil { + return nil + } + return e.Properties +} + +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (e *EnterpriseCustomPropertySchema) GetProperties() []*CustomProperty { + if e == nil || e.Properties == nil { + return nil + } + return e.Properties +} + +// GetOrganizationLogin returns the OrganizationLogin slice if it's non-nil, nil otherwise. +func (e *EnterpriseCustomPropertyValuesRequest) GetOrganizationLogin() []string { + if e == nil || e.OrganizationLogin == nil { + return nil + } + return e.OrganizationLogin +} + +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (e *EnterpriseCustomPropertyValuesRequest) GetProperties() []*CustomPropertyValue { + if e == nil || e.Properties == nil { + return nil + } + return e.Properties +} + +// GetID returns the ID field. +func (e *EnterpriseDeleteBudgetResponse) GetID() string { + if e == nil { + return "" + } + return e.ID +} + +// GetMessage returns the Message field. +func (e *EnterpriseDeleteBudgetResponse) GetMessage() string { + if e == nil { + return "" + } + return e.Message +} + +// GetEnterpriseServerEmails returns the EnterpriseServerEmails slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetEnterpriseServerEmails() []string { + if e == nil || e.EnterpriseServerEmails == nil { + return nil + } + return e.EnterpriseServerEmails +} + // GetEnterpriseServerUser returns the EnterpriseServerUser field if it's non-nil, zero value otherwise. func (e *EnterpriseLicensedUsers) GetEnterpriseServerUser() bool { if e == nil || e.EnterpriseServerUser == nil { @@ -9838,6 +14446,38 @@ func (e *EnterpriseLicensedUsers) GetEnterpriseServerUser() bool { return *e.EnterpriseServerUser } +// GetEnterpriseServerUserIDs returns the EnterpriseServerUserIDs slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetEnterpriseServerUserIDs() []string { + if e == nil || e.EnterpriseServerUserIDs == nil { + return nil + } + return e.EnterpriseServerUserIDs +} + +// GetGithubComEnterpriseRoles returns the GithubComEnterpriseRoles slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetGithubComEnterpriseRoles() []string { + if e == nil || e.GithubComEnterpriseRoles == nil { + return nil + } + return e.GithubComEnterpriseRoles +} + +// GetGithubComLogin returns the GithubComLogin field. +func (e *EnterpriseLicensedUsers) GetGithubComLogin() string { + if e == nil { + return "" + } + return e.GithubComLogin +} + +// GetGithubComMemberRoles returns the GithubComMemberRoles slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetGithubComMemberRoles() []string { + if e == nil || e.GithubComMemberRoles == nil { + return nil + } + return e.GithubComMemberRoles +} + // GetGithubComName returns the GithubComName field if it's non-nil, zero value otherwise. func (e *EnterpriseLicensedUsers) GetGithubComName() string { if e == nil || e.GithubComName == nil { @@ -9846,6 +14486,14 @@ func (e *EnterpriseLicensedUsers) GetGithubComName() string { return *e.GithubComName } +// GetGithubComOrgsWithPendingInvites returns the GithubComOrgsWithPendingInvites slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetGithubComOrgsWithPendingInvites() []string { + if e == nil || e.GithubComOrgsWithPendingInvites == nil { + return nil + } + return e.GithubComOrgsWithPendingInvites +} + // GetGithubComProfile returns the GithubComProfile field if it's non-nil, zero value otherwise. func (e *EnterpriseLicensedUsers) GetGithubComProfile() string { if e == nil || e.GithubComProfile == nil { @@ -9870,6 +14518,38 @@ func (e *EnterpriseLicensedUsers) GetGithubComTwoFactorAuth() bool { return *e.GithubComTwoFactorAuth } +// GetGithubComUser returns the GithubComUser field. +func (e *EnterpriseLicensedUsers) GetGithubComUser() bool { + if e == nil { + return false + } + return e.GithubComUser +} + +// GetGithubComVerifiedDomainEmails returns the GithubComVerifiedDomainEmails slice if it's non-nil, nil otherwise. +func (e *EnterpriseLicensedUsers) GetGithubComVerifiedDomainEmails() []string { + if e == nil || e.GithubComVerifiedDomainEmails == nil { + return nil + } + return e.GithubComVerifiedDomainEmails +} + +// GetLicenseType returns the LicenseType field. +func (e *EnterpriseLicensedUsers) GetLicenseType() string { + if e == nil { + return "" + } + return e.LicenseType +} + +// GetTotalUserAccounts returns the TotalUserAccounts field. +func (e *EnterpriseLicensedUsers) GetTotalUserAccounts() int { + if e == nil { + return 0 + } + return e.TotalUserAccounts +} + // GetVisualStudioLicenseStatus returns the VisualStudioLicenseStatus field if it's non-nil, zero value otherwise. func (e *EnterpriseLicensedUsers) GetVisualStudioLicenseStatus() string { if e == nil || e.VisualStudioLicenseStatus == nil { @@ -9886,6 +14566,22 @@ func (e *EnterpriseLicensedUsers) GetVisualStudioSubscriptionEmail() string { return *e.VisualStudioSubscriptionEmail } +// GetVisualStudioSubscriptionUser returns the VisualStudioSubscriptionUser field. +func (e *EnterpriseLicensedUsers) GetVisualStudioSubscriptionUser() bool { + if e == nil { + return false + } + return e.VisualStudioSubscriptionUser +} + +// GetDescription returns the Description field. +func (e *EnterpriseLicenseSyncStatus) GetDescription() string { + if e == nil { + return "" + } + return e.Description +} + // GetProperties returns the Properties field. func (e *EnterpriseLicenseSyncStatus) GetProperties() *ServerInstanceProperties { if e == nil { @@ -9894,6 +14590,38 @@ func (e *EnterpriseLicenseSyncStatus) GetProperties() *ServerInstanceProperties return e.Properties } +// GetTitle returns the Title field. +func (e *EnterpriseLicenseSyncStatus) GetTitle() string { + if e == nil { + return "" + } + return e.Title +} + +// GetBudgets returns the Budgets slice if it's non-nil, nil otherwise. +func (e *EnterpriseListBudgets) GetBudgets() []*EnterpriseBudget { + if e == nil || e.Budgets == nil { + return nil + } + return e.Budgets +} + +// GetHasNextPage returns the HasNextPage field if it's non-nil, zero value otherwise. +func (e *EnterpriseListBudgets) GetHasNextPage() bool { + if e == nil || e.HasNextPage == nil { + return false + } + return *e.HasNextPage +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (e *EnterpriseListBudgets) GetTotalCount() int { + if e == nil || e.TotalCount == nil { + return 0 + } + return *e.TotalCount +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetAllowsPublicRepositories() bool { if e == nil || e.AllowsPublicRepositories == nil { @@ -9910,6 +14638,14 @@ func (e *EnterpriseRunnerGroup) GetDefault() bool { return *e.Default } +// GetHostedRunnersURL returns the HostedRunnersURL field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetHostedRunnersURL() string { + if e == nil || e.HostedRunnersURL == nil { + return "" + } + return *e.HostedRunnersURL +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetID() int64 { if e == nil || e.ID == nil { @@ -9934,6 +14670,14 @@ func (e *EnterpriseRunnerGroup) GetName() string { return *e.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (e *EnterpriseRunnerGroup) GetNetworkConfigurationID() string { + if e == nil || e.NetworkConfigurationID == nil { + return "" + } + return *e.NetworkConfigurationID +} + // GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetRestrictedToWorkflows() bool { if e == nil || e.RestrictedToWorkflows == nil { @@ -9958,6 +14702,14 @@ func (e *EnterpriseRunnerGroup) GetSelectedOrganizationsURL() string { return *e.SelectedOrganizationsURL } +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (e *EnterpriseRunnerGroup) GetSelectedWorkflows() []string { + if e == nil || e.SelectedWorkflows == nil { + return nil + } + return e.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroup) GetVisibility() string { if e == nil || e.Visibility == nil { @@ -9974,6 +14726,14 @@ func (e *EnterpriseRunnerGroup) GetWorkflowRestrictionsReadOnly() bool { return *e.WorkflowRestrictionsReadOnly } +// GetRunnerGroups returns the RunnerGroups slice if it's non-nil, nil otherwise. +func (e *EnterpriseRunnerGroups) GetRunnerGroups() []*EnterpriseRunnerGroup { + if e == nil || e.RunnerGroups == nil { + return nil + } + return e.RunnerGroups +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (e *EnterpriseRunnerGroups) GetTotalCount() int { if e == nil || e.TotalCount == nil { @@ -10022,6 +14782,14 @@ func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningValidityChecksEnab return *e.SecretScanningValidityChecksEnabled } +// GetCreatedAt returns the CreatedAt field. +func (e *EnterpriseTeam) GetCreatedAt() Timestamp { + if e == nil { + return Timestamp{} + } + return e.CreatedAt +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (e *EnterpriseTeam) GetDescription() string { if e == nil || e.Description == nil { @@ -10030,6 +14798,46 @@ func (e *EnterpriseTeam) GetDescription() string { return *e.Description } +// GetGroupID returns the GroupID field. +func (e *EnterpriseTeam) GetGroupID() string { + if e == nil { + return "" + } + return e.GroupID +} + +// GetHTMLURL returns the HTMLURL field. +func (e *EnterpriseTeam) GetHTMLURL() string { + if e == nil { + return "" + } + return e.HTMLURL +} + +// GetID returns the ID field. +func (e *EnterpriseTeam) GetID() int64 { + if e == nil { + return 0 + } + return e.ID +} + +// GetMemberURL returns the MemberURL field. +func (e *EnterpriseTeam) GetMemberURL() string { + if e == nil { + return "" + } + return e.MemberURL +} + +// GetName returns the Name field. +func (e *EnterpriseTeam) GetName() string { + if e == nil { + return "" + } + return e.Name +} + // GetOrganizationSelectionType returns the OrganizationSelectionType field if it's non-nil, zero value otherwise. func (e *EnterpriseTeam) GetOrganizationSelectionType() string { if e == nil || e.OrganizationSelectionType == nil { @@ -10038,6 +14846,30 @@ func (e *EnterpriseTeam) GetOrganizationSelectionType() string { return *e.OrganizationSelectionType } +// GetSlug returns the Slug field. +func (e *EnterpriseTeam) GetSlug() string { + if e == nil { + return "" + } + return e.Slug +} + +// GetUpdatedAt returns the UpdatedAt field. +func (e *EnterpriseTeam) GetUpdatedAt() Timestamp { + if e == nil { + return Timestamp{} + } + return e.UpdatedAt +} + +// GetURL returns the URL field. +func (e *EnterpriseTeam) GetURL() string { + if e == nil { + return "" + } + return e.URL +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (e *EnterpriseTeamCreateOrUpdateRequest) GetDescription() string { if e == nil || e.Description == nil { @@ -10054,6 +14886,14 @@ func (e *EnterpriseTeamCreateOrUpdateRequest) GetGroupID() string { return *e.GroupID } +// GetName returns the Name field. +func (e *EnterpriseTeamCreateOrUpdateRequest) GetName() string { + if e == nil { + return "" + } + return e.Name +} + // GetOrganizationSelectionType returns the OrganizationSelectionType field if it's non-nil, zero value otherwise. func (e *EnterpriseTeamCreateOrUpdateRequest) GetOrganizationSelectionType() string { if e == nil || e.OrganizationSelectionType == nil { @@ -10062,6 +14902,62 @@ func (e *EnterpriseTeamCreateOrUpdateRequest) GetOrganizationSelectionType() str return *e.OrganizationSelectionType } +// GetBudgetAlerting returns the BudgetAlerting field. +func (e *EnterpriseUpdateBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting { + if e == nil { + return nil + } + return e.BudgetAlerting +} + +// GetBudgetAmount returns the BudgetAmount field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetAmount() int { + if e == nil || e.BudgetAmount == nil { + return 0 + } + return *e.BudgetAmount +} + +// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetEntityName() string { + if e == nil || e.BudgetEntityName == nil { + return "" + } + return *e.BudgetEntityName +} + +// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetProductSKU() string { + if e == nil || e.BudgetProductSKU == nil { + return "" + } + return *e.BudgetProductSKU +} + +// GetBudgetScope returns the BudgetScope field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetScope() string { + if e == nil || e.BudgetScope == nil { + return "" + } + return *e.BudgetScope +} + +// GetBudgetType returns the BudgetType field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetBudgetType() string { + if e == nil || e.BudgetType == nil { + return "" + } + return *e.BudgetType +} + +// GetPreventFurtherUsage returns the PreventFurtherUsage field if it's non-nil, zero value otherwise. +func (e *EnterpriseUpdateBudget) GetPreventFurtherUsage() bool { + if e == nil || e.PreventFurtherUsage == nil { + return false + } + return *e.PreventFurtherUsage +} + // GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. func (e *Environment) GetCanAdminsBypass() bool { if e == nil || e.CanAdminsBypass == nil { @@ -10134,6 +15030,14 @@ func (e *Environment) GetOwner() string { return *e.Owner } +// GetProtectionRules returns the ProtectionRules slice if it's non-nil, nil otherwise. +func (e *Environment) GetProtectionRules() []*ProtectionRule { + if e == nil || e.ProtectionRules == nil { + return nil + } + return e.ProtectionRules +} + // GetRepo returns the Repo field if it's non-nil, zero value otherwise. func (e *Environment) GetRepo() string { if e == nil || e.Repo == nil { @@ -10142,6 +15046,14 @@ func (e *Environment) GetRepo() string { return *e.Repo } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (e *Environment) GetReviewers() []*EnvReviewers { + if e == nil || e.Reviewers == nil { + return nil + } + return e.Reviewers +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (e *Environment) GetUpdatedAt() Timestamp { if e == nil || e.UpdatedAt == nil { @@ -10166,6 +15078,14 @@ func (e *Environment) GetWaitTimer() int { return *e.WaitTimer } +// GetEnvironments returns the Environments slice if it's non-nil, nil otherwise. +func (e *EnvResponse) GetEnvironments() []*Environment { + if e == nil || e.Environments == nil { + return nil + } + return e.Environments +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (e *EnvResponse) GetTotalCount() int { if e == nil || e.TotalCount == nil { @@ -10190,6 +15110,38 @@ func (e *EnvReviewers) GetType() string { return *e.Type } +// GetCode returns the Code field. +func (e *Error) GetCode() string { + if e == nil { + return "" + } + return e.Code +} + +// GetField returns the Field field. +func (e *Error) GetField() string { + if e == nil { + return "" + } + return e.Field +} + +// GetMessage returns the Message field. +func (e *Error) GetMessage() string { + if e == nil { + return "" + } + return e.Message +} + +// GetResource returns the Resource field. +func (e *Error) GetResource() string { + if e == nil { + return "" + } + return e.Resource +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (e *ErrorBlock) GetCreatedAt() Timestamp { if e == nil || e.CreatedAt == nil { @@ -10198,6 +15150,14 @@ func (e *ErrorBlock) GetCreatedAt() Timestamp { return *e.CreatedAt } +// GetReason returns the Reason field. +func (e *ErrorBlock) GetReason() string { + if e == nil { + return "" + } + return e.Reason +} + // GetBlock returns the Block field. func (e *ErrorResponse) GetBlock() *ErrorBlock { if e == nil { @@ -10206,6 +15166,30 @@ func (e *ErrorResponse) GetBlock() *ErrorBlock { return e.Block } +// GetDocumentationURL returns the DocumentationURL field. +func (e *ErrorResponse) GetDocumentationURL() string { + if e == nil { + return "" + } + return e.DocumentationURL +} + +// GetErrors returns the Errors slice if it's non-nil, nil otherwise. +func (e *ErrorResponse) GetErrors() []Error { + if e == nil || e.Errors == nil { + return nil + } + return e.Errors +} + +// GetMessage returns the Message field. +func (e *ErrorResponse) GetMessage() string { + if e == nil { + return "" + } + return e.Message +} + // GetActor returns the Actor field. func (e *Event) GetActor() *User { if e == nil { @@ -10286,6 +15270,22 @@ func (e *ExternalGroup) GetGroupName() string { return *e.GroupName } +// GetMembers returns the Members slice if it's non-nil, nil otherwise. +func (e *ExternalGroup) GetMembers() []*ExternalGroupMember { + if e == nil || e.Members == nil { + return nil + } + return e.Members +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (e *ExternalGroup) GetTeams() []*ExternalGroupTeam { + if e == nil || e.Teams == nil { + return nil + } + return e.Teams +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (e *ExternalGroup) GetUpdatedAt() Timestamp { if e == nil || e.UpdatedAt == nil { @@ -10294,6 +15294,14 @@ func (e *ExternalGroup) GetUpdatedAt() Timestamp { return *e.UpdatedAt } +// GetGroups returns the Groups slice if it's non-nil, nil otherwise. +func (e *ExternalGroupList) GetGroups() []*ExternalGroup { + if e == nil || e.Groups == nil { + return nil + } + return e.Groups +} + // GetMemberEmail returns the MemberEmail field if it's non-nil, zero value otherwise. func (e *ExternalGroupMember) GetMemberEmail() string { if e == nil || e.MemberEmail == nil { @@ -10382,6 +15390,14 @@ func (f *FeedLinks) GetCurrentUserOrganization() *FeedLink { return f.CurrentUserOrganization } +// GetCurrentUserOrganizations returns the CurrentUserOrganizations slice if it's non-nil, nil otherwise. +func (f *FeedLinks) GetCurrentUserOrganizations() []*FeedLink { + if f == nil || f.CurrentUserOrganizations == nil { + return nil + } + return f.CurrentUserOrganizations +} + // GetCurrentUserPublic returns the CurrentUserPublic field. func (f *FeedLinks) GetCurrentUserPublic() *FeedLink { if f == nil { @@ -10422,6 +15438,14 @@ func (f *Feeds) GetCurrentUserOrganizationURL() string { return *f.CurrentUserOrganizationURL } +// GetCurrentUserOrganizationURLs returns the CurrentUserOrganizationURLs slice if it's non-nil, nil otherwise. +func (f *Feeds) GetCurrentUserOrganizationURLs() []string { + if f == nil || f.CurrentUserOrganizationURLs == nil { + return nil + } + return f.CurrentUserOrganizationURLs +} + // GetCurrentUserPublicURL returns the CurrentUserPublicURL field if it's non-nil, zero value otherwise. func (f *Feeds) GetCurrentUserPublicURL() string { if f == nil || f.CurrentUserPublicURL == nil { @@ -10486,6 +15510,14 @@ func (f *FieldValue) GetFieldType() string { return *f.FieldType } +// GetFrom returns the From field. +func (f *FieldValue) GetFrom() json.RawMessage { + if f == nil { + return json.RawMessage{} + } + return f.From +} + // GetProjectNumber returns the ProjectNumber field if it's non-nil, zero value otherwise. func (f *FieldValue) GetProjectNumber() int64 { if f == nil || f.ProjectNumber == nil { @@ -10494,6 +15526,46 @@ func (f *FieldValue) GetProjectNumber() int64 { return *f.ProjectNumber } +// GetTo returns the To field. +func (f *FieldValue) GetTo() json.RawMessage { + if f == nil { + return json.RawMessage{} + } + return f.To +} + +// GetParameters returns the Parameters field. +func (f *FileExtensionRestrictionBranchRule) GetParameters() FileExtensionRestrictionRuleParameters { + if f == nil { + return FileExtensionRestrictionRuleParameters{} + } + return f.Parameters +} + +// GetRestrictedFileExtensions returns the RestrictedFileExtensions slice if it's non-nil, nil otherwise. +func (f *FileExtensionRestrictionRuleParameters) GetRestrictedFileExtensions() []string { + if f == nil || f.RestrictedFileExtensions == nil { + return nil + } + return f.RestrictedFileExtensions +} + +// GetParameters returns the Parameters field. +func (f *FilePathRestrictionBranchRule) GetParameters() FilePathRestrictionRuleParameters { + if f == nil { + return FilePathRestrictionRuleParameters{} + } + return f.Parameters +} + +// GetRestrictedFilePaths returns the RestrictedFilePaths slice if it's non-nil, nil otherwise. +func (f *FilePathRestrictionRuleParameters) GetRestrictedFilePaths() []string { + if f == nil || f.RestrictedFilePaths == nil { + return nil + } + return f.RestrictedFilePaths +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (f *FineGrainedPersonalAccessTokenRequest) GetCreatedAt() Timestamp { if f == nil || f.CreatedAt == nil { @@ -10502,6 +15574,62 @@ func (f *FineGrainedPersonalAccessTokenRequest) GetCreatedAt() Timestamp { return *f.CreatedAt } +// GetID returns the ID field. +func (f *FineGrainedPersonalAccessTokenRequest) GetID() int64 { + if f == nil { + return 0 + } + return f.ID +} + +// GetOwner returns the Owner field. +func (f *FineGrainedPersonalAccessTokenRequest) GetOwner() User { + if f == nil { + return User{} + } + return f.Owner +} + +// GetPermissions returns the Permissions field. +func (f *FineGrainedPersonalAccessTokenRequest) GetPermissions() PersonalAccessTokenPermissions { + if f == nil { + return PersonalAccessTokenPermissions{} + } + return f.Permissions +} + +// GetReason returns the Reason field. +func (f *FineGrainedPersonalAccessTokenRequest) GetReason() string { + if f == nil { + return "" + } + return f.Reason +} + +// GetRepositoriesURL returns the RepositoriesURL field. +func (f *FineGrainedPersonalAccessTokenRequest) GetRepositoriesURL() string { + if f == nil { + return "" + } + return f.RepositoriesURL +} + +// GetRepositorySelection returns the RepositorySelection field. +func (f *FineGrainedPersonalAccessTokenRequest) GetRepositorySelection() string { + if f == nil { + return "" + } + return f.RepositorySelection +} + +// GetTokenExpired returns the TokenExpired field. +func (f *FineGrainedPersonalAccessTokenRequest) GetTokenExpired() bool { + if f == nil { + return false + } + return f.TokenExpired +} + // GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. func (f *FineGrainedPersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp { if f == nil || f.TokenExpiresAt == nil { @@ -10510,6 +15638,14 @@ func (f *FineGrainedPersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp { return *f.TokenExpiresAt } +// GetTokenID returns the TokenID field. +func (f *FineGrainedPersonalAccessTokenRequest) GetTokenID() int64 { + if f == nil { + return 0 + } + return f.TokenID +} + // GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. func (f *FineGrainedPersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp { if f == nil || f.TokenLastUsedAt == nil { @@ -10518,6 +15654,14 @@ func (f *FineGrainedPersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp { return *f.TokenLastUsedAt } +// GetTokenName returns the TokenName field. +func (f *FineGrainedPersonalAccessTokenRequest) GetTokenName() string { + if f == nil { + return "" + } + return f.TokenName +} + // GetIdentifier returns the Identifier field if it's non-nil, zero value otherwise. func (f *FirstPatchedVersion) GetIdentifier() string { if f == nil || f.Identifier == nil { @@ -10558,6 +15702,30 @@ func (f *ForkEvent) GetSender() *User { return f.Sender } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (g *GenerateJITConfigRequest) GetLabels() []string { + if g == nil || g.Labels == nil { + return nil + } + return g.Labels +} + +// GetName returns the Name field. +func (g *GenerateJITConfigRequest) GetName() string { + if g == nil { + return "" + } + return g.Name +} + +// GetRunnerGroupID returns the RunnerGroupID field. +func (g *GenerateJITConfigRequest) GetRunnerGroupID() int64 { + if g == nil { + return 0 + } + return g.RunnerGroupID +} + // GetWorkFolder returns the WorkFolder field if it's non-nil, zero value otherwise. func (g *GenerateJITConfigRequest) GetWorkFolder() string { if g == nil || g.WorkFolder == nil { @@ -10582,6 +15750,14 @@ func (g *GenerateNotesOptions) GetPreviousTagName() string { return *g.PreviousTagName } +// GetTagName returns the TagName field. +func (g *GenerateNotesOptions) GetTagName() string { + if g == nil { + return "" + } + return g.TagName +} + // GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. func (g *GenerateNotesOptions) GetTargetCommitish() string { if g == nil || g.TargetCommitish == nil { @@ -10614,6 +15790,22 @@ func (g *GetAuditLogOptions) GetPhrase() string { return *g.Phrase } +// GetRef returns the Ref field. +func (g *GetCodeownersErrorsOptions) GetRef() string { + if g == nil { + return "" + } + return g.Ref +} + +// GetFields returns the Fields slice if it's non-nil, nil otherwise. +func (g *GetProjectItemOptions) GetFields() []int64 { + if g == nil || g.Fields == nil { + return nil + } + return g.Fields +} + // GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise. func (g *GetProvisionedSCIMGroupEnterpriseOptions) GetExcludedAttributes() string { if g == nil || g.ExcludedAttributes == nil { @@ -10902,6 +16094,14 @@ func (g *GistFork) GetUser() *User { return g.User } +// GetSince returns the Since field. +func (g *GistListOptions) GetSince() time.Time { + if g == nil { + return time.Time{} + } + return g.Since +} + // GetPrivateGists returns the PrivateGists field if it's non-nil, zero value otherwise. func (g *GistStats) GetPrivateGists() int { if g == nil || g.PrivateGists == nil { @@ -10990,6 +16190,14 @@ func (g *GitObject) GetURL() string { return *g.URL } +// GetCredits returns the Credits slice if it's non-nil, nil otherwise. +func (g *GlobalSecurityAdvisory) GetCredits() []*Credit { + if g == nil || g.Credits == nil { + return nil + } + return g.Credits +} + // GetGithubReviewedAt returns the GithubReviewedAt field if it's non-nil, zero value otherwise. func (g *GlobalSecurityAdvisory) GetGithubReviewedAt() Timestamp { if g == nil || g.GithubReviewedAt == nil { @@ -11014,6 +16222,14 @@ func (g *GlobalSecurityAdvisory) GetNVDPublishedAt() Timestamp { return *g.NVDPublishedAt } +// GetReferences returns the References slice if it's non-nil, nil otherwise. +func (g *GlobalSecurityAdvisory) GetReferences() []string { + if g == nil || g.References == nil { + return nil + } + return g.References +} + // GetRepositoryAdvisoryURL returns the RepositoryAdvisoryURL field if it's non-nil, zero value otherwise. func (g *GlobalSecurityAdvisory) GetRepositoryAdvisoryURL() string { if g == nil || g.RepositoryAdvisoryURL == nil { @@ -11038,6 +16254,14 @@ func (g *GlobalSecurityAdvisory) GetType() string { return *g.Type } +// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise. +func (g *GlobalSecurityAdvisory) GetVulnerabilities() []*GlobalSecurityVulnerability { + if g == nil || g.Vulnerabilities == nil { + return nil + } + return g.Vulnerabilities +} + // GetFirstPatchedVersion returns the FirstPatchedVersion field if it's non-nil, zero value otherwise. func (g *GlobalSecurityVulnerability) GetFirstPatchedVersion() string { if g == nil || g.FirstPatchedVersion == nil { @@ -11054,6 +16278,14 @@ func (g *GlobalSecurityVulnerability) GetPackage() *VulnerabilityPackage { return g.Package } +// GetVulnerableFunctions returns the VulnerableFunctions slice if it's non-nil, nil otherwise. +func (g *GlobalSecurityVulnerability) GetVulnerableFunctions() []string { + if g == nil || g.VulnerableFunctions == nil { + return nil + } + return g.VulnerableFunctions +} + // GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise. func (g *GlobalSecurityVulnerability) GetVulnerableVersionRange() string { if g == nil || g.VulnerableVersionRange == nil { @@ -11078,6 +16310,14 @@ func (g *GollumEvent) GetOrg() *Organization { return g.Org } +// GetPages returns the Pages slice if it's non-nil, nil otherwise. +func (g *GollumEvent) GetPages() []*Page { + if g == nil || g.Pages == nil { + return nil + } + return g.Pages +} + // GetRepo returns the Repo field. func (g *GollumEvent) GetRepo() *Repository { if g == nil { @@ -11094,6 +16334,30 @@ func (g *GollumEvent) GetSender() *User { return g.Sender } +// GetBucket returns the Bucket field. +func (g *GoogleCloudConfig) GetBucket() string { + if g == nil { + return "" + } + return g.Bucket +} + +// GetEncryptedJSONCredentials returns the EncryptedJSONCredentials field. +func (g *GoogleCloudConfig) GetEncryptedJSONCredentials() string { + if g == nil { + return "" + } + return g.EncryptedJSONCredentials +} + +// GetKeyID returns the KeyID field. +func (g *GoogleCloudConfig) GetKeyID() string { + if g == nil { + return "" + } + return g.KeyID +} + // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (g *GPGEmail) GetEmail() string { if g == nil || g.Email == nil { @@ -11150,6 +16414,14 @@ func (g *GPGKey) GetCreatedAt() Timestamp { return *g.CreatedAt } +// GetEmails returns the Emails slice if it's non-nil, nil otherwise. +func (g *GPGKey) GetEmails() []*GPGEmail { + if g == nil || g.Emails == nil { + return nil + } + return g.Emails +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (g *GPGKey) GetExpiresAt() Timestamp { if g == nil || g.ExpiresAt == nil { @@ -11198,6 +16470,14 @@ func (g *GPGKey) GetRawKey() string { return *g.RawKey } +// GetSubkeys returns the Subkeys slice if it's non-nil, nil otherwise. +func (g *GPGKey) GetSubkeys() []*GPGKey { + if g == nil || g.Subkeys == nil { + return nil + } + return g.Subkeys +} + // GetApp returns the App field. func (g *Grant) GetApp() *AuthorizationApp { if g == nil { @@ -11222,6 +16502,14 @@ func (g *Grant) GetID() int64 { return *g.ID } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (g *Grant) GetScopes() []string { + if g == nil || g.Scopes == nil { + return nil + } + return g.Scopes +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (g *Grant) GetUpdatedAt() Timestamp { if g == nil || g.UpdatedAt == nil { @@ -11238,6 +16526,14 @@ func (g *Grant) GetURL() string { return *g.URL } +// GetAdded returns the Added slice if it's non-nil, nil otherwise. +func (h *HeadCommit) GetAdded() []string { + if h == nil || h.Added == nil { + return nil + } + return h.Added +} + // GetAuthor returns the Author field. func (h *HeadCommit) GetAuthor() *CommitAuthor { if h == nil { @@ -11278,6 +16574,22 @@ func (h *HeadCommit) GetMessage() string { return *h.Message } +// GetModified returns the Modified slice if it's non-nil, nil otherwise. +func (h *HeadCommit) GetModified() []string { + if h == nil || h.Modified == nil { + return nil + } + return h.Modified +} + +// GetRemoved returns the Removed slice if it's non-nil, nil otherwise. +func (h *HeadCommit) GetRemoved() []string { + if h == nil || h.Removed == nil { + return nil + } + return h.Removed +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (h *HeadCommit) GetSHA() string { if h == nil || h.SHA == nil { @@ -11310,6 +16622,54 @@ func (h *HeadCommit) GetURL() string { return *h.URL } +// GetDomain returns the Domain field. +func (h *HecConfig) GetDomain() string { + if h == nil { + return "" + } + return h.Domain +} + +// GetEncryptedToken returns the EncryptedToken field. +func (h *HecConfig) GetEncryptedToken() string { + if h == nil { + return "" + } + return h.EncryptedToken +} + +// GetKeyID returns the KeyID field. +func (h *HecConfig) GetKeyID() string { + if h == nil { + return "" + } + return h.KeyID +} + +// GetPath returns the Path field. +func (h *HecConfig) GetPath() string { + if h == nil { + return "" + } + return h.Path +} + +// GetPort returns the Port field. +func (h *HecConfig) GetPort() uint16 { + if h == nil { + return 0 + } + return h.Port +} + +// GetSSLVerify returns the SSLVerify field. +func (h *HecConfig) GetSSLVerify() bool { + if h == nil { + return false + } + return h.SSLVerify +} + // GetActive returns the Active field if it's non-nil, zero value otherwise. func (h *Hook) GetActive() bool { if h == nil || h.Active == nil { @@ -11334,6 +16694,14 @@ func (h *Hook) GetCreatedAt() Timestamp { return *h.CreatedAt } +// GetEvents returns the Events slice if it's non-nil, nil otherwise. +func (h *Hook) GetEvents() []string { + if h == nil || h.Events == nil { + return nil + } + return h.Events +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (h *Hook) GetID() int64 { if h == nil || h.ID == nil { @@ -11446,12 +16814,12 @@ func (h *HookDelivery) GetDeliveredAt() Timestamp { return *h.DeliveredAt } -// GetDuration returns the Duration field. -func (h *HookDelivery) GetDuration() *float64 { - if h == nil { - return nil +// GetDuration returns the Duration field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetDuration() float64 { + if h == nil || h.Duration == nil { + return 0 } - return h.Duration + return *h.Duration } // GetEvent returns the Event field if it's non-nil, zero value otherwise. @@ -11654,6 +17022,14 @@ func (h *HostedRunner) GetPublicIPEnabled() bool { return *h.PublicIPEnabled } +// GetPublicIPs returns the PublicIPs slice if it's non-nil, nil otherwise. +func (h *HostedRunner) GetPublicIPs() []*HostedRunnerPublicIP { + if h == nil || h.PublicIPs == nil { + return nil + } + return h.PublicIPs +} + // GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. func (h *HostedRunner) GetRunnerGroupID() int64 { if h == nil || h.RunnerGroupID == nil { @@ -11670,6 +17046,158 @@ func (h *HostedRunner) GetStatus() string { return *h.Status } +// GetID returns the ID field. +func (h *HostedRunnerCustomImage) GetID() int64 { + if h == nil { + return 0 + } + return h.ID +} + +// GetLatestVersion returns the LatestVersion field. +func (h *HostedRunnerCustomImage) GetLatestVersion() string { + if h == nil { + return "" + } + return h.LatestVersion +} + +// GetName returns the Name field. +func (h *HostedRunnerCustomImage) GetName() string { + if h == nil { + return "" + } + return h.Name +} + +// GetPlatform returns the Platform field. +func (h *HostedRunnerCustomImage) GetPlatform() string { + if h == nil { + return "" + } + return h.Platform +} + +// GetSource returns the Source field. +func (h *HostedRunnerCustomImage) GetSource() string { + if h == nil { + return "" + } + return h.Source +} + +// GetState returns the State field. +func (h *HostedRunnerCustomImage) GetState() string { + if h == nil { + return "" + } + return h.State +} + +// GetTotalVersionsSize returns the TotalVersionsSize field. +func (h *HostedRunnerCustomImage) GetTotalVersionsSize() int { + if h == nil { + return 0 + } + return h.TotalVersionsSize +} + +// GetVersionsCount returns the VersionsCount field. +func (h *HostedRunnerCustomImage) GetVersionsCount() int { + if h == nil { + return 0 + } + return h.VersionsCount +} + +// GetImages returns the Images slice if it's non-nil, nil otherwise. +func (h *HostedRunnerCustomImages) GetImages() []*HostedRunnerCustomImage { + if h == nil || h.Images == nil { + return nil + } + return h.Images +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerCustomImages) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetCreatedOn returns the CreatedOn field. +func (h *HostedRunnerCustomImageVersion) GetCreatedOn() Timestamp { + if h == nil { + return Timestamp{} + } + return h.CreatedOn +} + +// GetSizeGB returns the SizeGB field. +func (h *HostedRunnerCustomImageVersion) GetSizeGB() int { + if h == nil { + return 0 + } + return h.SizeGB +} + +// GetState returns the State field. +func (h *HostedRunnerCustomImageVersion) GetState() string { + if h == nil { + return "" + } + return h.State +} + +// GetStateDetails returns the StateDetails field. +func (h *HostedRunnerCustomImageVersion) GetStateDetails() string { + if h == nil { + return "" + } + return h.StateDetails +} + +// GetVersion returns the Version field. +func (h *HostedRunnerCustomImageVersion) GetVersion() string { + if h == nil { + return "" + } + return h.Version +} + +// GetImageVersions returns the ImageVersions slice if it's non-nil, nil otherwise. +func (h *HostedRunnerCustomImageVersions) GetImageVersions() []*HostedRunnerCustomImageVersion { + if h == nil || h.ImageVersions == nil { + return nil + } + return h.ImageVersions +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerCustomImageVersions) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetID returns the ID field. +func (h *HostedRunnerImage) GetID() string { + if h == nil { + return "" + } + return h.ID +} + +// GetSource returns the Source field. +func (h *HostedRunnerImage) GetSource() string { + if h == nil { + return "" + } + return h.Source +} + // GetVersion returns the Version field if it's non-nil, zero value otherwise. func (h *HostedRunnerImage) GetVersion() string { if h == nil || h.Version == nil { @@ -11718,6 +17246,150 @@ func (h *HostedRunnerImageDetail) GetVersion() string { return *h.Version } +// GetImages returns the Images slice if it's non-nil, nil otherwise. +func (h *HostedRunnerImages) GetImages() []*HostedRunnerImageSpecs { + if h == nil || h.Images == nil { + return nil + } + return h.Images +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerImages) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetDisplayName returns the DisplayName field. +func (h *HostedRunnerImageSpecs) GetDisplayName() string { + if h == nil { + return "" + } + return h.DisplayName +} + +// GetID returns the ID field. +func (h *HostedRunnerImageSpecs) GetID() string { + if h == nil { + return "" + } + return h.ID +} + +// GetPlatform returns the Platform field. +func (h *HostedRunnerImageSpecs) GetPlatform() string { + if h == nil { + return "" + } + return h.Platform +} + +// GetSizeGB returns the SizeGB field. +func (h *HostedRunnerImageSpecs) GetSizeGB() int { + if h == nil { + return 0 + } + return h.SizeGB +} + +// GetSource returns the Source field. +func (h *HostedRunnerImageSpecs) GetSource() string { + if h == nil { + return "" + } + return h.Source +} + +// GetCPUCores returns the CPUCores field. +func (h *HostedRunnerMachineSpec) GetCPUCores() int { + if h == nil { + return 0 + } + return h.CPUCores +} + +// GetID returns the ID field. +func (h *HostedRunnerMachineSpec) GetID() string { + if h == nil { + return "" + } + return h.ID +} + +// GetMemoryGB returns the MemoryGB field. +func (h *HostedRunnerMachineSpec) GetMemoryGB() int { + if h == nil { + return 0 + } + return h.MemoryGB +} + +// GetStorageGB returns the StorageGB field. +func (h *HostedRunnerMachineSpec) GetStorageGB() int { + if h == nil { + return 0 + } + return h.StorageGB +} + +// GetMachineSpecs returns the MachineSpecs slice if it's non-nil, nil otherwise. +func (h *HostedRunnerMachineSpecs) GetMachineSpecs() []*HostedRunnerMachineSpec { + if h == nil || h.MachineSpecs == nil { + return nil + } + return h.MachineSpecs +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerMachineSpecs) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetPlatforms returns the Platforms slice if it's non-nil, nil otherwise. +func (h *HostedRunnerPlatforms) GetPlatforms() []string { + if h == nil || h.Platforms == nil { + return nil + } + return h.Platforms +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunnerPlatforms) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetEnabled returns the Enabled field. +func (h *HostedRunnerPublicIP) GetEnabled() bool { + if h == nil { + return false + } + return h.Enabled +} + +// GetLength returns the Length field. +func (h *HostedRunnerPublicIP) GetLength() int { + if h == nil { + return 0 + } + return h.Length +} + +// GetPrefix returns the Prefix field. +func (h *HostedRunnerPublicIP) GetPrefix() string { + if h == nil { + return "" + } + return h.Prefix +} + // GetPublicIPs returns the PublicIPs field. func (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage { if h == nil { @@ -11726,6 +17398,46 @@ func (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage { return h.PublicIPs } +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (h *HostedRunners) GetRunners() []*HostedRunner { + if h == nil || h.Runners == nil { + return nil + } + return h.Runners +} + +// GetTotalCount returns the TotalCount field. +func (h *HostedRunners) GetTotalCount() int { + if h == nil { + return 0 + } + return h.TotalCount +} + +// GetContexts returns the Contexts slice if it's non-nil, nil otherwise. +func (h *Hovercard) GetContexts() []*UserContext { + if h == nil || h.Contexts == nil { + return nil + } + return h.Contexts +} + +// GetSubjectID returns the SubjectID field. +func (h *HovercardOptions) GetSubjectID() string { + if h == nil { + return "" + } + return h.SubjectID +} + +// GetSubjectType returns the SubjectType field. +func (h *HovercardOptions) GetSubjectType() string { + if h == nil { + return "" + } + return h.SubjectType +} + // GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise. func (i *IDPGroup) GetGroupDescription() string { if i == nil || i.GroupDescription == nil { @@ -11750,6 +17462,14 @@ func (i *IDPGroup) GetGroupName() string { return *i.GroupName } +// GetGroups returns the Groups slice if it's non-nil, nil otherwise. +func (i *IDPGroupList) GetGroups() []*IDPGroup { + if i == nil || i.Groups == nil { + return nil + } + return i.Groups +} + // GetEnforcedRepositories returns the EnforcedRepositories field if it's non-nil, zero value otherwise. func (i *ImmutableReleasePolicy) GetEnforcedRepositories() string { if i == nil || i.EnforcedRepositories == nil { @@ -11758,6 +17478,14 @@ func (i *ImmutableReleasePolicy) GetEnforcedRepositories() string { return *i.EnforcedRepositories } +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (i *ImmutableReleasePolicy) GetSelectedRepositoryIDs() []int64 { + if i == nil || i.SelectedRepositoryIDs == nil { + return nil + } + return i.SelectedRepositoryIDs +} + // GetEnforcedRepositories returns the EnforcedRepositories field if it's non-nil, zero value otherwise. func (i *ImmutableReleaseSettings) GetEnforcedRepositories() string { if i == nil || i.EnforcedRepositories == nil { @@ -11774,6 +17502,14 @@ func (i *ImmutableReleaseSettings) GetSelectedRepositoriesURL() string { return *i.SelectedRepositoriesURL } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (i *ImpersonateUserOptions) GetScopes() []string { + if i == nil || i.Scopes == nil { + return nil + } + return i.Scopes +} + // GetAuthorsCount returns the AuthorsCount field if it's non-nil, zero value otherwise. func (i *Import) GetAuthorsCount() int { if i == nil || i.AuthorsCount == nil { @@ -11862,6 +17598,14 @@ func (i *Import) GetPercent() int { return *i.Percent } +// GetProjectChoices returns the ProjectChoices slice if it's non-nil, nil otherwise. +func (i *Import) GetProjectChoices() []*Import { + if i == nil || i.ProjectChoices == nil { + return nil + } + return i.ProjectChoices +} + // GetPushPercent returns the PushPercent field if it's non-nil, zero value otherwise. func (i *Import) GetPushPercent() int { if i == nil || i.PushPercent == nil { @@ -11950,6 +17694,22 @@ func (i *Import) GetVCSUsername() string { return *i.VCSUsername } +// GetLicense returns the License field. +func (i *InitialConfigOptions) GetLicense() string { + if i == nil { + return "" + } + return i.License +} + +// GetPassword returns the Password field. +func (i *InitialConfigOptions) GetPassword() string { + if i == nil { + return "" + } + return i.Password +} + // GetAccessibleRepositoriesURL returns the AccessibleRepositoriesURL field if it's non-nil, zero value otherwise. func (i *InstallableOrganization) GetAccessibleRepositoriesURL() string { if i == nil || i.AccessibleRepositoriesURL == nil { @@ -11958,6 +17718,46 @@ func (i *InstallableOrganization) GetAccessibleRepositoriesURL() string { return *i.AccessibleRepositoriesURL } +// GetID returns the ID field. +func (i *InstallableOrganization) GetID() int64 { + if i == nil { + return 0 + } + return i.ID +} + +// GetLogin returns the Login field. +func (i *InstallableOrganization) GetLogin() string { + if i == nil { + return "" + } + return i.Login +} + +// GetClientID returns the ClientID field. +func (i *InstallAppRequest) GetClientID() string { + if i == nil { + return "" + } + return i.ClientID +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallAppRequest) GetRepositories() []string { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + +// GetRepositorySelection returns the RepositorySelection field. +func (i *InstallAppRequest) GetRepositorySelection() string { + if i == nil { + return "" + } + return i.RepositorySelection +} + // GetAccessTokensURL returns the AccessTokensURL field if it's non-nil, zero value otherwise. func (i *Installation) GetAccessTokensURL() string { if i == nil || i.AccessTokensURL == nil { @@ -12006,6 +17806,14 @@ func (i *Installation) GetCreatedAt() Timestamp { return *i.CreatedAt } +// GetEvents returns the Events slice if it's non-nil, nil otherwise. +func (i *Installation) GetEvents() []string { + if i == nil || i.Events == nil { + return nil + } + return i.Events +} + // GetHasMultipleSingleFiles returns the HasMultipleSingleFiles field if it's non-nil, zero value otherwise. func (i *Installation) GetHasMultipleSingleFiles() bool { if i == nil || i.HasMultipleSingleFiles == nil { @@ -12070,6 +17878,14 @@ func (i *Installation) GetSingleFileName() string { return *i.SingleFileName } +// GetSingleFilePaths returns the SingleFilePaths slice if it's non-nil, nil otherwise. +func (i *Installation) GetSingleFilePaths() []string { + if i == nil || i.SingleFilePaths == nil { + return nil + } + return i.SingleFilePaths +} + // GetSuspendedAt returns the SuspendedAt field if it's non-nil, zero value otherwise. func (i *Installation) GetSuspendedAt() Timestamp { if i == nil || i.SuspendedAt == nil { @@ -12150,6 +17966,14 @@ func (i *InstallationEvent) GetOrg() *Organization { return i.Org } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallationEvent) GetRepositories() []*Repository { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + // GetRequester returns the Requester field. func (i *InstallationEvent) GetRequester() *User { if i == nil { @@ -12798,6 +18622,22 @@ func (i *InstallationRepositoriesEvent) GetOrg() *Organization { return i.Org } +// GetRepositoriesAdded returns the RepositoriesAdded slice if it's non-nil, nil otherwise. +func (i *InstallationRepositoriesEvent) GetRepositoriesAdded() []*Repository { + if i == nil || i.RepositoriesAdded == nil { + return nil + } + return i.RepositoriesAdded +} + +// GetRepositoriesRemoved returns the RepositoriesRemoved slice if it's non-nil, nil otherwise. +func (i *InstallationRepositoriesEvent) GetRepositoriesRemoved() []*Repository { + if i == nil || i.RepositoriesRemoved == nil { + return nil + } + return i.RepositoriesRemoved +} + // GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. func (i *InstallationRepositoriesEvent) GetRepositorySelection() string { if i == nil || i.RepositorySelection == nil { @@ -12950,6 +18790,14 @@ func (i *InstallationToken) GetPermissions() *InstallationPermissions { return i.Permissions } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallationToken) GetRepositories() []*Repository { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + // GetToken returns the Token field if it's non-nil, zero value otherwise. func (i *InstallationToken) GetToken() string { if i == nil || i.Token == nil { @@ -12966,6 +18814,22 @@ func (i *InstallationTokenListRepoOptions) GetPermissions() *InstallationPermiss return i.Permissions } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallationTokenListRepoOptions) GetRepositories() []string { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + +// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise. +func (i *InstallationTokenListRepoOptions) GetRepositoryIDs() []int64 { + if i == nil || i.RepositoryIDs == nil { + return nil + } + return i.RepositoryIDs +} + // GetPermissions returns the Permissions field. func (i *InstallationTokenOptions) GetPermissions() *InstallationPermissions { if i == nil { @@ -12974,6 +18838,22 @@ func (i *InstallationTokenOptions) GetPermissions() *InstallationPermissions { return i.Permissions } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (i *InstallationTokenOptions) GetRepositories() []string { + if i == nil || i.Repositories == nil { + return nil + } + return i.Repositories +} + +// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise. +func (i *InstallationTokenOptions) GetRepositoryIDs() []int64 { + if i == nil || i.RepositoryIDs == nil { + return nil + } + return i.RepositoryIDs +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (i *InteractionRestriction) GetExpiresAt() Timestamp { if i == nil || i.ExpiresAt == nil { @@ -13102,6 +18982,14 @@ func (i *Issue) GetAssignee() *User { return i.Assignee } +// GetAssignees returns the Assignees slice if it's non-nil, nil otherwise. +func (i *Issue) GetAssignees() []*User { + if i == nil || i.Assignees == nil { + return nil + } + return i.Assignees +} + // GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. func (i *Issue) GetAuthorAssociation() string { if i == nil || i.AuthorAssociation == nil { @@ -13190,6 +19078,22 @@ func (i *Issue) GetID() int64 { return *i.ID } +// GetIssueFieldValues returns the IssueFieldValues slice if it's non-nil, nil otherwise. +func (i *Issue) GetIssueFieldValues() []*IssueFieldValue { + if i == nil || i.IssueFieldValues == nil { + return nil + } + return i.IssueFieldValues +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (i *Issue) GetLabels() []*Label { + if i == nil || i.Labels == nil { + return nil + } + return i.Labels +} + // GetLabelsURL returns the LabelsURL field if it's non-nil, zero value otherwise. func (i *Issue) GetLabelsURL() string { if i == nil || i.LabelsURL == nil { @@ -13286,6 +19190,14 @@ func (i *Issue) GetStateReason() string { return *i.StateReason } +// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise. +func (i *Issue) GetTextMatches() []*TextMatch { + if i == nil || i.TextMatches == nil { + return nil + } + return i.TextMatches +} + // GetTitle returns the Title field if it's non-nil, zero value otherwise. func (i *Issue) GetTitle() string { if i == nil || i.Title == nil { @@ -13478,6 +19390,14 @@ func (i *IssueCommentEvent) GetSender() *User { return i.Sender } +// GetAction returns the Action field. +func (i *IssueEvent) GetAction() string { + if i == nil { + return "" + } + return i.Action +} + // GetActor returns the Actor field. func (i *IssueEvent) GetActor() *User { if i == nil { @@ -13630,6 +19550,70 @@ func (i *IssueEvent) GetURL() string { return *i.URL } +// GetDataType returns the DataType field. +func (i *IssueFieldValue) GetDataType() string { + if i == nil { + return "" + } + return i.DataType +} + +// GetIssueFieldID returns the IssueFieldID field. +func (i *IssueFieldValue) GetIssueFieldID() int64 { + if i == nil { + return 0 + } + return i.IssueFieldID +} + +// GetNodeID returns the NodeID field. +func (i *IssueFieldValue) GetNodeID() string { + if i == nil { + return "" + } + return i.NodeID +} + +// GetSingleSelectOption returns the SingleSelectOption field. +func (i *IssueFieldValue) GetSingleSelectOption() *IssueFieldValueSingleSelectOption { + if i == nil { + return nil + } + return i.SingleSelectOption +} + +// GetValue returns the Value field. +func (i *IssueFieldValue) GetValue() any { + if i == nil { + return nil + } + return i.Value +} + +// GetColor returns the Color field. +func (i *IssueFieldValueSingleSelectOption) GetColor() string { + if i == nil { + return "" + } + return i.Color +} + +// GetID returns the ID field. +func (i *IssueFieldValueSingleSelectOption) GetID() int64 { + if i == nil { + return 0 + } + return i.ID +} + +// GetName returns the Name field. +func (i *IssueFieldValueSingleSelectOption) GetName() string { + if i == nil { + return "" + } + return i.Name +} + // GetAssignee returns the Assignee field if it's non-nil, zero value otherwise. func (i *IssueImport) GetAssignee() string { if i == nil || i.Assignee == nil { @@ -13638,6 +19622,14 @@ func (i *IssueImport) GetAssignee() string { return *i.Assignee } +// GetBody returns the Body field. +func (i *IssueImport) GetBody() string { + if i == nil { + return "" + } + return i.Body +} + // GetClosed returns the Closed field if it's non-nil, zero value otherwise. func (i *IssueImport) GetClosed() bool { if i == nil || i.Closed == nil { @@ -13662,6 +19654,14 @@ func (i *IssueImport) GetCreatedAt() Timestamp { return *i.CreatedAt } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (i *IssueImport) GetLabels() []string { + if i == nil || i.Labels == nil { + return nil + } + return i.Labels +} + // GetMilestone returns the Milestone field if it's non-nil, zero value otherwise. func (i *IssueImport) GetMilestone() int { if i == nil || i.Milestone == nil { @@ -13670,6 +19670,14 @@ func (i *IssueImport) GetMilestone() int { return *i.Milestone } +// GetTitle returns the Title field. +func (i *IssueImport) GetTitle() string { + if i == nil { + return "" + } + return i.Title +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (i *IssueImport) GetUpdatedAt() Timestamp { if i == nil || i.UpdatedAt == nil { @@ -13718,6 +19726,22 @@ func (i *IssueImportError) GetValue() string { return *i.Value } +// GetComments returns the Comments slice if it's non-nil, nil otherwise. +func (i *IssueImportRequest) GetComments() []*Comment { + if i == nil || i.Comments == nil { + return nil + } + return i.Comments +} + +// GetIssueImport returns the IssueImport field. +func (i *IssueImportRequest) GetIssueImport() IssueImport { + if i == nil { + return IssueImport{} + } + return i.IssueImport +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (i *IssueImportResponse) GetCreatedAt() Timestamp { if i == nil || i.CreatedAt == nil { @@ -13734,6 +19758,14 @@ func (i *IssueImportResponse) GetDocumentationURL() string { return *i.DocumentationURL } +// GetErrors returns the Errors slice if it's non-nil, nil otherwise. +func (i *IssueImportResponse) GetErrors() []*IssueImportError { + if i == nil || i.Errors == nil { + return nil + } + return i.Errors +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (i *IssueImportResponse) GetID() int { if i == nil || i.ID == nil { @@ -13790,6 +19822,142 @@ func (i *IssueImportResponse) GetURL() string { return *i.URL } +// GetDirection returns the Direction field. +func (i *IssueListByOrgOptions) GetDirection() string { + if i == nil { + return "" + } + return i.Direction +} + +// GetFilter returns the Filter field. +func (i *IssueListByOrgOptions) GetFilter() string { + if i == nil { + return "" + } + return i.Filter +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (i *IssueListByOrgOptions) GetLabels() []string { + if i == nil || i.Labels == nil { + return nil + } + return i.Labels +} + +// GetSince returns the Since field. +func (i *IssueListByOrgOptions) GetSince() time.Time { + if i == nil { + return time.Time{} + } + return i.Since +} + +// GetSort returns the Sort field. +func (i *IssueListByOrgOptions) GetSort() string { + if i == nil { + return "" + } + return i.Sort +} + +// GetState returns the State field. +func (i *IssueListByOrgOptions) GetState() string { + if i == nil { + return "" + } + return i.State +} + +// GetType returns the Type field. +func (i *IssueListByOrgOptions) GetType() string { + if i == nil { + return "" + } + return i.Type +} + +// GetAssignee returns the Assignee field. +func (i *IssueListByRepoOptions) GetAssignee() string { + if i == nil { + return "" + } + return i.Assignee +} + +// GetCreator returns the Creator field. +func (i *IssueListByRepoOptions) GetCreator() string { + if i == nil { + return "" + } + return i.Creator +} + +// GetDirection returns the Direction field. +func (i *IssueListByRepoOptions) GetDirection() string { + if i == nil { + return "" + } + return i.Direction +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (i *IssueListByRepoOptions) GetLabels() []string { + if i == nil || i.Labels == nil { + return nil + } + return i.Labels +} + +// GetMentioned returns the Mentioned field. +func (i *IssueListByRepoOptions) GetMentioned() string { + if i == nil { + return "" + } + return i.Mentioned +} + +// GetMilestone returns the Milestone field. +func (i *IssueListByRepoOptions) GetMilestone() string { + if i == nil { + return "" + } + return i.Milestone +} + +// GetSince returns the Since field. +func (i *IssueListByRepoOptions) GetSince() time.Time { + if i == nil { + return time.Time{} + } + return i.Since +} + +// GetSort returns the Sort field. +func (i *IssueListByRepoOptions) GetSort() string { + if i == nil { + return "" + } + return i.Sort +} + +// GetState returns the State field. +func (i *IssueListByRepoOptions) GetState() string { + if i == nil { + return "" + } + return i.State +} + +// GetType returns the Type field. +func (i *IssueListByRepoOptions) GetType() string { + if i == nil { + return "" + } + return i.Type +} + // GetDirection returns the Direction field if it's non-nil, zero value otherwise. func (i *IssueListCommentsOptions) GetDirection() string { if i == nil || i.Direction == nil { @@ -13838,6 +20006,14 @@ func (i *IssueRequest) GetBody() string { return *i.Body } +// GetIssueFieldValues returns the IssueFieldValues slice if it's non-nil, nil otherwise. +func (i *IssueRequest) GetIssueFieldValues() []*IssueRequestFieldValue { + if i == nil || i.IssueFieldValues == nil { + return nil + } + return i.IssueFieldValues +} + // GetLabels returns the Labels field if it's non-nil, zero value otherwise. func (i *IssueRequest) GetLabels() []string { if i == nil || i.Labels == nil { @@ -13886,6 +20062,22 @@ func (i *IssueRequest) GetType() string { return *i.Type } +// GetFieldID returns the FieldID field. +func (i *IssueRequestFieldValue) GetFieldID() int64 { + if i == nil { + return 0 + } + return i.FieldID +} + +// GetValue returns the Value field. +func (i *IssueRequestFieldValue) GetValue() any { + if i == nil { + return nil + } + return i.Value +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (i *IssuesEvent) GetAction() string { if i == nil || i.Action == nil { @@ -13974,6 +20166,14 @@ func (i *IssuesSearchResult) GetIncompleteResults() bool { return *i.IncompleteResults } +// GetIssues returns the Issues slice if it's non-nil, nil otherwise. +func (i *IssuesSearchResult) GetIssues() []*Issue { + if i == nil || i.Issues == nil { + return nil + } + return i.Issues +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (i *IssuesSearchResult) GetTotal() int { if i == nil || i.Total == nil { @@ -14078,6 +20278,14 @@ func (j *JITRunnerConfig) GetRunner() *Runner { return j.Runner } +// GetJobs returns the Jobs slice if it's non-nil, nil otherwise. +func (j *Jobs) GetJobs() []*WorkflowJob { + if j == nil || j.Jobs == nil { + return nil + } + return j.Jobs +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (j *Jobs) GetTotalCount() int { if j == nil || j.TotalCount == nil { @@ -14310,12 +20518,12 @@ func (l *LabelResult) GetName() string { return *l.Name } -// GetScore returns the Score field. -func (l *LabelResult) GetScore() *float64 { - if l == nil { - return nil +// GetScore returns the Score field if it's non-nil, zero value otherwise. +func (l *LabelResult) GetScore() float64 { + if l == nil || l.Score == nil { + return 0 } - return l.Score + return *l.Score } // GetURL returns the URL field if it's non-nil, zero value otherwise. @@ -14334,6 +20542,14 @@ func (l *LabelsSearchResult) GetIncompleteResults() bool { return *l.IncompleteResults } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (l *LabelsSearchResult) GetLabels() []*LabelResult { + if l == nil || l.Labels == nil { + return nil + } + return l.Labels +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (l *LabelsSearchResult) GetTotal() int { if l == nil || l.Total == nil { @@ -14382,6 +20598,14 @@ func (l *LastLicenseSync) GetProperties() *LastLicenseSyncProperties { return l.Properties } +// GetType returns the Type field. +func (l *LastLicenseSync) GetType() string { + if l == nil { + return "" + } + return l.Type +} + // GetDate returns the Date field if it's non-nil, zero value otherwise. func (l *LastLicenseSyncProperties) GetDate() Timestamp { if l == nil || l.Date == nil { @@ -14390,6 +20614,22 @@ func (l *LastLicenseSyncProperties) GetDate() Timestamp { return *l.Date } +// GetError returns the Error field. +func (l *LastLicenseSyncProperties) GetError() string { + if l == nil { + return "" + } + return l.Error +} + +// GetStatus returns the Status field. +func (l *LastLicenseSyncProperties) GetStatus() string { + if l == nil { + return "" + } + return l.Status +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (l *License) GetBody() string { if l == nil || l.Body == nil { @@ -14702,6 +20942,86 @@ func (l *ListAlertsOptions) GetState() string { return *l.State } +// GetCollab returns the Collab field. +func (l *ListAllIssuesOptions) GetCollab() bool { + if l == nil { + return false + } + return l.Collab +} + +// GetDirection returns the Direction field. +func (l *ListAllIssuesOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetFilter returns the Filter field. +func (l *ListAllIssuesOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (l *ListAllIssuesOptions) GetLabels() []string { + if l == nil || l.Labels == nil { + return nil + } + return l.Labels +} + +// GetOrgs returns the Orgs field. +func (l *ListAllIssuesOptions) GetOrgs() bool { + if l == nil { + return false + } + return l.Orgs +} + +// GetOwned returns the Owned field. +func (l *ListAllIssuesOptions) GetOwned() bool { + if l == nil { + return false + } + return l.Owned +} + +// GetPulls returns the Pulls field. +func (l *ListAllIssuesOptions) GetPulls() bool { + if l == nil { + return false + } + return l.Pulls +} + +// GetSince returns the Since field. +func (l *ListAllIssuesOptions) GetSince() time.Time { + if l == nil { + return time.Time{} + } + return l.Since +} + +// GetSort returns the Sort field. +func (l *ListAllIssuesOptions) GetSort() string { + if l == nil { + return "" + } + return l.Sort +} + +// GetState returns the State field. +func (l *ListAllIssuesOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (l *ListArtifactsOptions) GetName() string { if l == nil || l.Name == nil { @@ -14742,6 +21062,14 @@ func (l *ListCheckRunsOptions) GetStatus() string { return *l.Status } +// GetCheckRuns returns the CheckRuns slice if it's non-nil, nil otherwise. +func (l *ListCheckRunsResults) GetCheckRuns() []*CheckRun { + if l == nil || l.CheckRuns == nil { + return nil + } + return l.CheckRuns +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (l *ListCheckRunsResults) GetTotal() int { if l == nil || l.Total == nil { @@ -14766,6 +21094,14 @@ func (l *ListCheckSuiteOptions) GetCheckName() string { return *l.CheckName } +// GetCheckSuites returns the CheckSuites slice if it's non-nil, nil otherwise. +func (l *ListCheckSuiteResults) GetCheckSuites() []*CheckSuite { + if l == nil || l.CheckSuites == nil { + return nil + } + return l.CheckSuites +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (l *ListCheckSuiteResults) GetTotal() int { if l == nil || l.Total == nil { @@ -14774,6 +21110,46 @@ func (l *ListCheckSuiteResults) GetTotal() int { return *l.Total } +// GetAfter returns the After field. +func (l *ListCodeSecurityConfigurationRepositoriesOptions) GetAfter() string { + if l == nil { + return "" + } + return l.After +} + +// GetBefore returns the Before field. +func (l *ListCodeSecurityConfigurationRepositoriesOptions) GetBefore() string { + if l == nil { + return "" + } + return l.Before +} + +// GetPerPage returns the PerPage field. +func (l *ListCodeSecurityConfigurationRepositoriesOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetStatus returns the Status field. +func (l *ListCodeSecurityConfigurationRepositoriesOptions) GetStatus() string { + if l == nil { + return "" + } + return l.Status +} + +// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise. +func (l *ListCodespaces) GetCodespaces() []*Codespace { + if l == nil || l.Codespaces == nil { + return nil + } + return l.Codespaces +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListCodespaces) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14782,6 +21158,54 @@ func (l *ListCodespaces) GetTotalCount() int { return *l.TotalCount } +// GetRepositoryID returns the RepositoryID field. +func (l *ListCodespacesOptions) GetRepositoryID() int64 { + if l == nil { + return 0 + } + return l.RepositoryID +} + +// GetAffiliation returns the Affiliation field. +func (l *ListCollaboratorsOptions) GetAffiliation() string { + if l == nil { + return "" + } + return l.Affiliation +} + +// GetPermission returns the Permission field. +func (l *ListCollaboratorsOptions) GetPermission() string { + if l == nil { + return "" + } + return l.Permission +} + +// GetAnon returns the Anon field. +func (l *ListContributorsOptions) GetAnon() string { + if l == nil { + return "" + } + return l.Anon +} + +// GetSeats returns the Seats slice if it's non-nil, nil otherwise. +func (l *ListCopilotSeatsResponse) GetSeats() []*CopilotSeatDetails { + if l == nil || l.Seats == nil { + return nil + } + return l.Seats +} + +// GetTotalSeats returns the TotalSeats field. +func (l *ListCopilotSeatsResponse) GetTotalSeats() int64 { + if l == nil { + return 0 + } + return l.TotalSeats +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (l *ListCostCenterOptions) GetState() string { if l == nil || l.State == nil { @@ -14790,6 +21214,70 @@ func (l *ListCostCenterOptions) GetState() string { return *l.State } +// GetAfter returns the After field. +func (l *ListCursorOptions) GetAfter() string { + if l == nil { + return "" + } + return l.After +} + +// GetBefore returns the Before field. +func (l *ListCursorOptions) GetBefore() string { + if l == nil { + return "" + } + return l.Before +} + +// GetCursor returns the Cursor field. +func (l *ListCursorOptions) GetCursor() string { + if l == nil { + return "" + } + return l.Cursor +} + +// GetFirst returns the First field. +func (l *ListCursorOptions) GetFirst() int { + if l == nil { + return 0 + } + return l.First +} + +// GetLast returns the Last field. +func (l *ListCursorOptions) GetLast() int { + if l == nil { + return 0 + } + return l.Last +} + +// GetPage returns the Page field. +func (l *ListCursorOptions) GetPage() string { + if l == nil { + return "" + } + return l.Page +} + +// GetPerPage returns the PerPage field. +func (l *ListCursorOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetAvailableIntegrations returns the AvailableIntegrations slice if it's non-nil, nil otherwise. +func (l *ListCustomDeploymentRuleIntegrationsResponse) GetAvailableIntegrations() []*CustomDeploymentProtectionRuleApp { + if l == nil || l.AvailableIntegrations == nil { + return nil + } + return l.AvailableIntegrations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListCustomDeploymentRuleIntegrationsResponse) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14798,6 +21286,22 @@ func (l *ListCustomDeploymentRuleIntegrationsResponse) GetTotalCount() int { return *l.TotalCount } +// GetRepositoryQuery returns the RepositoryQuery field. +func (l *ListCustomPropertyValuesOptions) GetRepositoryQuery() string { + if l == nil { + return "" + } + return l.RepositoryQuery +} + +// GetProtectionRules returns the ProtectionRules slice if it's non-nil, nil otherwise. +func (l *ListDeploymentProtectionRuleResponse) GetProtectionRules() []*CustomDeploymentProtectionRule { + if l == nil || l.ProtectionRules == nil { + return nil + } + return l.ProtectionRules +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListDeploymentProtectionRuleResponse) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14806,6 +21310,38 @@ func (l *ListDeploymentProtectionRuleResponse) GetTotalCount() int { return *l.TotalCount } +// GetAfter returns the After field. +func (l *ListEnterpriseCodeSecurityConfigurationOptions) GetAfter() string { + if l == nil { + return "" + } + return l.After +} + +// GetBefore returns the Before field. +func (l *ListEnterpriseCodeSecurityConfigurationOptions) GetBefore() string { + if l == nil { + return "" + } + return l.Before +} + +// GetPerPage returns the PerPage field. +func (l *ListEnterpriseCodeSecurityConfigurationOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetVisibleToOrganization returns the VisibleToOrganization field. +func (l *ListEnterpriseRunnerGroupOptions) GetVisibleToOrganization() string { + if l == nil { + return "" + } + return l.VisibleToOrganization +} + // GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. func (l *ListExternalGroupsOptions) GetDisplayName() string { if l == nil || l.DisplayName == nil { @@ -14814,6 +21350,70 @@ func (l *ListExternalGroupsOptions) GetDisplayName() string { return *l.DisplayName } +// GetDirection returns the Direction field. +func (l *ListFineGrainedPATOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetLastUsedAfter returns the LastUsedAfter field. +func (l *ListFineGrainedPATOptions) GetLastUsedAfter() string { + if l == nil { + return "" + } + return l.LastUsedAfter +} + +// GetLastUsedBefore returns the LastUsedBefore field. +func (l *ListFineGrainedPATOptions) GetLastUsedBefore() string { + if l == nil { + return "" + } + return l.LastUsedBefore +} + +// GetOwner returns the Owner slice if it's non-nil, nil otherwise. +func (l *ListFineGrainedPATOptions) GetOwner() []string { + if l == nil || l.Owner == nil { + return nil + } + return l.Owner +} + +// GetPermission returns the Permission field. +func (l *ListFineGrainedPATOptions) GetPermission() string { + if l == nil { + return "" + } + return l.Permission +} + +// GetRepository returns the Repository field. +func (l *ListFineGrainedPATOptions) GetRepository() string { + if l == nil { + return "" + } + return l.Repository +} + +// GetSort returns the Sort field. +func (l *ListFineGrainedPATOptions) GetSort() string { + if l == nil { + return "" + } + return l.Sort +} + +// GetTokenID returns the TokenID slice if it's non-nil, nil otherwise. +func (l *ListFineGrainedPATOptions) GetTokenID() []int64 { + if l == nil || l.TokenID == nil { + return nil + } + return l.TokenID +} + // GetAffects returns the Affects field if it's non-nil, zero value otherwise. func (l *ListGlobalSecurityAdvisoriesOptions) GetAffects() string { if l == nil || l.Affects == nil { @@ -14830,6 +21430,14 @@ func (l *ListGlobalSecurityAdvisoriesOptions) GetCVEID() string { return *l.CVEID } +// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetCWEs() []string { + if l == nil || l.CWEs == nil { + return nil + } + return l.CWEs +} + // GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise. func (l *ListGlobalSecurityAdvisoriesOptions) GetEcosystem() string { if l == nil || l.Ecosystem == nil { @@ -14894,6 +21502,14 @@ func (l *ListGlobalSecurityAdvisoriesOptions) GetUpdated() string { return *l.Updated } +// GetQuery returns the Query field. +func (l *ListIDPGroupsOptions) GetQuery() string { + if l == nil { + return "" + } + return l.Query +} + // GetFeatured returns the Featured field if it's non-nil, zero value otherwise. func (l *ListLicensesOptions) GetFeatured() bool { if l == nil || l.Featured == nil { @@ -14902,6 +21518,70 @@ func (l *ListLicensesOptions) GetFeatured() bool { return *l.Featured } +// GetFilter returns the Filter field. +func (l *ListMembersOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetPublicOnly returns the PublicOnly field. +func (l *ListMembersOptions) GetPublicOnly() bool { + if l == nil { + return false + } + return l.PublicOnly +} + +// GetRole returns the Role field. +func (l *ListMembersOptions) GetRole() string { + if l == nil { + return "" + } + return l.Role +} + +// GetPage returns the Page field. +func (l *ListOptions) GetPage() int { + if l == nil { + return 0 + } + return l.Page +} + +// GetPerPage returns the PerPage field. +func (l *ListOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (l *ListOrganizationCopilotCodingAgentRepositoriesResponse) GetRepositories() []*Repository { + if l == nil || l.Repositories == nil { + return nil + } + return l.Repositories +} + +// GetTotalCount returns the TotalCount field. +func (l *ListOrganizationCopilotCodingAgentRepositoriesResponse) GetTotalCount() int { + if l == nil { + return 0 + } + return l.TotalCount +} + +// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise. +func (l *ListOrganizations) GetOrganizations() []*Organization { + if l == nil || l.Organizations == nil { + return nil + } + return l.Organizations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListOrganizations) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14910,6 +21590,110 @@ func (l *ListOrganizations) GetTotalCount() int { return *l.TotalCount } +// GetAfter returns the After field. +func (l *ListOrgCodeSecurityConfigurationOptions) GetAfter() string { + if l == nil { + return "" + } + return l.After +} + +// GetBefore returns the Before field. +func (l *ListOrgCodeSecurityConfigurationOptions) GetBefore() string { + if l == nil { + return "" + } + return l.Before +} + +// GetPerPage returns the PerPage field. +func (l *ListOrgCodeSecurityConfigurationOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetTargetType returns the TargetType field. +func (l *ListOrgCodeSecurityConfigurationOptions) GetTargetType() string { + if l == nil { + return "" + } + return l.TargetType +} + +// GetState returns the State field. +func (l *ListOrgMembershipsOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + +// GetVisibleToRepository returns the VisibleToRepository field. +func (l *ListOrgRunnerGroupOptions) GetVisibleToRepository() string { + if l == nil { + return "" + } + return l.VisibleToRepository +} + +// GetFilter returns the Filter field. +func (l *ListOutsideCollaboratorsOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetState returns the State field. +func (l *ListPackageVersionsOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + +// GetFields returns the Fields slice if it's non-nil, nil otherwise. +func (l *ListProjectItemsOptions) GetFields() []int64 { + if l == nil || l.Fields == nil { + return nil + } + return l.Fields +} + +// GetQuery returns the Query field. +func (l *ListProjectsOptions) GetQuery() string { + if l == nil { + return "" + } + return l.Query +} + +// GetAfter returns the After field. +func (l *ListProjectsPaginationOptions) GetAfter() string { + if l == nil { + return "" + } + return l.After +} + +// GetBefore returns the Before field. +func (l *ListProjectsPaginationOptions) GetBefore() string { + if l == nil { + return "" + } + return l.Before +} + +// GetPerPage returns the PerPage field. +func (l *ListProjectsPaginationOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + // GetCount returns the Count field if it's non-nil, zero value otherwise. func (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetCount() int { if l == nil || l.Count == nil { @@ -14966,6 +21750,14 @@ func (l *ListProvisionedSCIMUsersEnterpriseOptions) GetStartIndex() int { return *l.StartIndex } +// GetContent returns the Content field. +func (l *ListReactionOptions) GetContent() string { + if l == nil { + return "" + } + return l.Content +} + // GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. func (l *ListRepoMachineTypesOptions) GetClientIP() string { if l == nil || l.ClientIP == nil { @@ -14990,6 +21782,14 @@ func (l *ListRepoMachineTypesOptions) GetRef() string { return *l.Ref } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (l *ListRepositories) GetRepositories() []*Repository { + if l == nil || l.Repositories == nil { + return nil + } + return l.Repositories +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListRepositories) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -14998,6 +21798,94 @@ func (l *ListRepositories) GetTotalCount() int { return *l.TotalCount } +// GetActivityType returns the ActivityType field. +func (l *ListRepositoryActivityOptions) GetActivityType() string { + if l == nil { + return "" + } + return l.ActivityType +} + +// GetActor returns the Actor field. +func (l *ListRepositoryActivityOptions) GetActor() string { + if l == nil { + return "" + } + return l.Actor +} + +// GetAfter returns the After field. +func (l *ListRepositoryActivityOptions) GetAfter() string { + if l == nil { + return "" + } + return l.After +} + +// GetBefore returns the Before field. +func (l *ListRepositoryActivityOptions) GetBefore() string { + if l == nil { + return "" + } + return l.Before +} + +// GetDirection returns the Direction field. +func (l *ListRepositoryActivityOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetPerPage returns the PerPage field. +func (l *ListRepositoryActivityOptions) GetPerPage() int { + if l == nil { + return 0 + } + return l.PerPage +} + +// GetRef returns the Ref field. +func (l *ListRepositoryActivityOptions) GetRef() string { + if l == nil { + return "" + } + return l.Ref +} + +// GetTimePeriod returns the TimePeriod field. +func (l *ListRepositoryActivityOptions) GetTimePeriod() string { + if l == nil { + return "" + } + return l.TimePeriod +} + +// GetDirection returns the Direction field. +func (l *ListRepositorySecurityAdvisoriesOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetSort returns the Sort field. +func (l *ListRepositorySecurityAdvisoriesOptions) GetSort() string { + if l == nil { + return "" + } + return l.Sort +} + +// GetState returns the State field. +func (l *ListRepositorySecurityAdvisoriesOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (l *ListRunnersOptions) GetName() string { if l == nil || l.Name == nil { @@ -15030,6 +21918,126 @@ func (l *ListSCIMProvisionedIdentitiesOptions) GetStartIndex() int { return *l.StartIndex } +// GetDirection returns the Direction field. +func (l *ListUserIssuesOptions) GetDirection() string { + if l == nil { + return "" + } + return l.Direction +} + +// GetFilter returns the Filter field. +func (l *ListUserIssuesOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (l *ListUserIssuesOptions) GetLabels() []string { + if l == nil || l.Labels == nil { + return nil + } + return l.Labels +} + +// GetSince returns the Since field. +func (l *ListUserIssuesOptions) GetSince() time.Time { + if l == nil { + return time.Time{} + } + return l.Since +} + +// GetSort returns the Sort field. +func (l *ListUserIssuesOptions) GetSort() string { + if l == nil { + return "" + } + return l.Sort +} + +// GetState returns the State field. +func (l *ListUserIssuesOptions) GetState() string { + if l == nil { + return "" + } + return l.State +} + +// GetFilter returns the Filter field. +func (l *ListWorkflowJobsOptions) GetFilter() string { + if l == nil { + return "" + } + return l.Filter +} + +// GetActor returns the Actor field. +func (l *ListWorkflowRunsOptions) GetActor() string { + if l == nil { + return "" + } + return l.Actor +} + +// GetBranch returns the Branch field. +func (l *ListWorkflowRunsOptions) GetBranch() string { + if l == nil { + return "" + } + return l.Branch +} + +// GetCheckSuiteID returns the CheckSuiteID field. +func (l *ListWorkflowRunsOptions) GetCheckSuiteID() int64 { + if l == nil { + return 0 + } + return l.CheckSuiteID +} + +// GetCreated returns the Created field. +func (l *ListWorkflowRunsOptions) GetCreated() string { + if l == nil { + return "" + } + return l.Created +} + +// GetEvent returns the Event field. +func (l *ListWorkflowRunsOptions) GetEvent() string { + if l == nil { + return "" + } + return l.Event +} + +// GetExcludePullRequests returns the ExcludePullRequests field. +func (l *ListWorkflowRunsOptions) GetExcludePullRequests() bool { + if l == nil { + return false + } + return l.ExcludePullRequests +} + +// GetHeadSHA returns the HeadSHA field. +func (l *ListWorkflowRunsOptions) GetHeadSHA() string { + if l == nil { + return "" + } + return l.HeadSHA +} + +// GetStatus returns the Status field. +func (l *ListWorkflowRunsOptions) GetStatus() string { + if l == nil { + return "" + } + return l.Status +} + // GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise. func (l *Location) GetEndColumn() int { if l == nil || l.EndColumn == nil { @@ -15078,6 +22086,14 @@ func (l *LockBranch) GetEnabled() bool { return *l.Enabled } +// GetLockReason returns the LockReason field. +func (l *LockIssueOptions) GetLockReason() string { + if l == nil { + return "" + } + return l.LockReason +} + // GetHostname returns the Hostname field if it's non-nil, zero value otherwise. func (m *MaintenanceOperationStatus) GetHostname() string { if m == nil || m.Hostname == nil { @@ -15102,6 +22118,22 @@ func (m *MaintenanceOperationStatus) GetUUID() string { return *m.UUID } +// GetEnabled returns the Enabled field. +func (m *MaintenanceOptions) GetEnabled() bool { + if m == nil { + return false + } + return m.Enabled +} + +// GetIPExceptionList returns the IPExceptionList slice if it's non-nil, nil otherwise. +func (m *MaintenanceOptions) GetIPExceptionList() []string { + if m == nil || m.IPExceptionList == nil { + return nil + } + return m.IPExceptionList +} + // GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise. func (m *MaintenanceOptions) GetMaintenanceModeMessage() string { if m == nil || m.MaintenanceModeMessage == nil { @@ -15134,6 +22166,14 @@ func (m *MaintenanceStatus) GetCanUnsetMaintenance() bool { return *m.CanUnsetMaintenance } +// GetConnectionServices returns the ConnectionServices slice if it's non-nil, nil otherwise. +func (m *MaintenanceStatus) GetConnectionServices() []*ConnectionServiceItem { + if m == nil || m.ConnectionServices == nil { + return nil + } + return m.ConnectionServices +} + // GetHostname returns the Hostname field if it's non-nil, zero value otherwise. func (m *MaintenanceStatus) GetHostname() string { if m == nil || m.Hostname == nil { @@ -15142,6 +22182,14 @@ func (m *MaintenanceStatus) GetHostname() string { return *m.Hostname } +// GetIPExceptionList returns the IPExceptionList slice if it's non-nil, nil otherwise. +func (m *MaintenanceStatus) GetIPExceptionList() []string { + if m == nil || m.IPExceptionList == nil { + return nil + } + return m.IPExceptionList +} + // GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise. func (m *MaintenanceStatus) GetMaintenanceModeMessage() string { if m == nil || m.MaintenanceModeMessage == nil { @@ -15174,6 +22222,22 @@ func (m *MaintenanceStatus) GetUUID() string { return *m.UUID } +// GetContext returns the Context field. +func (m *MarkdownOptions) GetContext() string { + if m == nil { + return "" + } + return m.Context +} + +// GetMode returns the Mode field. +func (m *MarkdownOptions) GetMode() string { + if m == nil { + return "" + } + return m.Mode +} + // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -15542,6 +22606,14 @@ func (m *MarketplacePurchaseEvent) GetSender() *User { return m.Sender } +// GetIndices returns the Indices slice if it's non-nil, nil otherwise. +func (m *Match) GetIndices() []int { + if m == nil || m.Indices == nil { + return nil + } + return m.Indices +} + // GetText returns the Text field if it's non-nil, zero value otherwise. func (m *Match) GetText() string { if m == nil || m.Text == nil { @@ -15550,6 +22622,38 @@ func (m *Match) GetText() string { return *m.Text } +// GetParameters returns the Parameters field. +func (m *MaxFilePathLengthBranchRule) GetParameters() MaxFilePathLengthRuleParameters { + if m == nil { + return MaxFilePathLengthRuleParameters{} + } + return m.Parameters +} + +// GetMaxFilePathLength returns the MaxFilePathLength field. +func (m *MaxFilePathLengthRuleParameters) GetMaxFilePathLength() int { + if m == nil { + return 0 + } + return m.MaxFilePathLength +} + +// GetParameters returns the Parameters field. +func (m *MaxFileSizeBranchRule) GetParameters() MaxFileSizeRuleParameters { + if m == nil { + return MaxFileSizeRuleParameters{} + } + return m.Parameters +} + +// GetMaxFileSize returns the MaxFileSize field. +func (m *MaxFileSizeRuleParameters) GetMaxFileSize() int64 { + if m == nil { + return 0 + } + return m.MaxFileSize +} + // GetPermission returns the Permission field. func (m *MemberChanges) GetPermission() *MemberChangesPermission { if m == nil { @@ -15854,6 +22958,70 @@ func (m *MergeGroupEvent) GetSender() *User { return m.Sender } +// GetParameters returns the Parameters field. +func (m *MergeQueueBranchRule) GetParameters() MergeQueueRuleParameters { + if m == nil { + return MergeQueueRuleParameters{} + } + return m.Parameters +} + +// GetCheckResponseTimeoutMinutes returns the CheckResponseTimeoutMinutes field. +func (m *MergeQueueRuleParameters) GetCheckResponseTimeoutMinutes() int { + if m == nil { + return 0 + } + return m.CheckResponseTimeoutMinutes +} + +// GetGroupingStrategy returns the GroupingStrategy field. +func (m *MergeQueueRuleParameters) GetGroupingStrategy() MergeGroupingStrategy { + if m == nil { + return "" + } + return m.GroupingStrategy +} + +// GetMaxEntriesToBuild returns the MaxEntriesToBuild field. +func (m *MergeQueueRuleParameters) GetMaxEntriesToBuild() int { + if m == nil { + return 0 + } + return m.MaxEntriesToBuild +} + +// GetMaxEntriesToMerge returns the MaxEntriesToMerge field. +func (m *MergeQueueRuleParameters) GetMaxEntriesToMerge() int { + if m == nil { + return 0 + } + return m.MaxEntriesToMerge +} + +// GetMergeMethod returns the MergeMethod field. +func (m *MergeQueueRuleParameters) GetMergeMethod() MergeQueueMergeMethod { + if m == nil { + return "" + } + return m.MergeMethod +} + +// GetMinEntriesToMerge returns the MinEntriesToMerge field. +func (m *MergeQueueRuleParameters) GetMinEntriesToMerge() int { + if m == nil { + return 0 + } + return m.MinEntriesToMerge +} + +// GetMinEntriesToMergeWaitMinutes returns the MinEntriesToMergeWaitMinutes field. +func (m *MergeQueueRuleParameters) GetMinEntriesToMergeWaitMinutes() int { + if m == nil { + return 0 + } + return m.MinEntriesToMergeWaitMinutes +} + // GetText returns the Text field if it's non-nil, zero value otherwise. func (m *Message) GetText() string { if m == nil || m.Text == nil { @@ -16006,6 +23174,14 @@ func (m *Migration) GetLockRepositories() bool { return *m.LockRepositories } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (m *Migration) GetRepositories() []*Repository { + if m == nil || m.Repositories == nil { + return nil + } + return m.Repositories +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (m *Migration) GetState() string { if m == nil || m.State == nil { @@ -16030,6 +23206,38 @@ func (m *Migration) GetURL() string { return *m.URL } +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (m *MigrationOptions) GetExclude() []string { + if m == nil || m.Exclude == nil { + return nil + } + return m.Exclude +} + +// GetExcludeAttachments returns the ExcludeAttachments field. +func (m *MigrationOptions) GetExcludeAttachments() bool { + if m == nil { + return false + } + return m.ExcludeAttachments +} + +// GetExcludeReleases returns the ExcludeReleases field. +func (m *MigrationOptions) GetExcludeReleases() bool { + if m == nil { + return false + } + return m.ExcludeReleases +} + +// GetLockRepositories returns the LockRepositories field. +func (m *MigrationOptions) GetLockRepositories() bool { + if m == nil { + return false + } + return m.LockRepositories +} + // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. func (m *Milestone) GetClosedAt() Timestamp { if m == nil || m.ClosedAt == nil { @@ -16214,6 +23422,30 @@ func (m *MilestoneEvent) GetSender() *User { return m.Sender } +// GetDirection returns the Direction field. +func (m *MilestoneListOptions) GetDirection() string { + if m == nil { + return "" + } + return m.Direction +} + +// GetSort returns the Sort field. +func (m *MilestoneListOptions) GetSort() string { + if m == nil { + return "" + } + return m.Sort +} + +// GetState returns the State field. +func (m *MilestoneListOptions) GetState() string { + if m == nil { + return "" + } + return m.State +} + // GetClosedMilestones returns the ClosedMilestones field if it's non-nil, zero value otherwise. func (m *MilestoneStats) GetClosedMilestones() int { if m == nil || m.ClosedMilestones == nil { @@ -16254,6 +23486,14 @@ func (m *MostRecentInstance) GetCategory() string { return *m.Category } +// GetClassifications returns the Classifications slice if it's non-nil, nil otherwise. +func (m *MostRecentInstance) GetClassifications() []string { + if m == nil || m.Classifications == nil { + return nil + } + return m.Classifications +} + // GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. func (m *MostRecentInstance) GetCommitSHA() string { if m == nil || m.CommitSHA == nil { @@ -16342,6 +23582,14 @@ func (n *NetworkConfiguration) GetName() string { return *n.Name } +// GetNetworkSettingsIDs returns the NetworkSettingsIDs slice if it's non-nil, nil otherwise. +func (n *NetworkConfiguration) GetNetworkSettingsIDs() []string { + if n == nil || n.NetworkSettingsIDs == nil { + return nil + } + return n.NetworkSettingsIDs +} + // GetComputeService returns the ComputeService field. func (n *NetworkConfigurationRequest) GetComputeService() *ComputeService { if n == nil { @@ -16358,6 +23606,22 @@ func (n *NetworkConfigurationRequest) GetName() string { return *n.Name } +// GetNetworkSettingsIDs returns the NetworkSettingsIDs slice if it's non-nil, nil otherwise. +func (n *NetworkConfigurationRequest) GetNetworkSettingsIDs() []string { + if n == nil || n.NetworkSettingsIDs == nil { + return nil + } + return n.NetworkSettingsIDs +} + +// GetNetworkConfigurations returns the NetworkConfigurations slice if it's non-nil, nil otherwise. +func (n *NetworkConfigurations) GetNetworkConfigurations() []*NetworkConfiguration { + if n == nil || n.NetworkConfigurations == nil { + return nil + } + return n.NetworkConfigurations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (n *NetworkConfigurations) GetTotalCount() int64 { if n == nil || n.TotalCount == nil { @@ -16486,6 +23750,22 @@ func (n *NewTeam) GetLDAPDN() string { return *n.LDAPDN } +// GetMaintainers returns the Maintainers slice if it's non-nil, nil otherwise. +func (n *NewTeam) GetMaintainers() []string { + if n == nil || n.Maintainers == nil { + return nil + } + return n.Maintainers +} + +// GetName returns the Name field. +func (n *NewTeam) GetName() string { + if n == nil { + return "" + } + return n.Name +} + // GetNotificationSetting returns the NotificationSetting field if it's non-nil, zero value otherwise. func (n *NewTeam) GetNotificationSetting() string { if n == nil || n.NotificationSetting == nil { @@ -16518,6 +23798,22 @@ func (n *NewTeam) GetPrivacy() string { return *n.Privacy } +// GetRepoNames returns the RepoNames slice if it's non-nil, nil otherwise. +func (n *NewTeam) GetRepoNames() []string { + if n == nil || n.RepoNames == nil { + return nil + } + return n.RepoNames +} + +// GetClusterRoles returns the ClusterRoles slice if it's non-nil, nil otherwise. +func (n *NodeDetails) GetClusterRoles() []string { + if n == nil || n.ClusterRoles == nil { + return nil + } + return n.ClusterRoles +} + // GetHostname returns the Hostname field if it's non-nil, zero value otherwise. func (n *NodeDetails) GetHostname() string { if n == nil || n.Hostname == nil { @@ -16534,6 +23830,14 @@ func (n *NodeDetails) GetUUID() string { return *n.UUID } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (n *NodeMetadataStatus) GetNodes() []*NodeDetails { + if n == nil || n.Nodes == nil { + return nil + } + return n.Nodes +} + // GetTopology returns the Topology field if it's non-nil, zero value otherwise. func (n *NodeMetadataStatus) GetTopology() string { if n == nil || n.Topology == nil { @@ -16638,6 +23942,38 @@ func (n *Notification) GetURL() string { return *n.URL } +// GetAll returns the All field. +func (n *NotificationListOptions) GetAll() bool { + if n == nil { + return false + } + return n.All +} + +// GetBefore returns the Before field. +func (n *NotificationListOptions) GetBefore() time.Time { + if n == nil { + return time.Time{} + } + return n.Before +} + +// GetParticipating returns the Participating field. +func (n *NotificationListOptions) GetParticipating() bool { + if n == nil { + return false + } + return n.Participating +} + +// GetSince returns the Since field. +func (n *NotificationListOptions) GetSince() time.Time { + if n == nil { + return time.Time{} + } + return n.Since +} + // GetLatestCommentURL returns the LatestCommentURL field if it's non-nil, zero value otherwise. func (n *NotificationSubject) GetLatestCommentURL() string { if n == nil || n.LatestCommentURL == nil { @@ -16694,6 +24030,14 @@ func (o *OAuthAPP) GetURL() string { return *o.URL } +// GetIncludeClaimKeys returns the IncludeClaimKeys slice if it's non-nil, nil otherwise. +func (o *OIDCSubjectClaimCustomTemplate) GetIncludeClaimKeys() []string { + if o == nil || o.IncludeClaimKeys == nil { + return nil + } + return o.IncludeClaimKeys +} + // GetUseDefault returns the UseDefault field if it's non-nil, zero value otherwise. func (o *OIDCSubjectClaimCustomTemplate) GetUseDefault() bool { if o == nil || o.UseDefault == nil { @@ -16710,6 +24054,14 @@ func (o *Organization) GetAdvancedSecurityEnabledForNewRepos() bool { return *o.AdvancedSecurityEnabledForNewRepos } +// GetArchivedAt returns the ArchivedAt field if it's non-nil, zero value otherwise. +func (o *Organization) GetArchivedAt() Timestamp { + if o == nil || o.ArchivedAt == nil { + return Timestamp{} + } + return *o.ArchivedAt +} + // GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. func (o *Organization) GetAvatarURL() string { if o == nil || o.AvatarURL == nil { @@ -16806,6 +24158,14 @@ func (o *Organization) GetDependencyGraphEnabledForNewRepos() bool { return *o.DependencyGraphEnabledForNewRepos } +// GetDeployKeysEnabledForRepositories returns the DeployKeysEnabledForRepositories field if it's non-nil, zero value otherwise. +func (o *Organization) GetDeployKeysEnabledForRepositories() bool { + if o == nil || o.DeployKeysEnabledForRepositories == nil { + return false + } + return *o.DeployKeysEnabledForRepositories +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (o *Organization) GetDescription() string { if o == nil || o.Description == nil { @@ -17150,6 +24510,22 @@ func (o *Organization) GetSecretScanningEnabledForNewRepos() bool { return *o.SecretScanningEnabledForNewRepos } +// GetSecretScanningPushProtectionCustomLink returns the SecretScanningPushProtectionCustomLink field if it's non-nil, zero value otherwise. +func (o *Organization) GetSecretScanningPushProtectionCustomLink() string { + if o == nil || o.SecretScanningPushProtectionCustomLink == nil { + return "" + } + return *o.SecretScanningPushProtectionCustomLink +} + +// GetSecretScanningPushProtectionCustomLinkEnabled returns the SecretScanningPushProtectionCustomLinkEnabled field if it's non-nil, zero value otherwise. +func (o *Organization) GetSecretScanningPushProtectionCustomLinkEnabled() bool { + if o == nil || o.SecretScanningPushProtectionCustomLinkEnabled == nil { + return false + } + return *o.SecretScanningPushProtectionCustomLinkEnabled +} + // GetSecretScanningPushProtectionEnabledForNewRepos returns the SecretScanningPushProtectionEnabledForNewRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetSecretScanningPushProtectionEnabledForNewRepos() bool { if o == nil || o.SecretScanningPushProtectionEnabledForNewRepos == nil { @@ -17222,6 +24598,22 @@ func (o *Organization) GetWebCommitSignoffRequired() bool { return *o.WebCommitSignoffRequired } +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (o *OrganizationCustomPropertyValues) GetProperties() []*CustomPropertyValue { + if o == nil || o.Properties == nil { + return nil + } + return o.Properties +} + +// GetCustomRepoRoles returns the CustomRepoRoles slice if it's non-nil, nil otherwise. +func (o *OrganizationCustomRepoRoles) GetCustomRepoRoles() []*CustomRepoRoles { + if o == nil || o.CustomRepoRoles == nil { + return nil + } + return o.CustomRepoRoles +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationCustomRepoRoles) GetTotalCount() int { if o == nil || o.TotalCount == nil { @@ -17230,6 +24622,14 @@ func (o *OrganizationCustomRepoRoles) GetTotalCount() int { return *o.TotalCount } +// GetCustomRepoRoles returns the CustomRepoRoles slice if it's non-nil, nil otherwise. +func (o *OrganizationCustomRoles) GetCustomRepoRoles() []*CustomOrgRole { + if o == nil || o.CustomRepoRoles == nil { + return nil + } + return o.CustomRepoRoles +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationCustomRoles) GetTotalCount() int { if o == nil || o.TotalCount == nil { @@ -17286,6 +24686,30 @@ func (o *OrganizationEvent) GetSender() *User { return o.Sender } +// GetDescription returns the Description field. +func (o *OrganizationFineGrainedPermission) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +// GetName returns the Name field. +func (o *OrganizationFineGrainedPermission) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +// GetInstallations returns the Installations slice if it's non-nil, nil otherwise. +func (o *OrganizationInstallations) GetInstallations() []*Installation { + if o == nil || o.Installations == nil { + return nil + } + return o.Installations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationInstallations) GetTotalCount() int { if o == nil || o.TotalCount == nil { @@ -17294,6 +24718,22 @@ func (o *OrganizationInstallations) GetTotalCount() int { return *o.TotalCount } +// GetPerPage returns the PerPage field. +func (o *OrganizationsListOptions) GetPerPage() int { + if o == nil { + return 0 + } + return o.PerPage +} + +// GetSince returns the Since field. +func (o *OrganizationsListOptions) GetSince() int64 { + if o == nil { + return 0 + } + return o.Since +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (o *OrgBlockEvent) GetAction() string { if o == nil || o.Action == nil { @@ -17510,6 +24950,14 @@ func (p *Package) GetVisibility() string { return *p.Visibility } +// GetTags returns the Tags slice if it's non-nil, nil otherwise. +func (p *PackageContainerMetadata) GetTags() []string { + if p == nil || p.Tags == nil { + return nil + } + return p.Tags +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PackageEvent) GetAction() string { if p == nil || p.Action == nil { @@ -17598,6 +25046,30 @@ func (p *PackageEventContainerMetadataTag) GetName() string { return *p.Name } +// GetReferenceCategory returns the ReferenceCategory field. +func (p *PackageExternalRef) GetReferenceCategory() string { + if p == nil { + return "" + } + return p.ReferenceCategory +} + +// GetReferenceLocator returns the ReferenceLocator field. +func (p *PackageExternalRef) GetReferenceLocator() string { + if p == nil { + return "" + } + return p.ReferenceLocator +} + +// GetReferenceType returns the ReferenceType field. +func (p *PackageExternalRef) GetReferenceType() string { + if p == nil { + return "" + } + return p.ReferenceType +} + // GetAuthor returns the Author field. func (p *PackageFile) GetAuthor() *User { if p == nil { @@ -17766,6 +25238,22 @@ func (p *PackageNPMMetadata) GetCommitOID() string { return *p.CommitOID } +// GetContributors returns the Contributors slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetContributors() []any { + if p == nil || p.Contributors == nil { + return nil + } + return p.Contributors +} + +// GetCPU returns the CPU slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetCPU() []string { + if p == nil || p.CPU == nil { + return nil + } + return p.CPU +} + // GetDeletedByID returns the DeletedByID field if it's non-nil, zero value otherwise. func (p *PackageNPMMetadata) GetDeletedByID() int64 { if p == nil || p.DeletedByID == nil { @@ -17822,6 +25310,14 @@ func (p *PackageNPMMetadata) GetEngines() map[string]string { return p.Engines } +// GetFiles returns the Files slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetFiles() []string { + if p == nil || p.Files == nil { + return nil + } + return p.Files +} + // GetGitHead returns the GitHead field if it's non-nil, zero value otherwise. func (p *PackageNPMMetadata) GetGitHead() string { if p == nil || p.GitHead == nil { @@ -17862,6 +25358,14 @@ func (p *PackageNPMMetadata) GetInstallationCommand() string { return *p.InstallationCommand } +// GetKeywords returns the Keywords slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetKeywords() []string { + if p == nil || p.Keywords == nil { + return nil + } + return p.Keywords +} + // GetLicense returns the License field if it's non-nil, zero value otherwise. func (p *PackageNPMMetadata) GetLicense() string { if p == nil || p.License == nil { @@ -17878,6 +25382,14 @@ func (p *PackageNPMMetadata) GetMain() string { return *p.Main } +// GetMaintainers returns the Maintainers slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetMaintainers() []any { + if p == nil || p.Maintainers == nil { + return nil + } + return p.Maintainers +} + // GetMan returns the Man map if it's non-nil, an empty map otherwise. func (p *PackageNPMMetadata) GetMan() map[string]any { if p == nil || p.Man == nil { @@ -17926,6 +25438,14 @@ func (p *PackageNPMMetadata) GetOptionalDependencies() map[string]string { return p.OptionalDependencies } +// GetOS returns the OS slice if it's non-nil, nil otherwise. +func (p *PackageNPMMetadata) GetOS() []string { + if p == nil || p.OS == nil { + return nil + } + return p.OS +} + // GetPeerDependencies returns the PeerDependencies map if it's non-nil, an empty map otherwise. func (p *PackageNPMMetadata) GetPeerDependencies() map[string]string { if p == nil || p.PeerDependencies == nil { @@ -17982,6 +25502,14 @@ func (p *PackageNPMMetadata) GetVersion() string { return *p.Version } +// GetID returns the ID field. +func (p *PackageNugetMetadata) GetID() json.RawMessage { + if p == nil { + return json.RawMessage{} + } + return p.ID +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PackageNugetMetadata) GetName() string { if p == nil || p.Name == nil { @@ -17990,6 +25518,14 @@ func (p *PackageNugetMetadata) GetName() string { return *p.Name } +// GetValue returns the Value field. +func (p *PackageNugetMetadata) GetValue() json.RawMessage { + if p == nil { + return json.RawMessage{} + } + return p.Value +} + // GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise. func (p *PackageRegistry) GetAboutURL() string { if p == nil || p.AboutURL == nil { @@ -18118,6 +25654,30 @@ func (p *PackageRelease) GetURL() string { return *p.URL } +// GetIncludedGigabytesBandwidth returns the IncludedGigabytesBandwidth field. +func (p *PackagesBilling) GetIncludedGigabytesBandwidth() int { + if p == nil { + return 0 + } + return p.IncludedGigabytesBandwidth +} + +// GetTotalGigabytesBandwidthUsed returns the TotalGigabytesBandwidthUsed field. +func (p *PackagesBilling) GetTotalGigabytesBandwidthUsed() int { + if p == nil { + return 0 + } + return p.TotalGigabytesBandwidthUsed +} + +// GetTotalPaidGigabytesBandwidthUsed returns the TotalPaidGigabytesBandwidthUsed field. +func (p *PackagesBilling) GetTotalPaidGigabytesBandwidthUsed() int { + if p == nil { + return 0 + } + return p.TotalPaidGigabytesBandwidthUsed +} + // GetAuthor returns the Author field. func (p *PackageVersion) GetAuthor() *User { if p == nil { @@ -18166,6 +25726,14 @@ func (p *PackageVersion) GetDescription() string { return *p.Description } +// GetDockerMetadata returns the DockerMetadata slice if it's non-nil, nil otherwise. +func (p *PackageVersion) GetDockerMetadata() []any { + if p == nil || p.DockerMetadata == nil { + return nil + } + return p.DockerMetadata +} + // GetDraft returns the Draft field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetDraft() bool { if p == nil || p.Draft == nil { @@ -18230,6 +25798,22 @@ func (p *PackageVersion) GetNPMMetadata() *PackageNPMMetadata { return p.NPMMetadata } +// GetNugetMetadata returns the NugetMetadata slice if it's non-nil, nil otherwise. +func (p *PackageVersion) GetNugetMetadata() []*PackageNugetMetadata { + if p == nil || p.NugetMetadata == nil { + return nil + } + return p.NugetMetadata +} + +// GetPackageFiles returns the PackageFiles slice if it's non-nil, nil otherwise. +func (p *PackageVersion) GetPackageFiles() []*PackageFile { + if p == nil || p.PackageFiles == nil { + return nil + } + return p.PackageFiles +} + // GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetPackageHTMLURL() string { if p == nil || p.PackageHTMLURL == nil { @@ -18902,6 +26486,14 @@ func (p *PagesHTTPSCertificate) GetDescription() string { return *p.Description } +// GetDomains returns the Domains slice if it's non-nil, nil otherwise. +func (p *PagesHTTPSCertificate) GetDomains() []string { + if p == nil || p.Domains == nil { + return nil + } + return p.Domains +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (p *PagesHTTPSCertificate) GetExpiresAt() string { if p == nil || p.ExpiresAt == nil { @@ -19014,6 +26606,14 @@ func (p *PagesUpdateWithoutCNAME) GetSource() *PagesSource { return p.Source } +// GetParameters returns the Parameters field. +func (p *PatternBranchRule) GetParameters() PatternRuleParameters { + if p == nil { + return PatternRuleParameters{} + } + return p.Parameters +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PatternRuleParameters) GetName() string { if p == nil || p.Name == nil { @@ -19030,6 +26630,22 @@ func (p *PatternRuleParameters) GetNegate() bool { return *p.Negate } +// GetOperator returns the Operator field. +func (p *PatternRuleParameters) GetOperator() PatternRuleOperator { + if p == nil { + return "" + } + return p.Operator +} + +// GetPattern returns the Pattern field. +func (p *PatternRuleParameters) GetPattern() string { + if p == nil { + return "" + } + return p.Pattern +} + // GetCurrentUserCanApprove returns the CurrentUserCanApprove field if it's non-nil, zero value otherwise. func (p *PendingDeployment) GetCurrentUserCanApprove() bool { if p == nil || p.CurrentUserCanApprove == nil { @@ -19046,6 +26662,14 @@ func (p *PendingDeployment) GetEnvironment() *PendingDeploymentEnvironment { return p.Environment } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (p *PendingDeployment) GetReviewers() []*RequiredReviewer { + if p == nil || p.Reviewers == nil { + return nil + } + return p.Reviewers +} + // GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. func (p *PendingDeployment) GetWaitTimer() int64 { if p == nil || p.WaitTimer == nil { @@ -19102,6 +26726,30 @@ func (p *PendingDeploymentEnvironment) GetURL() string { return *p.URL } +// GetComment returns the Comment field. +func (p *PendingDeploymentsRequest) GetComment() string { + if p == nil { + return "" + } + return p.Comment +} + +// GetEnvironmentIDs returns the EnvironmentIDs slice if it's non-nil, nil otherwise. +func (p *PendingDeploymentsRequest) GetEnvironmentIDs() []int64 { + if p == nil || p.EnvironmentIDs == nil { + return nil + } + return p.EnvironmentIDs +} + +// GetState returns the State field. +func (p *PendingDeploymentsRequest) GetState() string { + if p == nil { + return "" + } + return p.State +} + // GetAccessGrantedAt returns the AccessGrantedAt field if it's non-nil, zero value otherwise. func (p *PersonalAccessToken) GetAccessGrantedAt() Timestamp { if p == nil || p.AccessGrantedAt == nil { @@ -19270,6 +26918,14 @@ func (p *PersonalAccessTokenRequest) GetPermissionsUpgraded() *PersonalAccessTok return p.PermissionsUpgraded } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (p *PersonalAccessTokenRequest) GetRepositories() []*Repository { + if p == nil || p.Repositories == nil { + return nil + } + return p.Repositories +} + // GetRepositoryCount returns the RepositoryCount field if it's non-nil, zero value otherwise. func (p *PersonalAccessTokenRequest) GetRepositoryCount() int64 { if p == nil || p.RepositoryCount == nil { @@ -19454,6 +27110,102 @@ func (p *Plan) GetSpace() int { return *p.Space } +// GetAutoTriggerChecks returns the AutoTriggerChecks slice if it's non-nil, nil otherwise. +func (p *PreferenceList) GetAutoTriggerChecks() []*AutoTriggerCheck { + if p == nil || p.AutoTriggerChecks == nil { + return nil + } + return p.AutoTriggerChecks +} + +// GetDiscountAmount returns the DiscountAmount field. +func (p *PremiumRequestUsageItem) GetDiscountAmount() float64 { + if p == nil { + return 0 + } + return p.DiscountAmount +} + +// GetDiscountQuantity returns the DiscountQuantity field. +func (p *PremiumRequestUsageItem) GetDiscountQuantity() float64 { + if p == nil { + return 0 + } + return p.DiscountQuantity +} + +// GetGrossAmount returns the GrossAmount field. +func (p *PremiumRequestUsageItem) GetGrossAmount() float64 { + if p == nil { + return 0 + } + return p.GrossAmount +} + +// GetGrossQuantity returns the GrossQuantity field. +func (p *PremiumRequestUsageItem) GetGrossQuantity() float64 { + if p == nil { + return 0 + } + return p.GrossQuantity +} + +// GetModel returns the Model field. +func (p *PremiumRequestUsageItem) GetModel() string { + if p == nil { + return "" + } + return p.Model +} + +// GetNetAmount returns the NetAmount field. +func (p *PremiumRequestUsageItem) GetNetAmount() float64 { + if p == nil { + return 0 + } + return p.NetAmount +} + +// GetNetQuantity returns the NetQuantity field. +func (p *PremiumRequestUsageItem) GetNetQuantity() float64 { + if p == nil { + return 0 + } + return p.NetQuantity +} + +// GetPricePerUnit returns the PricePerUnit field. +func (p *PremiumRequestUsageItem) GetPricePerUnit() float64 { + if p == nil { + return 0 + } + return p.PricePerUnit +} + +// GetProduct returns the Product field. +func (p *PremiumRequestUsageItem) GetProduct() string { + if p == nil { + return "" + } + return p.Product +} + +// GetSKU returns the SKU field. +func (p *PremiumRequestUsageItem) GetSKU() string { + if p == nil { + return "" + } + return p.SKU +} + +// GetUnitType returns the UnitType field. +func (p *PremiumRequestUsageItem) GetUnitType() string { + if p == nil { + return "" + } + return p.UnitType +} + // GetModel returns the Model field if it's non-nil, zero value otherwise. func (p *PremiumRequestUsageReport) GetModel() string { if p == nil || p.Model == nil { @@ -19478,6 +27230,22 @@ func (p *PremiumRequestUsageReport) GetProduct() string { return *p.Product } +// GetTimePeriod returns the TimePeriod field. +func (p *PremiumRequestUsageReport) GetTimePeriod() PremiumRequestUsageTimePeriod { + if p == nil { + return PremiumRequestUsageTimePeriod{} + } + return p.TimePeriod +} + +// GetUsageItems returns the UsageItems slice if it's non-nil, nil otherwise. +func (p *PremiumRequestUsageReport) GetUsageItems() []*PremiumRequestUsageItem { + if p == nil || p.UsageItems == nil { + return nil + } + return p.UsageItems +} + // GetUser returns the User field if it's non-nil, zero value otherwise. func (p *PremiumRequestUsageReport) GetUser() string { if p == nil || p.User == nil { @@ -19550,6 +27318,14 @@ func (p *PremiumRequestUsageTimePeriod) GetMonth() int { return *p.Month } +// GetYear returns the Year field. +func (p *PremiumRequestUsageTimePeriod) GetYear() int { + if p == nil { + return 0 + } + return p.Year +} + // GetConfigURL returns the ConfigURL field if it's non-nil, zero value otherwise. func (p *PreReceiveHook) GetConfigURL() string { if p == nil || p.ConfigURL == nil { @@ -19582,6 +27358,14 @@ func (p *PreReceiveHook) GetName() string { return *p.Name } +// GetConfigurations returns the Configurations slice if it's non-nil, nil otherwise. +func (p *PrivateRegistries) GetConfigurations() []*PrivateRegistry { + if p == nil || p.Configurations == nil { + return nil + } + return p.Configurations +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (p *PrivateRegistries) GetTotalCount() int { if p == nil || p.TotalCount == nil { @@ -19590,6 +27374,46 @@ func (p *PrivateRegistries) GetTotalCount() int { return *p.TotalCount } +// GetAccountID returns the AccountID field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetAccountID() string { + if p == nil || p.AccountID == nil { + return "" + } + return *p.AccountID +} + +// GetAudience returns the Audience field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetAudience() string { + if p == nil || p.Audience == nil { + return "" + } + return *p.Audience +} + +// GetAuthType returns the AuthType field. +func (p *PrivateRegistry) GetAuthType() *PrivateRegistryAuthType { + if p == nil { + return nil + } + return p.AuthType +} + +// GetAWSRegion returns the AWSRegion field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetAWSRegion() string { + if p == nil || p.AWSRegion == nil { + return "" + } + return *p.AWSRegion +} + +// GetClientID returns the ClientID field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetClientID() string { + if p == nil || p.ClientID == nil { + return "" + } + return *p.ClientID +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (p *PrivateRegistry) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { @@ -19598,6 +27422,38 @@ func (p *PrivateRegistry) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetDomain returns the Domain field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetDomain() string { + if p == nil || p.Domain == nil { + return "" + } + return *p.Domain +} + +// GetDomainOwner returns the DomainOwner field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetDomainOwner() string { + if p == nil || p.DomainOwner == nil { + return "" + } + return *p.DomainOwner +} + +// GetIdentityMappingName returns the IdentityMappingName field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetIdentityMappingName() string { + if p == nil || p.IdentityMappingName == nil { + return "" + } + return *p.IdentityMappingName +} + +// GetJFrogOIDCProviderName returns the JFrogOIDCProviderName field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetJFrogOIDCProviderName() string { + if p == nil || p.JFrogOIDCProviderName == nil { + return "" + } + return *p.JFrogOIDCProviderName +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PrivateRegistry) GetName() string { if p == nil || p.Name == nil { @@ -19606,12 +27462,44 @@ func (p *PrivateRegistry) GetName() string { return *p.Name } -// GetRegistryType returns the RegistryType field if it's non-nil, zero value otherwise. -func (p *PrivateRegistry) GetRegistryType() string { - if p == nil || p.RegistryType == nil { +// GetRegistryType returns the RegistryType field. +func (p *PrivateRegistry) GetRegistryType() *PrivateRegistryType { + if p == nil { + return nil + } + return p.RegistryType +} + +// GetReplacesBase returns the ReplacesBase field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetReplacesBase() bool { + if p == nil || p.ReplacesBase == nil { + return false + } + return *p.ReplacesBase +} + +// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetRoleName() string { + if p == nil || p.RoleName == nil { + return "" + } + return *p.RoleName +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (p *PrivateRegistry) GetSelectedRepositoryIDs() []int64 { + if p == nil || p.SelectedRepositoryIDs == nil { + return nil + } + return p.SelectedRepositoryIDs +} + +// GetTenantID returns the TenantID field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetTenantID() string { + if p == nil || p.TenantID == nil { return "" } - return *p.RegistryType + return *p.TenantID } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. @@ -19622,6 +27510,14 @@ func (p *PrivateRegistry) GetUpdatedAt() Timestamp { return *p.UpdatedAt } +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PrivateRegistry) GetURL() string { + if p == nil || p.URL == nil { + return "" + } + return *p.URL +} + // GetUsername returns the Username field if it's non-nil, zero value otherwise. func (p *PrivateRegistry) GetUsername() string { if p == nil || p.Username == nil { @@ -20118,6 +28014,14 @@ func (p *ProjectV2Field) GetNodeID() string { return *p.NodeID } +// GetOptions returns the Options slice if it's non-nil, nil otherwise. +func (p *ProjectV2Field) GetOptions() []*ProjectV2FieldOption { + if p == nil || p.Options == nil { + return nil + } + return p.Options +} + // GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise. func (p *ProjectV2Field) GetProjectURL() string { if p == nil || p.ProjectURL == nil { @@ -20142,6 +28046,14 @@ func (p *ProjectV2FieldConfiguration) GetDuration() int { return *p.Duration } +// GetIterations returns the Iterations slice if it's non-nil, nil otherwise. +func (p *ProjectV2FieldConfiguration) GetIterations() []*ProjectV2FieldIteration { + if p == nil || p.Iterations == nil { + return nil + } + return p.Iterations +} + // GetStartDay returns the StartDay field if it's non-nil, zero value otherwise. func (p *ProjectV2FieldConfiguration) GetStartDay() int { if p == nil || p.StartDay == nil { @@ -20262,6 +28174,14 @@ func (p *ProjectV2Item) GetCreator() *User { return p.Creator } +// GetFields returns the Fields slice if it's non-nil, nil otherwise. +func (p *ProjectV2Item) GetFields() []*ProjectV2ItemFieldValue { + if p == nil || p.Fields == nil { + return nil + } + return p.Fields +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (p *ProjectV2Item) GetID() int64 { if p == nil || p.ID == nil { @@ -20422,6 +28342,14 @@ func (p *ProjectV2ItemFieldValue) GetName() string { return *p.Name } +// GetValue returns the Value field. +func (p *ProjectV2ItemFieldValue) GetValue() any { + if p == nil { + return nil + } + return p.Value +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (p *ProjectV2StatusUpdate) GetBody() string { if p == nil || p.Body == nil { @@ -20782,6 +28710,14 @@ func (p *ProtectionRequest) GetBlockCreations() bool { return *p.BlockCreations } +// GetEnforceAdmins returns the EnforceAdmins field. +func (p *ProtectionRequest) GetEnforceAdmins() bool { + if p == nil { + return false + } + return p.EnforceAdmins +} + // GetLockBranch returns the LockBranch field if it's non-nil, zero value otherwise. func (p *ProtectionRequest) GetLockBranch() bool { if p == nil || p.LockBranch == nil { @@ -20854,6 +28790,14 @@ func (p *ProtectionRule) GetPreventSelfReview() bool { return *p.PreventSelfReview } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (p *ProtectionRule) GetReviewers() []*RequiredReviewer { + if p == nil || p.Reviewers == nil { + return nil + } + return p.Reviewers +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (p *ProtectionRule) GetType() string { if p == nil || p.Type == nil { @@ -20902,6 +28846,22 @@ func (p *PublicEvent) GetSender() *User { return p.Sender } +// GetCurrentUsage returns the CurrentUsage field. +func (p *PublicIPUsage) GetCurrentUsage() int64 { + if p == nil { + return 0 + } + return p.CurrentUsage +} + +// GetMaximum returns the Maximum field. +func (p *PublicIPUsage) GetMaximum() int64 { + if p == nil { + return 0 + } + return p.Maximum +} + // GetKey returns the Key field if it's non-nil, zero value otherwise. func (p *PublicKey) GetKey() string { if p == nil || p.Key == nil { @@ -20958,6 +28918,14 @@ func (p *PullRequest) GetAssignee() *User { return p.Assignee } +// GetAssignees returns the Assignees slice if it's non-nil, nil otherwise. +func (p *PullRequest) GetAssignees() []*User { + if p == nil || p.Assignees == nil { + return nil + } + return p.Assignees +} + // GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. func (p *PullRequest) GetAuthorAssociation() string { if p == nil || p.AuthorAssociation == nil { @@ -21102,6 +29070,14 @@ func (p *PullRequest) GetIssueURL() string { return *p.IssueURL } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (p *PullRequest) GetLabels() []*Label { + if p == nil || p.Labels == nil { + return nil + } + return p.Labels +} + // GetLinks returns the Links field. func (p *PullRequest) GetLinks() *PRLinks { if p == nil { @@ -21214,6 +29190,22 @@ func (p *PullRequest) GetRebaseable() bool { return *p.Rebaseable } +// GetRequestedReviewers returns the RequestedReviewers slice if it's non-nil, nil otherwise. +func (p *PullRequest) GetRequestedReviewers() []*User { + if p == nil || p.RequestedReviewers == nil { + return nil + } + return p.RequestedReviewers +} + +// GetRequestedTeams returns the RequestedTeams slice if it's non-nil, nil otherwise. +func (p *PullRequest) GetRequestedTeams() []*Team { + if p == nil || p.RequestedTeams == nil { + return nil + } + return p.RequestedTeams +} + // GetReviewComments returns the ReviewComments field if it's non-nil, zero value otherwise. func (p *PullRequest) GetReviewComments() int { if p == nil || p.ReviewComments == nil { @@ -21358,6 +29350,14 @@ func (p *PullRequestBranch) GetUser() *User { return p.User } +// GetParameters returns the Parameters field. +func (p *PullRequestBranchRule) GetParameters() PullRequestRuleParameters { + if p == nil { + return PullRequestRuleParameters{} + } + return p.Parameters +} + // GetExpectedHeadSHA returns the ExpectedHeadSHA field if it's non-nil, zero value otherwise. func (p *PullRequestBranchUpdateOptions) GetExpectedHeadSHA() string { if p == nil || p.ExpectedHeadSHA == nil { @@ -21758,6 +29758,70 @@ func (p *PullRequestLinks) GetURL() string { return *p.URL } +// GetDirection returns the Direction field. +func (p *PullRequestListCommentsOptions) GetDirection() string { + if p == nil { + return "" + } + return p.Direction +} + +// GetSince returns the Since field. +func (p *PullRequestListCommentsOptions) GetSince() time.Time { + if p == nil { + return time.Time{} + } + return p.Since +} + +// GetSort returns the Sort field. +func (p *PullRequestListCommentsOptions) GetSort() string { + if p == nil { + return "" + } + return p.Sort +} + +// GetBase returns the Base field. +func (p *PullRequestListOptions) GetBase() string { + if p == nil { + return "" + } + return p.Base +} + +// GetDirection returns the Direction field. +func (p *PullRequestListOptions) GetDirection() string { + if p == nil { + return "" + } + return p.Direction +} + +// GetHead returns the Head field. +func (p *PullRequestListOptions) GetHead() string { + if p == nil { + return "" + } + return p.Head +} + +// GetSort returns the Sort field. +func (p *PullRequestListOptions) GetSort() string { + if p == nil { + return "" + } + return p.Sort +} + +// GetState returns the State field. +func (p *PullRequestListOptions) GetState() string { + if p == nil { + return "" + } + return p.State +} + // GetMerged returns the Merged field if it's non-nil, zero value otherwise. func (p *PullRequestMergeResult) GetMerged() bool { if p == nil || p.Merged == nil { @@ -21782,6 +29846,38 @@ func (p *PullRequestMergeResult) GetSHA() string { return *p.SHA } +// GetCommitTitle returns the CommitTitle field. +func (p *PullRequestOptions) GetCommitTitle() string { + if p == nil { + return "" + } + return p.CommitTitle +} + +// GetDontDefaultIfBlank returns the DontDefaultIfBlank field. +func (p *PullRequestOptions) GetDontDefaultIfBlank() bool { + if p == nil { + return false + } + return p.DontDefaultIfBlank +} + +// GetMergeMethod returns the MergeMethod field. +func (p *PullRequestOptions) GetMergeMethod() string { + if p == nil { + return "" + } + return p.MergeMethod +} + +// GetSHA returns the SHA field. +func (p *PullRequestOptions) GetSHA() string { + if p == nil { + return "" + } + return p.SHA +} + // GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. func (p *PullRequestReview) GetAuthorAssociation() string { if p == nil || p.AuthorAssociation == nil { @@ -21998,6 +30094,14 @@ func (p *PullRequestReviewRequest) GetBody() string { return *p.Body } +// GetComments returns the Comments slice if it's non-nil, nil otherwise. +func (p *PullRequestReviewRequest) GetComments() []*DraftReviewComment { + if p == nil || p.Comments == nil { + return nil + } + return p.Comments +} + // GetCommitID returns the CommitID field if it's non-nil, zero value otherwise. func (p *PullRequestReviewRequest) GetCommitID() string { if p == nil || p.CommitID == nil { @@ -22038,6 +30142,38 @@ func (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRes return p.DismissalRestrictions } +// GetDismissStaleReviews returns the DismissStaleReviews field. +func (p *PullRequestReviewsEnforcement) GetDismissStaleReviews() bool { + if p == nil { + return false + } + return p.DismissStaleReviews +} + +// GetRequireCodeOwnerReviews returns the RequireCodeOwnerReviews field. +func (p *PullRequestReviewsEnforcement) GetRequireCodeOwnerReviews() bool { + if p == nil { + return false + } + return p.RequireCodeOwnerReviews +} + +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field. +func (p *PullRequestReviewsEnforcement) GetRequiredApprovingReviewCount() int { + if p == nil { + return 0 + } + return p.RequiredApprovingReviewCount +} + +// GetRequireLastPushApproval returns the RequireLastPushApproval field. +func (p *PullRequestReviewsEnforcement) GetRequireLastPushApproval() bool { + if p == nil { + return false + } + return p.RequireLastPushApproval +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (p *PullRequestReviewsEnforcementLevelChanges) GetFrom() string { if p == nil || p.From == nil { @@ -22062,6 +30198,30 @@ func (p *PullRequestReviewsEnforcementRequest) GetDismissalRestrictionsRequest() return p.DismissalRestrictionsRequest } +// GetDismissStaleReviews returns the DismissStaleReviews field. +func (p *PullRequestReviewsEnforcementRequest) GetDismissStaleReviews() bool { + if p == nil { + return false + } + return p.DismissStaleReviews +} + +// GetRequireCodeOwnerReviews returns the RequireCodeOwnerReviews field. +func (p *PullRequestReviewsEnforcementRequest) GetRequireCodeOwnerReviews() bool { + if p == nil { + return false + } + return p.RequireCodeOwnerReviews +} + +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field. +func (p *PullRequestReviewsEnforcementRequest) GetRequiredApprovingReviewCount() int { + if p == nil { + return 0 + } + return p.RequiredApprovingReviewCount +} + // GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise. func (p *PullRequestReviewsEnforcementRequest) GetRequireLastPushApproval() bool { if p == nil || p.RequireLastPushApproval == nil { @@ -22102,6 +30262,14 @@ func (p *PullRequestReviewsEnforcementUpdate) GetRequireCodeOwnerReviews() bool return *p.RequireCodeOwnerReviews } +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field. +func (p *PullRequestReviewsEnforcementUpdate) GetRequiredApprovingReviewCount() int { + if p == nil { + return 0 + } + return p.RequiredApprovingReviewCount +} + // GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise. func (p *PullRequestReviewsEnforcementUpdate) GetRequireLastPushApproval() bool { if p == nil || p.RequireLastPushApproval == nil { @@ -22166,6 +30334,62 @@ func (p *PullRequestReviewThreadEvent) GetThread() *PullRequestThread { return p.Thread } +// GetAllowedMergeMethods returns the AllowedMergeMethods slice if it's non-nil, nil otherwise. +func (p *PullRequestRuleParameters) GetAllowedMergeMethods() []PullRequestMergeMethod { + if p == nil || p.AllowedMergeMethods == nil { + return nil + } + return p.AllowedMergeMethods +} + +// GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field. +func (p *PullRequestRuleParameters) GetDismissStaleReviewsOnPush() bool { + if p == nil { + return false + } + return p.DismissStaleReviewsOnPush +} + +// GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field. +func (p *PullRequestRuleParameters) GetRequireCodeOwnerReview() bool { + if p == nil { + return false + } + return p.RequireCodeOwnerReview +} + +// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field. +func (p *PullRequestRuleParameters) GetRequiredApprovingReviewCount() int { + if p == nil { + return 0 + } + return p.RequiredApprovingReviewCount +} + +// GetRequiredReviewers returns the RequiredReviewers slice if it's non-nil, nil otherwise. +func (p *PullRequestRuleParameters) GetRequiredReviewers() []*RulesetRequiredReviewer { + if p == nil || p.RequiredReviewers == nil { + return nil + } + return p.RequiredReviewers +} + +// GetRequiredReviewThreadResolution returns the RequiredReviewThreadResolution field. +func (p *PullRequestRuleParameters) GetRequiredReviewThreadResolution() bool { + if p == nil { + return false + } + return p.RequiredReviewThreadResolution +} + +// GetRequireLastPushApproval returns the RequireLastPushApproval field. +func (p *PullRequestRuleParameters) GetRequireLastPushApproval() bool { + if p == nil { + return false + } + return p.RequireLastPushApproval +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PullRequestTargetEvent) GetAction() string { if p == nil || p.Action == nil { @@ -22286,6 +30510,14 @@ func (p *PullRequestTargetEvent) GetSender() *User { return p.Sender } +// GetComments returns the Comments slice if it's non-nil, nil otherwise. +func (p *PullRequestThread) GetComments() []*PullRequestComment { + if p == nil || p.Comments == nil { + return nil + } + return p.Comments +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (p *PullRequestThread) GetID() int64 { if p == nil || p.ID == nil { @@ -22806,6 +31038,14 @@ func (p *PushEventRepository) GetSVNURL() string { return *p.SVNURL } +// GetTopics returns the Topics slice if it's non-nil, nil otherwise. +func (p *PushEventRepository) GetTopics() []string { + if p == nil || p.Topics == nil { + return nil + } + return p.Topics +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *PushEventRepository) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { @@ -22838,6 +31078,94 @@ func (p *PushProtectionBypass) GetExpireAt() Timestamp { return *p.ExpireAt } +// GetReason returns the Reason field. +func (p *PushProtectionBypass) GetReason() string { + if p == nil { + return "" + } + return p.Reason +} + +// GetTokenType returns the TokenType field. +func (p *PushProtectionBypass) GetTokenType() string { + if p == nil { + return "" + } + return p.TokenType +} + +// GetPlaceholderID returns the PlaceholderID field. +func (p *PushProtectionBypassRequest) GetPlaceholderID() string { + if p == nil { + return "" + } + return p.PlaceholderID +} + +// GetReason returns the Reason field. +func (p *PushProtectionBypassRequest) GetReason() string { + if p == nil { + return "" + } + return p.Reason +} + +// GetLimit returns the Limit field. +func (r *Rate) GetLimit() int { + if r == nil { + return 0 + } + return r.Limit +} + +// GetRemaining returns the Remaining field. +func (r *Rate) GetRemaining() int { + if r == nil { + return 0 + } + return r.Remaining +} + +// GetReset returns the Reset field. +func (r *Rate) GetReset() Timestamp { + if r == nil { + return Timestamp{} + } + return r.Reset +} + +// GetResource returns the Resource field. +func (r *Rate) GetResource() string { + if r == nil { + return "" + } + return r.Resource +} + +// GetUsed returns the Used field. +func (r *Rate) GetUsed() int { + if r == nil { + return 0 + } + return r.Used +} + +// GetMessage returns the Message field. +func (r *RateLimitError) GetMessage() string { + if r == nil { + return "" + } + return r.Message +} + +// GetRate returns the Rate field. +func (r *RateLimitError) GetRate() Rate { + if r == nil { + return Rate{} + } + return r.Rate +} + // GetActionsRunnerRegistration returns the ActionsRunnerRegistration field. func (r *RateLimits) GetActionsRunnerRegistration() *Rate { if r == nil { @@ -22934,6 +31262,14 @@ func (r *RateLimits) GetSourceImport() *Rate { return r.SourceImport } +// GetType returns the Type field. +func (r *RawOptions) GetType() RawType { + if r == nil { + return 0 + } + return r.Type +} + // GetContent returns the Content field if it's non-nil, zero value otherwise. func (r *Reaction) GetContent() string { if r == nil || r.Content == nil { @@ -23078,6 +31414,14 @@ func (r *ReassignedResource) GetResourceType() string { return *r.ResourceType } +// GetStatusCode returns the StatusCode field. +func (r *RedirectionError) GetStatusCode() int { + if r == nil { + return 0 + } + return r.StatusCode +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (r *Reference) GetNodeID() string { if r == nil || r.NodeID == nil { @@ -23494,6 +31838,38 @@ func (r *RepoAdvisoryCreditDetailed) GetUser() *User { return r.User } +// GetProperties returns the Properties slice if it's non-nil, nil otherwise. +func (r *RepoCustomPropertyValue) GetProperties() []*CustomPropertyValue { + if r == nil || r.Properties == nil { + return nil + } + return r.Properties +} + +// GetRepositoryFullName returns the RepositoryFullName field. +func (r *RepoCustomPropertyValue) GetRepositoryFullName() string { + if r == nil { + return "" + } + return r.RepositoryFullName +} + +// GetRepositoryID returns the RepositoryID field. +func (r *RepoCustomPropertyValue) GetRepositoryID() int64 { + if r == nil { + return 0 + } + return r.RepositoryID +} + +// GetRepositoryName returns the RepositoryName field. +func (r *RepoCustomPropertyValue) GetRepositoryName() string { + if r == nil { + return "" + } + return r.RepositoryName +} + // GetDownloadLocation returns the DownloadLocation field if it's non-nil, zero value otherwise. func (r *RepoDependencies) GetDownloadLocation() string { if r == nil || r.DownloadLocation == nil { @@ -23502,6 +31878,14 @@ func (r *RepoDependencies) GetDownloadLocation() string { return *r.DownloadLocation } +// GetExternalRefs returns the ExternalRefs slice if it's non-nil, nil otherwise. +func (r *RepoDependencies) GetExternalRefs() []*PackageExternalRef { + if r == nil || r.ExternalRefs == nil { + return nil + } + return r.ExternalRefs +} + // GetFilesAnalyzed returns the FilesAnalyzed field if it's non-nil, zero value otherwise. func (r *RepoDependencies) GetFilesAnalyzed() bool { if r == nil || r.FilesAnalyzed == nil { @@ -23550,6 +31934,38 @@ func (r *RepoDependencies) GetVersionInfo() string { return *r.VersionInfo } +// GetDescription returns the Description field. +func (r *RepoFineGrainedPermission) GetDescription() string { + if r == nil { + return "" + } + return r.Description +} + +// GetName returns the Name field. +func (r *RepoFineGrainedPermission) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (r *RepoImmutableReleasesStatus) GetEnabled() bool { + if r == nil || r.Enabled == nil { + return false + } + return *r.Enabled +} + +// GetEnforcedByOwner returns the EnforcedByOwner field if it's non-nil, zero value otherwise. +func (r *RepoImmutableReleasesStatus) GetEnforcedByOwner() bool { + if r == nil || r.EnforcedByOwner == nil { + return false + } + return *r.EnforcedByOwner +} + // GetBranch returns the Branch field if it's non-nil, zero value otherwise. func (r *RepoMergeUpstreamRequest) GetBranch() string { if r == nil || r.Branch == nil { @@ -23598,6 +32014,14 @@ func (r *RepositoriesSearchResult) GetIncompleteResults() bool { return *r.IncompleteResults } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (r *RepositoriesSearchResult) GetRepositories() []*Repository { + if r == nil || r.Repositories == nil { + return nil + } + return r.Repositories +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (r *RepositoriesSearchResult) GetTotal() int { if r == nil || r.Total == nil { @@ -24374,6 +32798,22 @@ func (r *Repository) GetTemplateRepository() *Repository { return r.TemplateRepository } +// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise. +func (r *Repository) GetTextMatches() []*TextMatch { + if r == nil || r.TextMatches == nil { + return nil + } + return r.TextMatches +} + +// GetTopics returns the Topics slice if it's non-nil, nil otherwise. +func (r *Repository) GetTopics() []string { + if r == nil || r.Topics == nil { + return nil + } + return r.Topics +} + // GetTreesURL returns the TreesURL field if it's non-nil, zero value otherwise. func (r *Repository) GetTreesURL() string { if r == nil || r.TreesURL == nil { @@ -24446,6 +32886,38 @@ func (r *RepositoryActionsAccessLevel) GetAccessLevel() string { return *r.AccessLevel } +// GetAdvancedSecurityCommitters returns the AdvancedSecurityCommitters field. +func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommitters() int { + if r == nil { + return 0 + } + return r.AdvancedSecurityCommitters +} + +// GetAdvancedSecurityCommittersBreakdown returns the AdvancedSecurityCommittersBreakdown slice if it's non-nil, nil otherwise. +func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommittersBreakdown() []*AdvancedSecurityCommittersBreakdown { + if r == nil || r.AdvancedSecurityCommittersBreakdown == nil { + return nil + } + return r.AdvancedSecurityCommittersBreakdown +} + +// GetName returns the Name field. +func (r *RepositoryActiveCommitters) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetActivityType returns the ActivityType field. +func (r *RepositoryActivity) GetActivityType() string { + if r == nil { + return "" + } + return r.ActivityType +} + // GetActor returns the Actor field. func (r *RepositoryActivity) GetActor() *RepositoryActor { if r == nil { @@ -24454,6 +32926,46 @@ func (r *RepositoryActivity) GetActor() *RepositoryActor { return r.Actor } +// GetAfter returns the After field. +func (r *RepositoryActivity) GetAfter() string { + if r == nil { + return "" + } + return r.After +} + +// GetBefore returns the Before field. +func (r *RepositoryActivity) GetBefore() string { + if r == nil { + return "" + } + return r.Before +} + +// GetID returns the ID field. +func (r *RepositoryActivity) GetID() int64 { + if r == nil { + return 0 + } + return r.ID +} + +// GetNodeID returns the NodeID field. +func (r *RepositoryActivity) GetNodeID() string { + if r == nil { + return "" + } + return r.NodeID +} + +// GetRef returns the Ref field. +func (r *RepositoryActivity) GetRef() string { + if r == nil { + return "" + } + return r.Ref +} + // GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. func (r *RepositoryActivity) GetTimestamp() Timestamp { if r == nil || r.Timestamp == nil { @@ -24614,6 +33126,14 @@ func (r *RepositoryActor) GetUserViewType() string { return *r.UserViewType } +// GetPermission returns the Permission field. +func (r *RepositoryAddCollaboratorOptions) GetPermission() string { + if r == nil { + return "" + } + return r.Permission +} + // GetRepository returns the Repository field. func (r *RepositoryAttachment) GetRepository() *Repository { if r == nil { @@ -24774,6 +33294,14 @@ func (r *RepositoryCommit) GetCommitter() *User { return r.Committer } +// GetFiles returns the Files slice if it's non-nil, nil otherwise. +func (r *RepositoryCommit) GetFiles() []*CommitFile { + if r == nil || r.Files == nil { + return nil + } + return r.Files +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (r *RepositoryCommit) GetHTMLURL() string { if r == nil || r.HTMLURL == nil { @@ -24790,6 +33318,14 @@ func (r *RepositoryCommit) GetNodeID() string { return *r.NodeID } +// GetParents returns the Parents slice if it's non-nil, nil otherwise. +func (r *RepositoryCommit) GetParents() []*Commit { + if r == nil || r.Parents == nil { + return nil + } + return r.Parents +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (r *RepositoryCommit) GetSHA() string { if r == nil || r.SHA == nil { @@ -24934,6 +33470,14 @@ func (r *RepositoryContentFileOptions) GetCommitter() *CommitAuthor { return r.Committer } +// GetContent returns the Content slice if it's non-nil, nil otherwise. +func (r *RepositoryContentFileOptions) GetContent() []byte { + if r == nil || r.Content == nil { + return nil + } + return r.Content +} + // GetMessage returns the Message field if it's non-nil, zero value otherwise. func (r *RepositoryContentFileOptions) GetMessage() string { if r == nil || r.Message == nil { @@ -24950,6 +33494,14 @@ func (r *RepositoryContentFileOptions) GetSHA() string { return *r.SHA } +// GetRef returns the Ref field. +func (r *RepositoryContentGetOptions) GetRef() string { + if r == nil { + return "" + } + return r.Ref +} + // GetContent returns the Content field. func (r *RepositoryContentResponse) GetContent() *RepositoryContent { if r == nil { @@ -24958,6 +33510,30 @@ func (r *RepositoryContentResponse) GetContent() *RepositoryContent { return r.Content } +// GetDefaultBranchOnly returns the DefaultBranchOnly field. +func (r *RepositoryCreateForkOptions) GetDefaultBranchOnly() bool { + if r == nil { + return false + } + return r.DefaultBranchOnly +} + +// GetName returns the Name field. +func (r *RepositoryCreateForkOptions) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetOrganization returns the Organization field. +func (r *RepositoryCreateForkOptions) GetOrganization() string { + if r == nil { + return "" + } + return r.Organization +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (r *RepositoryDispatchEvent) GetAction() string { if r == nil || r.Action == nil { @@ -24974,6 +33550,14 @@ func (r *RepositoryDispatchEvent) GetBranch() string { return *r.Branch } +// GetClientPayload returns the ClientPayload field. +func (r *RepositoryDispatchEvent) GetClientPayload() json.RawMessage { + if r == nil { + return json.RawMessage{} + } + return r.ClientPayload +} + // GetInstallation returns the Installation field. func (r *RepositoryDispatchEvent) GetInstallation() *Installation { if r == nil { @@ -25254,6 +33838,150 @@ func (r *RepositoryLicense) GetURL() string { return *r.URL } +// GetSince returns the Since field. +func (r *RepositoryListAllOptions) GetSince() int64 { + if r == nil { + return 0 + } + return r.Since +} + +// GetAffiliation returns the Affiliation field. +func (r *RepositoryListByAuthenticatedUserOptions) GetAffiliation() string { + if r == nil { + return "" + } + return r.Affiliation +} + +// GetDirection returns the Direction field. +func (r *RepositoryListByAuthenticatedUserOptions) GetDirection() string { + if r == nil { + return "" + } + return r.Direction +} + +// GetSort returns the Sort field. +func (r *RepositoryListByAuthenticatedUserOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetType returns the Type field. +func (r *RepositoryListByAuthenticatedUserOptions) GetType() string { + if r == nil { + return "" + } + return r.Type +} + +// GetVisibility returns the Visibility field. +func (r *RepositoryListByAuthenticatedUserOptions) GetVisibility() string { + if r == nil { + return "" + } + return r.Visibility +} + +// GetDirection returns the Direction field. +func (r *RepositoryListByOrgOptions) GetDirection() string { + if r == nil { + return "" + } + return r.Direction +} + +// GetSort returns the Sort field. +func (r *RepositoryListByOrgOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetType returns the Type field. +func (r *RepositoryListByOrgOptions) GetType() string { + if r == nil { + return "" + } + return r.Type +} + +// GetDirection returns the Direction field. +func (r *RepositoryListByUserOptions) GetDirection() string { + if r == nil { + return "" + } + return r.Direction +} + +// GetSort returns the Sort field. +func (r *RepositoryListByUserOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetType returns the Type field. +func (r *RepositoryListByUserOptions) GetType() string { + if r == nil { + return "" + } + return r.Type +} + +// GetSort returns the Sort field. +func (r *RepositoryListForksOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetAffiliation returns the Affiliation field. +func (r *RepositoryListOptions) GetAffiliation() string { + if r == nil { + return "" + } + return r.Affiliation +} + +// GetDirection returns the Direction field. +func (r *RepositoryListOptions) GetDirection() string { + if r == nil { + return "" + } + return r.Direction +} + +// GetSort returns the Sort field. +func (r *RepositoryListOptions) GetSort() string { + if r == nil { + return "" + } + return r.Sort +} + +// GetType returns the Type field. +func (r *RepositoryListOptions) GetType() string { + if r == nil { + return "" + } + return r.Type +} + +// GetVisibility returns the Visibility field. +func (r *RepositoryListOptions) GetVisibility() string { + if r == nil { + return "" + } + return r.Visibility +} + // GetIncludesParents returns the IncludesParents field if it's non-nil, zero value otherwise. func (r *RepositoryListRulesetsOptions) GetIncludesParents() bool { if r == nil || r.IncludesParents == nil { @@ -25286,6 +34014,22 @@ func (r *RepositoryMergeRequest) GetHead() string { return *r.Head } +// GetAll returns the All slice if it's non-nil, nil otherwise. +func (r *RepositoryParticipation) GetAll() []int { + if r == nil || r.All == nil { + return nil + } + return r.All +} + +// GetOwner returns the Owner slice if it's non-nil, nil otherwise. +func (r *RepositoryParticipation) GetOwner() []int { + if r == nil || r.Owner == nil { + return nil + } + return r.Owner +} + // GetPermission returns the Permission field if it's non-nil, zero value otherwise. func (r *RepositoryPermissionLevel) GetPermission() string { if r == nil || r.Permission == nil { @@ -25350,6 +34094,14 @@ func (r *RepositoryPermissions) GetTriage() bool { return *r.Triage } +// GetAssets returns the Assets slice if it's non-nil, nil otherwise. +func (r *RepositoryRelease) GetAssets() []*ReleaseAsset { + if r == nil || r.Assets == nil { + return nil + } + return r.Assets +} + // GetAssetsURL returns the AssetsURL field if it's non-nil, zero value otherwise. func (r *RepositoryRelease) GetAssetsURL() string { if r == nil || r.AssetsURL == nil { @@ -25518,6 +34270,46 @@ func (r *RepositoryRelease) GetZipballURL() string { return *r.ZipballURL } +// GetBody returns the Body field. +func (r *RepositoryReleaseNotes) GetBody() string { + if r == nil { + return "" + } + return r.Body +} + +// GetName returns the Name field. +func (r *RepositoryReleaseNotes) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRule) GetParameters() any { + if r == nil { + return nil + } + return r.Parameters +} + +// GetType returns the Type field. +func (r *RepositoryRule) GetType() RepositoryRuleType { + if r == nil { + return "" + } + return r.Type +} + +// GetBypassActors returns the BypassActors slice if it's non-nil, nil otherwise. +func (r *RepositoryRuleset) GetBypassActors() []*BypassActor { + if r == nil || r.BypassActors == nil { + return nil + } + return r.BypassActors +} + // GetConditions returns the Conditions field. func (r *RepositoryRuleset) GetConditions() *RepositoryRulesetConditions { if r == nil { @@ -25542,6 +34334,14 @@ func (r *RepositoryRuleset) GetCurrentUserCanBypass() *BypassMode { return r.CurrentUserCanBypass } +// GetEnforcement returns the Enforcement field. +func (r *RepositoryRuleset) GetEnforcement() RulesetEnforcement { + if r == nil { + return "" + } + return r.Enforcement +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *RepositoryRuleset) GetID() int64 { if r == nil || r.ID == nil { @@ -25558,6 +34358,14 @@ func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLinks { return r.Links } +// GetName returns the Name field. +func (r *RepositoryRuleset) GetName() string { + if r == nil { + return "" + } + return r.Name +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (r *RepositoryRuleset) GetNodeID() string { if r == nil || r.NodeID == nil { @@ -25574,6 +34382,14 @@ func (r *RepositoryRuleset) GetRules() *RepositoryRulesetRules { return r.Rules } +// GetSource returns the Source field. +func (r *RepositoryRuleset) GetSource() string { + if r == nil { + return "" + } + return r.Source +} + // GetSourceType returns the SourceType field. func (r *RepositoryRuleset) GetSourceType() *RulesetSourceType { if r == nil { @@ -25598,6 +34414,30 @@ func (r *RepositoryRuleset) GetUpdatedAt() Timestamp { return *r.UpdatedAt } +// GetAdded returns the Added slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedConditions) GetAdded() []*RepositoryRulesetConditions { + if r == nil || r.Added == nil { + return nil + } + return r.Added +} + +// GetDeleted returns the Deleted slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedConditions) GetDeleted() []*RepositoryRulesetConditions { + if r == nil || r.Deleted == nil { + return nil + } + return r.Deleted +} + +// GetUpdated returns the Updated slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedConditions) GetUpdated() []*RepositoryRulesetUpdatedConditions { + if r == nil || r.Updated == nil { + return nil + } + return r.Updated +} + // GetConfiguration returns the Configuration field. func (r *RepositoryRulesetChangedRule) GetConfiguration() *RepositoryRulesetChangeSource { if r == nil { @@ -25622,6 +34462,30 @@ func (r *RepositoryRulesetChangedRule) GetRuleType() *RepositoryRulesetChangeSou return r.RuleType } +// GetAdded returns the Added slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedRules) GetAdded() []*RepositoryRule { + if r == nil || r.Added == nil { + return nil + } + return r.Added +} + +// GetDeleted returns the Deleted slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedRules) GetDeleted() []*RepositoryRule { + if r == nil || r.Deleted == nil { + return nil + } + return r.Deleted +} + +// GetUpdated returns the Updated slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangedRules) GetUpdated() []*RepositoryRulesetUpdatedRules { + if r == nil || r.Updated == nil { + return nil + } + return r.Updated +} + // GetConditions returns the Conditions field. func (r *RepositoryRulesetChanges) GetConditions() *RepositoryRulesetChangedConditions { if r == nil { @@ -25662,6 +34526,14 @@ func (r *RepositoryRulesetChangeSource) GetFrom() string { return *r.From } +// GetFrom returns the From slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetChangeSources) GetFrom() []string { + if r == nil || r.From == nil { + return nil + } + return r.From +} + // GetOrganizationID returns the OrganizationID field. func (r *RepositoryRulesetConditions) GetOrganizationID() *RepositoryRulesetOrganizationIDsConditionParameters { if r == nil { @@ -25806,6 +34678,86 @@ func (r *RepositoryRulesetLinks) GetSelf() *RepositoryRulesetLink { return r.Self } +// GetOrganizationIDs returns the OrganizationIDs slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationIDsConditionParameters) GetOrganizationIDs() []int64 { + if r == nil || r.OrganizationIDs == nil { + return nil + } + return r.OrganizationIDs +} + +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationNamesConditionParameters) GetExclude() []string { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationNamesConditionParameters) GetInclude() []string { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationPropertyConditionParameters) GetExclude() []*RepositoryRulesetRepositoryPropertyTargetParameters { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetOrganizationPropertyConditionParameters) GetInclude() []*RepositoryRulesetRepositoryPropertyTargetParameters { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRefConditionParameters) GetExclude() []string { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRefConditionParameters) GetInclude() []string { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + +// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryIDsConditionParameters) GetRepositoryIDs() []int64 { + if r == nil || r.RepositoryIDs == nil { + return nil + } + return r.RepositoryIDs +} + +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetExclude() []string { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetInclude() []string { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + // GetProtected returns the Protected field if it's non-nil, zero value otherwise. func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetProtected() bool { if r == nil || r.Protected == nil { @@ -25814,6 +34766,38 @@ func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetProtected() boo return *r.Protected } +// GetExclude returns the Exclude slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryPropertyConditionParameters) GetExclude() []*RepositoryRulesetRepositoryPropertyTargetParameters { + if r == nil || r.Exclude == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryPropertyConditionParameters) GetInclude() []*RepositoryRulesetRepositoryPropertyTargetParameters { + if r == nil || r.Include == nil { + return nil + } + return r.Include +} + +// GetName returns the Name field. +func (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetName() string { + if r == nil { + return "" + } + return r.Name +} + +// GetPropertyValues returns the PropertyValues slice if it's non-nil, nil otherwise. +func (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetPropertyValues() []string { + if r == nil || r.PropertyValues == nil { + return nil + } + return r.PropertyValues +} + // GetSource returns the Source field if it's non-nil, zero value otherwise. func (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetSource() string { if r == nil || r.Source == nil { @@ -26134,6 +35118,22 @@ func (r *RepositoryTag) GetZipballURL() string { return *r.ZipballURL } +// GetInternal returns the Internal field. +func (r *RepositoryVisibilityRuleParameters) GetInternal() bool { + if r == nil { + return false + } + return r.Internal +} + +// GetPrivate returns the Private field. +func (r *RepositoryVisibilityRuleParameters) GetPrivate() bool { + if r == nil { + return false + } + return r.Private +} + // GetAffectedPackageName returns the AffectedPackageName field if it's non-nil, zero value otherwise. func (r *RepositoryVulnerabilityAlert) GetAffectedPackageName() string { if r == nil || r.AffectedPackageName == nil { @@ -26414,6 +35414,14 @@ func (r *RepoStatus) GetURL() string { return *r.URL } +// GetIdentifier returns the Identifier field. +func (r *RequestedAction) GetIdentifier() string { + if r == nil { + return "" + } + return r.Identifier +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequireCodeOwnerReviewChanges) GetFrom() bool { if r == nil || r.From == nil { @@ -26422,6 +35430,14 @@ func (r *RequireCodeOwnerReviewChanges) GetFrom() bool { return *r.From } +// GetEnabled returns the Enabled field. +func (r *RequiredConversationResolution) GetEnabled() bool { + if r == nil { + return false + } + return r.Enabled +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequiredConversationResolutionLevelChanges) GetFrom() string { if r == nil || r.From == nil { @@ -26430,6 +35446,14 @@ func (r *RequiredConversationResolutionLevelChanges) GetFrom() string { return *r.From } +// GetParameters returns the Parameters field. +func (r *RequiredDeploymentsBranchRule) GetParameters() RequiredDeploymentsRuleParameters { + if r == nil { + return RequiredDeploymentsRuleParameters{} + } + return r.Parameters +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequiredDeploymentsEnforcementLevelChanges) GetFrom() string { if r == nil || r.From == nil { @@ -26438,6 +35462,22 @@ func (r *RequiredDeploymentsEnforcementLevelChanges) GetFrom() string { return *r.From } +// GetRequiredDeploymentEnvironments returns the RequiredDeploymentEnvironments slice if it's non-nil, nil otherwise. +func (r *RequiredDeploymentsRuleParameters) GetRequiredDeploymentEnvironments() []string { + if r == nil || r.RequiredDeploymentEnvironments == nil { + return nil + } + return r.RequiredDeploymentEnvironments +} + +// GetReviewer returns the Reviewer field. +func (r *RequiredReviewer) GetReviewer() any { + if r == nil { + return nil + } + return r.Reviewer +} + // GetType returns the Type field if it's non-nil, zero value otherwise. func (r *RequiredReviewer) GetType() string { if r == nil || r.Type == nil { @@ -26454,6 +35494,14 @@ func (r *RequiredStatusCheck) GetAppID() int64 { return *r.AppID } +// GetContext returns the Context field. +func (r *RequiredStatusCheck) GetContext() string { + if r == nil { + return "" + } + return r.Context +} + // GetChecks returns the Checks field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecks) GetChecks() []*RequiredStatusCheck { if r == nil || r.Checks == nil { @@ -26478,6 +35526,14 @@ func (r *RequiredStatusChecks) GetContextsURL() string { return *r.ContextsURL } +// GetStrict returns the Strict field. +func (r *RequiredStatusChecks) GetStrict() bool { + if r == nil { + return false + } + return r.Strict +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecks) GetURL() string { if r == nil || r.URL == nil { @@ -26486,6 +35542,22 @@ func (r *RequiredStatusChecks) GetURL() string { return *r.URL } +// GetParameters returns the Parameters field. +func (r *RequiredStatusChecksBranchRule) GetParameters() RequiredStatusChecksRuleParameters { + if r == nil { + return RequiredStatusChecksRuleParameters{} + } + return r.Parameters +} + +// GetFrom returns the From slice if it's non-nil, nil otherwise. +func (r *RequiredStatusChecksChanges) GetFrom() []string { + if r == nil || r.From == nil { + return nil + } + return r.From +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecksEnforcementLevelChanges) GetFrom() string { if r == nil || r.From == nil { @@ -26494,6 +35566,22 @@ func (r *RequiredStatusChecksEnforcementLevelChanges) GetFrom() string { return *r.From } +// GetChecks returns the Checks slice if it's non-nil, nil otherwise. +func (r *RequiredStatusChecksRequest) GetChecks() []*RequiredStatusCheck { + if r == nil || r.Checks == nil { + return nil + } + return r.Checks +} + +// GetContexts returns the Contexts slice if it's non-nil, nil otherwise. +func (r *RequiredStatusChecksRequest) GetContexts() []string { + if r == nil || r.Contexts == nil { + return nil + } + return r.Contexts +} + // GetStrict returns the Strict field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecksRequest) GetStrict() bool { if r == nil || r.Strict == nil { @@ -26510,6 +35598,22 @@ func (r *RequiredStatusChecksRuleParameters) GetDoNotEnforceOnCreate() bool { return *r.DoNotEnforceOnCreate } +// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise. +func (r *RequiredStatusChecksRuleParameters) GetRequiredStatusChecks() []*RuleStatusCheck { + if r == nil || r.RequiredStatusChecks == nil { + return nil + } + return r.RequiredStatusChecks +} + +// GetStrictRequiredStatusChecksPolicy returns the StrictRequiredStatusChecksPolicy field. +func (r *RequiredStatusChecksRuleParameters) GetStrictRequiredStatusChecksPolicy() bool { + if r == nil { + return false + } + return r.StrictRequiredStatusChecksPolicy +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (r *RequireLastPushApprovalChanges) GetFrom() bool { if r == nil || r.From == nil { @@ -26518,6 +35622,134 @@ func (r *RequireLastPushApprovalChanges) GetFrom() bool { return *r.From } +// GetEnabled returns the Enabled field. +func (r *RequireLinearHistory) GetEnabled() bool { + if r == nil { + return false + } + return r.Enabled +} + +// GetAfter returns the After field. +func (r *Response) GetAfter() string { + if r == nil { + return "" + } + return r.After +} + +// GetBefore returns the Before field. +func (r *Response) GetBefore() string { + if r == nil { + return "" + } + return r.Before +} + +// GetCursor returns the Cursor field. +func (r *Response) GetCursor() string { + if r == nil { + return "" + } + return r.Cursor +} + +// GetFirstPage returns the FirstPage field. +func (r *Response) GetFirstPage() int { + if r == nil { + return 0 + } + return r.FirstPage +} + +// GetLastPage returns the LastPage field. +func (r *Response) GetLastPage() int { + if r == nil { + return 0 + } + return r.LastPage +} + +// GetNextPage returns the NextPage field. +func (r *Response) GetNextPage() int { + if r == nil { + return 0 + } + return r.NextPage +} + +// GetNextPageToken returns the NextPageToken field. +func (r *Response) GetNextPageToken() string { + if r == nil { + return "" + } + return r.NextPageToken +} + +// GetPrevPage returns the PrevPage field. +func (r *Response) GetPrevPage() int { + if r == nil { + return 0 + } + return r.PrevPage +} + +// GetRate returns the Rate field. +func (r *Response) GetRate() Rate { + if r == nil { + return Rate{} + } + return r.Rate +} + +// GetTokenExpiration returns the TokenExpiration field. +func (r *Response) GetTokenExpiration() Timestamp { + if r == nil { + return Timestamp{} + } + return r.TokenExpiration +} + +// GetComment returns the Comment field. +func (r *ReviewCustomDeploymentProtectionRuleRequest) GetComment() string { + if r == nil { + return "" + } + return r.Comment +} + +// GetEnvironmentName returns the EnvironmentName field. +func (r *ReviewCustomDeploymentProtectionRuleRequest) GetEnvironmentName() string { + if r == nil { + return "" + } + return r.EnvironmentName +} + +// GetState returns the State field. +func (r *ReviewCustomDeploymentProtectionRuleRequest) GetState() string { + if r == nil { + return "" + } + return r.State +} + +// GetTeams returns the Teams slice if it's non-nil, nil otherwise. +func (r *Reviewers) GetTeams() []*Team { + if r == nil || r.Teams == nil { + return nil + } + return r.Teams +} + +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (r *Reviewers) GetUsers() []*User { + if r == nil || r.Users == nil { + return nil + } + return r.Users +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (r *ReviewersRequest) GetNodeID() string { if r == nil || r.NodeID == nil { @@ -26526,6 +35758,30 @@ func (r *ReviewersRequest) GetNodeID() string { return *r.NodeID } +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (r *ReviewersRequest) GetReviewers() []string { + if r == nil || r.Reviewers == nil { + return nil + } + return r.Reviewers +} + +// GetTeamReviewers returns the TeamReviewers slice if it's non-nil, nil otherwise. +func (r *ReviewersRequest) GetTeamReviewers() []string { + if r == nil || r.TeamReviewers == nil { + return nil + } + return r.TeamReviewers +} + +// GetAction returns the Action field. +func (r *ReviewPersonalAccessTokenRequestOptions) GetAction() string { + if r == nil { + return "" + } + return r.Action +} + // GetReason returns the Reason field if it's non-nil, zero value otherwise. func (r *ReviewPersonalAccessTokenRequestOptions) GetReason() string { if r == nil || r.Reason == nil { @@ -26590,6 +35846,46 @@ func (r *Rule) GetSeverity() string { return *r.Severity } +// GetTags returns the Tags slice if it's non-nil, nil otherwise. +func (r *Rule) GetTags() []string { + if r == nil || r.Tags == nil { + return nil + } + return r.Tags +} + +// GetAlertsThreshold returns the AlertsThreshold field. +func (r *RuleCodeScanningTool) GetAlertsThreshold() CodeScanningAlertsThreshold { + if r == nil { + return "" + } + return r.AlertsThreshold +} + +// GetSecurityAlertsThreshold returns the SecurityAlertsThreshold field. +func (r *RuleCodeScanningTool) GetSecurityAlertsThreshold() CodeScanningSecurityAlertsThreshold { + if r == nil { + return "" + } + return r.SecurityAlertsThreshold +} + +// GetTool returns the Tool field. +func (r *RuleCodeScanningTool) GetTool() string { + if r == nil { + return "" + } + return r.Tool +} + +// GetFilePatterns returns the FilePatterns slice if it's non-nil, nil otherwise. +func (r *RulesetRequiredReviewer) GetFilePatterns() []string { + if r == nil || r.FilePatterns == nil { + return nil + } + return r.FilePatterns +} + // GetMinimumApprovals returns the MinimumApprovals field if it's non-nil, zero value otherwise. func (r *RulesetRequiredReviewer) GetMinimumApprovals() int { if r == nil || r.MinimumApprovals == nil { @@ -26622,6 +35918,14 @@ func (r *RulesetReviewer) GetType() *RulesetReviewerType { return r.Type } +// GetContext returns the Context field. +func (r *RuleStatusCheck) GetContext() string { + if r == nil { + return "" + } + return r.Context +} + // GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise. func (r *RuleStatusCheck) GetIntegrationID() int64 { if r == nil || r.IntegrationID == nil { @@ -26630,6 +35934,14 @@ func (r *RuleStatusCheck) GetIntegrationID() int64 { return *r.IntegrationID } +// GetPath returns the Path field. +func (r *RuleWorkflow) GetPath() string { + if r == nil { + return "" + } + return r.Path +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (r *RuleWorkflow) GetRef() string { if r == nil || r.Ref == nil { @@ -26670,6 +35982,14 @@ func (r *Runner) GetID() int64 { return *r.ID } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (r *Runner) GetLabels() []*RunnerLabels { + if r == nil || r.Labels == nil { + return nil + } + return r.Labels +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (r *Runner) GetName() string { if r == nil || r.Name == nil { @@ -26822,6 +36142,14 @@ func (r *RunnerGroup) GetSelectedRepositoriesURL() string { return *r.SelectedRepositoriesURL } +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (r *RunnerGroup) GetSelectedWorkflows() []string { + if r == nil || r.SelectedWorkflows == nil { + return nil + } + return r.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (r *RunnerGroup) GetVisibility() string { if r == nil || r.Visibility == nil { @@ -26838,6 +36166,22 @@ func (r *RunnerGroup) GetWorkflowRestrictionsReadOnly() bool { return *r.WorkflowRestrictionsReadOnly } +// GetRunnerGroups returns the RunnerGroups slice if it's non-nil, nil otherwise. +func (r *RunnerGroups) GetRunnerGroups() []*RunnerGroup { + if r == nil || r.RunnerGroups == nil { + return nil + } + return r.RunnerGroups +} + +// GetTotalCount returns the TotalCount field. +func (r *RunnerGroups) GetTotalCount() int { + if r == nil { + return 0 + } + return r.TotalCount +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *RunnerLabels) GetID() int64 { if r == nil || r.ID == nil { @@ -26862,6 +36206,22 @@ func (r *RunnerLabels) GetType() string { return *r.Type } +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (r *Runners) GetRunners() []*Runner { + if r == nil || r.Runners == nil { + return nil + } + return r.Runners +} + +// GetTotalCount returns the TotalCount field. +func (r *Runners) GetTotalCount() int { + if r == nil { + return 0 + } + return r.TotalCount +} + // GetCheckoutURI returns the CheckoutURI field if it's non-nil, zero value otherwise. func (s *SarifAnalysis) GetCheckoutURI() string { if s == nil || s.CheckoutURI == nil { @@ -26966,6 +36326,14 @@ func (s *SBOMInfo) GetDataLicense() string { return *s.DataLicense } +// GetDocumentDescribes returns the DocumentDescribes slice if it's non-nil, nil otherwise. +func (s *SBOMInfo) GetDocumentDescribes() []string { + if s == nil || s.DocumentDescribes == nil { + return nil + } + return s.DocumentDescribes +} + // GetDocumentNamespace returns the DocumentNamespace field if it's non-nil, zero value otherwise. func (s *SBOMInfo) GetDocumentNamespace() string { if s == nil || s.DocumentNamespace == nil { @@ -26982,6 +36350,22 @@ func (s *SBOMInfo) GetName() string { return *s.Name } +// GetPackages returns the Packages slice if it's non-nil, nil otherwise. +func (s *SBOMInfo) GetPackages() []*RepoDependencies { + if s == nil || s.Packages == nil { + return nil + } + return s.Packages +} + +// GetRelationships returns the Relationships slice if it's non-nil, nil otherwise. +func (s *SBOMInfo) GetRelationships() []*SBOMRelationship { + if s == nil || s.Relationships == nil { + return nil + } + return s.Relationships +} + // GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise. func (s *SBOMInfo) GetSPDXID() string { if s == nil || s.SPDXID == nil { @@ -26998,6 +36382,30 @@ func (s *SBOMInfo) GetSPDXVersion() string { return *s.SPDXVersion } +// GetRelatedSPDXElement returns the RelatedSPDXElement field. +func (s *SBOMRelationship) GetRelatedSPDXElement() string { + if s == nil { + return "" + } + return s.RelatedSPDXElement +} + +// GetRelationshipType returns the RelationshipType field. +func (s *SBOMRelationship) GetRelationshipType() string { + if s == nil { + return "" + } + return s.RelationshipType +} + +// GetSPDXElementID returns the SPDXElementID field. +func (s *SBOMRelationship) GetSPDXElementID() string { + if s == nil { + return "" + } + return s.SPDXElementID +} + // GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise. func (s *ScanningAnalysis) GetAnalysisKey() string { if s == nil || s.AnalysisKey == nil { @@ -27118,6 +36526,30 @@ func (s *ScanningAnalysis) GetWarning() string { return *s.Warning } +// GetOperations returns the Operations slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseAttribute) GetOperations() []*SCIMEnterpriseAttributeOperation { + if s == nil || s.Operations == nil { + return nil + } + return s.Operations +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseAttribute) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + +// GetOp returns the Op field. +func (s *SCIMEnterpriseAttributeOperation) GetOp() string { + if s == nil { + return "" + } + return s.Op +} + // GetPath returns the Path field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseAttributeOperation) GetPath() string { if s == nil || s.Path == nil { @@ -27126,6 +36558,14 @@ func (s *SCIMEnterpriseAttributeOperation) GetPath() string { return *s.Path } +// GetValue returns the Value field. +func (s *SCIMEnterpriseAttributeOperation) GetValue() any { + if s == nil { + return nil + } + return s.Value +} + // GetDisplay returns the Display field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseDisplayReference) GetDisplay() string { if s == nil || s.Display == nil { @@ -27142,6 +36582,14 @@ func (s *SCIMEnterpriseDisplayReference) GetRef() string { return *s.Ref } +// GetValue returns the Value field. +func (s *SCIMEnterpriseDisplayReference) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + // GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseGroupAttributes) GetDisplayName() string { if s == nil || s.DisplayName == nil { @@ -27166,6 +36614,14 @@ func (s *SCIMEnterpriseGroupAttributes) GetID() string { return *s.ID } +// GetMembers returns the Members slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseGroupAttributes) GetMembers() []*SCIMEnterpriseDisplayReference { + if s == nil || s.Members == nil { + return nil + } + return s.Members +} + // GetMeta returns the Meta field. func (s *SCIMEnterpriseGroupAttributes) GetMeta() *SCIMEnterpriseMeta { if s == nil { @@ -27174,6 +36630,14 @@ func (s *SCIMEnterpriseGroupAttributes) GetMeta() *SCIMEnterpriseMeta { return s.Meta } +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseGroupAttributes) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + // GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseGroups) GetItemsPerPage() int { if s == nil || s.ItemsPerPage == nil { @@ -27182,6 +36646,22 @@ func (s *SCIMEnterpriseGroups) GetItemsPerPage() int { return *s.ItemsPerPage } +// GetResources returns the Resources slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseGroups) GetResources() []*SCIMEnterpriseGroupAttributes { + if s == nil || s.Resources == nil { + return nil + } + return s.Resources +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseGroups) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + // GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseGroups) GetStartIndex() int { if s == nil || s.StartIndex == nil { @@ -27222,6 +36702,54 @@ func (s *SCIMEnterpriseMeta) GetLocation() string { return *s.Location } +// GetResourceType returns the ResourceType field. +func (s *SCIMEnterpriseMeta) GetResourceType() string { + if s == nil { + return "" + } + return s.ResourceType +} + +// GetActive returns the Active field. +func (s *SCIMEnterpriseUserAttributes) GetActive() bool { + if s == nil { + return false + } + return s.Active +} + +// GetDisplayName returns the DisplayName field. +func (s *SCIMEnterpriseUserAttributes) GetDisplayName() string { + if s == nil { + return "" + } + return s.DisplayName +} + +// GetEmails returns the Emails slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUserAttributes) GetEmails() []*SCIMEnterpriseUserEmail { + if s == nil || s.Emails == nil { + return nil + } + return s.Emails +} + +// GetExternalID returns the ExternalID field. +func (s *SCIMEnterpriseUserAttributes) GetExternalID() string { + if s == nil { + return "" + } + return s.ExternalID +} + +// GetGroups returns the Groups slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUserAttributes) GetGroups() []*SCIMEnterpriseDisplayReference { + if s == nil || s.Groups == nil { + return nil + } + return s.Groups +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUserAttributes) GetID() string { if s == nil || s.ID == nil { @@ -27246,6 +36774,62 @@ func (s *SCIMEnterpriseUserAttributes) GetName() *SCIMEnterpriseUserName { return s.Name } +// GetRoles returns the Roles slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUserAttributes) GetRoles() []*SCIMEnterpriseUserRole { + if s == nil || s.Roles == nil { + return nil + } + return s.Roles +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUserAttributes) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + +// GetUserName returns the UserName field. +func (s *SCIMEnterpriseUserAttributes) GetUserName() string { + if s == nil { + return "" + } + return s.UserName +} + +// GetPrimary returns the Primary field. +func (s *SCIMEnterpriseUserEmail) GetPrimary() bool { + if s == nil { + return false + } + return s.Primary +} + +// GetType returns the Type field. +func (s *SCIMEnterpriseUserEmail) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +// GetValue returns the Value field. +func (s *SCIMEnterpriseUserEmail) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + +// GetFamilyName returns the FamilyName field. +func (s *SCIMEnterpriseUserName) GetFamilyName() string { + if s == nil { + return "" + } + return s.FamilyName +} + // GetFormatted returns the Formatted field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUserName) GetFormatted() string { if s == nil || s.Formatted == nil { @@ -27254,6 +36838,14 @@ func (s *SCIMEnterpriseUserName) GetFormatted() string { return *s.Formatted } +// GetGivenName returns the GivenName field. +func (s *SCIMEnterpriseUserName) GetGivenName() string { + if s == nil { + return "" + } + return s.GivenName +} + // GetMiddleName returns the MiddleName field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUserName) GetMiddleName() string { if s == nil || s.MiddleName == nil { @@ -27286,6 +36878,14 @@ func (s *SCIMEnterpriseUserRole) GetType() string { return *s.Type } +// GetValue returns the Value field. +func (s *SCIMEnterpriseUserRole) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + // GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUsers) GetItemsPerPage() int { if s == nil || s.ItemsPerPage == nil { @@ -27294,6 +36894,22 @@ func (s *SCIMEnterpriseUsers) GetItemsPerPage() int { return *s.ItemsPerPage } +// GetResources returns the Resources slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUsers) GetResources() []*SCIMEnterpriseUserAttributes { + if s == nil || s.Resources == nil { + return nil + } + return s.Resources +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMEnterpriseUsers) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + // GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseUsers) GetStartIndex() int { if s == nil || s.StartIndex == nil { @@ -27350,6 +36966,22 @@ func (s *SCIMProvisionedIdentities) GetItemsPerPage() int { return *s.ItemsPerPage } +// GetResources returns the Resources slice if it's non-nil, nil otherwise. +func (s *SCIMProvisionedIdentities) GetResources() []*SCIMUserAttributes { + if s == nil || s.Resources == nil { + return nil + } + return s.Resources +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMProvisionedIdentities) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + // GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. func (s *SCIMProvisionedIdentities) GetStartIndex() int { if s == nil || s.StartIndex == nil { @@ -27382,6 +37014,14 @@ func (s *SCIMUserAttributes) GetDisplayName() string { return *s.DisplayName } +// GetEmails returns the Emails slice if it's non-nil, nil otherwise. +func (s *SCIMUserAttributes) GetEmails() []*SCIMUserEmail { + if s == nil || s.Emails == nil { + return nil + } + return s.Emails +} + // GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise. func (s *SCIMUserAttributes) GetExternalID() string { if s == nil || s.ExternalID == nil { @@ -27390,6 +37030,14 @@ func (s *SCIMUserAttributes) GetExternalID() string { return *s.ExternalID } +// GetGroups returns the Groups slice if it's non-nil, nil otherwise. +func (s *SCIMUserAttributes) GetGroups() []string { + if s == nil || s.Groups == nil { + return nil + } + return s.Groups +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (s *SCIMUserAttributes) GetID() string { if s == nil || s.ID == nil { @@ -27406,6 +37054,38 @@ func (s *SCIMUserAttributes) GetMeta() *SCIMMeta { return s.Meta } +// GetName returns the Name field. +func (s *SCIMUserAttributes) GetName() SCIMUserName { + if s == nil { + return SCIMUserName{} + } + return s.Name +} + +// GetRoles returns the Roles slice if it's non-nil, nil otherwise. +func (s *SCIMUserAttributes) GetRoles() []*SCIMUserRole { + if s == nil || s.Roles == nil { + return nil + } + return s.Roles +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (s *SCIMUserAttributes) GetSchemas() []string { + if s == nil || s.Schemas == nil { + return nil + } + return s.Schemas +} + +// GetUserName returns the UserName field. +func (s *SCIMUserAttributes) GetUserName() string { + if s == nil { + return "" + } + return s.UserName +} + // GetPrimary returns the Primary field if it's non-nil, zero value otherwise. func (s *SCIMUserEmail) GetPrimary() bool { if s == nil || s.Primary == nil { @@ -27422,6 +37102,22 @@ func (s *SCIMUserEmail) GetType() string { return *s.Type } +// GetValue returns the Value field. +func (s *SCIMUserEmail) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + +// GetFamilyName returns the FamilyName field. +func (s *SCIMUserName) GetFamilyName() string { + if s == nil { + return "" + } + return s.FamilyName +} + // GetFormatted returns the Formatted field if it's non-nil, zero value otherwise. func (s *SCIMUserName) GetFormatted() string { if s == nil || s.Formatted == nil { @@ -27430,6 +37126,14 @@ func (s *SCIMUserName) GetFormatted() string { return *s.Formatted } +// GetGivenName returns the GivenName field. +func (s *SCIMUserName) GetGivenName() string { + if s == nil { + return "" + } + return s.GivenName +} + // GetDisplay returns the Display field if it's non-nil, zero value otherwise. func (s *SCIMUserRole) GetDisplay() string { if s == nil || s.Display == nil { @@ -27454,6 +37158,14 @@ func (s *SCIMUserRole) GetType() string { return *s.Type } +// GetValue returns the Value field. +func (s *SCIMUserRole) GetValue() string { + if s == nil { + return "" + } + return s.Value +} + // GetAdvancedSearch returns the AdvancedSearch field if it's non-nil, zero value otherwise. func (s *SearchOptions) GetAdvancedSearch() bool { if s == nil || s.AdvancedSearch == nil { @@ -27462,6 +37174,102 @@ func (s *SearchOptions) GetAdvancedSearch() bool { return *s.AdvancedSearch } +// GetOrder returns the Order field. +func (s *SearchOptions) GetOrder() string { + if s == nil { + return "" + } + return s.Order +} + +// GetSort returns the Sort field. +func (s *SearchOptions) GetSort() string { + if s == nil { + return "" + } + return s.Sort +} + +// GetTextMatch returns the TextMatch field. +func (s *SearchOptions) GetTextMatch() bool { + if s == nil { + return false + } + return s.TextMatch +} + +// GetSeatsCreated returns the SeatsCreated field. +func (s *SeatAssignments) GetSeatsCreated() int { + if s == nil { + return 0 + } + return s.SeatsCreated +} + +// GetSeatsCancelled returns the SeatsCancelled field. +func (s *SeatCancellations) GetSeatsCancelled() int { + if s == nil { + return 0 + } + return s.SeatsCancelled +} + +// GetCreatedAt returns the CreatedAt field. +func (s *Secret) GetCreatedAt() Timestamp { + if s == nil { + return Timestamp{} + } + return s.CreatedAt +} + +// GetName returns the Name field. +func (s *Secret) GetName() string { + if s == nil { + return "" + } + return s.Name +} + +// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field. +func (s *Secret) GetSelectedRepositoriesURL() string { + if s == nil { + return "" + } + return s.SelectedRepositoriesURL +} + +// GetUpdatedAt returns the UpdatedAt field. +func (s *Secret) GetUpdatedAt() Timestamp { + if s == nil { + return Timestamp{} + } + return s.UpdatedAt +} + +// GetVisibility returns the Visibility field. +func (s *Secret) GetVisibility() string { + if s == nil { + return "" + } + return s.Visibility +} + +// GetSecrets returns the Secrets slice if it's non-nil, nil otherwise. +func (s *Secrets) GetSecrets() []*Secret { + if s == nil || s.Secrets == nil { + return nil + } + return s.Secrets +} + +// GetTotalCount returns the TotalCount field. +func (s *Secrets) GetTotalCount() int { + if s == nil { + return 0 + } + return s.TotalCount +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanning) GetStatus() string { if s == nil || s.Status == nil { @@ -27750,6 +37558,70 @@ func (s *SecretScanningAlertEvent) GetSender() *User { return s.Sender } +// GetDirection returns the Direction field. +func (s *SecretScanningAlertListOptions) GetDirection() string { + if s == nil { + return "" + } + return s.Direction +} + +// GetIsMultiRepo returns the IsMultiRepo field. +func (s *SecretScanningAlertListOptions) GetIsMultiRepo() bool { + if s == nil { + return false + } + return s.IsMultiRepo +} + +// GetIsPubliclyLeaked returns the IsPubliclyLeaked field. +func (s *SecretScanningAlertListOptions) GetIsPubliclyLeaked() bool { + if s == nil { + return false + } + return s.IsPubliclyLeaked +} + +// GetResolution returns the Resolution field. +func (s *SecretScanningAlertListOptions) GetResolution() string { + if s == nil { + return "" + } + return s.Resolution +} + +// GetSecretType returns the SecretType field. +func (s *SecretScanningAlertListOptions) GetSecretType() string { + if s == nil { + return "" + } + return s.SecretType +} + +// GetSort returns the Sort field. +func (s *SecretScanningAlertListOptions) GetSort() string { + if s == nil { + return "" + } + return s.Sort +} + +// GetState returns the State field. +func (s *SecretScanningAlertListOptions) GetState() string { + if s == nil { + return "" + } + return s.State +} + +// GetValidity returns the Validity field. +func (s *SecretScanningAlertListOptions) GetValidity() string { + if s == nil { + return "" + } + return s.Validity +} + // GetDetails returns the Details field. func (s *SecretScanningAlertLocation) GetDetails() *SecretScanningAlertLocationDetails { if s == nil { @@ -27918,6 +37790,14 @@ func (s *SecretScanningAlertUpdateOptions) GetResolutionComment() string { return *s.ResolutionComment } +// GetState returns the State field. +func (s *SecretScanningAlertUpdateOptions) GetState() string { + if s == nil { + return "" + } + return s.State +} + // GetCustomPatternVersion returns the CustomPatternVersion field if it's non-nil, zero value otherwise. func (s *SecretScanningCustomPatternSetting) GetCustomPatternVersion() string { if s == nil || s.CustomPatternVersion == nil { @@ -27926,6 +37806,38 @@ func (s *SecretScanningCustomPatternSetting) GetCustomPatternVersion() string { return *s.CustomPatternVersion } +// GetPushProtectionSetting returns the PushProtectionSetting field. +func (s *SecretScanningCustomPatternSetting) GetPushProtectionSetting() string { + if s == nil { + return "" + } + return s.PushProtectionSetting +} + +// GetTokenType returns the TokenType field. +func (s *SecretScanningCustomPatternSetting) GetTokenType() string { + if s == nil { + return "" + } + return s.TokenType +} + +// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise. +func (s *SecretScanningDelegatedBypassOptions) GetReviewers() []*BypassReviewer { + if s == nil || s.Reviewers == nil { + return nil + } + return s.Reviewers +} + +// GetCustomPatternOverrides returns the CustomPatternOverrides slice if it's non-nil, nil otherwise. +func (s *SecretScanningPatternConfigs) GetCustomPatternOverrides() []*SecretScanningPatternOverride { + if s == nil || s.CustomPatternOverrides == nil { + return nil + } + return s.CustomPatternOverrides +} + // GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. func (s *SecretScanningPatternConfigs) GetPatternConfigVersion() string { if s == nil || s.PatternConfigVersion == nil { @@ -27934,6 +37846,14 @@ func (s *SecretScanningPatternConfigs) GetPatternConfigVersion() string { return *s.PatternConfigVersion } +// GetProviderPatternOverrides returns the ProviderPatternOverrides slice if it's non-nil, nil otherwise. +func (s *SecretScanningPatternConfigs) GetProviderPatternOverrides() []*SecretScanningPatternOverride { + if s == nil || s.ProviderPatternOverrides == nil { + return nil + } + return s.ProviderPatternOverrides +} + // GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. func (s *SecretScanningPatternConfigsUpdate) GetPatternConfigVersion() string { if s == nil || s.PatternConfigVersion == nil { @@ -27942,6 +37862,14 @@ func (s *SecretScanningPatternConfigsUpdate) GetPatternConfigVersion() string { return *s.PatternConfigVersion } +// GetCustomPatternSettings returns the CustomPatternSettings slice if it's non-nil, nil otherwise. +func (s *SecretScanningPatternConfigsUpdateOptions) GetCustomPatternSettings() []*SecretScanningCustomPatternSetting { + if s == nil || s.CustomPatternSettings == nil { + return nil + } + return s.CustomPatternSettings +} + // GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. func (s *SecretScanningPatternConfigsUpdateOptions) GetPatternConfigVersion() string { if s == nil || s.PatternConfigVersion == nil { @@ -27950,6 +37878,14 @@ func (s *SecretScanningPatternConfigsUpdateOptions) GetPatternConfigVersion() st return *s.PatternConfigVersion } +// GetProviderPatternSettings returns the ProviderPatternSettings slice if it's non-nil, nil otherwise. +func (s *SecretScanningPatternConfigsUpdateOptions) GetProviderPatternSettings() []*SecretScanningProviderPatternSetting { + if s == nil || s.ProviderPatternSettings == nil { + return nil + } + return s.ProviderPatternSettings +} + // GetAlertTotal returns the AlertTotal field if it's non-nil, zero value otherwise. func (s *SecretScanningPatternOverride) GetAlertTotal() int { if s == nil || s.AlertTotal == nil { @@ -28046,6 +37982,22 @@ func (s *SecretScanningPatternOverride) GetTokenType() string { return *s.TokenType } +// GetPushProtectionSetting returns the PushProtectionSetting field. +func (s *SecretScanningProviderPatternSetting) GetPushProtectionSetting() string { + if s == nil { + return "" + } + return s.PushProtectionSetting +} + +// GetTokenType returns the TokenType field. +func (s *SecretScanningProviderPatternSetting) GetTokenType() string { + if s == nil { + return "" + } + return s.TokenType +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanningPushProtection) GetStatus() string { if s == nil || s.Status == nil { @@ -28054,6 +38006,38 @@ func (s *SecretScanningPushProtection) GetStatus() string { return *s.Status } +// GetBackfillScans returns the BackfillScans slice if it's non-nil, nil otherwise. +func (s *SecretScanningScanHistory) GetBackfillScans() []*SecretsScan { + if s == nil || s.BackfillScans == nil { + return nil + } + return s.BackfillScans +} + +// GetCustomPatternBackfillScans returns the CustomPatternBackfillScans slice if it's non-nil, nil otherwise. +func (s *SecretScanningScanHistory) GetCustomPatternBackfillScans() []*CustomPatternBackfillScan { + if s == nil || s.CustomPatternBackfillScans == nil { + return nil + } + return s.CustomPatternBackfillScans +} + +// GetIncrementalScans returns the IncrementalScans slice if it's non-nil, nil otherwise. +func (s *SecretScanningScanHistory) GetIncrementalScans() []*SecretsScan { + if s == nil || s.IncrementalScans == nil { + return nil + } + return s.IncrementalScans +} + +// GetPatternUpdateScans returns the PatternUpdateScans slice if it's non-nil, nil otherwise. +func (s *SecretScanningScanHistory) GetPatternUpdateScans() []*SecretsScan { + if s == nil || s.PatternUpdateScans == nil { + return nil + } + return s.PatternUpdateScans +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanningValidityChecks) GetStatus() string { if s == nil || s.Status == nil { @@ -28078,6 +38062,22 @@ func (s *SecretsScan) GetStartedAt() Timestamp { return *s.StartedAt } +// GetStatus returns the Status field. +func (s *SecretsScan) GetStatus() string { + if s == nil { + return "" + } + return s.Status +} + +// GetType returns the Type field. +func (s *SecretsScan) GetType() string { + if s == nil { + return "" + } + return s.Type +} + // GetAuthor returns the Author field. func (s *SecurityAdvisory) GetAuthor() *User { if s == nil { @@ -28094,6 +38094,22 @@ func (s *SecurityAdvisory) GetClosedAt() Timestamp { return *s.ClosedAt } +// GetCollaboratingTeams returns the CollaboratingTeams slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCollaboratingTeams() []*Team { + if s == nil || s.CollaboratingTeams == nil { + return nil + } + return s.CollaboratingTeams +} + +// GetCollaboratingUsers returns the CollaboratingUsers slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCollaboratingUsers() []*User { + if s == nil || s.CollaboratingUsers == nil { + return nil + } + return s.CollaboratingUsers +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -28102,6 +38118,22 @@ func (s *SecurityAdvisory) GetCreatedAt() Timestamp { return *s.CreatedAt } +// GetCredits returns the Credits slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCredits() []*RepoAdvisoryCredit { + if s == nil || s.Credits == nil { + return nil + } + return s.Credits +} + +// GetCreditsDetailed returns the CreditsDetailed slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCreditsDetailed() []*RepoAdvisoryCreditDetailed { + if s == nil || s.CreditsDetailed == nil { + return nil + } + return s.CreditsDetailed +} + // GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetCVEID() string { if s == nil || s.CVEID == nil { @@ -28118,6 +38150,22 @@ func (s *SecurityAdvisory) GetCVSS() *AdvisoryCVSS { return s.CVSS } +// GetCWEIDs returns the CWEIDs slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCWEIDs() []string { + if s == nil || s.CWEIDs == nil { + return nil + } + return s.CWEIDs +} + +// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetCWEs() []*AdvisoryCWEs { + if s == nil || s.CWEs == nil { + return nil + } + return s.CWEs +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetDescription() string { if s == nil || s.Description == nil { @@ -28142,6 +38190,14 @@ func (s *SecurityAdvisory) GetHTMLURL() string { return *s.HTMLURL } +// GetIdentifiers returns the Identifiers slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetIdentifiers() []*AdvisoryIdentifier { + if s == nil || s.Identifiers == nil { + return nil + } + return s.Identifiers +} + // GetPrivateFork returns the PrivateFork field. func (s *SecurityAdvisory) GetPrivateFork() *Repository { if s == nil { @@ -28166,6 +38222,14 @@ func (s *SecurityAdvisory) GetPublisher() *User { return s.Publisher } +// GetReferences returns the References slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetReferences() []*AdvisoryReference { + if s == nil || s.References == nil { + return nil + } + return s.References +} + // GetSeverity returns the Severity field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetSeverity() string { if s == nil || s.Severity == nil { @@ -28214,6 +38278,14 @@ func (s *SecurityAdvisory) GetURL() string { return *s.URL } +// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise. +func (s *SecurityAdvisory) GetVulnerabilities() []*AdvisoryVulnerability { + if s == nil || s.Vulnerabilities == nil { + return nil + } + return s.Vulnerabilities +} + // GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetWithdrawnAt() Timestamp { if s == nil || s.WithdrawnAt == nil { @@ -28294,6 +38366,14 @@ func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { return s.AdvancedSecurity } +// GetCodeSecurity returns the CodeSecurity field. +func (s *SecurityAndAnalysis) GetCodeSecurity() *CodeSecurity { + if s == nil { + return nil + } + return s.CodeSecurity +} + // GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field. func (s *SecurityAndAnalysis) GetDependabotSecurityUpdates() *DependabotSecurityUpdates { if s == nil { @@ -28390,6 +38470,14 @@ func (s *SecurityAndAnalysisEvent) GetSender() *User { return s.Sender } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (s *SelectedReposList) GetRepositories() []*Repository { + if s == nil || s.Repositories == nil { + return nil + } + return s.Repositories +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (s *SelectedReposList) GetTotalCount() int { if s == nil || s.TotalCount == nil { @@ -28398,6 +38486,22 @@ func (s *SelectedReposList) GetTotalCount() int { return *s.TotalCount } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (s *SelfHostedRunnersAllowedRepos) GetRepositories() []*Repository { + if s == nil || s.Repositories == nil { + return nil + } + return s.Repositories +} + +// GetTotalCount returns the TotalCount field. +func (s *SelfHostedRunnersAllowedRepos) GetTotalCount() int { + if s == nil { + return 0 + } + return s.TotalCount +} + // GetEnabledRepositories returns the EnabledRepositories field if it's non-nil, zero value otherwise. func (s *SelfHostedRunnersSettingsOrganization) GetEnabledRepositories() string { if s == nil || s.EnabledRepositories == nil { @@ -28446,6 +38550,22 @@ func (s *ServerInstances) GetItems() *ServiceInstanceItems { return s.Items } +// GetType returns the Type field. +func (s *ServerInstances) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +// GetHostname returns the Hostname field. +func (s *ServerItemProperties) GetHostname() string { + if s == nil { + return "" + } + return s.Hostname +} + // GetLastSync returns the LastSync field. func (s *ServerItemProperties) GetLastSync() *LastLicenseSync { if s == nil { @@ -28454,6 +38574,14 @@ func (s *ServerItemProperties) GetLastSync() *LastLicenseSync { return s.LastSync } +// GetServerID returns the ServerID field. +func (s *ServerItemProperties) GetServerID() string { + if s == nil { + return "" + } + return s.ServerID +} + // GetProperties returns the Properties field. func (s *ServiceInstanceItems) GetProperties() *ServerItemProperties { if s == nil { @@ -28462,6 +38590,38 @@ func (s *ServiceInstanceItems) GetProperties() *ServerItemProperties { return s.Properties } +// GetType returns the Type field. +func (s *ServiceInstanceItems) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +// GetSelectedOrganizationIDs returns the SelectedOrganizationIDs slice if it's non-nil, nil otherwise. +func (s *SetOrgAccessRunnerGroupRequest) GetSelectedOrganizationIDs() []int64 { + if s == nil || s.SelectedOrganizationIDs == nil { + return nil + } + return s.SelectedOrganizationIDs +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (s *SetRepoAccessRunnerGroupRequest) GetSelectedRepositoryIDs() []int64 { + if s == nil || s.SelectedRepositoryIDs == nil { + return nil + } + return s.SelectedRepositoryIDs +} + +// GetRunners returns the Runners slice if it's non-nil, nil otherwise. +func (s *SetRunnerGroupRunnersRequest) GetRunners() []int64 { + if s == nil || s.Runners == nil { + return nil + } + return s.Runners +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (s *SignatureRequirementEnforcementLevelChanges) GetFrom() string { if s == nil || s.From == nil { @@ -28518,6 +38678,22 @@ func (s *SignatureVerification) GetVerified() bool { return *s.Verified } +// GetNegate returns the Negate field. +func (s *SimplePatternRuleParameters) GetNegate() bool { + if s == nil { + return false + } + return s.Negate +} + +// GetPattern returns the Pattern field. +func (s *SimplePatternRuleParameters) GetPattern() string { + if s == nil { + return "" + } + return s.Pattern +} + // GetProvider returns the Provider field if it's non-nil, zero value otherwise. func (s *SocialAccount) GetProvider() string { if s == nil || s.Provider == nil { @@ -28630,6 +38806,46 @@ func (s *SourceImportAuthor) GetURL() string { return *s.URL } +// GetDomain returns the Domain field. +func (s *SplunkConfig) GetDomain() string { + if s == nil { + return "" + } + return s.Domain +} + +// GetEncryptedToken returns the EncryptedToken field. +func (s *SplunkConfig) GetEncryptedToken() string { + if s == nil { + return "" + } + return s.EncryptedToken +} + +// GetKeyID returns the KeyID field. +func (s *SplunkConfig) GetKeyID() string { + if s == nil { + return "" + } + return s.KeyID +} + +// GetPort returns the Port field. +func (s *SplunkConfig) GetPort() uint16 { + if s == nil { + return 0 + } + return s.Port +} + +// GetSSLVerify returns the SSLVerify field. +func (s *SplunkConfig) GetSSLVerify() bool { + if s == nil { + return false + } + return s.SSLVerify +} + // GetPrivacyLevel returns the PrivacyLevel field if it's non-nil, zero value otherwise. func (s *SponsorshipChanges) GetPrivacyLevel() string { if s == nil || s.PrivacyLevel == nil { @@ -28710,6 +38926,14 @@ func (s *SponsorshipTier) GetFrom() string { return *s.From } +// GetKey returns the Key field. +func (s *SSHKeyOptions) GetKey() string { + if s == nil { + return "" + } + return s.Key +} + // GetHostname returns the Hostname field if it's non-nil, zero value otherwise. func (s *SSHKeyStatus) GetHostname() string { if s == nil || s.Hostname == nil { @@ -28854,6 +39078,14 @@ func (s *StarredRepository) GetStarredAt() Timestamp { return *s.StarredAt } +// GetBranches returns the Branches slice if it's non-nil, nil otherwise. +func (s *StatusEvent) GetBranches() []*Branch { + if s == nil || s.Branches == nil { + return nil + } + return s.Branches +} + // GetCommit returns the Commit field. func (s *StatusEvent) GetCommit() *RepositoryCommit { if s == nil { @@ -28966,6 +39198,30 @@ func (s *StatusEvent) GetUpdatedAt() Timestamp { return *s.UpdatedAt } +// GetDaysLeftInBillingCycle returns the DaysLeftInBillingCycle field. +func (s *StorageBilling) GetDaysLeftInBillingCycle() int { + if s == nil { + return 0 + } + return s.DaysLeftInBillingCycle +} + +// GetEstimatedPaidStorageForMonth returns the EstimatedPaidStorageForMonth field. +func (s *StorageBilling) GetEstimatedPaidStorageForMonth() int { + if s == nil { + return 0 + } + return s.EstimatedPaidStorageForMonth +} + +// GetEstimatedStorageForMonth returns the EstimatedStorageForMonth field. +func (s *StorageBilling) GetEstimatedStorageForMonth() int { + if s == nil { + return 0 + } + return s.EstimatedStorageForMonth +} + // GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. func (s *SubIssueRequest) GetAfterID() int64 { if s == nil || s.AfterID == nil { @@ -28990,6 +39246,14 @@ func (s *SubIssueRequest) GetReplaceParent() bool { return *s.ReplaceParent } +// GetSubIssueID returns the SubIssueID field. +func (s *SubIssueRequest) GetSubIssueID() int64 { + if s == nil { + return 0 + } + return s.SubIssueID +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *Subscription) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -29046,6 +39310,14 @@ func (s *Subscription) GetURL() string { return *s.URL } +// GetNodes returns the Nodes slice if it's non-nil, nil otherwise. +func (s *SystemRequirements) GetNodes() []*SystemRequirementsNode { + if s == nil || s.Nodes == nil { + return nil + } + return s.Nodes +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SystemRequirements) GetStatus() string { if s == nil || s.Status == nil { @@ -29062,6 +39334,14 @@ func (s *SystemRequirementsNode) GetHostname() string { return *s.Hostname } +// GetRolesStatus returns the RolesStatus slice if it's non-nil, nil otherwise. +func (s *SystemRequirementsNode) GetRolesStatus() []*SystemRequirementsNodeRoleStatus { + if s == nil || s.RolesStatus == nil { + return nil + } + return s.RolesStatus +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SystemRequirementsNode) GetStatus() string { if s == nil || s.Status == nil { @@ -29414,6 +39694,22 @@ func (t *TeamAddEvent) GetTeam() *Team { return t.Team } +// GetRole returns the Role field. +func (t *TeamAddTeamMembershipOptions) GetRole() string { + if t == nil { + return "" + } + return t.Role +} + +// GetPermission returns the Permission field. +func (t *TeamAddTeamRepoOptions) GetPermission() string { + if t == nil { + return "" + } + return t.Permission +} + // GetDescription returns the Description field. func (t *TeamChange) GetDescription() *TeamDescription { if t == nil { @@ -29734,6 +40030,14 @@ func (t *TeamLDAPMapping) GetURL() string { return *t.URL } +// GetRole returns the Role field. +func (t *TeamListTeamMembersOptions) GetRole() string { + if t == nil { + return "" + } + return t.Role +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (t *TeamName) GetFrom() string { if t == nil || t.From == nil { @@ -29846,6 +40150,14 @@ func (t *TextMatch) GetFragment() string { return *t.Fragment } +// GetMatches returns the Matches slice if it's non-nil, nil otherwise. +func (t *TextMatch) GetMatches() []*Match { + if t == nil || t.Matches == nil { + return nil + } + return t.Matches +} + // GetObjectType returns the ObjectType field if it's non-nil, zero value otherwise. func (t *TextMatch) GetObjectType() string { if t == nil || t.ObjectType == nil { @@ -29982,6 +40294,14 @@ func (t *Timeline) GetMilestone() *Milestone { return t.Milestone } +// GetParents returns the Parents slice if it's non-nil, nil otherwise. +func (t *Timeline) GetParents() []*Commit { + if t == nil || t.Parents == nil { + return nil + } + return t.Parents +} + // GetPerformedViaGithubApp returns the PerformedViaGithubApp field. func (t *Timeline) GetPerformedViaGithubApp() *App { if t == nil { @@ -30150,12 +40470,12 @@ func (t *TopicResult) GetName() string { return *t.Name } -// GetScore returns the Score field. -func (t *TopicResult) GetScore() *float64 { - if t == nil { - return nil +// GetScore returns the Score field if it's non-nil, zero value otherwise. +func (t *TopicResult) GetScore() float64 { + if t == nil || t.Score == nil { + return 0 } - return t.Score + return *t.Score } // GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise. @@ -30182,6 +40502,14 @@ func (t *TopicsSearchResult) GetIncompleteResults() bool { return *t.IncompleteResults } +// GetTopics returns the Topics slice if it's non-nil, nil otherwise. +func (t *TopicsSearchResult) GetTopics() []*TopicResult { + if t == nil || t.Topics == nil { + return nil + } + return t.Topics +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (t *TopicsSearchResult) GetTotal() int { if t == nil || t.Total == nil { @@ -30190,6 +40518,38 @@ func (t *TopicsSearchResult) GetTotal() int { return *t.Total } +// GetTotalActiveCachesCount returns the TotalActiveCachesCount field. +func (t *TotalCacheUsage) GetTotalActiveCachesCount() int { + if t == nil { + return 0 + } + return t.TotalActiveCachesCount +} + +// GetTotalActiveCachesUsageSizeInBytes returns the TotalActiveCachesUsageSizeInBytes field. +func (t *TotalCacheUsage) GetTotalActiveCachesUsageSizeInBytes() int64 { + if t == nil { + return 0 + } + return t.TotalActiveCachesUsageSizeInBytes +} + +// GetPer returns the Per field. +func (t *TrafficBreakdownOptions) GetPer() string { + if t == nil { + return "" + } + return t.Per +} + +// GetClones returns the Clones slice if it's non-nil, nil otherwise. +func (t *TrafficClones) GetClones() []*TrafficData { + if t == nil || t.Clones == nil { + return nil + } + return t.Clones +} + // GetCount returns the Count field if it's non-nil, zero value otherwise. func (t *TrafficClones) GetCount() int { if t == nil || t.Count == nil { @@ -30302,6 +40662,14 @@ func (t *TrafficViews) GetUniques() int { return *t.Uniques } +// GetViews returns the Views slice if it's non-nil, nil otherwise. +func (t *TrafficViews) GetViews() []*TrafficData { + if t == nil || t.Views == nil { + return nil + } + return t.Views +} + // GetNewName returns the NewName field if it's non-nil, zero value otherwise. func (t *TransferRequest) GetNewName() string { if t == nil || t.NewName == nil { @@ -30310,6 +40678,30 @@ func (t *TransferRequest) GetNewName() string { return *t.NewName } +// GetNewOwner returns the NewOwner field. +func (t *TransferRequest) GetNewOwner() string { + if t == nil { + return "" + } + return t.NewOwner +} + +// GetTeamID returns the TeamID slice if it's non-nil, nil otherwise. +func (t *TransferRequest) GetTeamID() []int64 { + if t == nil || t.TeamID == nil { + return nil + } + return t.TeamID +} + +// GetEntries returns the Entries slice if it's non-nil, nil otherwise. +func (t *Tree) GetEntries() []*TreeEntry { + if t == nil || t.Entries == nil { + return nil + } + return t.Entries +} + // GetSHA returns the SHA field if it's non-nil, zero value otherwise. func (t *Tree) GetSHA() string { if t == nil || t.SHA == nil { @@ -30382,6 +40774,22 @@ func (t *TreeEntry) GetURL() string { return *t.URL } +// GetClientID returns the ClientID field. +func (u *UnauthenticatedRateLimitedTransport) GetClientID() string { + if u == nil { + return "" + } + return u.ClientID +} + +// GetClientSecret returns the ClientSecret field. +func (u *UnauthenticatedRateLimitedTransport) GetClientSecret() string { + if u == nil { + return "" + } + return u.ClientSecret +} + // GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. func (u *UpdateAppInstallationRepositoriesOptions) GetRepositorySelection() string { if u == nil || u.RepositorySelection == nil { @@ -30390,6 +40798,22 @@ func (u *UpdateAppInstallationRepositoriesOptions) GetRepositorySelection() stri return *u.RepositorySelection } +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (u *UpdateAppInstallationRepositoriesOptions) GetSelectedRepositoryIDs() []int64 { + if u == nil || u.SelectedRepositoryIDs == nil { + return nil + } + return u.SelectedRepositoryIDs +} + +// GetOp returns the Op field. +func (u *UpdateAttributeForSCIMUserOperations) GetOp() string { + if u == nil { + return "" + } + return u.Op +} + // GetPath returns the Path field if it's non-nil, zero value otherwise. func (u *UpdateAttributeForSCIMUserOperations) GetPath() string { if u == nil || u.Path == nil { @@ -30398,6 +40822,46 @@ func (u *UpdateAttributeForSCIMUserOperations) GetPath() string { return *u.Path } +// GetValue returns the Value field. +func (u *UpdateAttributeForSCIMUserOperations) GetValue() json.RawMessage { + if u == nil { + return json.RawMessage{} + } + return u.Value +} + +// GetOperations returns the Operations field. +func (u *UpdateAttributeForSCIMUserOptions) GetOperations() UpdateAttributeForSCIMUserOperations { + if u == nil { + return UpdateAttributeForSCIMUserOperations{} + } + return u.Operations +} + +// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise. +func (u *UpdateAttributeForSCIMUserOptions) GetSchemas() []string { + if u == nil || u.Schemas == nil { + return nil + } + return u.Schemas +} + +// GetParameters returns the Parameters field. +func (u *UpdateBranchRule) GetParameters() UpdateRuleParameters { + if u == nil { + return UpdateRuleParameters{} + } + return u.Parameters +} + +// GetActions returns the Actions slice if it's non-nil, nil otherwise. +func (u *UpdateCheckRunOptions) GetActions() []*CheckRunAction { + if u == nil || u.Actions == nil { + return nil + } + return u.Actions +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (u *UpdateCheckRunOptions) GetCompletedAt() Timestamp { if u == nil || u.CompletedAt == nil { @@ -30430,6 +40894,14 @@ func (u *UpdateCheckRunOptions) GetExternalID() string { return *u.ExternalID } +// GetName returns the Name field. +func (u *UpdateCheckRunOptions) GetName() string { + if u == nil { + return "" + } + return u.Name +} + // GetOutput returns the Output field. func (u *UpdateCheckRunOptions) GetOutput() *CheckRunOutput { if u == nil { @@ -30454,6 +40926,54 @@ func (u *UpdateCodespaceOptions) GetMachine() string { return *u.Machine } +// GetRecentFolders returns the RecentFolders slice if it's non-nil, nil otherwise. +func (u *UpdateCodespaceOptions) GetRecentFolders() []string { + if u == nil || u.RecentFolders == nil { + return nil + } + return u.RecentFolders +} + +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (u *UpdateCustomOrgRoleRequest) GetBaseRole() string { + if u == nil || u.BaseRole == nil { + return "" + } + return *u.BaseRole +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (u *UpdateCustomOrgRoleRequest) GetDescription() string { + if u == nil || u.Description == nil { + return "" + } + return *u.Description +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (u *UpdateCustomOrgRoleRequest) GetName() string { + if u == nil || u.Name == nil { + return "" + } + return *u.Name +} + +// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise. +func (u *UpdateCustomOrgRoleRequest) GetPermissions() []string { + if u == nil || u.Permissions == nil { + return nil + } + return u.Permissions +} + +// GetLanguages returns the Languages slice if it's non-nil, nil otherwise. +func (u *UpdateDefaultSetupConfigurationOptions) GetLanguages() []string { + if u == nil || u.Languages == nil { + return nil + } + return u.Languages +} + // GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. func (u *UpdateDefaultSetupConfigurationOptions) GetQuerySuite() string { if u == nil || u.QuerySuite == nil { @@ -30462,6 +40982,14 @@ func (u *UpdateDefaultSetupConfigurationOptions) GetQuerySuite() string { return *u.QuerySuite } +// GetState returns the State field. +func (u *UpdateDefaultSetupConfigurationOptions) GetState() string { + if u == nil { + return "" + } + return u.State +} + // GetRunID returns the RunID field if it's non-nil, zero value otherwise. func (u *UpdateDefaultSetupConfigurationResponse) GetRunID() int64 { if u == nil || u.RunID == nil { @@ -30494,6 +41022,14 @@ func (u *UpdateEnterpriseRunnerGroupRequest) GetName() string { return *u.Name } +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (u *UpdateEnterpriseRunnerGroupRequest) 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 *UpdateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { if u == nil || u.RestrictedToWorkflows == nil { @@ -30502,6 +41038,14 @@ func (u *UpdateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { return *u.RestrictedToWorkflows } +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (u *UpdateEnterpriseRunnerGroupRequest) GetSelectedWorkflows() []string { + if u == nil || u.SelectedWorkflows == nil { + return nil + } + return u.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (u *UpdateEnterpriseRunnerGroupRequest) GetVisibility() string { if u == nil || u.Visibility == nil { @@ -30566,6 +41110,62 @@ func (u *UpdateHostedRunnerRequest) GetSize() string { return *u.Size } +// GetAccountID returns the AccountID field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetAccountID() string { + if u == nil || u.AccountID == nil { + return "" + } + return *u.AccountID +} + +// GetAudience returns the Audience field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetAudience() string { + if u == nil || u.Audience == nil { + return "" + } + return *u.Audience +} + +// GetAuthType returns the AuthType field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetAuthType() string { + if u == nil || u.AuthType == nil { + return "" + } + return *u.AuthType +} + +// GetAWSRegion returns the AWSRegion field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetAWSRegion() string { + if u == nil || u.AWSRegion == nil { + return "" + } + return *u.AWSRegion +} + +// GetClientID returns the ClientID field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetClientID() string { + if u == nil || u.ClientID == nil { + return "" + } + return *u.ClientID +} + +// GetDomain returns the Domain field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetDomain() string { + if u == nil || u.Domain == nil { + return "" + } + return *u.Domain +} + +// GetDomainOwner returns the DomainOwner field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetDomainOwner() string { + if u == nil || u.DomainOwner == nil { + return "" + } + return *u.DomainOwner +} + // GetEncryptedValue returns the EncryptedValue field if it's non-nil, zero value otherwise. func (u *UpdateOrganizationPrivateRegistry) GetEncryptedValue() string { if u == nil || u.EncryptedValue == nil { @@ -30574,6 +41174,22 @@ func (u *UpdateOrganizationPrivateRegistry) GetEncryptedValue() string { return *u.EncryptedValue } +// GetIdentityMappingName returns the IdentityMappingName field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetIdentityMappingName() string { + if u == nil || u.IdentityMappingName == nil { + return "" + } + return *u.IdentityMappingName +} + +// GetJFrogOIDCProviderName returns the JFrogOIDCProviderName field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetJFrogOIDCProviderName() string { + if u == nil || u.JFrogOIDCProviderName == nil { + return "" + } + return *u.JFrogOIDCProviderName +} + // GetKeyID returns the KeyID field if it's non-nil, zero value otherwise. func (u *UpdateOrganizationPrivateRegistry) GetKeyID() string { if u == nil || u.KeyID == nil { @@ -30582,12 +41198,44 @@ func (u *UpdateOrganizationPrivateRegistry) GetKeyID() string { return *u.KeyID } -// GetRegistryType returns the RegistryType field if it's non-nil, zero value otherwise. -func (u *UpdateOrganizationPrivateRegistry) GetRegistryType() string { - if u == nil || u.RegistryType == nil { +// GetRegistryType returns the RegistryType field. +func (u *UpdateOrganizationPrivateRegistry) GetRegistryType() *PrivateRegistryType { + if u == nil { + return nil + } + return u.RegistryType +} + +// GetReplacesBase returns the ReplacesBase field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetReplacesBase() bool { + if u == nil || u.ReplacesBase == nil { + return false + } + return *u.ReplacesBase +} + +// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetRoleName() string { + if u == nil || u.RoleName == nil { return "" } - return *u.RegistryType + return *u.RoleName +} + +// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetSelectedRepositoryIDs() []int64 { + if u == nil || u.SelectedRepositoryIDs == nil { + return nil + } + return u.SelectedRepositoryIDs +} + +// GetTenantID returns the TenantID field if it's non-nil, zero value otherwise. +func (u *UpdateOrganizationPrivateRegistry) GetTenantID() string { + if u == nil || u.TenantID == nil { + return "" + } + return *u.TenantID } // GetURL returns the URL field if it's non-nil, zero value otherwise. @@ -30622,6 +41270,30 @@ func (u *UpdateProjectItemOptions) GetArchived() bool { return *u.Archived } +// GetFields returns the Fields slice if it's non-nil, nil otherwise. +func (u *UpdateProjectItemOptions) GetFields() []*UpdateProjectV2Field { + if u == nil || u.Fields == nil { + return nil + } + return u.Fields +} + +// GetID returns the ID field. +func (u *UpdateProjectV2Field) GetID() int64 { + if u == nil { + return 0 + } + return u.ID +} + +// GetValue returns the Value field. +func (u *UpdateProjectV2Field) GetValue() any { + if u == nil { + return nil + } + return u.Value +} + // GetForce returns the Force field if it's non-nil, zero value otherwise. func (u *UpdateRef) GetForce() bool { if u == nil || u.Force == nil { @@ -30630,6 +41302,22 @@ func (u *UpdateRef) GetForce() bool { return *u.Force } +// GetSHA returns the SHA field. +func (u *UpdateRef) GetSHA() string { + if u == nil { + return "" + } + return u.SHA +} + +// GetUpdateAllowsFetchAndMerge returns the UpdateAllowsFetchAndMerge field. +func (u *UpdateRuleParameters) GetUpdateAllowsFetchAndMerge() bool { + if u == nil { + return false + } + return u.UpdateAllowsFetchAndMerge +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetAllowsPublicRepositories() bool { if u == nil || u.AllowsPublicRepositories == nil { @@ -30662,6 +41350,14 @@ func (u *UpdateRunnerGroupRequest) GetRestrictedToWorkflows() bool { return *u.RestrictedToWorkflows } +// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise. +func (u *UpdateRunnerGroupRequest) GetSelectedWorkflows() []string { + if u == nil || u.SelectedWorkflows == nil { + return nil + } + return u.SelectedWorkflows +} + // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetVisibility() string { if u == nil || u.Visibility == nil { @@ -30670,6 +41366,70 @@ func (u *UpdateRunnerGroupRequest) GetVisibility() string { return *u.Visibility } +// GetLicense returns the License field. +func (u *UploadLicenseOptions) GetLicense() string { + if u == nil { + return "" + } + return u.License +} + +// GetLabel returns the Label field. +func (u *UploadOptions) GetLabel() string { + if u == nil { + return "" + } + return u.Label +} + +// GetMediaType returns the MediaType field. +func (u *UploadOptions) GetMediaType() string { + if u == nil { + return "" + } + return u.MediaType +} + +// GetName returns the Name field. +func (u *UploadOptions) GetName() string { + if u == nil { + return "" + } + return u.Name +} + +// GetDate returns the Date field. +func (u *UsageItem) GetDate() string { + if u == nil { + return "" + } + return u.Date +} + +// GetDiscountAmount returns the DiscountAmount field. +func (u *UsageItem) GetDiscountAmount() float64 { + if u == nil { + return 0 + } + return u.DiscountAmount +} + +// GetGrossAmount returns the GrossAmount field. +func (u *UsageItem) GetGrossAmount() float64 { + if u == nil { + return 0 + } + return u.GrossAmount +} + +// GetNetAmount returns the NetAmount field. +func (u *UsageItem) GetNetAmount() float64 { + if u == nil { + return 0 + } + return u.NetAmount +} + // GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise. func (u *UsageItem) GetOrganizationName() string { if u == nil || u.OrganizationName == nil { @@ -30678,6 +41438,30 @@ func (u *UsageItem) GetOrganizationName() string { return *u.OrganizationName } +// GetPricePerUnit returns the PricePerUnit field. +func (u *UsageItem) GetPricePerUnit() float64 { + if u == nil { + return 0 + } + return u.PricePerUnit +} + +// GetProduct returns the Product field. +func (u *UsageItem) GetProduct() string { + if u == nil { + return "" + } + return u.Product +} + +// GetQuantity returns the Quantity field. +func (u *UsageItem) GetQuantity() float64 { + if u == nil { + return 0 + } + return u.Quantity +} + // GetRepositoryName returns the RepositoryName field if it's non-nil, zero value otherwise. func (u *UsageItem) GetRepositoryName() string { if u == nil || u.RepositoryName == nil { @@ -30686,6 +41470,30 @@ func (u *UsageItem) GetRepositoryName() string { return *u.RepositoryName } +// GetSKU returns the SKU field. +func (u *UsageItem) GetSKU() string { + if u == nil { + return "" + } + return u.SKU +} + +// GetUnitType returns the UnitType field. +func (u *UsageItem) GetUnitType() string { + if u == nil { + return "" + } + return u.UnitType +} + +// GetUsageItems returns the UsageItems slice if it's non-nil, nil otherwise. +func (u *UsageReport) GetUsageItems() []*UsageItem { + if u == nil || u.UsageItems == nil { + return nil + } + return u.UsageItems +} + // GetDay returns the Day field if it's non-nil, zero value otherwise. func (u *UsageReportOptions) GetDay() int { if u == nil || u.Day == nil { @@ -30750,6 +41558,14 @@ func (u *User) GetBlog() string { return *u.Blog } +// GetBusinessPlus returns the BusinessPlus field if it's non-nil, zero value otherwise. +func (u *User) GetBusinessPlus() bool { + if u == nil || u.BusinessPlus == nil { + return false + } + return *u.BusinessPlus +} + // GetCollaborators returns the Collaborators field if it's non-nil, zero value otherwise. func (u *User) GetCollaborators() int { if u == nil || u.Collaborators == nil { @@ -30870,6 +41686,14 @@ func (u *User) GetID() int64 { return *u.ID } +// GetInheritedFrom returns the InheritedFrom slice if it's non-nil, nil otherwise. +func (u *User) GetInheritedFrom() []*Team { + if u == nil || u.InheritedFrom == nil { + return nil + } + return u.InheritedFrom +} + // GetLdapDn returns the LdapDn field if it's non-nil, zero value otherwise. func (u *User) GetLdapDn() string { if u == nil || u.LdapDn == nil { @@ -30910,6 +41734,14 @@ func (u *User) GetNodeID() string { return *u.NodeID } +// GetNotificationEmail returns the NotificationEmail field if it's non-nil, zero value otherwise. +func (u *User) GetNotificationEmail() string { + if u == nil || u.NotificationEmail == nil { + return "" + } + return *u.NotificationEmail +} + // GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise. func (u *User) GetOrganizationsURL() string { if u == nil || u.OrganizationsURL == nil { @@ -31022,6 +41854,14 @@ func (u *User) GetSuspendedAt() Timestamp { return *u.SuspendedAt } +// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise. +func (u *User) GetTextMatches() []*TextMatch { + if u == nil || u.TextMatches == nil { + return nil + } + return u.TextMatches +} + // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise. func (u *User) GetTotalPrivateRepos() int64 { if u == nil || u.TotalPrivateRepos == nil { @@ -31070,6 +41910,14 @@ func (u *User) GetURL() string { return *u.URL } +// GetUserViewType returns the UserViewType field if it's non-nil, zero value otherwise. +func (u *User) GetUserViewType() string { + if u == nil || u.UserViewType == nil { + return "" + } + return *u.UserViewType +} + // GetApp returns the App field. func (u *UserAuthorization) GetApp() *OAuthAPP { if u == nil { @@ -31126,6 +41974,14 @@ func (u *UserAuthorization) GetNoteURL() string { return *u.NoteURL } +// GetScopes returns the Scopes slice if it's non-nil, nil otherwise. +func (u *UserAuthorization) GetScopes() []string { + if u == nil || u.Scopes == nil { + return nil + } + return u.Scopes +} + // GetToken returns the Token field if it's non-nil, zero value otherwise. func (u *UserAuthorization) GetToken() string { if u == nil || u.Token == nil { @@ -31382,6 +42238,22 @@ func (u *UserLDAPMapping) GetURL() string { return *u.URL } +// GetPerPage returns the PerPage field. +func (u *UserListOptions) GetPerPage() int { + if u == nil { + return 0 + } + return u.PerPage +} + +// GetSince returns the Since field. +func (u *UserListOptions) GetSince() int64 { + if u == nil { + return 0 + } + return u.Since +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (u *UserMigration) GetCreatedAt() string { if u == nil || u.CreatedAt == nil { @@ -31422,6 +42294,14 @@ func (u *UserMigration) GetLockRepositories() bool { return *u.LockRepositories } +// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise. +func (u *UserMigration) GetRepositories() []*Repository { + if u == nil || u.Repositories == nil { + return nil + } + return u.Repositories +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (u *UserMigration) GetState() string { if u == nil || u.State == nil { @@ -31446,6 +42326,22 @@ func (u *UserMigration) GetURL() string { return *u.URL } +// GetExcludeAttachments returns the ExcludeAttachments field. +func (u *UserMigrationOptions) GetExcludeAttachments() bool { + if u == nil { + return false + } + return u.ExcludeAttachments +} + +// GetLockRepositories returns the LockRepositories field. +func (u *UserMigrationOptions) GetLockRepositories() bool { + if u == nil { + return false + } + return u.LockRepositories +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (u *UsersSearchResult) GetIncompleteResults() bool { if u == nil || u.IncompleteResults == nil { @@ -31462,6 +42358,14 @@ func (u *UsersSearchResult) GetTotal() int { return *u.Total } +// GetUsers returns the Users slice if it's non-nil, nil otherwise. +func (u *UsersSearchResult) GetUsers() []*User { + if u == nil || u.Users == nil { + return nil + } + return u.Users +} + // GetAdminUsers returns the AdminUsers field if it's non-nil, zero value otherwise. func (u *UserStats) GetAdminUsers() int { if u == nil || u.AdminUsers == nil { @@ -31550,6 +42454,14 @@ func (w *WatchEvent) GetSender() *User { return w.Sender } +// GetDays returns the Days slice if it's non-nil, nil otherwise. +func (w *WeeklyCommitActivity) GetDays() []int { + if w == nil || w.Days == nil { + return nil + } + return w.Days +} + // GetTotal returns the Total field if it's non-nil, zero value otherwise. func (w *WeeklyCommitActivity) GetTotal() int { if w == nil || w.Total == nil { @@ -31686,6 +42598,14 @@ func (w *WorkflowBill) GetTotalMS() int64 { return *w.TotalMS } +// GetInputs returns the Inputs field. +func (w *WorkflowDispatchEvent) GetInputs() json.RawMessage { + if w == nil { + return json.RawMessage{} + } + return w.Inputs +} + // GetInstallation returns the Installation field. func (w *WorkflowDispatchEvent) GetInstallation() *Installation { if w == nil { @@ -31822,6 +42742,14 @@ func (w *WorkflowJob) GetID() int64 { return *w.ID } +// GetLabels returns the Labels slice if it's non-nil, nil otherwise. +func (w *WorkflowJob) GetLabels() []string { + if w == nil || w.Labels == nil { + return nil + } + return w.Labels +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetName() string { if w == nil || w.Name == nil { @@ -31910,6 +42838,14 @@ func (w *WorkflowJob) GetStatus() string { return *w.Status } +// GetSteps returns the Steps slice if it's non-nil, nil otherwise. +func (w *WorkflowJob) GetSteps() []*TaskStep { + if w == nil || w.Steps == nil { + return nil + } + return w.Steps +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetURL() string { if w == nil || w.URL == nil { @@ -32222,6 +43158,22 @@ func (w *WorkflowRun) GetPreviousAttemptURL() string { return *w.PreviousAttemptURL } +// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise. +func (w *WorkflowRun) GetPullRequests() []*PullRequest { + if w == nil || w.PullRequests == nil { + return nil + } + return w.PullRequests +} + +// GetReferencedWorkflows returns the ReferencedWorkflows slice if it's non-nil, nil otherwise. +func (w *WorkflowRun) GetReferencedWorkflows() []*ReferencedWorkflow { + if w == nil || w.ReferencedWorkflows == nil { + return nil + } + return w.ReferencedWorkflows +} + // GetRepository returns the Repository field. func (w *WorkflowRun) GetRepository() *Repository { if w == nil { @@ -32318,6 +43270,14 @@ func (w *WorkflowRunAttemptOptions) GetExcludePullRequests() bool { return *w.ExcludePullRequests } +// GetJobRuns returns the JobRuns slice if it's non-nil, nil otherwise. +func (w *WorkflowRunBill) GetJobRuns() []*WorkflowRunJobRun { + if w == nil || w.JobRuns == nil { + return nil + } + return w.JobRuns +} + // GetJobs returns the Jobs field if it's non-nil, zero value otherwise. func (w *WorkflowRunBill) GetJobs() int { if w == nil || w.Jobs == nil { @@ -32414,6 +43374,14 @@ func (w *WorkflowRuns) GetTotalCount() int { return *w.TotalCount } +// GetWorkflowRuns returns the WorkflowRuns slice if it's non-nil, nil otherwise. +func (w *WorkflowRuns) GetWorkflowRuns() []*WorkflowRun { + if w == nil || w.WorkflowRuns == nil { + return nil + } + return w.WorkflowRuns +} + // GetBillable returns the Billable field. func (w *WorkflowRunUsage) GetBillable() *WorkflowRunBillMap { if w == nil { @@ -32438,6 +43406,22 @@ func (w *Workflows) GetTotalCount() int { return *w.TotalCount } +// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise. +func (w *Workflows) GetWorkflows() []*Workflow { + if w == nil || w.Workflows == nil { + return nil + } + return w.Workflows +} + +// GetParameters returns the Parameters field. +func (w *WorkflowsBranchRule) GetParameters() WorkflowsRuleParameters { + if w == nil { + return WorkflowsRuleParameters{} + } + return w.Parameters +} + // GetRequireApprovalForForkPRWorkflows returns the RequireApprovalForForkPRWorkflows field if it's non-nil, zero value otherwise. func (w *WorkflowsPermissions) GetRequireApprovalForForkPRWorkflows() bool { if w == nil || w.RequireApprovalForForkPRWorkflows == nil { @@ -32478,6 +43462,14 @@ func (w *WorkflowsPermissionsOpt) GetRequireApprovalForForkPRWorkflows() bool { return *w.RequireApprovalForForkPRWorkflows } +// GetRunWorkflowsFromForkPullRequests returns the RunWorkflowsFromForkPullRequests field. +func (w *WorkflowsPermissionsOpt) GetRunWorkflowsFromForkPullRequests() bool { + if w == nil { + return false + } + return w.RunWorkflowsFromForkPullRequests +} + // GetSendSecretsAndVariables returns the SendSecretsAndVariables field if it's non-nil, zero value otherwise. func (w *WorkflowsPermissionsOpt) GetSendSecretsAndVariables() bool { if w == nil || w.SendSecretsAndVariables == nil { @@ -32502,6 +43494,14 @@ func (w *WorkflowsRuleParameters) GetDoNotEnforceOnCreate() bool { return *w.DoNotEnforceOnCreate } +// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise. +func (w *WorkflowsRuleParameters) GetWorkflows() []*RuleWorkflow { + if w == nil || w.Workflows == nil { + return nil + } + return w.Workflows +} + // GetBillable returns the Billable field. func (w *WorkflowUsage) GetBillable() *WorkflowBillMap { if w == nil { diff --git a/vendor/github.com/google/go-github/v84/github/github-iterators.go b/vendor/github.com/google/go-github/v88/github/github-iterators.go similarity index 96% rename from vendor/github.com/google/go-github/v84/github/github-iterators.go rename to vendor/github.com/google/go-github/v88/github/github-iterators.go index 96a0c7b37..6833b56cb 100644 --- a/vendor/github.com/google/go-github/v84/github/github-iterators.go +++ b/vendor/github.com/google/go-github/v88/github/github-iterators.go @@ -679,6 +679,41 @@ func (s *ActionsService) ListRepositoryWorkflowRunsIter(ctx context.Context, own } } +// ListRunnerGroupHostedRunnersIter returns an iterator that paginates through all results of ListRunnerGroupHostedRunners. +func (s *ActionsService) ListRunnerGroupHostedRunnersIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*HostedRunner, error] { + return func(yield func(*HostedRunner, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRunnerGroupHostedRunners(ctx, org, groupID, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*HostedRunner + if results != nil { + iterItems = results.Runners + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + // ListRunnerGroupRunnersIter returns an iterator that paginates through all results of ListRunnerGroupRunners. func (s *ActionsService) ListRunnerGroupRunnersIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*Runner, error] { return func(yield func(*Runner, error) bool) { @@ -1486,10 +1521,10 @@ func (s *AppsService) ListHookDeliveriesIter(ctx context.Context, opts *ListCurs } } - if resp.After == "" { + if resp.Cursor == "" { break } - opts.After = resp.After + opts.Cursor = resp.Cursor } } } @@ -2432,6 +2467,41 @@ func (s *CopilotService) ListCopilotSeatsIter(ctx context.Context, org string, o } } +// ListOrganizationCodingAgentRepositoriesIter returns an iterator that paginates through all results of ListOrganizationCodingAgentRepositories. +func (s *CopilotService) ListOrganizationCodingAgentRepositoriesIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Repository, error] { + return func(yield func(*Repository, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListOrganizationCodingAgentRepositories(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*Repository + if results != nil { + iterItems = results.Repositories + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + // ListOrgAlertsIter returns an iterator that paginates through all results of ListOrgAlerts. func (s *DependabotService) ListOrgAlertsIter(ctx context.Context, org string, opts *ListAlertsOptions) iter.Seq2[*DependabotAlert, error] { return func(yield func(*DependabotAlert, error) bool) { @@ -2787,6 +2857,41 @@ func (s *EnterpriseService) ListCodeSecurityConfigurationsIter(ctx context.Conte } } +// ListConsumedLicensesIter returns an iterator that paginates through all results of ListConsumedLicenses. +func (s *EnterpriseService) ListConsumedLicensesIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*EnterpriseLicensedUsers, error] { + return func(yield func(*EnterpriseLicensedUsers, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListConsumedLicenses(ctx, enterprise, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*EnterpriseLicensedUsers + if results != nil { + iterItems = results.Users + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + // ListEnterpriseNetworkConfigurationsIter returns an iterator that paginates through all results of ListEnterpriseNetworkConfigurations. func (s *EnterpriseService) ListEnterpriseNetworkConfigurationsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*NetworkConfiguration, error] { return func(yield func(*NetworkConfiguration, error) bool) { @@ -3928,6 +4033,37 @@ func (s *OrganizationsService) ListIter(ctx context.Context, user string, opts * } } +// ListAllRepositoryRulesetsIter returns an iterator that paginates through all results of ListAllRepositoryRulesets. +func (s *OrganizationsService) ListAllRepositoryRulesetsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*RepositoryRuleset, error] { + return func(yield func(*RepositoryRuleset, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListAllRepositoryRulesets(ctx, org, opts) + if err != nil { + yield(nil, err) + return + } + + for _, item := range results { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + // ListAttestationsIter returns an iterator that paginates through all results of ListAttestations. func (s *OrganizationsService) ListAttestationsIter(ctx context.Context, org string, subjectDigest string, opts *ListOptions) iter.Seq2[*Attestation, error] { return func(yield func(*Attestation, error) bool) { @@ -4234,10 +4370,10 @@ func (s *OrganizationsService) ListHookDeliveriesIter(ctx context.Context, org s } } - if resp.After == "" { + if resp.Cursor == "" { break } - opts.After = resp.After + opts.Cursor = resp.Cursor } } } @@ -5281,6 +5417,111 @@ func (s *ReactionsService) ListTeamDiscussionReactionsIter(ctx context.Context, } } +// ListCommitComparisonFilesIter returns an iterator that paginates through all results of CompareCommits. +func (s *RepositoriesService) ListCommitComparisonFilesIter(ctx context.Context, owner string, repo string, base string, head string, opts *ListOptions) iter.Seq2[*CommitFile, error] { + return func(yield func(*CommitFile, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.CompareCommits(ctx, owner, repo, base, head, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CommitFile + if results != nil { + iterItems = results.Files + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCombinedStatusIter returns an iterator that paginates through all results of GetCombinedStatus. +func (s *RepositoriesService) ListCombinedStatusIter(ctx context.Context, owner string, repo string, ref string, opts *ListOptions) iter.Seq2[*RepoStatus, error] { + return func(yield func(*RepoStatus, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.GetCombinedStatus(ctx, owner, repo, ref, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*RepoStatus + if results != nil { + iterItems = results.Statuses + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// ListCommitFilesIter returns an iterator that paginates through all results of GetCommit. +func (s *RepositoriesService) ListCommitFilesIter(ctx context.Context, owner string, repo string, sha string, opts *ListOptions) iter.Seq2[*CommitFile, error] { + return func(yield func(*CommitFile, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.GetCommit(ctx, owner, repo, sha, opts) + if err != nil { + yield(nil, err) + return + } + + var iterItems []*CommitFile + if results != nil { + iterItems = results.Files + } + for _, item := range iterItems { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + // ListIter returns an iterator that paginates through all results of List. func (s *RepositoriesService) ListIter(ctx context.Context, user string, opts *RepositoryListOptions) iter.Seq2[*Repository, error] { return func(yield func(*Repository, error) bool) { @@ -5878,10 +6119,10 @@ func (s *RepositoriesService) ListHookDeliveriesIter(ctx context.Context, owner } } - if resp.After == "" { + if resp.Cursor == "" { break } - opts.After = resp.After + opts.Cursor = resp.Cursor } } } diff --git a/vendor/github.com/google/go-github/v84/github/github.go b/vendor/github.com/google/go-github/v88/github/github.go similarity index 73% rename from vendor/github.com/google/go-github/v84/github/github.go rename to vendor/github.com/google/go-github/v88/github/github.go index 9c2cafcce..08838a249 100644 --- a/vendor/github.com/google/go-github/v84/github/github.go +++ b/vendor/github.com/google/go-github/v88/github/github.go @@ -20,6 +20,7 @@ import ( "net/http" "net/url" "regexp" + "slices" "strconv" "strings" "sync" @@ -29,7 +30,7 @@ import ( ) const ( - Version = "v84.0.0" + Version = "v88.0.0" HeaderRateLimit = "X-Ratelimit-Limit" HeaderRateRemaining = "X-Ratelimit-Remaining" @@ -38,10 +39,15 @@ const ( HeaderRateUsed = "X-Ratelimit-Used" HeaderRequestID = "X-Github-Request-Id" - defaultAPIVersion = "2022-11-28" - defaultBaseURL = "https://api.github.com/" - defaultUserAgent = "go-github" + "/" + Version - uploadBaseURL = "https://uploads.github.com/" + // https://docs.github.com/en/rest/about-the-rest-api/api-versions#about-api-versioning + defaultAPIVersion = api20221128 + latestAPIVersion = api20260310 + api20221128 = "2022-11-28" + api20260310 = "2026-03-10" + + defaultBaseURL = "https://api.github.com/" + defaultUserAgent = "go-github" + "/" + Version + uploadBaseURL = "https://uploads.github.com/" headerAPIVersion = "X-Github-Api-Version" headerOTP = "X-Github-Otp" @@ -155,29 +161,30 @@ const ( mediaTypeContentAttachmentsPreview = "application/vnd.github.corsair-preview+json" ) -var errNonNilContext = errors.New("context must be non-nil") +// ErrPathForbidden is returned when a URL path contains ".." as a path +// segment, which could allow path traversal attacks. +var ErrPathForbidden = errors.New("path must not contain '..' due to auth vulnerability issue") // A Client manages communication with the GitHub API. type Client struct { - clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func. client *http.Client // HTTP client used to communicate with the API. clientIgnoreRedirects *http.Client // HTTP client used to communicate with the API on endpoints where we don't want to follow redirects. // Base URL for API requests. Defaults to the public GitHub API, but can be - // set to a domain endpoint to use with GitHub Enterprise. BaseURL should + // set to a domain endpoint to use with GitHub Enterprise. baseURL should // always be specified with a trailing slash. - BaseURL *url.URL + baseURL *url.URL // Base URL for uploading files. - UploadURL *url.URL + uploadURL *url.URL // User agent used when communicating with the GitHub API. - UserAgent string + userAgent string - // DisableRateLimitCheck stops the client checking for rate limits or tracking + // disableRateLimitCheck stops the client checking for rate limits or tracking // them. This is different to setting BypassRateLimitCheck in the context, // as that still tracks the rate limits. - DisableRateLimitCheck bool + disableRateLimitCheck bool rateMu sync.Mutex rateLimits [Categories]Rate // Rate limits for the client as determined by the most recent API calls. @@ -185,10 +192,10 @@ type Client struct { // If specified, Client will block requests for at most this duration in case of reaching a secondary // rate limit - MaxSecondaryRateLimitRetryAfterDuration time.Duration + maxSecondaryRateLimitRetryAfterDuration time.Duration // Whether to respect rate limit headers on endpoints that return 302 redirections to artifacts - RateLimitRedirectionalEndpoints bool + rateLimitRedirectionalEndpoints bool common service // Reuse a single struct instead of allocating one for each service on the heap. @@ -245,8 +252,6 @@ type service struct { // This should only be used for requests to the GitHub API because // request headers will contain an authorization token. func (c *Client) Client() *http.Client { - c.clientMu.Lock() - defer c.clientMu.Unlock() clientCopy := *c.client return &clientCopy } @@ -334,113 +339,304 @@ func addOptions[P structPtr[T], T any](s string, opts P) (string, error) { return u.String(), nil } -// NewClient returns a new GitHub API client. If a nil httpClient is -// provided, a new http.Client will be used. To use API methods which require -// authentication, either use Client.WithAuthToken or provide NewClient with -// an http.Client that will perform the authentication for you (such as that -// provided by the golang.org/x/oauth2 library). -// -// Note: When using a nil httpClient, the default client has no timeout set. -// This may not be suitable for production environments. It is recommended to -// provide a custom http.Client with an appropriate timeout. -func NewClient(httpClient *http.Client) *Client { - if httpClient == nil { - httpClient = &http.Client{} - } - httpClient2 := *httpClient - c := &Client{client: &httpClient2} - c.initialize() - return c -} - -// WithAuthToken returns a copy of the client configured to use the provided token for the Authorization header. -func (c *Client) WithAuthToken(token string) *Client { - c2 := c.copy() - defer c2.initialize() - transport := c2.client.Transport - if transport == nil { - transport = http.DefaultTransport - } - c2.client.Transport = roundTripperFunc( - func(req *http.Request) (*http.Response, error) { - req = req.Clone(req.Context()) - if token != "" { - req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", token)) +// errUninitialized is returned when an uninitialized Client is used. +var errUninitialized = errors.New("client is not initialized") + +// clientOptions holds the configuration options for a Client. +type clientOptions struct { + httpClient *http.Client + transport http.RoundTripper + timeout *time.Duration + userAgent *string + envProxy bool + token *string + baseURL *url.URL + uploadURL *url.URL + disableRateLimitCheck bool + rateLimitRedirectionalEndpoints bool + maxSecondaryRateLimitRetryAfterDuration *time.Duration + marketplaceStubbed bool +} + +// ClientOptionsFunc is a functional option for providing configuration options +// to a Client. +type ClientOptionsFunc func(*clientOptions) error + +// WithHTTPClient returns a ClientOptionsFunc that sets the http.Client +// for a Client. If not set, a default http.Client will be used. +func WithHTTPClient(httpClient *http.Client) ClientOptionsFunc { + return func(o *clientOptions) error { + if httpClient == nil { + return errors.New("http client must not be nil") + } + + httpClient := *httpClient + o.httpClient = &httpClient + return nil + } +} + +// WithTransport returns a ClientOptionsFunc that sets the http.RoundTripper +// for a Client. This overrides the transport set by [WithHTTPClient]. If not +// set and no HTTP client is provided, the default http.RoundTripper will be used. +func WithTransport(transport http.RoundTripper) ClientOptionsFunc { + return func(o *clientOptions) error { + if transport == nil { + return errors.New("transport must not be nil") + } + + o.transport = transport + return nil + } +} + +// WithTimeout returns a ClientOptionsFunc that sets the timeout for a Client. +// This overrides the timeout set by [WithHTTPClient]. If not set and no HTTP +// client is provided, the default http.Client with no timeout will be used. +// It is recommended to provide a timeout for production environments. +func WithTimeout(timeout time.Duration) ClientOptionsFunc { + return func(o *clientOptions) error { + if timeout < 0 { + return errors.New("timeout must not be negative") + } + + o.timeout = &timeout + return nil + } +} + +// WithUserAgent returns a ClientOptionsFunc that sets the User-Agent header +// for a Client. If not set, a default User-Agent will be used. +func WithUserAgent(userAgent string) ClientOptionsFunc { + return func(o *clientOptions) error { + o.userAgent = &userAgent + return nil + } +} + +// WithEnvProxy returns a ClientOptionsFunc that configures the Client to use +// the HTTP proxy settings from the environment variables +// (e.g., HTTP_PROXY, HTTPS_PROXY, NO_PROXY). +// If not set, the client will not use environment proxy settings. +func WithEnvProxy() ClientOptionsFunc { + return func(o *clientOptions) error { + o.envProxy = true + return nil + } +} + +// WithAuthToken returns a ClientOptionsFunc that sets the authentication token +// for a Client. If not set, the client will make unauthenticated requests. +func WithAuthToken(token string) ClientOptionsFunc { + return func(o *clientOptions) error { + if token == "" { + return errors.New("token must not be empty") + } + + o.token = &token + return nil + } +} + +// WithURLs returns a ClientOptionsFunc that sets the base and upload URLs +// while only validating the URL format. Nil values will be ignored and default +// URLs will be used. +func WithURLs(baseURL, uploadURL *string) ClientOptionsFunc { + return func(o *clientOptions) error { + if baseURL != nil { + b, err := parseURL(*baseURL) + if err != nil { + return fmt.Errorf("invalid base url: %w", err) } - return transport.RoundTrip(req) - }, - ) - return c2 + + o.baseURL = b + } + + if uploadURL != nil { + u, err := parseURL(*uploadURL) + if err != nil { + return fmt.Errorf("invalid upload url: %w", err) + } + + o.uploadURL = u + } + + return nil + } } -// WithEnterpriseURLs returns a copy of the client configured to use the provided base and -// upload URLs. If the base URL does not have the suffix "/api/v3/", it will be added -// automatically. If the upload URL does not have the suffix "/api/uploads", it will be -// added automatically. +// WithEnterpriseURLs returns a ClientOptionsFunc that sets the base and upload +// URLs for a Client. +func WithEnterpriseURLs(baseURL, uploadURL string) ClientOptionsFunc { + return func(o *clientOptions) error { + b, err := parseURL(baseURL) + if err != nil { + return fmt.Errorf("invalid base url: %w", err) + } + + if !strings.HasSuffix(b.Path, "/api/v3/") && + !strings.HasPrefix(b.Host, "api.") && + !strings.Contains(b.Host, ".api.") { + b.Path += "api/v3/" + } + + o.baseURL = b + + u, err := parseURL(uploadURL) + if err != nil { + return fmt.Errorf("invalid upload url: %w", err) + } + + if !strings.HasSuffix(u.Path, "/api/uploads/") && + !strings.HasPrefix(u.Host, "api.") && + !strings.Contains(u.Host, ".api.") && + !strings.HasPrefix(u.Host, "uploads.") { + u.Path += "api/uploads/" + } + + o.uploadURL = u + + return nil + } +} + +// WithDisableRateLimitCheck returns a ClientOptionsFunc that disables rate +// limit checking for a Client. If not set, the client will check for rate +// limits and track them. +func WithDisableRateLimitCheck() ClientOptionsFunc { + return func(o *clientOptions) error { + o.disableRateLimitCheck = true + return nil + } +} + +// WithRateLimitRedirectionalEndpoints returns a ClientOptionsFunc that +// configures the Client to respect rate limit headers on endpoints that +// return 302 redirection to artifacts. If not set, the client will not +// respect rate limit headers on these endpoints. +func WithRateLimitRedirectionalEndpoints() ClientOptionsFunc { + return func(o *clientOptions) error { + o.rateLimitRedirectionalEndpoints = true + return nil + } +} + +// WithMaxSecondaryRateLimitRetryAfterDuration returns a ClientOptionsFunc +// that configures the Client secondary rate limit max retry after duration. +func WithMaxSecondaryRateLimitRetryAfterDuration(duration time.Duration) ClientOptionsFunc { + return func(o *clientOptions) error { + o.maxSecondaryRateLimitRetryAfterDuration = &duration + return nil + } +} + +// NewClient returns a new GitHub API client configured with the provided +// options. The default configuration is suitable for making unauthenticated +// requests to the public GitHub API. // -// Note that WithEnterpriseURLs is a convenience helper only; -// its behavior is equivalent to setting the BaseURL and UploadURL fields. +// For GitHub Enterprise, use [WithEnterpriseURLs] to set the base and upload +// URLs. // -// Another important thing is that by default, the GitHub Enterprise URL format -// should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code. -// The upload URL format should be http(s)://[hostname]/api/uploads/. -func (c *Client) WithEnterpriseURLs(baseURL, uploadURL string) (*Client, error) { - c2 := c.copy() - defer c2.initialize() - var err error - c2.BaseURL, err = url.Parse(baseURL) - if err != nil { - return nil, err +// To make authenticated requests, use [WithAuthToken] or [WithHTTPClient] to +// pass in a [http.Client] that performs authentication +// (e.g., using golang.org/x/oauth2). +// +// For production usage it is recommended to provide a timeout using +// [WithTimeout] or by providing a custom [http.Client] with an appropriate +// timeout using [WithHTTPClient]. +func NewClient(opts ...ClientOptionsFunc) (*Client, error) { + o := clientOptions{} + for _, opt := range opts { + if err := opt(&o); err != nil { + return nil, err + } } - if !strings.HasSuffix(c2.BaseURL.Path, "/") { - c2.BaseURL.Path += "/" + return newClient(o) +} + +// newClient creates a new Client with the provided options. This is an internal +// helper function that is called by [NewClient] and [Client.Clone]. +func newClient(opts clientOptions) (*Client, error) { + c := &Client{} + + if opts.httpClient != nil { + c.client = opts.httpClient + } else { + c.client = &http.Client{} } - if !strings.HasSuffix(c2.BaseURL.Path, "/api/v3/") && - !strings.HasPrefix(c2.BaseURL.Host, "api.") && - !strings.Contains(c2.BaseURL.Host, ".api.") { - c2.BaseURL.Path += "api/v3/" + + if opts.transport != nil { + c.client.Transport = opts.transport } - c2.UploadURL, err = url.Parse(uploadURL) - if err != nil { - return nil, err + if opts.timeout != nil { + c.client.Timeout = *opts.timeout } - if !strings.HasSuffix(c2.UploadURL.Path, "/") { - c2.UploadURL.Path += "/" + if opts.envProxy { + transport := c.client.Transport + if transport == nil { + transport = http.DefaultTransport + } + + t, ok := transport.(*http.Transport) + if !ok { + return nil, errors.New("cannot set environment proxy on non-http transport") + } + + t2 := t.Clone() + t2.Proxy = http.ProxyFromEnvironment + c.client.Transport = t2 } - if !strings.HasSuffix(c2.UploadURL.Path, "/api/uploads/") && - !strings.HasPrefix(c2.UploadURL.Host, "api.") && - !strings.Contains(c2.UploadURL.Host, ".api.") && - !strings.HasPrefix(c2.UploadURL.Host, "uploads.") { - c2.UploadURL.Path += "api/uploads/" + + if opts.token != nil { + transport := c.client.Transport + if transport == nil { + transport = http.DefaultTransport + } + c.client.Transport = roundTripperFunc(func(req *http.Request) (*http.Response, error) { + req = req.Clone(req.Context()) + req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", *opts.token)) + return transport.RoundTrip(req) + }) } - return c2, nil -} -// initialize sets default values and initializes services. -func (c *Client) initialize() { - if c.client == nil { - c.client = &http.Client{} + c.clientIgnoreRedirects = &http.Client{ + Transport: c.client.Transport, + Timeout: c.client.Timeout, + Jar: c.client.Jar, + CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }, } - // Copy the main http client into the IgnoreRedirects one, overriding the `CheckRedirect` func - c.clientIgnoreRedirects = &http.Client{} - c.clientIgnoreRedirects.Transport = c.client.Transport - c.clientIgnoreRedirects.Timeout = c.client.Timeout - c.clientIgnoreRedirects.Jar = c.client.Jar - c.clientIgnoreRedirects.CheckRedirect = func(*http.Request, []*http.Request) error { - return http.ErrUseLastResponse + + if opts.userAgent != nil { + c.userAgent = *opts.userAgent + } else { + c.userAgent = defaultUserAgent } - if c.BaseURL == nil { - c.BaseURL, _ = url.Parse(defaultBaseURL) + + if opts.baseURL != nil { + c.baseURL = opts.baseURL + } else { + c.baseURL, _ = url.Parse(defaultBaseURL) } - if c.UploadURL == nil { - c.UploadURL, _ = url.Parse(uploadBaseURL) + + if opts.uploadURL != nil { + c.uploadURL = opts.uploadURL + } else { + c.uploadURL, _ = url.Parse(uploadBaseURL) } - if c.UserAgent == "" { - c.UserAgent = defaultUserAgent + + c.disableRateLimitCheck = opts.disableRateLimitCheck + + if !c.disableRateLimitCheck { + c.rateLimitRedirectionalEndpoints = opts.rateLimitRedirectionalEndpoints + + if opts.maxSecondaryRateLimitRetryAfterDuration != nil { + c.maxSecondaryRateLimitRetryAfterDuration = *opts.maxSecondaryRateLimitRetryAfterDuration + } } + c.common.client = c c.Actions = (*ActionsService)(&c.common) c.Activity = (*ActivityService)(&c.common) @@ -467,7 +663,7 @@ func (c *Client) initialize() { c.Issues = (*IssuesService)(&c.common) c.Licenses = (*LicensesService)(&c.common) c.Markdown = (*MarkdownService)(&c.common) - c.Marketplace = &MarketplaceService{client: c} + c.Marketplace = &MarketplaceService{client: c, Stubbed: opts.marketplaceStubbed} c.Meta = (*MetaService)(&c.common) c.Migrations = (*MigrationService)(&c.common) c.Organizations = (*OrganizationsService)(&c.common) @@ -484,52 +680,84 @@ func (c *Client) initialize() { c.SubIssue = (*SubIssueService)(&c.common) c.Teams = (*TeamsService)(&c.common) c.Users = (*UsersService)(&c.common) + + return c, nil } -// copy returns a copy of the current client. It must be initialized before use. -func (c *Client) copy() *Client { - c.clientMu.Lock() - // can't use *c here because that would copy mutexes by value. - clone := Client{ - client: &http.Client{}, - UserAgent: c.UserAgent, - BaseURL: c.BaseURL, - UploadURL: c.UploadURL, - RateLimitRedirectionalEndpoints: c.RateLimitRedirectionalEndpoints, - secondaryRateLimitReset: c.secondaryRateLimitReset, - } - c.clientMu.Unlock() - if c.client != nil { - clone.client.Transport = c.client.Transport - clone.client.CheckRedirect = c.client.CheckRedirect - clone.client.Jar = c.client.Jar - clone.client.Timeout = c.client.Timeout - } - c.rateMu.Lock() - copy(clone.rateLimits[:], c.rateLimits[:]) - c.rateMu.Unlock() - return &clone +// UserAgent returns the User-Agent header value for the client. +func (c *Client) UserAgent() string { + return c.userAgent } -// NewClientWithEnvProxy enhances NewClient with the HttpProxy env. -func NewClientWithEnvProxy() *Client { - return NewClient(&http.Client{Transport: &http.Transport{Proxy: http.ProxyFromEnvironment}}) +// BaseURL returns the base URL for API requests. +func (c *Client) BaseURL() string { + if c.baseURL == nil { + return "" + } + return c.baseURL.String() } -// NewTokenClient returns a new GitHub API client authenticated with the provided token. -// -// Deprecated: Use NewClient(nil).WithAuthToken(token) instead. -func NewTokenClient(_ context.Context, token string) *Client { - // This always returns a nil error. - return NewClient(nil).WithAuthToken(token) +// UploadURL returns the base URL for upload API requests. +func (c *Client) UploadURL() string { + if c.uploadURL == nil { + return "" + } + return c.uploadURL.String() } -// NewEnterpriseClient returns a new GitHub API client with provided -// base URL and upload URL (often is your GitHub Enterprise hostname). -// -// Deprecated: Use NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL) instead. -func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*Client, error) { - return NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL) +// Clone returns a copy of the client with the same configuration and services. +// The returned client has its own http.Client but shares the client +// configuration such as transport and timeout. The returned client starts with +// the same rate limit information as the original client, but it is not +// updated when the original client's rate limit information is updated. +// The returned client is independent of the original client and can be +// modified without affecting the original client. +func (c *Client) Clone(opts ...ClientOptionsFunc) (*Client, error) { + if c.client == nil { + return nil, errUninitialized + } + + o := clientOptions{ + userAgent: &c.userAgent, + baseURL: Ptr(*c.baseURL), + uploadURL: Ptr(*c.uploadURL), + disableRateLimitCheck: c.disableRateLimitCheck, + rateLimitRedirectionalEndpoints: c.rateLimitRedirectionalEndpoints, + maxSecondaryRateLimitRetryAfterDuration: &c.maxSecondaryRateLimitRetryAfterDuration, + } + + if c.Marketplace != nil { + o.marketplaceStubbed = c.Marketplace.Stubbed + } + + for _, opt := range opts { + if err := opt(&o); err != nil { + return nil, err + } + } + + if o.httpClient == nil { + o.httpClient = &http.Client{ + Transport: c.client.Transport, + CheckRedirect: c.client.CheckRedirect, + Jar: c.client.Jar, + Timeout: c.client.Timeout, + } + } + + clone, err := newClient(o) + if err != nil { + return nil, err + } + + if !clone.disableRateLimitCheck { + c.rateMu.Lock() + clone.rateLimits = c.rateLimits + clone.secondaryRateLimitReset = c.secondaryRateLimitReset + c.rateMu.Unlock() + } + + return clone, nil } // RequestOption represents an option that can modify an http.Request. @@ -549,12 +777,16 @@ func WithVersion(version string) RequestOption { // Relative URLs should always be specified without a preceding slash. If // specified, the value pointed to by body is JSON encoded and included as the // request body. -func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOption) (*http.Request, error) { - if !strings.HasSuffix(c.BaseURL.Path, "/") { - return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) +func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body any, opts ...RequestOption) (*http.Request, error) { + if !strings.HasSuffix(c.baseURL.Path, "/") { + return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.baseURL) + } + + if err := checkURLPathTraversal(urlStr); err != nil { + return nil, err } - u, err := c.BaseURL.Parse(urlStr) + u, err := c.baseURL.Parse(urlStr) if err != nil { return nil, err } @@ -570,7 +802,7 @@ func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOpti } } - req, err := http.NewRequest(method, u.String(), buf) + req, err := http.NewRequestWithContext(ctx, method, u.String(), buf) if err != nil { return nil, err } @@ -579,8 +811,8 @@ func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOpti req.Header.Set("Content-Type", "application/json") } req.Header.Set("Accept", mediaTypeV3) - if c.UserAgent != "" { - req.Header.Set("User-Agent", c.UserAgent) + if c.userAgent != "" { + req.Header.Set("User-Agent", c.userAgent) } req.Header.Set(headerAPIVersion, defaultAPIVersion) @@ -595,25 +827,29 @@ func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOpti // in which case it is resolved relative to the BaseURL of the Client. // Relative URLs should always be specified without a preceding slash. // Body is sent with Content-Type: application/x-www-form-urlencoded. -func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOption) (*http.Request, error) { - if !strings.HasSuffix(c.BaseURL.Path, "/") { - return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) +func (c *Client) NewFormRequest(ctx context.Context, urlStr string, body io.Reader, opts ...RequestOption) (*http.Request, error) { + if !strings.HasSuffix(c.baseURL.Path, "/") { + return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.baseURL) + } + + if err := checkURLPathTraversal(urlStr); err != nil { + return nil, err } - u, err := c.BaseURL.Parse(urlStr) + u, err := c.baseURL.Parse(urlStr) if err != nil { return nil, err } - req, err := http.NewRequest("POST", u.String(), body) + req, err := http.NewRequestWithContext(ctx, "POST", u.String(), body) if err != nil { return nil, err } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") req.Header.Set("Accept", mediaTypeV3) - if c.UserAgent != "" { - req.Header.Set("User-Agent", c.UserAgent) + if c.userAgent != "" { + req.Header.Set("User-Agent", c.userAgent) } req.Header.Set(headerAPIVersion, defaultAPIVersion) @@ -624,19 +860,56 @@ func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOp return req, nil } +// checkURLPathTraversal returns ErrPathForbidden if urlStr contains ".." as a +// path segment (e.g. "a/../b"), preventing path traversal attacks. It does not +// match ".." embedded within a segment (e.g. "file..txt"). The check is +// performed only on the path portion of the URL, ignoring any query string or +// fragment. +func checkURLPathTraversal(urlStr string) error { + if !strings.Contains(urlStr, "..") { + return nil + } + u, err := url.Parse(urlStr) + if err != nil { + return err + } + if slices.Contains(strings.Split(u.Path, "/"), "..") { + return ErrPathForbidden + } + return nil +} + // NewUploadRequest creates an upload request. A relative URL can be provided in // urlStr, in which case it is resolved relative to the UploadURL of the Client. // Relative URLs should always be specified without a preceding slash. -func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string, opts ...RequestOption) (*http.Request, error) { - if !strings.HasSuffix(c.UploadURL.Path, "/") { - return nil, fmt.Errorf("uploadURL must have a trailing slash, but %q does not", c.UploadURL) +func (c *Client) NewUploadRequest(ctx context.Context, urlStr string, reader io.Reader, size int64, mediaType string, opts ...RequestOption) (*http.Request, error) { + if !strings.HasSuffix(c.uploadURL.Path, "/") { + return nil, fmt.Errorf("uploadURL must have a trailing slash, but %q does not", c.uploadURL) + } + + if err := checkURLPathTraversal(urlStr); err != nil { + return nil, err } - u, err := c.UploadURL.Parse(urlStr) + + u, err := c.uploadURL.Parse(urlStr) if err != nil { return nil, err } - req, err := http.NewRequest("POST", u.String(), reader) + requestBody := reader + if reader != nil { + // Wrap the provided reader so transport code does not observe concrete body types + // (for example *os.File) and switch to platform-specific sendfile fast paths. + // + // Why this exists: + // race-enabled test runs on Windows have surfaced data races in the sendfile path + // while request read/write loops run concurrently. Hiding concrete type information + // keeps uploads on the generic io.Reader copy path, which is race-stable and preserves + // request semantics (same bytes, same headers, same content length). + requestBody = uploadRequestBodyReader{Reader: reader} + } + + req, err := http.NewRequestWithContext(ctx, "POST", u.String(), requestBody) if err != nil { return nil, err } @@ -648,7 +921,7 @@ func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, m } req.Header.Set("Content-Type", mediaType) req.Header.Set("Accept", mediaTypeV3) - req.Header.Set("User-Agent", c.UserAgent) + req.Header.Set("User-Agent", c.userAgent) req.Header.Set(headerAPIVersion, defaultAPIVersion) for _, opt := range opts { @@ -658,6 +931,12 @@ func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, m return req, nil } +// uploadRequestBodyReader intentionally wraps an io.Reader to hide concrete reader types. +// See NewUploadRequest for why this prevents race-prone transport optimizations. +type uploadRequestBodyReader struct { + io.Reader +} + // Response is a GitHub API response. This wraps the standard http.Response // returned from GitHub and provides convenient access to things like // pagination links. @@ -859,24 +1138,22 @@ const ( SleepUntilPrimaryRateLimitResetWhenRateLimited ) +// maxErrorBodySize is the maximum number of bytes read from an HTTP error +// response body. Limits memory allocation when a server returns an +// unexpectedly large error body. +const maxErrorBodySize = 1 * 1024 * 1024 // 1 MiB + // bareDo sends an API request using `caller` http.Client passed in the parameters // and lets you handle the api response. If an error or API Error occurs, the error // will contain more information. Otherwise, you are supposed to read and close the // response's Body. If rate limit is exceeded and reset time is in the future, // bareDo returns *RateLimitError immediately without making a network API call. -// -// The provided ctx must be non-nil, if it is nil an error is returned. If it is -// canceled or times out, ctx.Err() will be returned. -func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Request) (*Response, error) { - if ctx == nil { - return nil, errNonNilContext - } - - req = withContext(ctx, req) +func (c *Client) bareDo(caller *http.Client, req *http.Request) (*Response, error) { + ctx := req.Context() rateLimitCategory := CoreCategory - if !c.DisableRateLimitCheck { + if !c.disableRateLimitCheck { rateLimitCategory = GetRateLimitCategory(req.Method, req.URL.Path) if bypass := ctx.Value(BypassRateLimitCheck); bypass == nil { @@ -927,7 +1204,7 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ // Don't update the rate limits if the client has rate limits disabled or if // this was a cached response. The X-From-Cache is set by // https://github.com/bartventer/httpcache if it's enabled. - if !c.DisableRateLimitCheck && response.Header.Get("X-From-Cache") == "" { + if !c.disableRateLimitCheck && response.Header.Get("X-From-Cache") == "" { c.rateMu.Lock() c.rateLimits[rateLimitCategory] = response.Rate c.rateMu.Unlock() @@ -943,7 +1220,7 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ // Issue #1022 var aerr *AcceptedError if errors.As(err, &aerr) { - b, readErr := io.ReadAll(resp.Body) + b, readErr := io.ReadAll(io.LimitReader(resp.Body, maxErrorBodySize)) if readErr != nil { return response, readErr } @@ -954,20 +1231,21 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ var rateLimitError *RateLimitError if errors.As(err, &rateLimitError) && - req.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil { - if err := sleepUntilResetWithBuffer(req.Context(), rateLimitError.Rate.Reset.Time); err != nil { + ctx.Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil { + if err := sleepUntilResetWithBuffer(ctx, rateLimitError.Rate.Reset.Time); err != nil { return response, err } - // retry the request once when the rate limit has reset - return c.bareDo(context.WithValue(req.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, nil), caller, req) + // retry the request now the rate limit should have been reset + newReq := req.Clone(context.WithValue(ctx, SleepUntilPrimaryRateLimitResetWhenRateLimited, nil)) + return c.bareDo(caller, newReq) } // Update the secondary rate limit if we hit it. var rerr *AbuseRateLimitError if errors.As(err, &rerr) && rerr.RetryAfter != nil { // if a max duration is specified, make sure that we are waiting at most this duration - if c.MaxSecondaryRateLimitRetryAfterDuration > 0 && rerr.GetRetryAfter() > c.MaxSecondaryRateLimitRetryAfterDuration { - rerr.RetryAfter = &c.MaxSecondaryRateLimitRetryAfterDuration + if c.maxSecondaryRateLimitRetryAfterDuration > 0 && rerr.GetRetryAfter() > c.maxSecondaryRateLimitRetryAfterDuration { + rerr.RetryAfter = &c.maxSecondaryRateLimitRetryAfterDuration } c.rateMu.Lock() c.secondaryRateLimitReset = time.Now().Add(*rerr.RetryAfter) @@ -982,21 +1260,15 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ // are supposed to read and close the response's Body. If rate limit is exceeded // and reset time is in the future, BareDo returns *RateLimitError immediately // without making a network API call. -// -// The provided ctx must be non-nil, if it is nil an error is returned. If it is -// canceled or times out, ctx.Err() will be returned. -func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, error) { - return c.bareDo(ctx, c.client, req) +func (c *Client) BareDo(req *http.Request) (*Response, error) { + return c.bareDo(c.client, req) } // bareDoIgnoreRedirects has the exact same behavior as BareDo but stops at the first // redirection code returned by the API. If a redirection is returned by the api, bareDoIgnoreRedirects // returns a *RedirectionError. -// -// The provided ctx must be non-nil, if it is nil an error is returned. If it is -// canceled or times out, ctx.Err() will be returned. -func (c *Client) bareDoIgnoreRedirects(ctx context.Context, req *http.Request) (*Response, error) { - return c.bareDo(ctx, c.clientIgnoreRedirects, req) +func (c *Client) bareDoIgnoreRedirects(req *http.Request) (*Response, error) { + return c.bareDo(c.clientIgnoreRedirects, req) } var errInvalidLocation = errors.New("invalid or empty Location header in redirection response") @@ -1005,11 +1277,8 @@ var errInvalidLocation = errors.New("invalid or empty Location header in redirec // a 302, it will parse the Location header into a *url.URL and return that. // This is useful for endpoints that return a 302 in successful cases but still might return 301s for // permanent redirections. -// -// The provided ctx must be non-nil, if it is nil an error is returned. If it is -// canceled or times out, ctx.Err() will be returned. -func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRedirects int) (*url.URL, *Response, error) { - response, err := c.bareDoIgnoreRedirects(ctx, req) +func (c *Client) bareDoUntilFound(req *http.Request, maxRedirects int) (*url.URL, *Response, error) { + response, err := c.bareDoIgnoreRedirects(req) if err != nil { var rerr *RedirectionError if errors.As(err, &rerr) { @@ -1018,7 +1287,7 @@ func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRed if rerr.Location == nil { return nil, nil, errInvalidLocation } - newURL := c.BaseURL.ResolveReference(rerr.Location) + newURL := c.baseURL.ResolveReference(rerr.Location) return newURL, response, nil } // If permanent redirect response is returned, follow it @@ -1026,10 +1295,16 @@ func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRed if rerr.Location == nil { return nil, nil, errInvalidLocation } - newURL := c.BaseURL.ResolveReference(rerr.Location) - newRequest := req.Clone(ctx) + newURL := c.baseURL.ResolveReference(rerr.Location) + // Refuse to follow a permanent redirect to a different host: + // req.Clone preserves Authorization headers added by the auth + // transport, so a cross-host target would leak credentials. + if newURL.Host != c.baseURL.Host { + return nil, response, fmt.Errorf("refusing to follow cross-host redirect from %q to %q", c.baseURL.Host, newURL.Host) + } + newRequest := req.Clone(req.Context()) newRequest.URL = newURL - return c.bareDoUntilFound(ctx, newRequest, maxRedirects-1) + return c.bareDoUntilFound(newRequest, maxRedirects-1) } // If we reached the maximum amount of redirections, return an error if maxRedirects <= 0 && rerr.StatusCode == http.StatusMovedPermanently { @@ -1050,11 +1325,8 @@ func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRed // decode it. If v is nil, and no error happens, the response is returned as is. // If rate limit is exceeded and reset time is in the future, Do returns // *RateLimitError immediately without making a network API call. -// -// The provided ctx must be non-nil, if it is nil an error is returned. If it -// is canceled or times out, ctx.Err() will be returned. -func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*Response, error) { - resp, err := c.BareDo(ctx, req) +func (c *Client) Do(req *http.Request, v any) (*Response, error) { + resp, err := c.BareDo(req) if err != nil { return resp, err } @@ -1081,6 +1353,8 @@ func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*Response, e // from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily. // Otherwise it returns nil, and Client.Do should proceed normally. func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory RateLimitCategory) *RateLimitError { + ctx := req.Context() + c.rateMu.Lock() rate := c.rateLimits[rateLimitCategory] c.rateMu.Unlock() @@ -1094,8 +1368,8 @@ func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory Rat Body: io.NopCloser(strings.NewReader("")), } - if req.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil { - if err := sleepUntilResetWithBuffer(req.Context(), rate.Reset.Time); err == nil { + if ctx.Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil { + if err := sleepUntilResetWithBuffer(ctx, rate.Reset.Time); err == nil { return nil } return &RateLimitError{ @@ -1161,7 +1435,7 @@ func compareHTTPResponse(r1, r2 *http.Response) bool { /* An ErrorResponse reports one or more errors caused by an API request. -GitHub API docs: https://docs.github.com/rest/#client-errors +GitHub API docs: https://docs.github.com/rest?apiVersion=2022-11-28#client-errors */ type ErrorResponse struct { Response *http.Response `json:"-"` // HTTP response that caused this error @@ -1172,7 +1446,7 @@ type ErrorResponse struct { Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing // to some content that might help you resolve the error, see - // https://docs.github.com/rest/#client-errors + // https://docs.github.com/rest?apiVersion=2022-11-28#client-errors DocumentationURL string `json:"documentation_url,omitempty"` } @@ -1300,7 +1574,7 @@ func (ae *AcceptedError) Is(target error) bool { } // AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the -// "documentation_url" field value equal to "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits". +// "documentation_url" field value equal to "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits". type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message @@ -1312,9 +1586,13 @@ type AbuseRateLimitError struct { } func (r *AbuseRateLimitError) Error() string { - return fmt.Sprintf("%v %v: %v %v", + retryInfo := "" + if r.RetryAfter != nil && *r.RetryAfter > 0 { + retryInfo = fmt.Sprintf(" [retry after %v]", r.RetryAfter.Round(time.Second)) + } + return fmt.Sprintf("%v %v: %v %v%v", r.Response.Request.Method, sanitizeURL(r.Response.Request.URL), - r.Response.StatusCode, r.Message) + r.Response.StatusCode, r.Message, retryInfo) } // Is returns whether the provided error equals this error. @@ -1363,15 +1641,23 @@ func (r *RedirectionError) Is(target error) bool { r.Location != nil && v.Location != nil && r.Location.String() == v.Location.String()) // or they are both not nil and marshaled identically } -// sanitizeURL redacts the client_secret parameter from the URL which may be +var sensitiveParams = []string{"client_secret", "access_token", "token"} + +// sanitizeURL redacts sensitive parameters from the URL which may be // exposed to the user. func sanitizeURL(uri *url.URL) *url.URL { if uri == nil { return nil } params := uri.Query() - if len(params.Get("client_secret")) > 0 { - params.Set("client_secret", "REDACTED") + var redacted bool + for _, p := range sensitiveParams { + if len(params.Get(p)) > 0 { + params.Set(p, "REDACTED") + redacted = true + } + } + if redacted { uri.RawQuery = params.Encode() } return uri @@ -1397,7 +1683,7 @@ GitHub error responses structure are often undocumented and inconsistent. Sometimes error is just a simple string (Issue #540). In such cases, Message represents an error message as a workaround. -GitHub API docs: https://docs.github.com/rest/#client-errors +GitHub API docs: https://docs.github.com/rest?apiVersion=2022-11-28#client-errors */ type Error struct { Resource string `json:"resource"` // resource on which the error occurred @@ -1439,7 +1725,7 @@ func CheckResponse(r *http.Response) error { } errorResponse := &ErrorResponse{Response: r} - data, err := io.ReadAll(r.Body) + data, err := io.ReadAll(io.LimitReader(r.Body, maxErrorBodySize)) if err == nil && data != nil { err = json.Unmarshal(data, errorResponse) if err != nil { @@ -1455,7 +1741,7 @@ func CheckResponse(r *http.Response) error { case r.StatusCode == http.StatusUnauthorized && strings.HasPrefix(r.Header.Get(headerOTP), "required"): return (*TwoFactorAuthError)(errorResponse) // Primary rate limit exceeded: GitHub returns 403 or 429 with X-RateLimit-Remaining: 0 - // See: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api + // See: https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28 case (r.StatusCode == http.StatusForbidden || r.StatusCode == http.StatusTooManyRequests) && r.Header.Get(HeaderRateRemaining) == "0": return &RateLimitError{ @@ -1464,7 +1750,7 @@ func CheckResponse(r *http.Response) error { Message: errorResponse.Message, } // Secondary rate limit exceeded: GitHub returns 403 or 429 with specific documentation_url - // See: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits + // See: https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits case (r.StatusCode == http.StatusForbidden || r.StatusCode == http.StatusTooManyRequests) && (strings.HasSuffix(errorResponse.DocumentationURL, "#abuse-rate-limits") || strings.HasSuffix(errorResponse.DocumentationURL, "secondary-rate-limits")): @@ -1543,13 +1829,13 @@ const ( // GetRateLimitCategory returns the rate limit RateLimitCategory of the endpoint, determined by HTTP method and Request.URL.Path. func GetRateLimitCategory(method, path string) RateLimitCategory { switch { - // https://docs.github.com/rest/rate-limit#about-rate-limits + // https://docs.github.com/rest/rate-limit?apiVersion=2022-11-28#about-rate-limits default: // NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too, // because no API found for this category. return CoreCategory - // https://docs.github.com/en/rest/search/search#search-code + // https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-code case strings.HasPrefix(path, "/search/code") && method == "GET": return CodeSearchCategory @@ -1563,31 +1849,31 @@ func GetRateLimitCategory(method, path string) RateLimitCategory { method == "POST": return IntegrationManifestCategory - // https://docs.github.com/rest/migrations/source-imports#start-an-import + // https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#start-an-import case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/import") && method == "PUT": return SourceImportCategory - // https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data + // https://docs.github.com/rest/code-scanning?apiVersion=2022-11-28#upload-an-analysis-as-sarif-data case strings.HasSuffix(path, "/code-scanning/sarifs"): return CodeScanningUploadCategory - // https://docs.github.com/enterprise-cloud@latest/rest/scim + // https://docs.github.com/enterprise-cloud@latest/rest/scim?apiVersion=2022-11-28 case strings.HasPrefix(path, "/scim/"): return ScimCategory - // https://docs.github.com/en/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository + // https://docs.github.com/rest/dependency-graph/dependency-submission?apiVersion=2022-11-28#create-a-snapshot-of-dependencies-for-a-repository case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/dependency-graph/snapshots") && method == "POST": return DependencySnapshotsCategory - // https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization + // https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization case strings.HasSuffix(path, "/audit-log"): return AuditLogCategory - // https://docs.github.com/en/rest/dependency-graph/sboms?apiVersion=2022-11-28#export-a-software-bill-of-materials-sbom-for-a-repository + // https://docs.github.com/rest/dependency-graph/sboms?apiVersion=2022-11-28#export-a-software-bill-of-materials-sbom-for-a-repository case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/dependency-graph/sbom"): return DependencySBOMCategory @@ -1608,15 +1894,14 @@ func setCredentialsAsHeaders(req *http.Request, id, secret string) *http.Request // // Since we are going to modify only req.Header here, we only need a deep copy // of req.Header. - convertedRequest := new(http.Request) - *convertedRequest = *req + convertedRequest := *req convertedRequest.Header = make(http.Header, len(req.Header)) for k, s := range req.Header { convertedRequest.Header[k] = append([]string(nil), s...) } convertedRequest.SetBasicAuth(id, secret) - return convertedRequest + return &convertedRequest } /* @@ -1632,7 +1917,7 @@ that need to use a higher rate limit associated with your OAuth application. This will add the client id and secret as a base64-encoded string in the format ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. -See https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-oauth-apps +See https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-oauth-apps for more information. */ type UnauthenticatedRateLimitedTransport struct { @@ -1755,14 +2040,13 @@ func sleepUntilResetWithBuffer(ctx context.Context, reset time.Time) error { // When using roundTripWithOptionalFollowRedirect, note that it // is the responsibility of the caller to close the response body. func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, maxRedirects int, opts ...RequestOption) (*http.Response, error) { - req, err := c.NewRequest("GET", u, nil, opts...) + req, err := c.NewRequest(ctx, "GET", u, nil, opts...) if err != nil { return nil, err } var resp *http.Response // Use http.DefaultTransport if no custom Transport is configured - req = withContext(ctx, req) if c.client.Transport == nil { resp, err = http.DefaultTransport.RoundTrip(req) } else { @@ -1776,11 +2060,35 @@ func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u stri if maxRedirects > 0 && resp.StatusCode == http.StatusMovedPermanently { _ = resp.Body.Close() u = resp.Header.Get("Location") + if err := c.checkRedirectHost(u); err != nil { + return nil, err + } resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects-1, opts...) } return resp, err } +// checkRedirectHost returns an error if the redirect target is on a different +// host than the client's configured BaseURL. This prevents credentials attached +// by the auth transport from being sent to an attacker-controlled host when a +// compromised or malicious API response returns a cross-origin Location header. +// An empty Location is also rejected. +func (c *Client) checkRedirectHost(location string) error { + if location == "" { + return errInvalidLocation + } + target, err := url.Parse(location) + if err != nil { + return fmt.Errorf("invalid redirect location %q: %w", location, err) + } + // Resolve relative locations against BaseURL so relative paths are allowed. + target = c.baseURL.ResolveReference(target) + if target.Host != c.baseURL.Host { + return fmt.Errorf("refusing to follow cross-host redirect from %q to %q", c.baseURL.Host, target.Host) + } + return nil +} + // Ptr is a helper routine that allocates a new T value // to store v and returns a pointer to it. func Ptr[T any](v T) *T { diff --git a/vendor/github.com/google/go-github/v84/github/gitignore.go b/vendor/github.com/google/go-github/v88/github/gitignore.go similarity index 76% rename from vendor/github.com/google/go-github/v84/github/gitignore.go rename to vendor/github.com/google/go-github/v88/github/gitignore.go index 34cf285e1..9a2c8b2d1 100644 --- a/vendor/github.com/google/go-github/v84/github/gitignore.go +++ b/vendor/github.com/google/go-github/v88/github/gitignore.go @@ -13,7 +13,7 @@ import ( // GitignoresService provides access to the gitignore related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/rest/gitignore/ +// GitHub API docs: https://docs.github.com/rest/gitignore?apiVersion=2022-11-28 type GitignoresService service // Gitignore represents a .gitignore file as returned by the GitHub API. @@ -28,17 +28,17 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // -// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore?apiVersion=2022-11-28#get-all-gitignore-templates // //meta:operation GET /gitignore/templates func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { - req, err := s.client.NewRequest("GET", "gitignore/templates", nil) + req, err := s.client.NewRequest(ctx, "GET", "gitignore/templates", nil) if err != nil { return nil, nil, err } var availableTemplates []string - resp, err := s.client.Do(ctx, req, &availableTemplates) + resp, err := s.client.Do(req, &availableTemplates) if err != nil { return nil, resp, err } @@ -48,18 +48,18 @@ func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, erro // Get a Gitignore by name. // -// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore?apiVersion=2022-11-28#get-a-gitignore-template // //meta:operation GET /gitignore/templates/{name} func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { u := fmt.Sprintf("gitignore/templates/%v", name) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - gitignore := new(Gitignore) - resp, err := s.client.Do(ctx, req, gitignore) + var gitignore *Gitignore + resp, err := s.client.Do(req, &gitignore) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/interactions.go b/vendor/github.com/google/go-github/v88/github/interactions.go similarity index 92% rename from vendor/github.com/google/go-github/v84/github/interactions.go rename to vendor/github.com/google/go-github/v88/github/interactions.go index 2268273dd..92bd24b4d 100644 --- a/vendor/github.com/google/go-github/v84/github/interactions.go +++ b/vendor/github.com/google/go-github/v88/github/interactions.go @@ -8,7 +8,7 @@ package github // InteractionsService handles communication with the repository and organization related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/interactions/ +// GitHub API docs: https://docs.github.com/rest/interactions?apiVersion=2022-11-28 type InteractionsService service // InteractionRestriction represents the interaction restrictions for repository and organization. diff --git a/vendor/github.com/google/go-github/v84/github/interactions_orgs.go b/vendor/github.com/google/go-github/v88/github/interactions_orgs.go similarity index 75% rename from vendor/github.com/google/go-github/v84/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v88/github/interactions_orgs.go index 55f254817..8ec5e8936 100644 --- a/vendor/github.com/google/go-github/v84/github/interactions_orgs.go +++ b/vendor/github.com/google/go-github/v88/github/interactions_orgs.go @@ -12,21 +12,20 @@ import ( // GetRestrictionsForOrg fetches the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs?apiVersion=2022-11-28#get-interaction-restrictions-for-an-organization // //meta:operation GET /orgs/{org}/interaction-limits func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - organizationInteractions := new(InteractionRestriction) - - resp, err := s.client.Do(ctx, req, organizationInteractions) + var organizationInteractions *InteractionRestriction + resp, err := s.client.Do(req, &organizationInteractions) if err != nil { return nil, resp, err } @@ -40,24 +39,23 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz // in public repositories for the given organization. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs?apiVersion=2022-11-28#set-interaction-restrictions-for-an-organization // //meta:operation PUT /orgs/{org}/interaction-limits func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) - interaction := &InteractionRestriction{Limit: Ptr(limit)} + interaction := &InteractionRestriction{Limit: &limit} - req, err := s.client.NewRequest("PUT", u, interaction) + req, err := s.client.NewRequest(ctx, "PUT", u, interaction) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - organizationInteractions := new(InteractionRestriction) - - resp, err := s.client.Do(ctx, req, organizationInteractions) + var organizationInteractions *InteractionRestriction + resp, err := s.client.Do(req, &organizationInteractions) if err != nil { return nil, resp, err } @@ -67,17 +65,17 @@ func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, orga // RemoveRestrictionsFromOrg removes the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs?apiVersion=2022-11-28#remove-interaction-restrictions-for-an-organization // //meta:operation DELETE /orgs/{org}/interaction-limits func (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/interactions_repos.go b/vendor/github.com/google/go-github/v88/github/interactions_repos.go similarity index 76% rename from vendor/github.com/google/go-github/v84/github/interactions_repos.go rename to vendor/github.com/google/go-github/v88/github/interactions_repos.go index d99de494a..8de75e73c 100644 --- a/vendor/github.com/google/go-github/v84/github/interactions_repos.go +++ b/vendor/github.com/google/go-github/v88/github/interactions_repos.go @@ -12,21 +12,20 @@ import ( // GetRestrictionsForRepo fetches the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos?apiVersion=2022-11-28#get-interaction-restrictions-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - repositoryInteractions := new(InteractionRestriction) - - resp, err := s.client.Do(ctx, req, repositoryInteractions) + var repositoryInteractions *InteractionRestriction + resp, err := s.client.Do(req, &repositoryInteractions) if err != nil { return nil, resp, err } @@ -40,24 +39,23 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, // for the given repository. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos?apiVersion=2022-11-28#set-interaction-restrictions-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) - interaction := &InteractionRestriction{Limit: Ptr(limit)} + interaction := &InteractionRestriction{Limit: &limit} - req, err := s.client.NewRequest("PUT", u, interaction) + req, err := s.client.NewRequest(ctx, "PUT", u, interaction) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - repositoryInteractions := new(InteractionRestriction) - - resp, err := s.client.Do(ctx, req, repositoryInteractions) + var repositoryInteractions *InteractionRestriction + resp, err := s.client.Do(req, &repositoryInteractions) if err != nil { return nil, resp, err } @@ -67,17 +65,17 @@ func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, own // RemoveRestrictionsFromRepo removes the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos?apiVersion=2022-11-28#remove-interaction-restrictions-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeInteractionRestrictionsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/issue_import.go b/vendor/github.com/google/go-github/v88/github/issue_import.go similarity index 91% rename from vendor/github.com/google/go-github/v84/github/issue_import.go rename to vendor/github.com/google/go-github/v88/github/issue_import.go index ea42db1ba..31761632c 100644 --- a/vendor/github.com/google/go-github/v84/github/issue_import.go +++ b/vendor/github.com/google/go-github/v88/github/issue_import.go @@ -76,27 +76,27 @@ type IssueImportError struct { //meta:operation POST /repos/{owner}/{repo}/import/issues func (s *IssueImportService) Create(ctx context.Context, owner, repo string, issue *IssueImportRequest) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues", owner, repo) - req, err := s.client.NewRequest("POST", u, issue) + req, err := s.client.NewRequest(ctx, "POST", u, issue) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeIssueImportAPI) - i := new(IssueImportResponse) - resp, err := s.client.Do(ctx, req, i) + var i IssueImportResponse + resp, err := s.client.Do(req, &i) if err != nil { var aerr *AcceptedError if errors.As(err, &aerr) { - if err := json.Unmarshal(aerr.Raw, i); err != nil { - return i, resp, err + if err := json.Unmarshal(aerr.Raw, &i); err != nil { + return &i, resp, err } - return i, resp, err + return &i, resp, err } return nil, resp, err } - return i, resp, nil + return &i, resp, nil } // CheckStatus checks the status of an imported issue. @@ -106,15 +106,15 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss //meta:operation GET /repos/{owner}/{repo}/import/issues/{issue_number} func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string, issueID int64) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues/%v", owner, repo, issueID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeIssueImportAPI) - i := new(IssueImportResponse) - resp, err := s.client.Do(ctx, req, i) + var i *IssueImportResponse + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } @@ -129,7 +129,7 @@ func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string //meta:operation GET /repos/{owner}/{repo}/import/issues func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since Timestamp) ([]*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues?since=%v", owner, repo, since.Format("2006-01-02")) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -137,7 +137,7 @@ func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo s req.Header.Set("Accept", mediaTypeIssueImportAPI) var b bytes.Buffer - resp, err := s.client.Do(ctx, req, &b) + resp, err := s.client.Do(req, &b) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/issues.go b/vendor/github.com/google/go-github/v88/github/issues.go similarity index 71% rename from vendor/github.com/google/go-github/v84/github/issues.go rename to vendor/github.com/google/go-github/v88/github/issues.go index c31bebe45..bea89912b 100644 --- a/vendor/github.com/google/go-github/v84/github/issues.go +++ b/vendor/github.com/google/go-github/v88/github/issues.go @@ -14,7 +14,7 @@ import ( // IssuesService handles communication with the issue related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/issues/ +// GitHub API docs: https://docs.github.com/rest/issues?apiVersion=2022-11-28 type IssuesService service // Issue represents a GitHub issue on a repository. @@ -38,31 +38,32 @@ type Issue struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Issues REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/issues/issues#get-an-issue - AuthorAssociation *string `json:"author_association,omitempty"` - User *User `json:"user,omitempty"` - Labels []*Label `json:"labels,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Comments *int `json:"comments,omitempty"` - ClosedAt *Timestamp `json:"closed_at,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - ClosedBy *User `json:"closed_by,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - CommentsURL *string `json:"comments_url,omitempty"` - EventsURL *string `json:"events_url,omitempty"` - LabelsURL *string `json:"labels_url,omitempty"` - RepositoryURL *string `json:"repository_url,omitempty"` - ParentIssueURL *string `json:"parent_issue_url,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` - PullRequestLinks *PullRequestLinks `json:"pull_request,omitempty"` - Repository *Repository `json:"repository,omitempty"` - Reactions *Reactions `json:"reactions,omitempty"` - Assignees []*User `json:"assignees,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Draft *bool `json:"draft,omitempty"` - Type *IssueType `json:"type,omitempty"` + // See: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue + AuthorAssociation *string `json:"author_association,omitempty"` + User *User `json:"user,omitempty"` + Labels []*Label `json:"labels,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Comments *int `json:"comments,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ClosedBy *User `json:"closed_by,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + CommentsURL *string `json:"comments_url,omitempty"` + EventsURL *string `json:"events_url,omitempty"` + LabelsURL *string `json:"labels_url,omitempty"` + RepositoryURL *string `json:"repository_url,omitempty"` + ParentIssueURL *string `json:"parent_issue_url,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + PullRequestLinks *PullRequestLinks `json:"pull_request,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Reactions *Reactions `json:"reactions,omitempty"` + Assignees []*User `json:"assignees,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Draft *bool `json:"draft,omitempty"` + Type *IssueType `json:"type,omitempty"` + IssueFieldValues []*IssueFieldValue `json:"issue_field_values,omitempty"` // TextMatches is only populated from search results that request text matches // See: search.go and https://docs.github.com/rest/search/#text-match-metadata @@ -94,10 +95,11 @@ type IssueRequest struct { Assignee *string `json:"assignee,omitempty"` State *string `json:"state,omitempty"` // StateReason can be 'completed' or 'not_planned'. - StateReason *string `json:"state_reason,omitempty"` - Milestone *int `json:"milestone,omitempty"` - Assignees *[]string `json:"assignees,omitempty"` - Type *string `json:"type,omitempty"` + StateReason *string `json:"state_reason,omitempty"` + Milestone *int `json:"milestone,omitempty"` + Assignees *[]string `json:"assignees,omitempty"` + Type *string `json:"type,omitempty"` + IssueFieldValues []*IssueRequestFieldValue `json:"issue_field_values,omitempty"` } // PullRequestLinks object is added to the Issue object when it's an issue included @@ -122,6 +124,36 @@ type IssueType struct { UpdatedAt *Timestamp `json:"updated_at,omitempty"` } +// IssueFieldValueSingleSelectOption represents a single-select option for an issue field value. +// +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue +type IssueFieldValueSingleSelectOption struct { + ID int64 `json:"id"` + Name string `json:"name"` + Color string `json:"color"` +} + +// IssueRequestFieldValue represents a custom field value to set on an issue. +// +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#update-an-issue +type IssueRequestFieldValue struct { + FieldID int64 `json:"field_id"` + Value any `json:"value"` +} + +// IssueFieldValue represents a custom field value attached to an issue. +// The Value field contains a string for text, single_select, and date fields, +// or a number for numeric fields. +// +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue +type IssueFieldValue struct { + IssueFieldID int64 `json:"issue_field_id"` + NodeID string `json:"node_id"` + DataType string `json:"data_type"` + Value any `json:"value"` + SingleSelectOption *IssueFieldValueSingleSelectOption `json:"single_select_option,omitempty"` +} + // ListAllIssuesOptions specifies the optional parameters to the // IssuesService.ListAllIssues method. type ListAllIssuesOptions struct { @@ -159,7 +191,7 @@ type ListAllIssuesOptions struct { // member repositories, and organization repositories. // You can use the filter query parameter to fetch issues that are not necessarily assigned to you. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#list-issues-assigned-to-the-authenticated-user // //meta:operation GET /issues func (s *IssuesService) ListAllIssues(ctx context.Context, opts *ListAllIssuesOptions) ([]*Issue, *Response, error) { @@ -169,7 +201,7 @@ func (s *IssuesService) ListAllIssues(ctx context.Context, opts *ListAllIssuesOp return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -177,7 +209,7 @@ func (s *IssuesService) ListAllIssues(ctx context.Context, opts *ListAllIssuesOp req.Header.Set("Accept", mediaTypeReactionsPreview) var issues []*Issue - resp, err := s.client.Do(ctx, req, &issues) + resp, err := s.client.Do(req, &issues) if err != nil { return nil, resp, err } @@ -215,7 +247,7 @@ type ListUserIssuesOptions struct { // ListUserIssues gets issues across owned and member repositories assigned to the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#list-user-account-issues-assigned-to-the-authenticated-user // //meta:operation GET /user/issues func (s *IssuesService) ListUserIssues(ctx context.Context, opts *ListUserIssuesOptions) ([]*Issue, *Response, error) { @@ -225,7 +257,7 @@ func (s *IssuesService) ListUserIssues(ctx context.Context, opts *ListUserIssues return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -233,7 +265,7 @@ func (s *IssuesService) ListUserIssues(ctx context.Context, opts *ListUserIssues req.Header.Set("Accept", mediaTypeReactionsPreview) var issues []*Issue - resp, err := s.client.Do(ctx, req, &issues) + resp, err := s.client.Do(req, &issues) if err != nil { return nil, resp, err } @@ -275,7 +307,7 @@ type IssueListByOrgOptions struct { // ListByOrg fetches the issues in the specified organization for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#list-organization-issues-assigned-to-the-authenticated-user // //meta:operation GET /orgs/{org}/issues func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListByOrgOptions) ([]*Issue, *Response, error) { @@ -285,7 +317,7 @@ func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueLi return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -293,7 +325,7 @@ func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueLi req.Header.Set("Accept", mediaTypeReactionsPreview) var issues []*Issue - resp, err := s.client.Do(ctx, req, &issues) + resp, err := s.client.Do(req, &issues) if err != nil { return nil, resp, err } @@ -353,7 +385,7 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-repository-issues +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues // //meta:operation GET /repos/{owner}/{repo}/issues func (s *IssuesService) ListByRepo(ctx context.Context, owner, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { @@ -363,7 +395,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner, repo string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -371,7 +403,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner, repo string, opts req.Header.Set("Accept", mediaTypeReactionsPreview) var issues []*Issue - resp, err := s.client.Do(ctx, req, &issues) + resp, err := s.client.Do(req, &issues) if err != nil { return nil, resp, err } @@ -381,20 +413,20 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner, repo string, opts // Get a single issue. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) Get(ctx context.Context, owner, repo string, number int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, number) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - issue := new(Issue) - resp, err := s.client.Do(ctx, req, issue) + var issue *Issue + resp, err := s.client.Do(req, &issue) if err != nil { return nil, resp, err } @@ -404,18 +436,18 @@ func (s *IssuesService) Get(ctx context.Context, owner, repo string, number int) // Create a new issue on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#create-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#create-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues func (s *IssuesService) Create(ctx context.Context, owner, repo string, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) - req, err := s.client.NewRequest("POST", u, issue) + req, err := s.client.NewRequest(ctx, "POST", u, issue) if err != nil { return nil, nil, err } - i := new(Issue) - resp, err := s.client.Do(ctx, req, i) + var i *Issue + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } @@ -425,18 +457,18 @@ func (s *IssuesService) Create(ctx context.Context, owner, repo string, issue *I // Edit (update) an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#update-an-issue // //meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) Edit(ctx context.Context, owner, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, number) - req, err := s.client.NewRequest("PATCH", u, issue) + req, err := s.client.NewRequest(ctx, "PATCH", u, issue) if err != nil { return nil, nil, err } - i := new(Issue) - resp, err := s.client.Do(ctx, req, i) + var i *Issue + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } @@ -448,20 +480,20 @@ func (s *IssuesService) Edit(ctx context.Context, owner, repo string, number int // // This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#update-an-issue // //meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber) - req, err := s.client.NewRequest("PATCH", u, &struct { + req, err := s.client.NewRequest(ctx, "PATCH", u, &struct { Milestone *Milestone `json:"milestone"` }{}) if err != nil { return nil, nil, err } - i := new(Issue) - resp, err := s.client.Do(ctx, req, i) + var i *Issue + resp, err := s.client.Do(req, &i) if err != nil { return nil, resp, err } @@ -480,30 +512,30 @@ type LockIssueOptions struct { // Lock an issue's conversation. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#lock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#lock-an-issue // //meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/lock func (s *IssuesService) Lock(ctx context.Context, owner, repo string, number int, opts *LockIssueOptions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/lock", owner, repo, number) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Unlock an issue's conversation. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#unlock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#unlock-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock func (s *IssuesService) Unlock(ctx context.Context, owner, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/lock", owner, repo, number) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/issues_assignees.go b/vendor/github.com/google/go-github/v88/github/issues_assignees.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/issues_assignees.go rename to vendor/github.com/google/go-github/v88/github/issues_assignees.go index fd065771e..3b2dd4d3a 100644 --- a/vendor/github.com/google/go-github/v84/github/issues_assignees.go +++ b/vendor/github.com/google/go-github/v88/github/issues_assignees.go @@ -13,7 +13,7 @@ import ( // ListAssignees fetches all available assignees (owners and collaborators) to // which issues may be assigned. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#list-assignees +// GitHub API docs: https://docs.github.com/rest/issues/assignees?apiVersion=2022-11-28#list-assignees // //meta:operation GET /repos/{owner}/{repo}/assignees func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { @@ -23,13 +23,13 @@ func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, o return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var assignees []*User - resp, err := s.client.Do(ctx, req, &assignees) + resp, err := s.client.Do(req, &assignees) if err != nil { return nil, resp, err } @@ -39,24 +39,24 @@ func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, o // IsAssignee checks if a user is an assignee for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned +// GitHub API docs: https://docs.github.com/rest/issues/assignees?apiVersion=2022-11-28#check-if-a-user-can-be-assigned // //meta:operation GET /repos/{owner}/{repo}/assignees/{assignee} func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees/%v", owner, repo, user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) assignee, err := parseBoolResponse(err) return assignee, resp, err } // AddAssignees adds the provided GitHub users as assignees to the issue. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees?apiVersion=2022-11-28#add-assignees-to-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/assignees func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { @@ -64,13 +64,13 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu Assignees []string `json:"assignees,omitempty"` }{Assignees: assignees} u := fmt.Sprintf("repos/%v/%v/issues/%v/assignees", owner, repo, number) - req, err := s.client.NewRequest("POST", u, users) + req, err := s.client.NewRequest(ctx, "POST", u, users) if err != nil { return nil, nil, err } - issue := &Issue{} - resp, err := s.client.Do(ctx, req, issue) + var issue *Issue + resp, err := s.client.Do(req, &issue) if err != nil { return nil, resp, err } @@ -80,7 +80,7 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu // RemoveAssignees removes the provided GitHub users as assignees from the issue. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees?apiVersion=2022-11-28#remove-assignees-from-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { @@ -88,13 +88,13 @@ func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, Assignees []string `json:"assignees,omitempty"` }{Assignees: assignees} u := fmt.Sprintf("repos/%v/%v/issues/%v/assignees", owner, repo, number) - req, err := s.client.NewRequest("DELETE", u, users) + req, err := s.client.NewRequest(ctx, "DELETE", u, users) if err != nil { return nil, nil, err } - issue := &Issue{} - resp, err := s.client.Do(ctx, req, issue) + var issue *Issue + resp, err := s.client.Do(req, &issue) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/issues_comments.go b/vendor/github.com/google/go-github/v88/github/issues_comments.go similarity index 84% rename from vendor/github.com/google/go-github/v84/github/issues_comments.go rename to vendor/github.com/google/go-github/v88/github/issues_comments.go index ef5314b18..f7ab4b80e 100644 --- a/vendor/github.com/google/go-github/v84/github/issues_comments.go +++ b/vendor/github.com/google/go-github/v88/github/issues_comments.go @@ -25,7 +25,7 @@ type IssueComment struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Issue Comments REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/issues/comments#get-an-issue-comment + // See: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#get-an-issue-comment AuthorAssociation *string `json:"author_association,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` @@ -54,9 +54,9 @@ type IssueListCommentsOptions struct { // ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#list-issue-comments // -// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#list-issue-comments-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/issues/comments //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/comments @@ -72,7 +72,7 @@ func (s *IssuesService) ListComments(ctx context.Context, owner, repo string, nu return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -80,7 +80,7 @@ func (s *IssuesService) ListComments(ctx context.Context, owner, repo string, nu req.Header.Set("Accept", mediaTypeReactionsPreview) var comments []*IssueComment - resp, err := s.client.Do(ctx, req, &comments) + resp, err := s.client.Do(req, &comments) if err != nil { return nil, resp, err } @@ -90,21 +90,21 @@ func (s *IssuesService) ListComments(ctx context.Context, owner, repo string, nu // GetComment fetches the specified issue comment. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#get-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#get-an-issue-comment // //meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v", owner, repo, commentID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - comment := new(IssueComment) - resp, err := s.client.Do(ctx, req, comment) + var comment *IssueComment + resp, err := s.client.Do(req, &comment) if err != nil { return nil, resp, err } @@ -114,17 +114,17 @@ func (s *IssuesService) GetComment(ctx context.Context, owner, repo string, comm // CreateComment creates a new comment on the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#create-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/comments func (s *IssuesService) CreateComment(ctx context.Context, owner, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/comments", owner, repo, number) - req, err := s.client.NewRequest("POST", u, comment) + req, err := s.client.NewRequest(ctx, "POST", u, comment) if err != nil { return nil, nil, err } - c := new(IssueComment) - resp, err := s.client.Do(ctx, req, c) + var c *IssueComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -135,17 +135,17 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner, repo string, n // EditComment updates an issue comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#update-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#update-an-issue-comment // //meta:operation PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v", owner, repo, commentID) - req, err := s.client.NewRequest("PATCH", u, comment) + req, err := s.client.NewRequest(ctx, "PATCH", u, comment) if err != nil { return nil, nil, err } - c := new(IssueComment) - resp, err := s.client.Do(ctx, req, c) + var c *IssueComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -155,14 +155,14 @@ func (s *IssuesService) EditComment(ctx context.Context, owner, repo string, com // DeleteComment deletes an issue comment. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#delete-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments?apiVersion=2022-11-28#delete-an-issue-comment // //meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v", owner, repo, commentID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/issues_events.go b/vendor/github.com/google/go-github/v88/github/issues_events.go similarity index 90% rename from vendor/github.com/google/go-github/v84/github/issues_events.go rename to vendor/github.com/google/go-github/v88/github/issues_events.go index 8e234d7e0..82aa38f9a 100644 --- a/vendor/github.com/google/go-github/v84/github/issues_events.go +++ b/vendor/github.com/google/go-github/v88/github/issues_events.go @@ -104,7 +104,7 @@ type DismissedReview struct { // ListIssueEvents lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events +// GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#list-issue-events // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/events func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*IssueEvent, *Response, error) { @@ -114,7 +114,7 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -122,7 +122,7 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, req.Header.Set("Accept", mediaTypeProjectCardDetailsPreview) var events []*IssueEvent - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -132,7 +132,7 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, // ListRepositoryEvents lists events for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#list-issue-events-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/issues/events func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { @@ -142,13 +142,13 @@ func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo st return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var events []*IssueEvent - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } @@ -158,19 +158,19 @@ func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo st // GetEvent returns the specified issue event. // -// GitHub API docs: https://docs.github.com/rest/issues/events#get-an-issue-event +// GitHub API docs: https://docs.github.com/rest/issues/events?apiVersion=2022-11-28#get-an-issue-event // //meta:operation GET /repos/{owner}/{repo}/issues/events/{event_id} func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int64) (*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - event := new(IssueEvent) - resp, err := s.client.Do(ctx, req, event) + var event *IssueEvent + resp, err := s.client.Do(req, &event) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/issues_labels.go b/vendor/github.com/google/go-github/v88/github/issues_labels.go similarity index 71% rename from vendor/github.com/google/go-github/v84/github/issues_labels.go rename to vendor/github.com/google/go-github/v88/github/issues_labels.go index 243670ec7..c334ed660 100644 --- a/vendor/github.com/google/go-github/v84/github/issues_labels.go +++ b/vendor/github.com/google/go-github/v88/github/issues_labels.go @@ -27,7 +27,7 @@ func (l Label) String() string { // ListLabels lists all labels for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#list-labels-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/labels func (s *IssuesService) ListLabels(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Label, *Response, error) { @@ -37,13 +37,13 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner, repo string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var labels []*Label - resp, err := s.client.Do(ctx, req, &labels) + resp, err := s.client.Do(req, &labels) if err != nil { return nil, resp, err } @@ -53,18 +53,18 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner, repo string, opts // GetLabel gets a single label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#get-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#get-a-label // //meta:operation GET /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) GetLabel(ctx context.Context, owner, repo, name string) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - label := new(Label) - resp, err := s.client.Do(ctx, req, label) + var label *Label + resp, err := s.client.Do(req, &label) if err != nil { return nil, resp, err } @@ -74,18 +74,18 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner, repo, name string) // CreateLabel creates a new label on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#create-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#create-a-label // //meta:operation POST /repos/{owner}/{repo}/labels func (s *IssuesService) CreateLabel(ctx context.Context, owner, repo string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) - req, err := s.client.NewRequest("POST", u, label) + req, err := s.client.NewRequest(ctx, "POST", u, label) if err != nil { return nil, nil, err } - l := new(Label) - resp, err := s.client.Do(ctx, req, l) + var l *Label + resp, err := s.client.Do(req, &l) if err != nil { return nil, resp, err } @@ -95,18 +95,18 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner, repo string, lab // EditLabel edits a label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#update-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#update-a-label // //meta:operation PATCH /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) EditLabel(ctx context.Context, owner, repo, name string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) - req, err := s.client.NewRequest("PATCH", u, label) + req, err := s.client.NewRequest(ctx, "PATCH", u, label) if err != nil { return nil, nil, err } - l := new(Label) - resp, err := s.client.Do(ctx, req, l) + var l *Label + resp, err := s.client.Do(req, &l) if err != nil { return nil, resp, err } @@ -116,21 +116,21 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner, repo, name string, // DeleteLabel deletes a label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#delete-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#delete-a-label // //meta:operation DELETE /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) DeleteLabel(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListLabelsByIssue lists all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#list-labels-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { @@ -140,13 +140,13 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner, repo strin return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var labels []*Label - resp, err := s.client.Do(ctx, req, &labels) + resp, err := s.client.Do(req, &labels) if err != nil { return nil, resp, err } @@ -156,18 +156,18 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner, repo strin // AddLabelsToIssue adds labels to an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/labels", owner, repo, number) - req, err := s.client.NewRequest("POST", u, labels) + req, err := s.client.NewRequest(ctx, "POST", u, labels) if err != nil { return nil, nil, err } var l []*Label - resp, err := s.client.Do(ctx, req, &l) + resp, err := s.client.Do(req, &l) if err != nil { return nil, resp, err } @@ -177,33 +177,33 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner, repo string // RemoveLabelForIssue removes a label for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#remove-a-label-from-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner, repo string, number int, label string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/labels/%v", owner, repo, number, label) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ReplaceLabelsForIssue replaces all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#set-labels-for-an-issue // //meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/labels", owner, repo, number) - req, err := s.client.NewRequest("PUT", u, labels) + req, err := s.client.NewRequest(ctx, "PUT", u, labels) if err != nil { return nil, nil, err } var l []*Label - resp, err := s.client.Do(ctx, req, &l) + resp, err := s.client.Do(req, &l) if err != nil { return nil, resp, err } @@ -213,22 +213,22 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner, repo s // RemoveLabelsForIssue removes all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#remove-all-labels-from-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/labels", owner, repo, number) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListLabelsForMilestone lists labels for every issue in a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/labels?apiVersion=2022-11-28#list-labels-for-issues-in-a-milestone // //meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { @@ -238,13 +238,13 @@ func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var labels []*Label - resp, err := s.client.Do(ctx, req, &labels) + resp, err := s.client.Do(req, &labels) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/issues_milestones.go b/vendor/github.com/google/go-github/v88/github/issues_milestones.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/issues_milestones.go rename to vendor/github.com/google/go-github/v88/github/issues_milestones.go index 747829029..9365745de 100644 --- a/vendor/github.com/google/go-github/v84/github/issues_milestones.go +++ b/vendor/github.com/google/go-github/v88/github/issues_milestones.go @@ -54,7 +54,7 @@ type MilestoneListOptions struct { // ListMilestones lists all milestones for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#list-milestones +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#list-milestones // //meta:operation GET /repos/{owner}/{repo}/milestones func (s *IssuesService) ListMilestones(ctx context.Context, owner, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { @@ -64,13 +64,13 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var milestones []*Milestone - resp, err := s.client.Do(ctx, req, &milestones) + resp, err := s.client.Do(req, &milestones) if err != nil { return nil, resp, err } @@ -80,18 +80,18 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner, repo string, // GetMilestone gets a single milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#get-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#get-a-milestone // //meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) GetMilestone(ctx context.Context, owner, repo string, number int) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%v", owner, repo, number) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - milestone := new(Milestone) - resp, err := s.client.Do(ctx, req, milestone) + var milestone *Milestone + resp, err := s.client.Do(req, &milestone) if err != nil { return nil, resp, err } @@ -101,18 +101,18 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner, repo string, nu // CreateMilestone creates a new milestone on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#create-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#create-a-milestone // //meta:operation POST /repos/{owner}/{repo}/milestones func (s *IssuesService) CreateMilestone(ctx context.Context, owner, repo string, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) - req, err := s.client.NewRequest("POST", u, milestone) + req, err := s.client.NewRequest(ctx, "POST", u, milestone) if err != nil { return nil, nil, err } - m := new(Milestone) - resp, err := s.client.Do(ctx, req, m) + var m *Milestone + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -122,18 +122,18 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner, repo string, // EditMilestone edits a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#update-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#update-a-milestone // //meta:operation PATCH /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) EditMilestone(ctx context.Context, owner, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%v", owner, repo, number) - req, err := s.client.NewRequest("PATCH", u, milestone) + req, err := s.client.NewRequest(ctx, "PATCH", u, milestone) if err != nil { return nil, nil, err } - m := new(Milestone) - resp, err := s.client.Do(ctx, req, m) + var m *Milestone + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -143,15 +143,15 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner, repo string, n // DeleteMilestone deletes a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#delete-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones?apiVersion=2022-11-28#delete-a-milestone // //meta:operation DELETE /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) DeleteMilestone(ctx context.Context, owner, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%v", owner, repo, number) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/issues_timeline.go b/vendor/github.com/google/go-github/v88/github/issues_timeline.go similarity index 97% rename from vendor/github.com/google/go-github/v84/github/issues_timeline.go rename to vendor/github.com/google/go-github/v88/github/issues_timeline.go index cea900ee6..7cebc47c7 100644 --- a/vendor/github.com/google/go-github/v84/github/issues_timeline.go +++ b/vendor/github.com/google/go-github/v88/github/issues_timeline.go @@ -173,7 +173,7 @@ type Source struct { // ListIssueTimeline lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/timeline?apiVersion=2022-11-28#list-timeline-events-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/timeline func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Timeline, *Response, error) { @@ -183,7 +183,7 @@ func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo strin return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -192,7 +192,7 @@ func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo strin req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var events []*Timeline - resp, err := s.client.Do(ctx, req, &events) + resp, err := s.client.Do(req, &events) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/licenses.go b/vendor/github.com/google/go-github/v88/github/licenses.go similarity index 88% rename from vendor/github.com/google/go-github/v84/github/licenses.go rename to vendor/github.com/google/go-github/v88/github/licenses.go index c589a8152..8d34f6feb 100644 --- a/vendor/github.com/google/go-github/v84/github/licenses.go +++ b/vendor/github.com/google/go-github/v88/github/licenses.go @@ -13,7 +13,7 @@ import ( // LicensesService handles communication with the license related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/licenses/ +// GitHub API docs: https://docs.github.com/rest/licenses?apiVersion=2022-11-28 type LicensesService service // RepositoryLicense represents the license for a repository. @@ -67,7 +67,7 @@ type ListLicensesOptions struct { // List popular open source licenses. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses +// GitHub API docs: https://docs.github.com/rest/licenses/licenses?apiVersion=2022-11-28#get-all-commonly-used-licenses // //meta:operation GET /licenses func (s *LicensesService) List(ctx context.Context, opts *ListLicensesOptions) ([]*License, *Response, error) { @@ -77,13 +77,13 @@ func (s *LicensesService) List(ctx context.Context, opts *ListLicensesOptions) ( return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var licenses []*License - resp, err := s.client.Do(ctx, req, &licenses) + resp, err := s.client.Do(req, &licenses) if err != nil { return nil, resp, err } @@ -93,19 +93,19 @@ func (s *LicensesService) List(ctx context.Context, opts *ListLicensesOptions) ( // Get extended metadata for one license. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-a-license +// GitHub API docs: https://docs.github.com/rest/licenses/licenses?apiVersion=2022-11-28#get-a-license // //meta:operation GET /licenses/{license} func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) { u := fmt.Sprintf("licenses/%v", licenseName) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - license := new(License) - resp, err := s.client.Do(ctx, req, license) + var license *License + resp, err := s.client.Do(req, &license) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/markdown.go b/vendor/github.com/google/go-github/v88/github/markdown.go similarity index 84% rename from vendor/github.com/google/go-github/v84/github/markdown.go rename to vendor/github.com/google/go-github/v88/github/markdown.go index 0fd896c6c..60e4660cd 100644 --- a/vendor/github.com/google/go-github/v84/github/markdown.go +++ b/vendor/github.com/google/go-github/v88/github/markdown.go @@ -40,27 +40,27 @@ type markdownRenderRequest struct { // Render renders an arbitrary Render document. // -// GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document +// GitHub API docs: https://docs.github.com/rest/markdown/markdown?apiVersion=2022-11-28#render-a-markdown-document // //meta:operation POST /markdown func (s *MarkdownService) Render(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { - request := &markdownRenderRequest{Text: Ptr(text)} + request := &markdownRenderRequest{Text: &text} if opts != nil { if opts.Mode != "" { - request.Mode = Ptr(opts.Mode) + request.Mode = &opts.Mode } if opts.Context != "" { - request.Context = Ptr(opts.Context) + request.Context = &opts.Context } } - req, err := s.client.NewRequest("POST", "markdown", request) + req, err := s.client.NewRequest(ctx, "POST", "markdown", request) if err != nil { return "", nil, err } - buf := new(bytes.Buffer) - resp, err := s.client.Do(ctx, req, buf) + var buf bytes.Buffer + resp, err := s.client.Do(req, &buf) if err != nil { return "", resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/messages.go b/vendor/github.com/google/go-github/v88/github/messages.go similarity index 94% rename from vendor/github.com/google/go-github/v84/github/messages.go rename to vendor/github.com/google/go-github/v88/github/messages.go index c3d14acdc..9bb43c75d 100644 --- a/vendor/github.com/google/go-github/v84/github/messages.go +++ b/vendor/github.com/google/go-github/v88/github/messages.go @@ -42,6 +42,10 @@ const ( EventTypeHeader = "X-Github-Event" // DeliveryIDHeader is the GitHub header key used to pass the unique ID for the webhook event. DeliveryIDHeader = "X-Github-Delivery" + + // maxPayloadSize is the maximum size of a GitHub webhook payload. + // GitHub documents a 25 MB limit for webhook payloads. + maxPayloadSize = 25 * 1024 * 1024 ) var ( @@ -146,8 +150,19 @@ func checkMAC(message, messageMAC, key []byte, hashFunc func() hash.Hash) bool { return hmac.Equal(messageMAC, expectedMAC) } -// messageMAC returns the hex-decoded HMAC tag from the signature and its -// corresponding hash function. +// readPayloadBody reads the body from readable, enforcing maxPayloadSize. +func readPayloadBody(readable io.Reader) ([]byte, error) { + body, err := io.ReadAll(io.LimitReader(readable, maxPayloadSize+1)) + if err != nil { + return nil, err + } + if len(body) > maxPayloadSize { + return nil, errors.New("webhook payload exceeds maximum allowed size") + } + return body, nil +} + +// messageMAC returns the MAC method and the corresponding hash function. func messageMAC(signature string) ([]byte, func() hash.Hash, error) { if signature == "" { return nil, nil, errors.New("missing signature") @@ -199,7 +214,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s switch contentType { case "application/json": var err error - if body, err = io.ReadAll(readable); err != nil { + if body, err = readPayloadBody(readable); err != nil { return nil, err } @@ -213,7 +228,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s const payloadFormParam = "payload" var err error - if body, err = io.ReadAll(readable); err != nil { + if body, err = readPayloadBody(readable); err != nil { return nil, err } diff --git a/vendor/github.com/google/go-github/v84/github/meta.go b/vendor/github.com/google/go-github/v88/github/meta.go similarity index 90% rename from vendor/github.com/google/go-github/v84/github/meta.go rename to vendor/github.com/google/go-github/v88/github/meta.go index 6dd104c8c..d895b3328 100644 --- a/vendor/github.com/google/go-github/v84/github/meta.go +++ b/vendor/github.com/google/go-github/v88/github/meta.go @@ -114,17 +114,17 @@ type APIMetaArtifactAttestations struct { // this endpoint on your organization’s GitHub Enterprise installation, this // endpoint provides information about that installation. // -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information +// GitHub API docs: https://docs.github.com/rest/meta/meta?apiVersion=2022-11-28#get-github-meta-information // //meta:operation GET /meta func (s *MetaService) Get(ctx context.Context) (*APIMeta, *Response, error) { - req, err := s.client.NewRequest("GET", "meta", nil) + req, err := s.client.NewRequest(ctx, "GET", "meta", nil) if err != nil { return nil, nil, err } - meta := new(APIMeta) - resp, err := s.client.Do(ctx, req, meta) + var meta *APIMeta + resp, err := s.client.Do(req, &meta) if err != nil { return nil, resp, err } @@ -142,7 +142,7 @@ func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { // Octocat returns an ASCII art octocat with the specified message in a speech // bubble. If message is empty, a random zen phrase is used. // -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat +// GitHub API docs: https://docs.github.com/rest/meta/meta?apiVersion=2022-11-28#get-octocat // //meta:operation GET /octocat func (s *MetaService) Octocat(ctx context.Context, message string) (string, *Response, error) { @@ -151,13 +151,13 @@ func (s *MetaService) Octocat(ctx context.Context, message string) (string, *Res u = fmt.Sprintf("%v?s=%v", u, url.QueryEscape(message)) } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return "", nil, err } - buf := new(bytes.Buffer) - resp, err := s.client.Do(ctx, req, buf) + var buf bytes.Buffer + resp, err := s.client.Do(req, &buf) if err != nil { return "", resp, err } @@ -177,17 +177,17 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response // // See also: https://warpspire.com/posts/taste/ // -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github +// GitHub API docs: https://docs.github.com/rest/meta/meta?apiVersion=2022-11-28#get-the-zen-of-github // //meta:operation GET /zen func (s *MetaService) Zen(ctx context.Context) (string, *Response, error) { - req, err := s.client.NewRequest("GET", "zen", nil) + req, err := s.client.NewRequest(ctx, "GET", "zen", nil) if err != nil { return "", nil, err } - buf := new(bytes.Buffer) - resp, err := s.client.Do(ctx, req, buf) + var buf bytes.Buffer + resp, err := s.client.Do(req, &buf) if err != nil { return "", resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/migrations.go b/vendor/github.com/google/go-github/v88/github/migrations.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/migrations.go rename to vendor/github.com/google/go-github/v88/github/migrations.go index 14d014b61..0ebf8b122 100644 --- a/vendor/github.com/google/go-github/v84/github/migrations.go +++ b/vendor/github.com/google/go-github/v88/github/migrations.go @@ -9,14 +9,12 @@ import ( "context" "errors" "fmt" - "net/http" - "strings" ) // MigrationService provides access to the migration related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/migration/ +// GitHub API docs: https://docs.github.com/rest/migrations?apiVersion=2022-11-28 type MigrationService service // Migration represents a GitHub migration (archival). @@ -90,7 +88,7 @@ type startMigration struct { // StartMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#start-an-organization-migration // //meta:operation POST /orgs/{org}/migrations func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) { @@ -98,21 +96,21 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos body := &startMigration{Repositories: repos} if opts != nil { - body.LockRepositories = Ptr(opts.LockRepositories) - body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) - body.ExcludeReleases = Ptr(opts.ExcludeReleases) + body.LockRepositories = &opts.LockRepositories + body.ExcludeAttachments = &opts.ExcludeAttachments + body.ExcludeReleases = &opts.ExcludeReleases body.Exclude = append(body.Exclude, opts.Exclude...) } - req, err := s.client.NewRequest("POST", u, body) + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &Migration{} - resp, err := s.client.Do(ctx, req, m) + var m *Migration + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -122,7 +120,7 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos // ListMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#list-organization-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#list-organization-migrations // //meta:operation GET /orgs/{org}/migrations func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) { @@ -132,7 +130,7 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -140,7 +138,7 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts req.Header.Set("Accept", mediaTypeMigrationsPreview) var m []*Migration - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -151,21 +149,21 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts // MigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#get-an-organization-migration-status // //meta:operation GET /orgs/{org}/migrations/{migration_id} func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v", org, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &Migration{} - resp, err := s.client.Do(ctx, req, m) + var m *Migration + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -176,58 +174,47 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i // MigrationArchiveURL fetches a migration archive URL. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#download-an-organization-migration-archive // //meta:operation GET /orgs/{org}/migrations/{migration_id}/archive func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return "", err } - req.Header.Set("Accept", mediaTypeMigrationsPreview) - s.client.clientMu.Lock() - defer s.client.clientMu.Unlock() - - // Disable the redirect mechanism because AWS fails if the GitHub auth token is provided. - var loc string - saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { - loc = req.URL.String() - return errors.New("disable redirect") + loc, _, err := s.client.bareDoUntilFound(req, 10) + if err != nil { + return "", err } - defer func() { s.client.client.CheckRedirect = saveRedirect }() - _, err = s.client.Do(ctx, req, nil) // expect error from disable redirect - if err == nil { + if loc == nil { return "", errors.New("expected redirect, none provided") } - if !strings.Contains(err.Error(), "disable redirect") { - return "", err - } - return loc, nil + + return loc.String(), nil } // DeleteMigration deletes a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#delete-an-organization-migration-archive // //meta:operation DELETE /orgs/{org}/migrations/{migration_id}/archive func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UnlockRepo unlocks a repository that was locked for migration. @@ -235,18 +222,18 @@ func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id i // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#unlock-an-organization-repository // //meta:operation DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/repos/%v/lock", org, id, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/migrations_source_import.go b/vendor/github.com/google/go-github/v88/github/migrations_source_import.go similarity index 88% rename from vendor/github.com/google/go-github/v84/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v88/github/migrations_source_import.go index f484b77d4..0503dcad2 100644 --- a/vendor/github.com/google/go-github/v84/github/migrations_source_import.go +++ b/vendor/github.com/google/go-github/v88/github/migrations_source_import.go @@ -115,7 +115,7 @@ func (i Import) String() string { // SourceImportAuthor identifies an author imported from a source repository. // -// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-commit-authors type SourceImportAuthor struct { ID *int64 `json:"id,omitempty"` RemoteID *string `json:"remote_id,omitempty"` @@ -132,7 +132,7 @@ func (a SourceImportAuthor) String() string { // LargeFile identifies a file larger than 100MB found during a repository import. // -// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-large-files +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-large-files type LargeFile struct { RefName *string `json:"ref_name,omitempty"` Path *string `json:"path,omitempty"` @@ -146,18 +146,18 @@ func (f LargeFile) String() string { // StartImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#start-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#start-an-import // //meta:operation PUT /repos/{owner}/{repo}/import func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) - req, err := s.client.NewRequest("PUT", u, in) + req, err := s.client.NewRequest(ctx, "PUT", u, in) if err != nil { return nil, nil, err } - out := new(Import) - resp, err := s.client.Do(ctx, req, out) + var out *Import + resp, err := s.client.Do(req, &out) if err != nil { return nil, resp, err } @@ -167,18 +167,18 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, // ImportProgress queries for the status and progress of an ongoing repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-an-import-status +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-an-import-status // //meta:operation GET /repos/{owner}/{repo}/import func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - out := new(Import) - resp, err := s.client.Do(ctx, req, out) + var out *Import + resp, err := s.client.Do(req, &out) if err != nil { return nil, resp, err } @@ -188,18 +188,18 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin // UpdateImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#update-an-import // //meta:operation PATCH /repos/{owner}/{repo}/import func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) - req, err := s.client.NewRequest("PATCH", u, in) + req, err := s.client.NewRequest(ctx, "PATCH", u, in) if err != nil { return nil, nil, err } - out := new(Import) - resp, err := s.client.Do(ctx, req, out) + var out *Import + resp, err := s.client.Do(req, &out) if err != nil { return nil, resp, err } @@ -219,18 +219,18 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, // This method and MapCommitAuthor allow you to provide correct Git author // information. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-commit-authors // //meta:operation GET /repos/{owner}/{repo}/import/authors func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var authors []*SourceImportAuthor - resp, err := s.client.Do(ctx, req, &authors) + resp, err := s.client.Do(req, &authors) if err != nil { return nil, resp, err } @@ -242,18 +242,18 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string // application can continue updating authors any time before you push new // commits to the repository. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#map-a-commit-author // //meta:operation PATCH /repos/{owner}/{repo}/import/authors/{author_id} func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors/%v", owner, repo, id) - req, err := s.client.NewRequest("PATCH", u, author) + req, err := s.client.NewRequest(ctx, "PATCH", u, author) if err != nil { return nil, nil, err } - out := new(SourceImportAuthor) - resp, err := s.client.Do(ctx, req, out) + var out *SourceImportAuthor + resp, err := s.client.Do(req, &out) if err != nil { return nil, resp, err } @@ -265,18 +265,18 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri // files larger than 100MB. Only the UseLFS field on the provided Import is // used. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#update-git-lfs-preference // //meta:operation PATCH /repos/{owner}/{repo}/import/lfs func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/lfs", owner, repo) - req, err := s.client.NewRequest("PATCH", u, in) + req, err := s.client.NewRequest(ctx, "PATCH", u, in) if err != nil { return nil, nil, err } - out := new(Import) - resp, err := s.client.Do(ctx, req, out) + var out *Import + resp, err := s.client.Do(req, &out) if err != nil { return nil, resp, err } @@ -286,18 +286,18 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str // LargeFiles lists files larger than 100MB found during the import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-large-files +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#get-large-files // //meta:operation GET /repos/{owner}/{repo}/import/large_files func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/large_files", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var files []*LargeFile - resp, err := s.client.Do(ctx, req, &files) + resp, err := s.client.Do(req, &files) if err != nil { return nil, resp, err } @@ -307,15 +307,15 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ( // CancelImport stops an import for a repository. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#cancel-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports?apiVersion=2022-11-28#cancel-an-import // //meta:operation DELETE /repos/{owner}/{repo}/import func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/migrations_user.go b/vendor/github.com/google/go-github/v88/github/migrations_user.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/migrations_user.go rename to vendor/github.com/google/go-github/v88/github/migrations_user.go index 49678fcc0..6387d7f15 100644 --- a/vendor/github.com/google/go-github/v84/github/migrations_user.go +++ b/vendor/github.com/google/go-github/v88/github/migrations_user.go @@ -67,7 +67,7 @@ type startUserMigration struct { // StartUserMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#start-a-user-migration +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#start-a-user-migration // //meta:operation POST /user/migrations func (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) { @@ -75,19 +75,19 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin body := &startUserMigration{Repositories: repos} if opts != nil { - body.LockRepositories = Ptr(opts.LockRepositories) - body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) + body.LockRepositories = &opts.LockRepositories + body.ExcludeAttachments = &opts.ExcludeAttachments } - req, err := s.client.NewRequest("POST", u, body) + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &UserMigration{} - resp, err := s.client.Do(ctx, req, m) + var m *UserMigration + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -97,7 +97,7 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#list-user-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#list-user-migrations // //meta:operation GET /user/migrations func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOptions) ([]*UserMigration, *Response, error) { @@ -107,7 +107,7 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOpt return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -115,7 +115,7 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOpt req.Header.Set("Accept", mediaTypeMigrationsPreview) var m []*UserMigration - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -126,21 +126,21 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOpt // UserMigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#get-a-user-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#get-a-user-migration-status // //meta:operation GET /user/migrations/{migration_id} func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (*UserMigration, *Response, error) { u := fmt.Sprintf("user/migrations/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &UserMigration{} - resp, err := s.client.Do(ctx, req, m) + var m *UserMigration + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -151,21 +151,19 @@ func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (* // UserMigrationArchiveURL gets the URL for a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#download-a-user-migration-archive // //meta:operation GET /user/migrations/{migration_id}/archive func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64) (string, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return "", err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - m := &UserMigration{} - var loc string originalRedirect := s.client.client.CheckRedirect s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { @@ -175,10 +173,13 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 defer func() { s.client.client.CheckRedirect = originalRedirect }() - resp, err := s.client.Do(ctx, req, m) + + var m *UserMigration + resp, err := s.client.Do(req, &m) if err == nil { return "", errors.New("expected redirect, none provided") } + loc = resp.Header.Get("Location") return loc, nil } @@ -186,20 +187,20 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 // DeleteUserMigration will delete a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#delete-a-user-migration-archive // //meta:operation DELETE /user/migrations/{migration_id}/archive func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UnlockUserRepo will unlock a repo that was locked for migration. @@ -207,18 +208,18 @@ func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (* // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#unlock-a-user-repository +// GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#unlock-a-user-repository // //meta:operation DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock func (s *MigrationService) UnlockUserRepo(ctx context.Context, id int64, repo string) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/repos/%v/lock", id, repo) - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeMigrationsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs.go b/vendor/github.com/google/go-github/v88/github/orgs.go similarity index 84% rename from vendor/github.com/google/go-github/v84/github/orgs.go rename to vendor/github.com/google/go-github/v88/github/orgs.go index 2119f1d56..d577b98b6 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs.go +++ b/vendor/github.com/google/go-github/v88/github/orgs.go @@ -13,7 +13,7 @@ import ( // OrganizationsService provides access to the organization related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/orgs/ +// GitHub API docs: https://docs.github.com/rest/orgs?apiVersion=2022-11-28 type OrganizationsService service // Organization represents a GitHub organization account. @@ -36,6 +36,7 @@ type Organization struct { Following *int `json:"following,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ArchivedAt *Timestamp `json:"archived_at,omitempty"` TotalPrivateRepos *int64 `json:"total_private_repos,omitempty"` OwnedPrivateRepos *int64 `json:"owned_private_repos,omitempty"` PrivateGists *int `json:"private_gists,omitempty"` @@ -67,6 +68,9 @@ type Organization struct { // MembersCanForkPrivateRepos toggles whether organization members can fork private organization repositories. MembersCanForkPrivateRepos *bool `json:"members_can_fork_private_repositories,omitempty"` + // DeployKeysEnabledForRepositories toggles whether deploy keys may be added and used for repositories in the organization. + DeployKeysEnabledForRepositories *bool `json:"deploy_keys_enabled_for_repositories,omitempty"` + // MembersAllowedRepositoryCreationType denotes if organization members can create repositories // and the type of repositories they can create. Possible values are: "all", "private", or "none". // @@ -97,6 +101,10 @@ type Organization struct { SecretScanningPushProtectionEnabledForNewRepos *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` // SecretScanningValidityChecksEnabled toggles whether secret scanning validity check is enabled. SecretScanningValidityChecksEnabled *bool `json:"secret_scanning_validity_checks_enabled,omitempty"` + // SecretScanningPushProtectionCustomLinkEnabled toggles whether a custom link is shown to contributors blocked by secret scanning push protection. + SecretScanningPushProtectionCustomLinkEnabled *bool `json:"secret_scanning_push_protection_custom_link_enabled,omitempty"` + // SecretScanningPushProtectionCustomLink is the URL displayed to contributors blocked by secret scanning push protection. + SecretScanningPushProtectionCustomLink *string `json:"secret_scanning_push_protection_custom_link,omitempty"` // MembersCanDeleteRepositories toggles whether members with admin permissions can delete a repository. MembersCanDeleteRepositories *bool `json:"members_can_delete_repositories,omitempty"` // MembersCanChangeRepoVisibility toggles whether members with admin permissions can change the visibility for a repository. @@ -166,7 +174,7 @@ type OrganizationsListOptions struct { // listing the next set of organizations, use the ID of the last-returned organization // as the opts.Since parameter for the next call. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-organizations // //meta:operation GET /organizations func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsListOptions) ([]*Organization, *Response, error) { @@ -175,13 +183,13 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } orgs := []*Organization{} - resp, err := s.client.Do(ctx, req, &orgs) + resp, err := s.client.Do(req, &orgs) if err != nil { return nil, resp, err } @@ -191,9 +199,9 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL // List the organizations for a user. Passing the empty string will list // organizations for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-organizations-for-a-user // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-organizations-for-the-authenticated-user // //meta:operation GET /user/orgs //meta:operation GET /users/{username}/orgs @@ -209,13 +217,13 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opts *List return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var orgs []*Organization - resp, err := s.client.Do(ctx, req, &orgs) + resp, err := s.client.Do(req, &orgs) if err != nil { return nil, resp, err } @@ -225,25 +233,25 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opts *List // Get fetches an organization by name. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#get-an-organization // //meta:operation GET /orgs/{org} func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeMemberAllowedRepoCreationTypePreview) - organization := new(Organization) - resp, err := s.client.Do(ctx, req, organization) + var o *Organization + resp, err := s.client.Do(req, &o) if err != nil { return nil, resp, err } - return organization, resp, nil + return o, resp, nil } // GetByID fetches an organization. @@ -253,36 +261,36 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati //meta:operation GET /organizations/{organization_id} func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organization, *Response, error) { u := fmt.Sprintf("organizations/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - organization := new(Organization) - resp, err := s.client.Do(ctx, req, organization) + var org *Organization + resp, err := s.client.Do(req, &org) if err != nil { return nil, resp, err } - return organization, resp, nil + return org, resp, nil } // Edit an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#update-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#update-an-organization // //meta:operation PATCH /orgs/{org} func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", name) - req, err := s.client.NewRequest("PATCH", u, org) + req, err := s.client.NewRequest(ctx, "PATCH", u, org) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeMemberAllowedRepoCreationTypePreview) - o := new(Organization) - resp, err := s.client.Do(ctx, req, o) + var o *Organization + resp, err := s.client.Do(req, &o) if err != nil { return nil, resp, err } @@ -292,22 +300,22 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ // Delete an organization by name. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#delete-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#delete-an-organization // //meta:operation DELETE /orgs/{org} func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v", org) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListInstallations lists installations for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-app-installations-for-an-organization // //meta:operation GET /orgs/{org}/installations func (s *OrganizationsService) ListInstallations(ctx context.Context, org string, opts *ListOptions) (*OrganizationInstallations, *Response, error) { @@ -318,13 +326,13 @@ func (s *OrganizationsService) ListInstallations(ctx context.Context, org string return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - result := new(OrganizationInstallations) - resp, err := s.client.Do(ctx, req, result) + var result *OrganizationInstallations + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v88/github/orgs_actions_allowed.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v88/github/orgs_actions_allowed.go index 9c42df645..fdec0c73a 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_actions_allowed.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_actions_allowed.go @@ -13,7 +13,7 @@ import ( // // Deprecated: please use `client.Actions.GetActionsAllowed` instead. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions/selected-actions func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { @@ -25,7 +25,7 @@ func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string // // Deprecated: please use `client.Actions.UpdateActionsAllowed` instead. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions/selected-actions func (s *OrganizationsService) UpdateActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { diff --git a/vendor/github.com/google/go-github/v84/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v88/github/orgs_actions_permissions.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v88/github/orgs_actions_permissions.go index 60abbeec3..8f2531886 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_actions_permissions.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_actions_permissions.go @@ -13,7 +13,7 @@ import ( // // Deprecated: please use `client.Actions.GetActionsPermissions` instead. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-an-organization // //meta:operation GET /orgs/{org}/actions/permissions func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { @@ -25,7 +25,7 @@ func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org st // // Deprecated: please use `client.Actions.UpdateActionsPermissions` instead. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-an-organization // //meta:operation PUT /orgs/{org}/actions/permissions func (s *OrganizationsService) UpdateActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { diff --git a/vendor/github.com/google/go-github/v84/github/orgs_artifacts.go b/vendor/github.com/google/go-github/v88/github/orgs_artifacts.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/orgs_artifacts.go rename to vendor/github.com/google/go-github/v88/github/orgs_artifacts.go index f17c078b1..ce3e04b0a 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_artifacts.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_artifacts.go @@ -109,58 +109,64 @@ type ArtifactStorageResponse struct { // CreateArtifactDeploymentRecord creates or updates deployment records for an artifact associated with an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#create-an-artifact-deployment-record +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#create-an-artifact-deployment-record // //meta:operation POST /orgs/{org}/artifacts/metadata/deployment-record func (s *OrganizationsService) CreateArtifactDeploymentRecord(ctx context.Context, org string, record CreateArtifactDeploymentRequest) (*ArtifactDeploymentResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/artifacts/metadata/deployment-record", org) - req, err := s.client.NewRequest("POST", u, record) + req, err := s.client.NewRequest(ctx, "POST", u, record) if err != nil { return nil, nil, err } - v := new(ArtifactDeploymentResponse) - resp, err := s.client.Do(ctx, req, v) + + var v *ArtifactDeploymentResponse + resp, err := s.client.Do(req, &v) if err != nil { return nil, resp, err } + return v, resp, nil } // SetClusterDeploymentRecords sets deployment records for a given cluster. // -// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#set-cluster-deployment-records +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#set-cluster-deployment-records // //meta:operation POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster} func (s *OrganizationsService) SetClusterDeploymentRecords(ctx context.Context, org, cluster string, request ClusterDeploymentRecordsRequest) (*ArtifactDeploymentResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/artifacts/metadata/deployment-record/cluster/%v", org, cluster) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - v := new(ArtifactDeploymentResponse) - resp, err := s.client.Do(ctx, req, v) + + var v *ArtifactDeploymentResponse + resp, err := s.client.Do(req, &v) if err != nil { return nil, resp, err } + return v, resp, nil } // CreateArtifactStorageRecord creates metadata storage records for artifacts. // -// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#create-artifact-metadata-storage-record +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#create-artifact-metadata-storage-record // //meta:operation POST /orgs/{org}/artifacts/metadata/storage-record func (s *OrganizationsService) CreateArtifactStorageRecord(ctx context.Context, org string, record CreateArtifactStorageRequest) (*ArtifactStorageResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/artifacts/metadata/storage-record", org) - req, err := s.client.NewRequest("POST", u, record) + req, err := s.client.NewRequest(ctx, "POST", u, record) if err != nil { return nil, nil, err } - v := new(ArtifactStorageResponse) - resp, err := s.client.Do(ctx, req, v) + + var v *ArtifactStorageResponse + resp, err := s.client.Do(req, &v) if err != nil { return nil, resp, err } + return v, resp, nil } @@ -168,22 +174,23 @@ func (s *OrganizationsService) CreateArtifactStorageRecord(ctx context.Context, // // subjectDigest is SHA256 digest of the artifact, in the form sha256:HEX_DIGEST. // -// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#list-artifact-deployment-records +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#list-artifact-deployment-records // //meta:operation GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records func (s *OrganizationsService) ListArtifactDeploymentRecords(ctx context.Context, org, subjectDigest string) (*ArtifactDeploymentResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/artifacts/%v/metadata/deployment-records", org, subjectDigest) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - v := new(ArtifactDeploymentResponse) - resp, err := s.client.Do(ctx, req, v) + var v *ArtifactDeploymentResponse + resp, err := s.client.Do(req, &v) if err != nil { return nil, resp, err } + return v, resp, nil } @@ -191,21 +198,22 @@ func (s *OrganizationsService) ListArtifactDeploymentRecords(ctx context.Context // // subjectDigest is SHA256 digest of the artifact, in the form sha256:HEX_DIGEST. // -// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#list-artifact-storage-records +// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata?apiVersion=2022-11-28#list-artifact-storage-records // //meta:operation GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records func (s *OrganizationsService) ListArtifactStorageRecords(ctx context.Context, org, subjectDigest string) (*ArtifactStorageResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/artifacts/%v/metadata/storage-records", org, subjectDigest) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - v := new(ArtifactStorageResponse) - resp, err := s.client.Do(ctx, req, v) + var v *ArtifactStorageResponse + resp, err := s.client.Do(req, &v) if err != nil { return nil, resp, err } + return v, resp, nil } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_attestations.go b/vendor/github.com/google/go-github/v88/github/orgs_attestations.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/orgs_attestations.go rename to vendor/github.com/google/go-github/v88/github/orgs_attestations.go index 1a7a1d5c9..bfc4f61c7 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_attestations.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_attestations.go @@ -14,7 +14,7 @@ import ( // with a given subject digest that are associated with repositories // owned by an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/attestations#list-attestations +// GitHub API docs: https://docs.github.com/rest/orgs/attestations?apiVersion=2022-11-28#list-attestations // //meta:operation GET /orgs/{org}/attestations/{subject_digest} func (s *OrganizationsService) ListAttestations(ctx context.Context, org, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { @@ -25,13 +25,13 @@ func (s *OrganizationsService) ListAttestations(ctx context.Context, org, subjec return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var attestations *AttestationsResponse - resp, err := s.client.Do(ctx, req, &attestations) + resp, err := s.client.Do(req, &attestations) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v88/github/orgs_audit_log.go similarity index 95% rename from vendor/github.com/google/go-github/v84/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v88/github/orgs_audit_log.go index 8aae4ef38..164450f78 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_audit_log.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_audit_log.go @@ -91,9 +91,9 @@ func (a *AuditEntry) UnmarshalJSON(data []byte) error { } // MarshalJSON implements the json.Marshaler interface. -func (a *AuditEntry) MarshalJSON() ([]byte, error) { +func (a AuditEntry) MarshalJSON() ([]byte, error) { type entryAlias AuditEntry - v := entryAlias(*a) + v := entryAlias(a) defBytes, err := json.Marshal(v) if err != nil { return nil, err @@ -119,7 +119,7 @@ func (a *AuditEntry) MarshalJSON() ([]byte, error) { // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#get-the-audit-log-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization // //meta:operation GET /orgs/{org}/audit-log func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { @@ -129,13 +129,13 @@ func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var auditEntries []*AuditEntry - resp, err := s.client.Do(ctx, req, &auditEntries) + resp, err := s.client.Do(req, &auditEntries) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_codesecurity_configurations.go b/vendor/github.com/google/go-github/v88/github/orgs_codesecurity_configurations.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/orgs_codesecurity_configurations.go rename to vendor/github.com/google/go-github/v88/github/orgs_codesecurity_configurations.go index 6bacf0ba0..701e2cc8f 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_codesecurity_configurations.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_codesecurity_configurations.go @@ -57,6 +57,7 @@ type CodeSecurityConfiguration struct { DependencyGraphAutosubmitAction *string `json:"dependency_graph_autosubmit_action,omitempty"` DependencyGraphAutosubmitActionOptions *DependencyGraphAutosubmitActionOptions `json:"dependency_graph_autosubmit_action_options,omitempty"` DependabotAlerts *string `json:"dependabot_alerts,omitempty"` + DependabotDelegatedAlertDismissal *string `json:"dependabot_delegated_alert_dismissal,omitempty"` DependabotSecurityUpdates *string `json:"dependabot_security_updates,omitempty"` CodeScanningDefaultSetup *string `json:"code_scanning_default_setup,omitempty"` CodeScanningDefaultSetupOptions *CodeScanningDefaultSetupOptions `json:"code_scanning_default_setup_options,omitempty"` @@ -71,6 +72,7 @@ type CodeSecurityConfiguration struct { SecretScanningNonProviderPatterns *string `json:"secret_scanning_non_provider_patterns,omitempty"` SecretScanningGenericSecrets *string `json:"secret_scanning_generic_secrets,omitempty"` SecretScanningDelegatedAlertDismissal *string `json:"secret_scanning_delegated_alert_dismissal,omitempty"` + SecretScanningExtendedMetadata *string `json:"secret_scanning_extended_metadata,omitempty"` SecretProtection *string `json:"secret_protection,omitempty"` PrivateVulnerabilityReporting *string `json:"private_vulnerability_reporting,omitempty"` Enforcement *string `json:"enforcement,omitempty"` @@ -142,7 +144,7 @@ type ListCodeSecurityConfigurationRepositoriesOptions struct { // ListCodeSecurityConfigurations gets code security configurations for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-code-security-configurations-for-an-organization // //meta:operation GET /orgs/{org}/code-security/configurations func (s *OrganizationsService) ListCodeSecurityConfigurations(ctx context.Context, org string, opts *ListOrgCodeSecurityConfigurationOptions) ([]*CodeSecurityConfiguration, *Response, error) { @@ -152,13 +154,13 @@ func (s *OrganizationsService) ListCodeSecurityConfigurations(ctx context.Contex return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var configurations []*CodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &configurations) + resp, err := s.client.Do(req, &configurations) if err != nil { return nil, resp, err } @@ -167,19 +169,19 @@ func (s *OrganizationsService) ListCodeSecurityConfigurations(ctx context.Contex // CreateCodeSecurityConfiguration creates a code security configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#create-a-code-security-configuration // //meta:operation POST /orgs/{org}/code-security/configurations func (s *OrganizationsService) CreateCodeSecurityConfiguration(ctx context.Context, org string, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { u := fmt.Sprintf("orgs/%v/code-security/configurations", org) - req, err := s.client.NewRequest("POST", u, config) + req, err := s.client.NewRequest(ctx, "POST", u, config) if err != nil { return nil, nil, err } var configuration *CodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &configuration) + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } @@ -188,19 +190,19 @@ func (s *OrganizationsService) CreateCodeSecurityConfiguration(ctx context.Conte // ListDefaultCodeSecurityConfigurations gets default code security configurations for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-default-code-security-configurations // //meta:operation GET /orgs/{org}/code-security/configurations/defaults func (s *OrganizationsService) ListDefaultCodeSecurityConfigurations(ctx context.Context, org string) ([]*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { u := fmt.Sprintf("orgs/%v/code-security/configurations/defaults", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var configurations []*CodeSecurityConfigurationWithDefaultForNewRepos - resp, err := s.client.Do(ctx, req, &configurations) + resp, err := s.client.Do(req, &configurations) if err != nil { return nil, resp, err } @@ -209,7 +211,7 @@ func (s *OrganizationsService) ListDefaultCodeSecurityConfigurations(ctx context // DetachCodeSecurityConfigurationsFromRepositories detaches code security configuration from an organization's repositories. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#detach-configurations-from-repositories // //meta:operation DELETE /orgs/{org}/code-security/configurations/detach func (s *OrganizationsService) DetachCodeSecurityConfigurationsFromRepositories(ctx context.Context, org string, repoIDs []int64) (*Response, error) { @@ -217,11 +219,11 @@ func (s *OrganizationsService) DetachCodeSecurityConfigurationsFromRepositories( type selectedRepoIDs struct { SelectedIDs []int64 `json:"selected_repository_ids"` } - req, err := s.client.NewRequest("DELETE", u, selectedRepoIDs{SelectedIDs: repoIDs}) + req, err := s.client.NewRequest(ctx, "DELETE", u, selectedRepoIDs{SelectedIDs: repoIDs}) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -230,19 +232,19 @@ func (s *OrganizationsService) DetachCodeSecurityConfigurationsFromRepositories( // GetCodeSecurityConfiguration gets a code security configuration available in an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-a-code-security-configuration // //meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id} func (s *OrganizationsService) GetCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64) (*CodeSecurityConfiguration, *Response, error) { u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, configurationID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var configuration *CodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &configuration) + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } @@ -251,19 +253,19 @@ func (s *OrganizationsService) GetCodeSecurityConfiguration(ctx context.Context, // UpdateCodeSecurityConfiguration updates a code security configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#update-a-code-security-configuration // //meta:operation PATCH /orgs/{org}/code-security/configurations/{configuration_id} func (s *OrganizationsService) UpdateCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, configurationID) - req, err := s.client.NewRequest("PATCH", u, config) + req, err := s.client.NewRequest(ctx, "PATCH", u, config) if err != nil { return nil, nil, err } var configuration *CodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &configuration) + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } @@ -272,17 +274,17 @@ func (s *OrganizationsService) UpdateCodeSecurityConfiguration(ctx context.Conte // DeleteCodeSecurityConfiguration deletes a code security configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#delete-a-code-security-configuration // //meta:operation DELETE /orgs/{org}/code-security/configurations/{configuration_id} func (s *OrganizationsService) DeleteCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, configurationID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -291,7 +293,7 @@ func (s *OrganizationsService) DeleteCodeSecurityConfiguration(ctx context.Conte // AttachCodeSecurityConfigurationToRepositories attaches code security configurations to repositories for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#attach-a-configuration-to-repositories // //meta:operation POST /orgs/{org}/code-security/configurations/{configuration_id}/attach func (s *OrganizationsService) AttachCodeSecurityConfigurationToRepositories(ctx context.Context, org string, configurationID int64, scope string, repoIDs []int64) (*Response, error) { @@ -300,11 +302,11 @@ func (s *OrganizationsService) AttachCodeSecurityConfigurationToRepositories(ctx Scope string `json:"scope"` SelectedIDs []int64 `json:"selected_repository_ids,omitempty"` } - req, err := s.client.NewRequest("POST", u, selectedRepoIDs{Scope: scope, SelectedIDs: repoIDs}) + req, err := s.client.NewRequest(ctx, "POST", u, selectedRepoIDs{Scope: scope, SelectedIDs: repoIDs}) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil && resp.StatusCode != http.StatusAccepted { // StatusAccepted(202) is the expected status code as job is queued for processing return resp, err } @@ -313,7 +315,7 @@ func (s *OrganizationsService) AttachCodeSecurityConfigurationToRepositories(ctx // SetDefaultCodeSecurityConfiguration sets a code security configuration as the default for an organization. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#set-a-code-security-configuration-as-a-default-for-an-organization // //meta:operation PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults func (s *OrganizationsService) SetDefaultCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64, newReposParam string) (*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { @@ -321,12 +323,12 @@ func (s *OrganizationsService) SetDefaultCodeSecurityConfiguration(ctx context.C type configParam struct { DefaultForNewRepos string `json:"default_for_new_repos"` } - req, err := s.client.NewRequest("PUT", u, configParam{DefaultForNewRepos: newReposParam}) + req, err := s.client.NewRequest(ctx, "PUT", u, configParam{DefaultForNewRepos: newReposParam}) if err != nil { return nil, nil, err } var config *CodeSecurityConfigurationWithDefaultForNewRepos - resp, err := s.client.Do(ctx, req, &config) + resp, err := s.client.Do(req, &config) if err != nil { return nil, resp, err } @@ -335,7 +337,7 @@ func (s *OrganizationsService) SetDefaultCodeSecurityConfiguration(ctx context.C // ListCodeSecurityConfigurationRepositories gets repositories associated with a code security configuration. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-repositories-associated-with-a-code-security-configuration // //meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories func (s *OrganizationsService) ListCodeSecurityConfigurationRepositories(ctx context.Context, org string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) ([]*RepositoryAttachment, *Response, error) { @@ -345,13 +347,13 @@ func (s *OrganizationsService) ListCodeSecurityConfigurationRepositories(ctx con return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var attachments []*RepositoryAttachment - resp, err := s.client.Do(ctx, req, &attachments) + resp, err := s.client.Do(req, &attachments) if err != nil { return nil, resp, err } @@ -361,18 +363,18 @@ func (s *OrganizationsService) ListCodeSecurityConfigurationRepositories(ctx con // GetCodeSecurityConfigurationForRepository gets code security configuration that manages a repository's code security settings. // -// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository +// GitHub API docs: https://docs.github.com/rest/code-security/configurations?apiVersion=2022-11-28#get-the-code-security-configuration-associated-with-a-repository // //meta:operation GET /repos/{owner}/{repo}/code-security-configuration func (s *OrganizationsService) GetCodeSecurityConfigurationForRepository(ctx context.Context, org, repo string) (*RepositoryCodeSecurityConfiguration, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-security-configuration", org, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var repoConfig *RepositoryCodeSecurityConfiguration - resp, err := s.client.Do(ctx, req, &repoConfig) + resp, err := s.client.Do(req, &repoConfig) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_credential_authorizations.go b/vendor/github.com/google/go-github/v88/github/orgs_credential_authorizations.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/orgs_credential_authorizations.go rename to vendor/github.com/google/go-github/v88/github/orgs_credential_authorizations.go index 326922c3b..c21bfaf5a 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_credential_authorizations.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_credential_authorizations.go @@ -57,7 +57,7 @@ type CredentialAuthorization struct { // CredentialAuthorizationsListOptions adds the Login option as supported by the // list SAML SSO authorizations for organizations endpoint alongside paging options // such as Page and PerPage. -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization type CredentialAuthorizationsListOptions struct { ListOptions // For credentials authorizations for an organization, limit the list of authorizations to a specific login (aka github username) @@ -67,7 +67,7 @@ type CredentialAuthorizationsListOptions struct { // ListCredentialAuthorizations lists credentials authorized through SAML SSO // for a given organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization // //meta:operation GET /orgs/{org}/credential-authorizations func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *CredentialAuthorizationsListOptions) ([]*CredentialAuthorization, *Response, error) { @@ -77,13 +77,13 @@ func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var creds []*CredentialAuthorization - resp, err := s.client.Do(ctx, req, &creds) + resp, err := s.client.Do(req, &creds) if err != nil { return nil, resp, err } @@ -94,15 +94,15 @@ func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, // RemoveCredentialAuthorization revokes the SAML SSO authorization for a given // credential within an organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#remove-a-saml-sso-authorization-for-an-organization // //meta:operation DELETE /orgs/{org}/credential-authorizations/{credential_id} func (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations/%v", org, credentialID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_custom_repository_roles.go b/vendor/github.com/google/go-github/v88/github/orgs_custom_repository_roles.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/orgs_custom_repository_roles.go rename to vendor/github.com/google/go-github/v88/github/orgs_custom_repository_roles.go index 192ab63a6..001fc0329 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_custom_repository_roles.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_custom_repository_roles.go @@ -47,19 +47,19 @@ type RepoFineGrainedPermission struct { // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-custom-repository-roles-in-an-organization // //meta:operation GET /orgs/{org}/custom-repository-roles func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - customRepoRoles := new(OrganizationCustomRepoRoles) - resp, err := s.client.Do(ctx, req, customRepoRoles) + var customRepoRoles *OrganizationCustomRepoRoles + resp, err := s.client.Do(req, &customRepoRoles) if err != nil { return nil, resp, err } @@ -70,19 +70,19 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri // GetCustomRepoRole gets a custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#get-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#get-a-custom-repository-role // //meta:operation GET /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) GetCustomRepoRole(ctx context.Context, org string, roleID int64) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomRepoRoles + resp, err := s.client.Do(req, &resultingRole) if err != nil { return nil, resp, err } @@ -93,19 +93,19 @@ func (s *OrganizationsService) GetCustomRepoRole(ctx context.Context, org string // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#create-a-custom-repository-role // //meta:operation POST /orgs/{org}/custom-repository-roles func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomRepoRoles + resp, err := s.client.Do(req, &resultingRole) if err != nil { return nil, resp, err } @@ -116,19 +116,19 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // UpdateCustomRepoRole updates a custom repository role in this organization. // In order to update custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#update-a-custom-repository-role // //meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomRepoRoles + resp, err := s.client.Do(req, &resultingRole) if err != nil { return nil, resp, err } @@ -139,19 +139,19 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org str // DeleteCustomRepoRole deletes an existing custom repository role in this organization. // In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#delete-a-custom-repository-role // //meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org string, roleID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomRepoRoles + resp, err := s.client.Do(req, &resultingRole) if err != nil { return resp, err } @@ -162,19 +162,19 @@ func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org str // ListRepositoryFineGrainedPermissions lists the fine-grained permissions that can be used in custom repository roles for an organization. // The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization // //meta:operation GET /orgs/{org}/repository-fine-grained-permissions func (s *OrganizationsService) ListRepositoryFineGrainedPermissions(ctx context.Context, org string) ([]*RepoFineGrainedPermission, *Response, error) { u := fmt.Sprintf("orgs/%v/repository-fine-grained-permissions", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var perms []*RepoFineGrainedPermission - resp, err := s.client.Do(ctx, req, &perms) + resp, err := s.client.Do(req, &perms) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_hooks.go b/vendor/github.com/google/go-github/v88/github/orgs_hooks.go similarity index 68% rename from vendor/github.com/google/go-github/v84/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v88/github/orgs_hooks.go index e3bb25e78..e0b8d29f4 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_hooks.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_hooks.go @@ -13,7 +13,7 @@ import ( // ListHooks lists all Hooks for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#list-organization-webhooks // //meta:operation GET /orgs/{org}/hooks func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts *ListOptions) ([]*Hook, *Response, error) { @@ -23,13 +23,13 @@ func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts * return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var hooks []*Hook - resp, err := s.client.Do(ctx, req, &hooks) + resp, err := s.client.Do(req, &hooks) if err != nil { return nil, resp, err } @@ -39,18 +39,18 @@ func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts * // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#get-an-organization-webhook // //meta:operation GET /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v", org, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - hook := new(Hook) - resp, err := s.client.Do(ctx, req, hook) + var hook *Hook + resp, err := s.client.Do(req, &hook) if err != nil { return nil, resp, err } @@ -64,7 +64,7 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#create-an-organization-webhook // //meta:operation POST /orgs/{org}/hooks func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { @@ -81,13 +81,13 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook Config: hook.Config, } - req, err := s.client.NewRequest("POST", u, hookReq) + req, err := s.client.NewRequest(ctx, "POST", u, hookReq) if err != nil { return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + var h *Hook + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -97,18 +97,18 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#update-an-organization-webhook // //meta:operation PATCH /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v", org, id) - req, err := s.client.NewRequest("PATCH", u, hook) + req, err := s.client.NewRequest(ctx, "PATCH", u, hook) if err != nil { return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + var h *Hook + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -118,30 +118,30 @@ func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int6 // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#ping-an-organization-webhook // //meta:operation POST /orgs/{org}/hooks/{hook_id}/pings func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/pings", org, id) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#delete-an-organization-webhook // //meta:operation DELETE /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v", org, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_hooks_configuration.go b/vendor/github.com/google/go-github/v88/github/orgs_hooks_configuration.go similarity index 69% rename from vendor/github.com/google/go-github/v84/github/orgs_hooks_configuration.go rename to vendor/github.com/google/go-github/v88/github/orgs_hooks_configuration.go index aeb616fc4..63eb1adb2 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_hooks_configuration.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_hooks_configuration.go @@ -12,18 +12,18 @@ import ( // GetHookConfiguration returns the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-organization // //meta:operation GET /orgs/{org}/hooks/{hook_id}/config func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - config := new(HookConfig) - resp, err := s.client.Do(ctx, req, config) + var config *HookConfig + resp, err := s.client.Do(req, &config) if err != nil { return nil, resp, err } @@ -33,18 +33,18 @@ func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org str // EditHookConfiguration updates the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-organization // //meta:operation PATCH /orgs/{org}/hooks/{hook_id}/config func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) - req, err := s.client.NewRequest("PATCH", u, config) + req, err := s.client.NewRequest(ctx, "PATCH", u, config) if err != nil { return nil, nil, err } - c := new(HookConfig) - resp, err := s.client.Do(ctx, req, c) + var c *HookConfig + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v88/github/orgs_hooks_deliveries.go similarity index 72% rename from vendor/github.com/google/go-github/v84/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v88/github/orgs_hooks_deliveries.go index c1c301240..0150bc695 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists webhook deliveries for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#list-deliveries-for-an-organization-webhook // //meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { @@ -22,13 +22,13 @@ func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org strin return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } deliveries := []*HookDelivery{} - resp, err := s.client.Do(ctx, req, &deliveries) + resp, err := s.client.Do(req, &deliveries) if err != nil { return nil, resp, err } @@ -38,18 +38,18 @@ func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org strin // GetHookDelivery returns a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-delivery-for-an-organization-webhook // //meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v", owner, hookID, deliveryID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -59,18 +59,18 @@ func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string // RedeliverHookDelivery redelivers a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks?apiVersion=2022-11-28#redeliver-a-delivery-for-an-organization-webhook // //meta:operation POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v/attempts", owner, hookID, deliveryID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_immutable_releases.go b/vendor/github.com/google/go-github/v88/github/orgs_immutable_releases.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/orgs_immutable_releases.go rename to vendor/github.com/google/go-github/v88/github/orgs_immutable_releases.go index 4e305947d..e9c3fe9c0 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_immutable_releases.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_immutable_releases.go @@ -35,19 +35,19 @@ type setImmutableReleasesRepositoriesOptions struct { // GetImmutableReleasesSettings returns the immutable releases configuration that applies to repositories within the given organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-immutable-releases-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#get-immutable-releases-settings-for-an-organization // //meta:operation GET /orgs/{org}/settings/immutable-releases func (s *OrganizationsService) GetImmutableReleasesSettings(ctx context.Context, org string) (*ImmutableReleaseSettings, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/immutable-releases", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var settings *ImmutableReleaseSettings - resp, err := s.client.Do(ctx, req, &settings) + resp, err := s.client.Do(req, &settings) if err != nil { return nil, resp, err } @@ -57,18 +57,18 @@ func (s *OrganizationsService) GetImmutableReleasesSettings(ctx context.Context, // UpdateImmutableReleasesSettings sets immutable releases settings for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-immutable-releases-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#set-immutable-releases-settings-for-an-organization // //meta:operation PUT /orgs/{org}/settings/immutable-releases func (s *OrganizationsService) UpdateImmutableReleasesSettings(ctx context.Context, org string, opts ImmutableReleasePolicy) (*Response, error) { u := fmt.Sprintf("orgs/%v/settings/immutable-releases", org) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -78,7 +78,7 @@ func (s *OrganizationsService) UpdateImmutableReleasesSettings(ctx context.Conte // ListImmutableReleaseRepositories lists selected repositories for immutable releases enforcement in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-selected-repositories-for-immutable-releases-enforcement +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#list-selected-repositories-for-immutable-releases-enforcement // //meta:operation GET /orgs/{org}/settings/immutable-releases/repositories func (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Context, org string, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -89,13 +89,13 @@ func (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Cont return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var repositories *ListRepositories - resp, err := s.client.Do(ctx, req, &repositories) + resp, err := s.client.Do(req, &repositories) if err != nil { return nil, resp, err } @@ -106,7 +106,7 @@ func (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Cont // SetImmutableReleaseRepositories sets selected repositories for immutable releases enforcement. // It requires the organization's immutable releases policy for enforced_repositories to be set to "selected". // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-selected-repositories-for-immutable-releases-enforcement +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#set-selected-repositories-for-immutable-releases-enforcement // //meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories func (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Context, org string, repositoryIDs []int64) (*Response, error) { @@ -116,12 +116,12 @@ func (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Conte SelectedRepositoryIDs: repositoryIDs, } - req, err := s.client.NewRequest("PUT", u, body) + req, err := s.client.NewRequest(ctx, "PUT", u, body) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -132,18 +132,18 @@ func (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Conte // EnableRepositoryForImmutableRelease enables a selected repository for immutable releases in an organization. // It requires enforced_repositories to be set to "selected". // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#enable-a-selected-repository-for-immutable-releases-in-an-organization // //meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id} func (s *OrganizationsService) EnableRepositoryForImmutableRelease(ctx context.Context, org string, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories/%v", org, repoID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -154,18 +154,18 @@ func (s *OrganizationsService) EnableRepositoryForImmutableRelease(ctx context.C // DisableRepositoryForImmutableRelease removes a repository from the organization's selected list for immutable releases enforcement. // It requires enforced_repositories to be set to "selected". // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs?apiVersion=2022-11-28#disable-a-selected-repository-for-immutable-releases-in-an-organization // //meta:operation DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id} func (s *OrganizationsService) DisableRepositoryForImmutableRelease(ctx context.Context, org string, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories/%v", org, repoID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_issue_types.go b/vendor/github.com/google/go-github/v88/github/orgs_issue_types.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/orgs_issue_types.go rename to vendor/github.com/google/go-github/v88/github/orgs_issue_types.go index 0819c2183..2a1f1aa3a 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_issue_types.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_issue_types.go @@ -21,19 +21,19 @@ type CreateOrUpdateIssueTypesOptions struct { // ListIssueTypes lists all issue types for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types?apiVersion=2022-11-28#list-issue-types-for-an-organization // //meta:operation GET /orgs/{org}/issue-types func (s *OrganizationsService) ListIssueTypes(ctx context.Context, org string) ([]*IssueType, *Response, error) { u := fmt.Sprintf("orgs/%v/issue-types", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var issueTypes []*IssueType - resp, err := s.client.Do(ctx, req, &issueTypes) + resp, err := s.client.Do(req, &issueTypes) if err != nil { return nil, resp, err } @@ -43,18 +43,18 @@ func (s *OrganizationsService) ListIssueTypes(ctx context.Context, org string) ( // CreateIssueType creates a new issue type for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types?apiVersion=2022-11-28#create-issue-type-for-an-organization // //meta:operation POST /orgs/{org}/issue-types func (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, opts *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { u := fmt.Sprintf("orgs/%v/issue-types", org) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - issueType := new(IssueType) - resp, err := s.client.Do(ctx, req, issueType) + var issueType *IssueType + resp, err := s.client.Do(req, &issueType) if err != nil { return nil, resp, err } @@ -64,18 +64,18 @@ func (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, // UpdateIssueType updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types?apiVersion=2022-11-28#update-issue-type-for-an-organization // //meta:operation PUT /orgs/{org}/issue-types/{issue_type_id} func (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, issueTypeID int64, opts *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { u := fmt.Sprintf("orgs/%v/issue-types/%v", org, issueTypeID) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, nil, err } - issueType := new(IssueType) - resp, err := s.client.Do(ctx, req, issueType) + var issueType *IssueType + resp, err := s.client.Do(req, &issueType) if err != nil { return nil, resp, err } @@ -85,15 +85,15 @@ func (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, // DeleteIssueType deletes an issue type for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types?apiVersion=2022-11-28#delete-issue-type-for-an-organization // //meta:operation DELETE /orgs/{org}/issue-types/{issue_type_id} func (s *OrganizationsService) DeleteIssueType(ctx context.Context, org string, issueTypeID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/issue-types/%v", org, issueTypeID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_members.go b/vendor/github.com/google/go-github/v88/github/orgs_members.go similarity index 75% rename from vendor/github.com/google/go-github/v84/github/orgs_members.go rename to vendor/github.com/google/go-github/v88/github/orgs_members.go index 837a8f446..ab5dc65af 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_members.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_members.go @@ -71,9 +71,9 @@ type ListMembersOptions struct { // user is an owner of the organization, this will return both concealed and // public members; otherwise, it will only return public members. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-organization-members // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-public-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-public-organization-members // //meta:operation GET /orgs/{org}/members //meta:operation GET /orgs/{org}/public_members @@ -89,13 +89,13 @@ func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var members []*User - resp, err := s.client.Do(ctx, req, &members) + resp, err := s.client.Do(req, &members) if err != nil { return nil, resp, err } @@ -105,96 +105,96 @@ func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts // IsMember checks if a user is a member of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#check-organization-membership-for-a-user // //meta:operation GET /orgs/{org}/members/{username} func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) member, err := parseBoolResponse(err) return member, resp, err } // IsPublicMember checks if a user is a public member of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#check-public-organization-membership-for-a-user // //meta:operation GET /orgs/{org}/public_members/{username} func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) member, err := parseBoolResponse(err) return member, resp, err } // RemoveMember removes a user from all teams of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-an-organization-member +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#remove-an-organization-member // //meta:operation DELETE /orgs/{org}/members/{username} func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CancelInvite cancels an organization invitation. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#cancel-an-organization-invitation // //meta:operation DELETE /orgs/{org}/invitations/{invitation_id} func (s *OrganizationsService) CancelInvite(ctx context.Context, org string, invitationID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/invitations/%v", org, invitationID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // -// GitHub API docs: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#set-public-organization-membership-for-the-authenticated-user // //meta:operation PUT /orgs/{org}/public_members/{username} func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ConcealMembership conceals a user's membership in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#remove-public-organization-membership-for-the-authenticated-user // //meta:operation DELETE /orgs/{org}/public_members/{username} func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListOrgMembershipsOptions specifies optional parameters to the @@ -209,7 +209,7 @@ type ListOrgMembershipsOptions struct { // ListOrgMemberships lists the organization memberships for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-organization-memberships-for-the-authenticated-user // //meta:operation GET /user/memberships/orgs func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *ListOrgMembershipsOptions) ([]*Membership, *Response, error) { @@ -219,13 +219,13 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var memberships []*Membership - resp, err := s.client.Do(ctx, req, &memberships) + resp, err := s.client.Do(req, &memberships) if err != nil { return nil, resp, err } @@ -237,9 +237,9 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis // Passing an empty string for user will get the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#get-an-organization-membership-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#get-organization-membership-for-a-user // //meta:operation GET /orgs/{org}/memberships/{username} //meta:operation GET /user/memberships/orgs/{org} @@ -251,13 +251,13 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s u = fmt.Sprintf("user/memberships/orgs/%v", org) } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - membership := new(Membership) - resp, err := s.client.Do(ctx, req, membership) + var membership *Membership + resp, err := s.client.Do(req, &membership) if err != nil { return nil, resp, err } @@ -269,9 +269,9 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s // Passing an empty string for user will edit the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#set-organization-membership-for-a-user // -// GitHub API docs: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#update-an-organization-membership-for-the-authenticated-user // //meta:operation PUT /orgs/{org}/memberships/{username} //meta:operation PATCH /user/memberships/orgs/{org} @@ -285,13 +285,13 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org method = "PATCH" } - req, err := s.client.NewRequest(method, u, membership) + req, err := s.client.NewRequest(ctx, method, u, membership) if err != nil { return nil, nil, err } - m := new(Membership) - resp, err := s.client.Do(ctx, req, m) + var m *Membership + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -302,22 +302,22 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org // RemoveOrgMembership removes user from the specified organization. If the // user has been invited to the organization, this will cancel their invitation. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#remove-organization-membership-for-a-user // //meta:operation DELETE /orgs/{org}/memberships/{username} func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v/memberships/%v", org, user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListPendingOrgInvitations returns a list of pending invitations. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-pending-organization-invitations // //meta:operation GET /orgs/{org}/invitations func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { @@ -327,13 +327,13 @@ func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, or return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var pendingInvitations []*Invitation - resp, err := s.client.Do(ctx, req, &pendingInvitations) + resp, err := s.client.Do(req, &pendingInvitations) if err != nil { return nil, resp, err } @@ -365,19 +365,19 @@ type CreateOrgInvitationOptions struct { // In order to create invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#create-an-organization-invitation +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#create-an-organization-invitation // //meta:operation POST /orgs/{org}/invitations func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } var invitation *Invitation - resp, err := s.client.Do(ctx, req, &invitation) + resp, err := s.client.Do(req, &invitation) if err != nil { return nil, resp, err } @@ -388,7 +388,7 @@ func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org stri // ListOrgInvitationTeams lists all teams associated with an invitation. In order to see invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-organization-invitation-teams // //meta:operation GET /orgs/{org}/invitations/{invitation_id}/teams func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, invitationID string, opts *ListOptions) ([]*Team, *Response, error) { @@ -398,13 +398,13 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var orgInvitationTeams []*Team - resp, err := s.client.Do(ctx, req, &orgInvitationTeams) + resp, err := s.client.Do(req, &orgInvitationTeams) if err != nil { return nil, resp, err } @@ -414,7 +414,7 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, // ListFailedOrgInvitations returns a list of failed invitations. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members?apiVersion=2022-11-28#list-failed-organization-invitations // //meta:operation GET /orgs/{org}/failed_invitations func (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { @@ -424,13 +424,13 @@ func (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var failedInvitations []*Invitation - resp, err := s.client.Do(ctx, req, &failedInvitations) + resp, err := s.client.Do(req, &failedInvitations) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_network_configurations.go b/vendor/github.com/google/go-github/v88/github/orgs_network_configurations.go similarity index 83% rename from vendor/github.com/google/go-github/v84/github/orgs_network_configurations.go rename to vendor/github.com/google/go-github/v88/github/orgs_network_configurations.go index 89437f76c..a62f34f4c 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_network_configurations.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_network_configurations.go @@ -101,7 +101,7 @@ type NetworkConfigurationRequest struct { // ListNetworkConfigurations lists all hosted compute network configurations configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#list-hosted-compute-network-configurations-for-an-organization // //meta:operation GET /orgs/{org}/settings/network-configurations func (s *OrganizationsService) ListNetworkConfigurations(ctx context.Context, org string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { @@ -111,22 +111,23 @@ func (s *OrganizationsService) ListNetworkConfigurations(ctx context.Context, or return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - configurations := &NetworkConfigurations{} - resp, err := s.client.Do(ctx, req, configurations) + var configurations *NetworkConfigurations + resp, err := s.client.Do(req, &configurations) if err != nil { return nil, resp, err } + return configurations, resp, nil } // CreateNetworkConfiguration creates a hosted compute network configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#create-a-hosted-compute-network-configuration-for-an-organization // //meta:operation POST /orgs/{org}/settings/network-configurations func (s *OrganizationsService) CreateNetworkConfiguration(ctx context.Context, org string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { @@ -135,42 +136,44 @@ func (s *OrganizationsService) CreateNetworkConfiguration(ctx context.Context, o } u := fmt.Sprintf("orgs/%v/settings/network-configurations", org) - req, err := s.client.NewRequest("POST", u, createReq) + req, err := s.client.NewRequest(ctx, "POST", u, createReq) if err != nil { return nil, nil, err } - configuration := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, configuration) + var configuration *NetworkConfiguration + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } + return configuration, resp, nil } // GetNetworkConfiguration gets a hosted compute network configuration configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#get-a-hosted-compute-network-configuration-for-an-organization // //meta:operation GET /orgs/{org}/settings/network-configurations/{network_configuration_id} func (s *OrganizationsService) GetNetworkConfiguration(ctx context.Context, org, networkID string) (*NetworkConfiguration, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - configuration := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, configuration) + var configuration *NetworkConfiguration + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } + return configuration, resp, nil } // UpdateNetworkConfiguration updates a hosted compute network configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#update-a-hosted-compute-network-configuration-for-an-organization // //meta:operation PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id} func (s *OrganizationsService) UpdateNetworkConfiguration(ctx context.Context, org, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { @@ -179,55 +182,58 @@ func (s *OrganizationsService) UpdateNetworkConfiguration(ctx context.Context, o } u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) - req, err := s.client.NewRequest("PATCH", u, updateReq) + req, err := s.client.NewRequest(ctx, "PATCH", u, updateReq) if err != nil { return nil, nil, err } - configuration := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, configuration) + var configuration *NetworkConfiguration + resp, err := s.client.Do(req, &configuration) if err != nil { return nil, resp, err } + return configuration, resp, nil } // DeleteNetworkConfigurations deletes a hosted compute network configuration from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#delete-a-hosted-compute-network-configuration-from-an-organization // //meta:operation DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id} func (s *OrganizationsService) DeleteNetworkConfigurations(ctx context.Context, org, networkID string) (*Response, error) { u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - configuration := &NetworkConfiguration{} - resp, err := s.client.Do(ctx, req, configuration) + var configuration *NetworkConfiguration + resp, err := s.client.Do(req, &configuration) if err != nil { return resp, err } + return resp, nil } // GetNetworkConfigurationResource gets a hosted compute network settings resource configured for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations?apiVersion=2022-11-28#get-a-hosted-compute-network-settings-resource-for-an-organization // //meta:operation GET /orgs/{org}/settings/network-settings/{network_settings_id} func (s *OrganizationsService) GetNetworkConfigurationResource(ctx context.Context, org, networkID string) (*NetworkSettingsResource, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/network-settings/%v", org, networkID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - resource := &NetworkSettingsResource{} - resp, err := s.client.Do(ctx, req, resource) + var resource *NetworkSettingsResource + resp, err := s.client.Do(req, &resource) if err != nil { return nil, resp, err } + return resource, resp, nil } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_organization_properties.go b/vendor/github.com/google/go-github/v88/github/orgs_organization_properties.go similarity index 80% rename from vendor/github.com/google/go-github/v84/github/orgs_organization_properties.go rename to vendor/github.com/google/go-github/v88/github/orgs_organization_properties.go index 4e4c33c77..aa6faa637 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_organization_properties.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_organization_properties.go @@ -18,19 +18,19 @@ type OrganizationCustomPropertyValues struct { // GetOrganizationCustomPropertyValues returns all custom property names and their values for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs#get-all-custom-property-values-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs?apiVersion=2022-11-28#get-all-custom-property-values-for-an-organization // //meta:operation GET /organizations/{org}/org-properties/values func (s *OrganizationsService) GetOrganizationCustomPropertyValues(ctx context.Context, org string) ([]*CustomPropertyValue, *Response, error) { u := fmt.Sprintf("organizations/%v/org-properties/values", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var values []*CustomPropertyValue - resp, err := s.client.Do(ctx, req, &values) + resp, err := s.client.Do(req, &values) if err != nil { return nil, resp, err } @@ -41,17 +41,17 @@ func (s *OrganizationsService) GetOrganizationCustomPropertyValues(ctx context.C // CreateOrUpdateOrganizationCustomPropertyValues creates or updates custom property values for an organization. // To remove a custom property value from an organization, set the property value to null. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs#create-or-update-custom-property-values-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs?apiVersion=2022-11-28#create-or-update-custom-property-values-for-an-organization // //meta:operation PATCH /organizations/{org}/org-properties/values func (s *OrganizationsService) CreateOrUpdateOrganizationCustomPropertyValues(ctx context.Context, org string, values OrganizationCustomPropertyValues) (*Response, error) { u := fmt.Sprintf("organizations/%v/org-properties/values", org) - req, err := s.client.NewRequest("PATCH", u, values) + req, err := s.client.NewRequest(ctx, "PATCH", u, values) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_organization_roles.go b/vendor/github.com/google/go-github/v88/github/orgs_organization_roles.go similarity index 63% rename from vendor/github.com/google/go-github/v84/github/orgs_organization_roles.go rename to vendor/github.com/google/go-github/v88/github/orgs_organization_roles.go index 0954b92d4..c0503ce0d 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_organization_roles.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_organization_roles.go @@ -12,12 +12,12 @@ import ( // OrganizationCustomRoles represents custom organization roles available in specified organization. type OrganizationCustomRoles struct { - TotalCount *int `json:"total_count,omitempty"` - CustomRepoRoles []*CustomOrgRoles `json:"roles,omitempty"` + TotalCount *int `json:"total_count,omitempty"` + CustomRepoRoles []*CustomOrgRole `json:"roles,omitempty"` } -// CustomOrgRoles represents custom organization role available in specified organization. -type CustomOrgRoles struct { +// CustomOrgRole represents custom organization role available in specified organization. +type CustomOrgRole struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -29,30 +29,44 @@ type CustomOrgRoles struct { BaseRole *string `json:"base_role,omitempty"` } -// CreateOrUpdateOrgRoleOptions represents options required to create or update a custom organization role. -type CreateOrUpdateOrgRoleOptions struct { - Name *string `json:"name,omitempty"` +// CreateCustomOrgRoleRequest represents body parameters required to create a custom organization role. +type CreateCustomOrgRoleRequest struct { + Name string `json:"name"` Description *string `json:"description,omitempty"` Permissions []string `json:"permissions"` - BaseRole *string `json:"base_role,omitempty"` + BaseRole *string `json:"base_role,omitempty"` // Can be one of: read, triage, write, maintain, admin +} + +// UpdateCustomOrgRoleRequest represents body parameters to update a custom organization role. +type UpdateCustomOrgRoleRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Permissions []string `json:"permissions,omitempty"` + BaseRole *string `json:"base_role,omitempty"` // Can be one of: none, read, triage, write, maintain, admin +} + +// OrganizationFineGrainedPermission represents a fine-grained permission that protects organization resources. +type OrganizationFineGrainedPermission struct { + Name string `json:"name"` + Description string `json:"description"` } // ListRoles lists the custom roles available in this organization. // In order to see custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#get-all-organization-roles-for-an-organization // //meta:operation GET /orgs/{org}/organization-roles func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*OrganizationCustomRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - customRepoRoles := new(OrganizationCustomRoles) - resp, err := s.client.Do(ctx, req, customRepoRoles) + var customRepoRoles *OrganizationCustomRoles + resp, err := s.client.Do(req, &customRepoRoles) if err != nil { return nil, resp, err } @@ -63,19 +77,19 @@ func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*Orga // GetOrgRole gets an organization role in this organization. // In order to get organization roles in an organization, the authenticated user must be an organization owner, or have access via an organization role. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#get-an-organization-role // //meta:operation GET /orgs/{org}/organization-roles/{role_id} -func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleID int64) (*CustomOrgRoles, *Response, error) { +func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleID int64) (*CustomOrgRole, *Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - resultingRole := new(CustomOrgRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomOrgRole + resp, err := s.client.Do(req, &resultingRole) if err != nil { return nil, resp, err } @@ -86,19 +100,19 @@ func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleI // CreateCustomOrgRole creates a custom role in this organization. // In order to create custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#create-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#create-a-custom-organization-role // //meta:operation POST /orgs/{org}/organization-roles -func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org string, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { +func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org string, request CreateCustomOrgRoleRequest) (*CustomOrgRole, *Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles", org) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - resultingRole := new(CustomOrgRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomOrgRole + resp, err := s.client.Do(req, &resultingRole) if err != nil { return nil, resp, err } @@ -109,19 +123,19 @@ func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org stri // UpdateCustomOrgRole updates a custom role in this organization. // In order to update custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#update-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#update-a-custom-organization-role // //meta:operation PATCH /orgs/{org}/organization-roles/{role_id} -func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { +func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org string, roleID int64, request UpdateCustomOrgRoleRequest) (*CustomOrgRole, *Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, request) if err != nil { return nil, nil, err } - resultingRole := new(CustomOrgRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomOrgRole + resp, err := s.client.Do(req, &resultingRole) if err != nil { return nil, resp, err } @@ -132,19 +146,19 @@ func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org stri // DeleteCustomOrgRole deletes an existing custom role in this organization. // In order to delete custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#delete-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#delete-a-custom-organization-role // //meta:operation DELETE /orgs/{org}/organization-roles/{role_id} func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org string, roleID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resultingRole := new(CustomOrgRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + var resultingRole *CustomOrgRole + resp, err := s.client.Do(req, &resultingRole) if err != nil { return resp, err } @@ -155,18 +169,18 @@ func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org stri // AssignOrgRoleToTeam assigns an existing organization role to a team in this organization. // In order to assign organization roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#assign-an-organization-role-to-a-team // //meta:operation PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} func (s *OrganizationsService) AssignOrgRoleToTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/teams/%v/%v", org, teamSlug, roleID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -177,18 +191,18 @@ func (s *OrganizationsService) AssignOrgRoleToTeam(ctx context.Context, org, tea // RemoveOrgRoleFromTeam removes an existing organization role assignment from a team in this organization. // In order to remove organization role assignments in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#remove-an-organization-role-from-a-team // //meta:operation DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} func (s *OrganizationsService) RemoveOrgRoleFromTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/teams/%v/%v", org, teamSlug, roleID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -199,18 +213,18 @@ func (s *OrganizationsService) RemoveOrgRoleFromTeam(ctx context.Context, org, t // AssignOrgRoleToUser assigns an existing organization role to a user in this organization. // In order to assign organization roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#assign-an-organization-role-to-a-user // //meta:operation PUT /orgs/{org}/organization-roles/users/{username}/{role_id} func (s *OrganizationsService) AssignOrgRoleToUser(ctx context.Context, org, username string, roleID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/users/%v/%v", org, username, roleID) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -221,18 +235,18 @@ func (s *OrganizationsService) AssignOrgRoleToUser(ctx context.Context, org, use // RemoveOrgRoleFromUser removes an existing organization role assignment from a user in this organization. // In order to remove organization role assignments in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#remove-an-organization-role-from-a-user // //meta:operation DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} func (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, username string, roleID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/organization-roles/users/%v/%v", org, username, roleID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -243,7 +257,7 @@ func (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, u // ListTeamsAssignedToOrgRole returns all teams assigned to a specific organization role. // In order to list teams assigned to an organization role, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#list-teams-that-are-assigned-to-an-organization-role // //meta:operation GET /orgs/{org}/organization-roles/{role_id}/teams func (s *OrganizationsService) ListTeamsAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*Team, *Response, error) { @@ -253,13 +267,13 @@ func (s *OrganizationsService) ListTeamsAssignedToOrgRole(ctx context.Context, o return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -270,7 +284,7 @@ func (s *OrganizationsService) ListTeamsAssignedToOrgRole(ctx context.Context, o // ListUsersAssignedToOrgRole returns all users assigned to a specific organization role. // In order to list users assigned to an organization role, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles?apiVersion=2022-11-28#list-users-that-are-assigned-to-an-organization-role // //meta:operation GET /orgs/{org}/organization-roles/{role_id}/users func (s *OrganizationsService) ListUsersAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*User, *Response, error) { @@ -280,16 +294,44 @@ func (s *OrganizationsService) ListUsersAssignedToOrgRole(ctx context.Context, o return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var users []*User - resp, err := s.client.Do(ctx, req, &users) + resp, err := s.client.Do(req, &users) if err != nil { return nil, resp, err } return users, resp, nil } + +// ListFineGrainedPermissions lists the fine-grained permissions that can be used in custom organization roles for an organization. +// +// To use this endpoint, the authenticated user must be one of: +// - An administrator for the organization. +// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. +// +// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#list-organization-fine-grained-permissions-for-an-organization +// +//meta:operation GET /orgs/{org}/organization-fine-grained-permissions +func (s *OrganizationsService) ListFineGrainedPermissions(ctx context.Context, org string) ([]*OrganizationFineGrainedPermission, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-fine-grained-permissions", org) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var permissions []*OrganizationFineGrainedPermission + resp, err := s.client.Do(req, &permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} diff --git a/vendor/github.com/google/go-github/v84/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v88/github/orgs_outside_collaborators.go similarity index 83% rename from vendor/github.com/google/go-github/v84/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v88/github/orgs_outside_collaborators.go index 72f885fed..61a4861d4 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_outside_collaborators.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_outside_collaborators.go @@ -27,7 +27,7 @@ type ListOutsideCollaboratorsOptions struct { // Warning: The API may change without advance notice during the preview period. // Preview features are not supported for production use. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators?apiVersion=2022-11-28#list-outside-collaborators-for-an-organization // //meta:operation GET /orgs/{org}/outside_collaborators func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) ([]*User, *Response, error) { @@ -37,13 +37,13 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var members []*User - resp, err := s.client.Do(ctx, req, &members) + resp, err := s.client.Do(req, &members) if err != nil { return nil, resp, err } @@ -54,17 +54,17 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org // RemoveOutsideCollaborator removes a user from the list of outside collaborators; // consequently, removing them from all the organization's repositories. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators?apiVersion=2022-11-28#remove-outside-collaborator-from-an-organization // //meta:operation DELETE /orgs/{org}/outside_collaborators/{username} func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ConvertMemberToOutsideCollaborator reduces the permission level of a member of the @@ -73,15 +73,15 @@ func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, or // Responses for converting a non-member or the last owner to an outside collaborator // are listed in GitHub API docs. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators?apiVersion=2022-11-28#convert-an-organization-member-to-outside-collaborator // //meta:operation PUT /orgs/{org}/outside_collaborators/{username} func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_packages.go b/vendor/github.com/google/go-github/v88/github/orgs_packages.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/orgs_packages.go rename to vendor/github.com/google/go-github/v88/github/orgs_packages.go index edd8e508f..54762e5e7 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_packages.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_packages.go @@ -13,7 +13,7 @@ import ( // ListPackages lists the packages for an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-packages-for-an-organization // //meta:operation GET /orgs/{org}/packages func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { @@ -23,13 +23,13 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var packages []*Package - resp, err := s.client.Do(ctx, req, &packages) + resp, err := s.client.Do(req, &packages) if err != nil { return nil, resp, err } @@ -41,18 +41,18 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-for-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name} func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, url.PathEscape(packageName)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var pack *Package - resp, err := s.client.Do(ctx, req, &pack) + resp, err := s.client.Do(req, &pack) if err != nil { return nil, resp, err } @@ -64,41 +64,41 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-a-package-for-an-organization // //meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name} func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, url.PathEscape(packageName)) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RestorePackage restores a package to an organization. // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-a-package-for-an-organization // //meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/restore func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/restore", org, packageType, url.PathEscape(packageName)) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // PackageGetAllVersions gets all versions of a package in an organization. // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { @@ -108,13 +108,13 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var versions []*PackageVersion - resp, err := s.client.Do(ctx, req, &versions) + resp, err := s.client.Do(req, &versions) if err != nil { return nil, resp, err } @@ -126,18 +126,18 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-version-for-an-organization // //meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, url.PathEscape(packageName), packageVersionID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var version *PackageVersion - resp, err := s.client.Do(ctx, req, &version) + resp, err := s.client.Do(req, &version) if err != nil { return nil, resp, err } @@ -149,32 +149,32 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-package-version-for-an-organization // //meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, url.PathEscape(packageName), packageVersionID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // PackageRestoreVersion restores a package version to an organization. // // Note that packageName is escaped for the URL path so that you don't need to. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-package-version-for-an-organization // //meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore func (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v/restore", org, packageType, url.PathEscape(packageName), packageVersionID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_personal_access_tokens.go b/vendor/github.com/google/go-github/v88/github/orgs_personal_access_tokens.go similarity index 92% rename from vendor/github.com/google/go-github/v84/github/orgs_personal_access_tokens.go rename to vendor/github.com/google/go-github/v88/github/orgs_personal_access_tokens.go index f09b436c1..98b1ea81a 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_personal_access_tokens.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_personal_access_tokens.go @@ -16,7 +16,7 @@ import ( // PersonalAccessToken represents the minimal representation of an organization programmatic access grant. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28 +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens?apiVersion=2022-11-28 type PersonalAccessToken struct { // "Unique identifier of the fine-grained personal access token. // The `pat_id` used to get details about an approved fine-grained personal access token. @@ -93,7 +93,7 @@ type ListFineGrainedPATOptions struct { // ListFineGrainedPersonalAccessTokens lists approved fine-grained personal access tokens owned by organization members that can access organization resources. // Only GitHub Apps can call this API, using the `Personal access tokens` organization permissions (read). // -// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#list-fine-grained-personal-access-tokens-with-access-to-organization-resources // //meta:operation GET /orgs/{org}/personal-access-tokens func (s *OrganizationsService) ListFineGrainedPersonalAccessTokens(ctx context.Context, org string, opts *ListFineGrainedPATOptions) ([]*PersonalAccessToken, *Response, error) { @@ -104,14 +104,14 @@ func (s *OrganizationsService) ListFineGrainedPersonalAccessTokens(ctx context.C return nil, nil, err } - req, err := s.client.NewRequest("GET", u, opts) + req, err := s.client.NewRequest(ctx, "GET", u, opts) if err != nil { return nil, nil, err } var pats []*PersonalAccessToken - resp, err := s.client.Do(ctx, req, &pats) + resp, err := s.client.Do(req, &pats) if err != nil { return nil, resp, err } @@ -163,7 +163,7 @@ type FineGrainedPersonalAccessTokenRequest struct { // ListFineGrainedPersonalAccessTokenRequests lists requests to access organization resources via fine-grained personal access tokens. // Only GitHub Apps can call this API, using the `Personal access tokens` organization permissions (read). // -// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens // //meta:operation GET /orgs/{org}/personal-access-token-requests func (s *OrganizationsService) ListFineGrainedPersonalAccessTokenRequests(ctx context.Context, org string, opts *ListFineGrainedPATOptions) ([]*FineGrainedPersonalAccessTokenRequest, *Response, error) { @@ -174,13 +174,13 @@ func (s *OrganizationsService) ListFineGrainedPersonalAccessTokenRequests(ctx co return nil, nil, err } - req, err := s.client.NewRequest("GET", u, opts) + req, err := s.client.NewRequest(ctx, "GET", u, opts) if err != nil { return nil, nil, err } var pats []*FineGrainedPersonalAccessTokenRequest - resp, err := s.client.Do(ctx, req, &pats) + resp, err := s.client.Do(req, &pats) if err != nil { return nil, resp, err } @@ -198,18 +198,18 @@ type ReviewPersonalAccessTokenRequestOptions struct { // Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. // `action` can be one of `approve` or `deny`. // -// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token // //meta:operation POST /orgs/{org}/personal-access-token-requests/{pat_request_id} func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) - req, err := s.client.NewRequest("POST", u, &opts) + req, err := s.client.NewRequest(ctx, "POST", u, &opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // addListFineGrainedPATOptions adds the owner and token_id parameters to the URL query string with the correct format if they are set. diff --git a/vendor/github.com/google/go-github/v84/github/orgs_properties.go b/vendor/github.com/google/go-github/v88/github/orgs_properties.go similarity index 88% rename from vendor/github.com/google/go-github/v84/github/orgs_properties.go rename to vendor/github.com/google/go-github/v88/github/orgs_properties.go index 8b9541bde..d45ba463a 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_properties.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_properties.go @@ -156,19 +156,19 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { // GetAllCustomProperties gets all custom properties that are defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#get-all-custom-properties-for-an-organization // //meta:operation GET /orgs/{org}/properties/schema func (s *OrganizationsService) GetAllCustomProperties(ctx context.Context, org string) ([]*CustomProperty, *Response, error) { u := fmt.Sprintf("orgs/%v/properties/schema", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var customProperties []*CustomProperty - resp, err := s.client.Do(ctx, req, &customProperties) + resp, err := s.client.Do(req, &customProperties) if err != nil { return nil, resp, err } @@ -178,7 +178,7 @@ func (s *OrganizationsService) GetAllCustomProperties(ctx context.Context, org s // CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#create-or-update-custom-properties-for-an-organization // //meta:operation PATCH /orgs/{org}/properties/schema func (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Context, org string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) { @@ -190,13 +190,13 @@ func (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Contex Properties: properties, } - req, err := s.client.NewRequest("PATCH", u, params) + req, err := s.client.NewRequest(ctx, "PATCH", u, params) if err != nil { return nil, nil, err } var customProperties []*CustomProperty - resp, err := s.client.Do(ctx, req, &customProperties) + resp, err := s.client.Do(req, &customProperties) if err != nil { return nil, resp, err } @@ -206,19 +206,19 @@ func (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Contex // GetCustomProperty gets a custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#get-a-custom-property-for-an-organization // //meta:operation GET /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) GetCustomProperty(ctx context.Context, org, name string) (*CustomProperty, *Response, error) { u := fmt.Sprintf("orgs/%v/properties/schema/%v", org, name) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var customProperty *CustomProperty - resp, err := s.client.Do(ctx, req, &customProperty) + resp, err := s.client.Do(req, &customProperty) if err != nil { return nil, resp, err } @@ -228,19 +228,19 @@ func (s *OrganizationsService) GetCustomProperty(ctx context.Context, org, name // CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#create-or-update-a-custom-property-for-an-organization // //meta:operation PUT /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) CreateOrUpdateCustomProperty(ctx context.Context, org, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) { u := fmt.Sprintf("orgs/%v/properties/schema/%v", org, customPropertyName) - req, err := s.client.NewRequest("PUT", u, property) + req, err := s.client.NewRequest(ctx, "PUT", u, property) if err != nil { return nil, nil, err } var customProperty *CustomProperty - resp, err := s.client.Do(ctx, req, &customProperty) + resp, err := s.client.Do(req, &customProperty) if err != nil { return nil, resp, err } @@ -250,23 +250,23 @@ func (s *OrganizationsService) CreateOrUpdateCustomProperty(ctx context.Context, // RemoveCustomProperty removes a custom property that is defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#remove-a-custom-property-for-an-organization // //meta:operation DELETE /orgs/{org}/properties/schema/{custom_property_name} func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, customPropertyName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/properties/schema/%v", org, customPropertyName) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListCustomPropertyValues lists all custom property values for repositories in the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#list-custom-property-values-for-organization-repositories // //meta:operation GET /orgs/{org}/properties/values func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListCustomPropertyValuesOptions) ([]*RepoCustomPropertyValue, *Response, error) { @@ -276,13 +276,13 @@ func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var repoCustomPropertyValues []*RepoCustomPropertyValue - resp, err := s.client.Do(ctx, req, &repoCustomPropertyValues) + resp, err := s.client.Do(req, &repoCustomPropertyValues) if err != nil { return nil, resp, err } @@ -292,7 +292,7 @@ func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org // CreateOrUpdateRepoCustomPropertyValues creates new or updates existing custom property values across multiple repositories for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties?apiVersion=2022-11-28#create-or-update-custom-property-values-for-organization-repositories // //meta:operation PATCH /orgs/{org}/properties/values func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomPropertyValue) (*Response, error) { @@ -306,10 +306,10 @@ func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx contex Properties: properties, } - req, err := s.client.NewRequest("PATCH", u, params) + req, err := s.client.NewRequest(ctx, "PATCH", u, params) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_rules.go b/vendor/github.com/google/go-github/v88/github/orgs_rules.go similarity index 64% rename from vendor/github.com/google/go-github/v84/github/orgs_rules.go rename to vendor/github.com/google/go-github/v88/github/orgs_rules.go index 26012091a..308afe2a1 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_rules.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_rules.go @@ -10,12 +10,12 @@ import ( "fmt" ) -// GetAllRepositoryRulesets gets all the repository rulesets for the specified organization. +// ListAllRepositoryRulesets gets all the repository rulesets for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#get-all-organization-repository-rulesets // //meta:operation GET /orgs/{org}/rulesets -func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string, opts *ListOptions) ([]*RepositoryRuleset, *Response, error) { +func (s *OrganizationsService) ListAllRepositoryRulesets(ctx context.Context, org string, opts *ListOptions) ([]*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) u, err := addOptions(u, opts) @@ -23,13 +23,13 @@ func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var rulesets []*RepositoryRuleset - resp, err := s.client.Do(ctx, req, &rulesets) + resp, err := s.client.Do(req, &rulesets) if err != nil { return nil, resp, err } @@ -39,19 +39,19 @@ func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org // CreateRepositoryRuleset creates a repository ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#create-an-organization-repository-ruleset // //meta:operation POST /orgs/{org}/rulesets func (s *OrganizationsService) CreateRepositoryRuleset(ctx context.Context, org string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) - req, err := s.client.NewRequest("POST", u, ruleset) + req, err := s.client.NewRequest(ctx, "POST", u, ruleset) if err != nil { return nil, nil, err } var rs *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &rs) + resp, err := s.client.Do(req, &rs) if err != nil { return nil, resp, err } @@ -61,19 +61,19 @@ func (s *OrganizationsService) CreateRepositoryRuleset(ctx context.Context, org // GetRepositoryRuleset gets a repository ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#get-an-organization-repository-ruleset // //meta:operation GET /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) GetRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var ruleset *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &ruleset) + resp, err := s.client.Do(req, &ruleset) if err != nil { return nil, resp, err } @@ -83,19 +83,19 @@ func (s *OrganizationsService) GetRepositoryRuleset(ctx context.Context, org str // UpdateRepositoryRuleset updates a repository ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#update-an-organization-repository-ruleset // //meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) UpdateRepositoryRuleset(ctx context.Context, org string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) - req, err := s.client.NewRequest("PUT", u, ruleset) + req, err := s.client.NewRequest(ctx, "PUT", u, ruleset) if err != nil { return nil, nil, err } var rs *RepositoryRuleset - resp, err := s.client.Do(ctx, req, &rs) + resp, err := s.client.Do(req, &rs) if err != nil { return nil, resp, err } @@ -105,16 +105,16 @@ func (s *OrganizationsService) UpdateRepositoryRuleset(ctx context.Context, org // DeleteRepositoryRuleset deletes a repository ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules?apiVersion=2022-11-28#delete-an-organization-repository-ruleset // //meta:operation DELETE /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) DeleteRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_security_managers.go b/vendor/github.com/google/go-github/v88/github/orgs_security_managers.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/orgs_security_managers.go rename to vendor/github.com/google/go-github/v88/github/orgs_security_managers.go index b8562a2fd..088a5700a 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_security_managers.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_security_managers.go @@ -14,19 +14,19 @@ import ( // // Deprecated: Please use `client.Organizations.ListTeamsAssignedToOrgRole` instead. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers?apiVersion=2022-11-28#list-security-manager-teams // //meta:operation GET /orgs/{org}/security-managers func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/security-managers", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -38,32 +38,32 @@ func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org // // Deprecated: Please use `client.Organizations.AssignOrgRoleToTeam` instead. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers?apiVersion=2022-11-28#add-a-security-manager-team // //meta:operation PUT /orgs/{org}/security-managers/teams/{team_slug} func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveSecurityManagerTeam removes a team from the list of security managers for an organization. // // Deprecated: Please use `client.Organizations.RemoveOrgRoleFromTeam` instead. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers?apiVersion=2022-11-28#remove-a-security-manager-team // //meta:operation DELETE /orgs/{org}/security-managers/teams/{team_slug} func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v88/github/orgs_users_blocking.go similarity index 69% rename from vendor/github.com/google/go-github/v84/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v88/github/orgs_users_blocking.go index 60ee0f18b..62d578c93 100644 --- a/vendor/github.com/google/go-github/v84/github/orgs_users_blocking.go +++ b/vendor/github.com/google/go-github/v88/github/orgs_users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the users blocked by an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking?apiVersion=2022-11-28#list-users-blocked-by-an-organization // //meta:operation GET /orgs/{org}/blocks func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opts *ListOptions) ([]*User, *Response, error) { @@ -22,7 +22,7 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -30,7 +30,7 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, req.Header.Set("Accept", mediaTypeBlockUsersPreview) var blockedUsers []*User - resp, err := s.client.Do(ctx, req, &blockedUsers) + resp, err := s.client.Do(req, &blockedUsers) if err != nil { return nil, resp, err } @@ -40,56 +40,56 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, // IsBlocked reports whether specified user is blocked from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking?apiVersion=2022-11-28#check-if-a-user-is-blocked-by-an-organization // //meta:operation GET /orgs/{org}/blocks/{username} func (s *OrganizationsService) IsBlocked(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } req.Header.Set("Accept", mediaTypeBlockUsersPreview) - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) isBlocked, err := parseBoolResponse(err) return isBlocked, resp, err } // BlockUser blocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking?apiVersion=2022-11-28#block-a-user-from-an-organization // //meta:operation PUT /orgs/{org}/blocks/{username} func (s *OrganizationsService) BlockUser(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeBlockUsersPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UnblockUser unblocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking?apiVersion=2022-11-28#unblock-a-user-from-an-organization // //meta:operation DELETE /orgs/{org}/blocks/{username} func (s *OrganizationsService) UnblockUser(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeBlockUsersPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/packages.go b/vendor/github.com/google/go-github/v88/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v84/github/packages.go rename to vendor/github.com/google/go-github/v88/github/packages.go diff --git a/vendor/github.com/google/go-github/v84/github/private_registries.go b/vendor/github.com/google/go-github/v88/github/private_registries.go similarity index 56% rename from vendor/github.com/google/go-github/v84/github/private_registries.go rename to vendor/github.com/google/go-github/v88/github/private_registries.go index ff8582c45..d1899f4f9 100644 --- a/vendor/github.com/google/go-github/v84/github/private_registries.go +++ b/vendor/github.com/google/go-github/v88/github/private_registries.go @@ -13,7 +13,7 @@ import ( // PrivateRegistriesService handles communication with the private registries // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/private-registries +// GitHub API docs: https://docs.github.com/rest/private-registries?apiVersion=2026-03-10 type PrivateRegistriesService service // PrivateRegistryType represents the type of private registry. @@ -46,21 +46,60 @@ const ( PrivateRegistryVisibilitySelected PrivateRegistryVisibility = "selected" ) +// PrivateRegistryAuthType represents the authentication type for a private registry. +type PrivateRegistryAuthType string + +const ( + PrivateRegistryAuthTypeToken PrivateRegistryAuthType = "token" + PrivateRegistryAuthTypeUsernamePassword PrivateRegistryAuthType = "username_password" + PrivateRegistryAuthTypeOIDCAzure PrivateRegistryAuthType = "oidc_azure" + PrivateRegistryAuthTypeOIDCAWS PrivateRegistryAuthType = "oidc_aws" + PrivateRegistryAuthTypeOIDCJFrog PrivateRegistryAuthType = "oidc_jfrog" +) + // PrivateRegistry represents a private registry configuration. type PrivateRegistry struct { // Name of the private registry. Name *string `json:"name,omitempty"` // RegistryType is the type of private registry. You can find the list of supported types in PrivateRegistryType. - RegistryType *string `json:"registry_type,omitempty"` + RegistryType *PrivateRegistryType `json:"registry_type,omitempty"` + // AuthType is the authentication type for the private registry. + AuthType *PrivateRegistryAuthType `json:"auth_type,omitempty"` + // URL is the URL of the private registry. + URL *string `json:"url,omitempty"` // Username to use when authenticating with the private registry. // This field is omitted if the private registry does not require a username for authentication. Username *string `json:"username,omitempty"` + // ReplacesBase indicates whether this private registry should replace the base registry. + ReplacesBase *bool `json:"replaces_base,omitempty"` + // Visibility is the visibility of the private registry. Possible values are: "private", "all", and "selected". + Visibility *PrivateRegistryVisibility `json:"visibility,omitempty"` + // SelectedRepositoryIDs is an array of repository IDs that can access the organization private registry. + SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitempty"` + // TenantID is the tenant ID of the Azure AD application. + TenantID *string `json:"tenant_id,omitempty"` + // ClientID is the client ID of the Azure AD application. + ClientID *string `json:"client_id,omitempty"` + // AWSRegion is the AWS region. + AWSRegion *string `json:"aws_region,omitempty"` + // AccountID is the AWS account ID. + AccountID *string `json:"account_id,omitempty"` + // RoleName is the AWS IAM role name. + RoleName *string `json:"role_name,omitempty"` + // Domain is the CodeArtifact domain. + Domain *string `json:"domain,omitempty"` + // DomainOwner is the CodeArtifact domain owner. + DomainOwner *string `json:"domain_owner,omitempty"` + // JFrogOIDCProviderName is the JFrog OIDC provider name. + JFrogOIDCProviderName *string `json:"jfrog_oidc_provider_name,omitempty"` + // Audience is the OIDC audience. + Audience *string `json:"audience,omitempty"` + // IdentityMappingName is the JFrog identity mapping name. + IdentityMappingName *string `json:"identity_mapping_name,omitempty"` // CreatedAt is the timestamp when the private registry was created. CreatedAt *Timestamp `json:"created_at,omitempty"` // UpdatedAt is the timestamp when the private registry was last updated. UpdatedAt *Timestamp `json:"updated_at,omitempty"` - // Visibility is the visibility of the private registry. Possible values are: "private", "all", and "selected". - Visibility *PrivateRegistryVisibility `json:"visibility,omitempty"` } // PrivateRegistries represents a list of private registries. @@ -75,7 +114,7 @@ type PrivateRegistries struct { type CreateOrganizationPrivateRegistry struct { // RegistryType is the type of private registry. // You can find the list of supported types in PrivateRegistryType. - RegistryType string `json:"registry_type"` + RegistryType PrivateRegistryType `json:"registry_type"` // URL is the URL of the private registry. URL string `json:"url"` @@ -84,11 +123,17 @@ type CreateOrganizationPrivateRegistry struct { // This field should be omitted if the private registry does not require a username for authentication. Username *string `json:"username,omitempty"` + // ReplacesBase indicates whether this private registry should replace the base registry + // (e.g., npmjs.org for npm, rubygems.org for rubygems). + ReplacesBase *bool `json:"replaces_base,omitempty"` + // The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) // using the public key retrieved from the PrivateRegistriesService.GetOrganizationPrivateRegistriesPublicKey. - EncryptedValue string `json:"encrypted_value"` + // Required when AuthType is "token" or "username_password". Should be omitted for OIDC auth types. + EncryptedValue *string `json:"encrypted_value,omitempty"` // KeyID is the ID of the public key used to encrypt the secret. - KeyID string `json:"key_id"` + // Required when AuthType is "token" or "username_password". Should be omitted for OIDC auth types. + KeyID *string `json:"key_id,omitempty"` // Visibility is the visibility of the private registry. // Possible values are: "private", "all", and "selected". Visibility PrivateRegistryVisibility `json:"visibility"` @@ -97,13 +142,41 @@ type CreateOrganizationPrivateRegistry struct { // You can only provide a list of repository IDs when CreateOrganizationPrivateRegistry.Visibility is set to PrivateRegistryVisibilitySelected. // This field should be omitted if visibility is set to PrivateRegistryVisibilityAll or PrivateRegistryVisibilityPrivate. SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitempty"` + + // AuthType is the authentication type for the private registry. + // Defaults to "token" if not specified. Use "oidc_azure", "oidc_aws", or "oidc_jfrog" for OIDC authentication. + AuthType *string `json:"auth_type,omitempty"` + + // TenantID is the tenant ID of the Azure AD application. Required when AuthType is "oidc_azure". + TenantID *string `json:"tenant_id,omitempty"` + // ClientID is the client ID of the Azure AD application. Required when AuthType is "oidc_azure". + ClientID *string `json:"client_id,omitempty"` + + // AWSRegion is the AWS region. Required when AuthType is "oidc_aws". + AWSRegion *string `json:"aws_region,omitempty"` + // AccountID is the AWS account ID. Required when AuthType is "oidc_aws". + AccountID *string `json:"account_id,omitempty"` + // RoleName is the AWS IAM role name. Required when AuthType is "oidc_aws". + RoleName *string `json:"role_name,omitempty"` + // Domain is the CodeArtifact domain. Required when AuthType is "oidc_aws". + Domain *string `json:"domain,omitempty"` + // DomainOwner is the CodeArtifact domain owner (AWS account ID). Required when AuthType is "oidc_aws". + DomainOwner *string `json:"domain_owner,omitempty"` + + // JFrogOIDCProviderName is the JFrog OIDC provider name. Required when AuthType is "oidc_jfrog". + JFrogOIDCProviderName *string `json:"jfrog_oidc_provider_name,omitempty"` + + // Audience is the OIDC audience. Optional for "oidc_aws" and "oidc_jfrog" auth types. + Audience *string `json:"audience,omitempty"` + // IdentityMappingName is the JFrog identity mapping name. Optional for "oidc_jfrog" auth type. + IdentityMappingName *string `json:"identity_mapping_name,omitempty"` } // UpdateOrganizationPrivateRegistry represents the payload to update a private registry. type UpdateOrganizationPrivateRegistry struct { // RegistryType is the type of private registry. // You can find the list of supported types in PrivateRegistryType. - RegistryType *string `json:"registry_type,omitempty"` + RegistryType *PrivateRegistryType `json:"registry_type,omitempty"` // URL is the URL of the private registry. URL *string `json:"url,omitempty"` @@ -112,6 +185,10 @@ type UpdateOrganizationPrivateRegistry struct { // This field should be omitted if the private registry does not require a username for authentication. Username *string `json:"username,omitempty"` + // ReplacesBase indicates whether this private registry should replace the base registry + // (e.g., npmjs.org for npm, rubygems.org for rubygems). + ReplacesBase *bool `json:"replaces_base,omitempty"` + // The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) // using the public key retrieved from the PrivateRegistriesService.GetOrganizationPrivateRegistriesPublicKey. EncryptedValue *string `json:"encrypted_value,omitempty"` @@ -122,14 +199,42 @@ type UpdateOrganizationPrivateRegistry struct { Visibility *PrivateRegistryVisibility `json:"visibility,omitempty"` // An array of repository IDs that can access the organization private registry. - // You can only provide a list of repository IDs when CreateOrganizationPrivateRegistry.Visibility is set to PrivateRegistryVisibilitySelected. + // You can only provide a list of repository IDs when UpdateOrganizationPrivateRegistry.Visibility is set to PrivateRegistryVisibilitySelected. // This field should be omitted if visibility is set to PrivateRegistryVisibilityAll or PrivateRegistryVisibilityPrivate. SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitempty"` + + // AuthType is the authentication type for the private registry. + // This field cannot be changed after creation. If provided, it must match the existing auth_type. + AuthType *string `json:"auth_type,omitempty"` + + // TenantID is the tenant ID of the Azure AD application. Required when AuthType is "oidc_azure". + TenantID *string `json:"tenant_id,omitempty"` + // ClientID is the client ID of the Azure AD application. Required when AuthType is "oidc_azure". + ClientID *string `json:"client_id,omitempty"` + + // AWSRegion is the AWS region. Required when AuthType is "oidc_aws". + AWSRegion *string `json:"aws_region,omitempty"` + // AccountID is the AWS account ID. Required when AuthType is "oidc_aws". + AccountID *string `json:"account_id,omitempty"` + // RoleName is the AWS IAM role name. Required when AuthType is "oidc_aws". + RoleName *string `json:"role_name,omitempty"` + // Domain is the CodeArtifact domain. Required when AuthType is "oidc_aws". + Domain *string `json:"domain,omitempty"` + // DomainOwner is the CodeArtifact domain owner (AWS account ID). Required when AuthType is "oidc_aws". + DomainOwner *string `json:"domain_owner,omitempty"` + + // JFrogOIDCProviderName is the JFrog OIDC provider name. Required when AuthType is "oidc_jfrog". + JFrogOIDCProviderName *string `json:"jfrog_oidc_provider_name,omitempty"` + + // Audience is the OIDC audience. Optional for "oidc_aws" and "oidc_jfrog" auth types. + Audience *string `json:"audience,omitempty"` + // IdentityMappingName is the JFrog identity mapping name. Optional for "oidc_jfrog" auth type. + IdentityMappingName *string `json:"identity_mapping_name,omitempty"` } // ListOrganizationPrivateRegistries lists private registries for an organization. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2026-03-10#list-private-registries-for-an-organization // //meta:operation GET /orgs/{org}/private-registries func (s *PrivateRegistriesService) ListOrganizationPrivateRegistries(ctx context.Context, org string, opts *ListOptions) (*PrivateRegistries, *Response, error) { @@ -139,13 +244,13 @@ func (s *PrivateRegistriesService) ListOrganizationPrivateRegistries(ctx context return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil, WithVersion(api20260310)) if err != nil { return nil, nil, err } var privateRegistries PrivateRegistries - resp, err := s.client.Do(ctx, req, &privateRegistries) + resp, err := s.client.Do(req, &privateRegistries) if err != nil { return nil, resp, err } @@ -154,19 +259,19 @@ func (s *PrivateRegistriesService) ListOrganizationPrivateRegistries(ctx context // CreateOrganizationPrivateRegistry creates a private registry configuration with an encrypted value for an organization. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#create-a-private-registry-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2026-03-10#create-a-private-registry-for-an-organization // //meta:operation POST /orgs/{org}/private-registries func (s *PrivateRegistriesService) CreateOrganizationPrivateRegistry(ctx context.Context, org string, privateRegistry CreateOrganizationPrivateRegistry) (*PrivateRegistry, *Response, error) { u := fmt.Sprintf("orgs/%v/private-registries", org) - req, err := s.client.NewRequest("POST", u, privateRegistry) + req, err := s.client.NewRequest(ctx, "POST", u, privateRegistry, WithVersion(api20260310)) if err != nil { return nil, nil, err } var result PrivateRegistry - resp, err := s.client.Do(ctx, req, &result) + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } @@ -175,19 +280,19 @@ func (s *PrivateRegistriesService) CreateOrganizationPrivateRegistry(ctx context // GetOrganizationPrivateRegistriesPublicKey retrieves the public key for encrypting secrets for an organization's private registries. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2026-03-10#get-private-registries-public-key-for-an-organization // //meta:operation GET /orgs/{org}/private-registries/public-key func (s *PrivateRegistriesService) GetOrganizationPrivateRegistriesPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { u := fmt.Sprintf("orgs/%v/private-registries/public-key", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil, WithVersion(api20260310)) if err != nil { return nil, nil, err } var publicKey PublicKey - resp, err := s.client.Do(ctx, req, &publicKey) + resp, err := s.client.Do(req, &publicKey) if err != nil { return nil, resp, err } @@ -197,19 +302,19 @@ func (s *PrivateRegistriesService) GetOrganizationPrivateRegistriesPublicKey(ctx // GetOrganizationPrivateRegistry gets a specific private registry for an organization. // The `name` parameter is the name of the private registry to retrieve. It is the same as PrivateRegistry.Name. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#get-a-private-registry-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2026-03-10#get-a-private-registry-for-an-organization // //meta:operation GET /orgs/{org}/private-registries/{secret_name} func (s *PrivateRegistriesService) GetOrganizationPrivateRegistry(ctx context.Context, org, secretName string) (*PrivateRegistry, *Response, error) { u := fmt.Sprintf("orgs/%v/private-registries/%v", org, secretName) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil, WithVersion(api20260310)) if err != nil { return nil, nil, err } var privateRegistry PrivateRegistry - resp, err := s.client.Do(ctx, req, &privateRegistry) + resp, err := s.client.Do(req, &privateRegistry) if err != nil { return nil, resp, err } @@ -220,41 +325,35 @@ func (s *PrivateRegistriesService) GetOrganizationPrivateRegistry(ctx context.Co // UpdateOrganizationPrivateRegistry updates a specific private registry for an organization. // The `name` parameter is the name of the private registry to update. It is the same as PrivateRegistry.Name. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2026-03-10#update-a-private-registry-for-an-organization // //meta:operation PATCH /orgs/{org}/private-registries/{secret_name} -func (s *PrivateRegistriesService) UpdateOrganizationPrivateRegistry(ctx context.Context, org, secretName string, privateRegistry UpdateOrganizationPrivateRegistry) (*PrivateRegistry, *Response, error) { +func (s *PrivateRegistriesService) UpdateOrganizationPrivateRegistry(ctx context.Context, org, secretName string, privateRegistry UpdateOrganizationPrivateRegistry) (*Response, error) { u := fmt.Sprintf("orgs/%v/private-registries/%v", org, secretName) - req, err := s.client.NewRequest("PATCH", u, privateRegistry) + req, err := s.client.NewRequest(ctx, "PATCH", u, privateRegistry, WithVersion(api20260310)) if err != nil { - return nil, nil, err - } - - var updatedRegistry PrivateRegistry - resp, err := s.client.Do(ctx, req, &updatedRegistry) - if err != nil { - return nil, resp, err + return nil, err } - return &updatedRegistry, resp, nil + return s.client.Do(req, nil) } // DeleteOrganizationPrivateRegistry deletes a specific private registry for an organization. // The `name` parameter is the name of the private registry to delete. It is the same as PrivateRegistry.Name. // -// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#delete-a-private-registry-for-an-organization +// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations?apiVersion=2026-03-10#delete-a-private-registry-for-an-organization // //meta:operation DELETE /orgs/{org}/private-registries/{secret_name} func (s *PrivateRegistriesService) DeleteOrganizationPrivateRegistry(ctx context.Context, org, secretName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/private-registries/%v", org, secretName) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil, WithVersion(api20260310)) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/projects.go b/vendor/github.com/google/go-github/v88/github/projects.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/projects.go rename to vendor/github.com/google/go-github/v88/github/projects.go index 8d6cbf8da..98574148b 100644 --- a/vendor/github.com/google/go-github/v84/github/projects.go +++ b/vendor/github.com/google/go-github/v88/github/projects.go @@ -14,7 +14,7 @@ import ( // ProjectsService handles communication with the project V2 // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/projects/projects +// GitHub API docs: https://docs.github.com/rest/projects?apiVersion=2022-11-28 type ProjectsService service // ProjectV2ItemContentType represents the type of content in a ProjectV2Item. @@ -116,7 +116,7 @@ type ListProjectsOptions struct { // ProjectV2TextContent represents text content in a project field option or iteration. // It includes both HTML and raw text representations. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2TextContent struct { HTML *string `json:"html,omitempty"` Raw *string `json:"raw,omitempty"` @@ -125,7 +125,7 @@ type ProjectV2TextContent struct { // ProjectV2FieldOption represents an option for a project field of type single_select or multi_select. // It defines the available choices that can be selected for dropdown-style fields. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2FieldOption struct { ID *string `json:"id,omitempty"` // The unique identifier for this option. Color *string `json:"color,omitempty"` // The color associated with this option (e.g., "blue", "red"). @@ -136,7 +136,7 @@ type ProjectV2FieldOption struct { // ProjectV2FieldIteration represents an iteration within a project field of type iteration. // It defines a specific time-bound period that can be associated with project items. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2FieldIteration struct { ID *string `json:"id,omitempty"` // The unique identifier for the iteration. Title *ProjectV2TextContent `json:"title,omitempty"` // The title of the iteration. @@ -147,7 +147,7 @@ type ProjectV2FieldIteration struct { // ProjectV2FieldConfiguration represents the configuration for a project field of type iteration. // It defines settings such as duration and start day for iterations within the project. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2FieldConfiguration struct { Duration *int `json:"duration,omitempty"` // The duration of the iteration field in seconds. StartDay *int `json:"start_day,omitempty"` // The start day for the iteration. @@ -164,7 +164,7 @@ type ProjectV2ItemContent struct { } // MarshalJSON implements custom marshaling for ProjectV2ItemContent. -func (c *ProjectV2ItemContent) MarshalJSON() ([]byte, error) { +func (c ProjectV2ItemContent) MarshalJSON() ([]byte, error) { if c.Issue != nil { return json.Marshal(c.Issue) } @@ -238,7 +238,7 @@ func (p *ProjectV2Item) UnmarshalJSON(data []byte) error { // ProjectV2Field represents a field in a GitHub Projects V2 project. // Fields define the structure and data types for project items. // -// GitHub API docs: https://docs.github.com/rest/projects/fields +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28 type ProjectV2Field struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -275,7 +275,7 @@ type ProjectV2ItemFieldValue struct { // ListOrganizationProjects lists Projects V2 for an organization. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-projects-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#list-projects-for-organization // //meta:operation GET /orgs/{org}/projectsV2 func (s *ProjectsService) ListOrganizationProjects(ctx context.Context, org string, opts *ListProjectsOptions) ([]*ProjectV2, *Response, error) { @@ -285,42 +285,44 @@ func (s *ProjectsService) ListOrganizationProjects(ctx context.Context, org stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var projects []*ProjectV2 - resp, err := s.client.Do(ctx, req, &projects) + resp, err := s.client.Do(req, &projects) if err != nil { return nil, resp, err } + return projects, resp, nil } // GetOrganizationProject gets a Projects V2 project for an organization by ID. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#get-project-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#get-project-for-organization // //meta:operation GET /orgs/{org}/projectsV2/{project_number} func (s *ProjectsService) GetOrganizationProject(ctx context.Context, org string, projectNumber int) (*ProjectV2, *Response, error) { u := fmt.Sprintf("orgs/%v/projectsV2/%v", org, projectNumber) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - project := new(ProjectV2) - resp, err := s.client.Do(ctx, req, project) + var project *ProjectV2 + resp, err := s.client.Do(req, &project) if err != nil { return nil, resp, err } + return project, resp, nil } // ListUserProjects lists Projects V2 for a user. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-projects-for-user +// GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#list-projects-for-user // //meta:operation GET /users/{username}/projectsV2 func (s *ProjectsService) ListUserProjects(ctx context.Context, username string, opts *ListProjectsOptions) ([]*ProjectV2, *Response, error) { @@ -329,42 +331,44 @@ func (s *ProjectsService) ListUserProjects(ctx context.Context, username string, if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var projects []*ProjectV2 - resp, err := s.client.Do(ctx, req, &projects) + resp, err := s.client.Do(req, &projects) if err != nil { return nil, resp, err } + return projects, resp, nil } // GetUserProject gets a Projects V2 project for a user by ID. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#get-project-for-user +// GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#get-project-for-user // //meta:operation GET /users/{username}/projectsV2/{project_number} func (s *ProjectsService) GetUserProject(ctx context.Context, username string, projectNumber int) (*ProjectV2, *Response, error) { u := fmt.Sprintf("users/%v/projectsV2/%v", username, projectNumber) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - project := new(ProjectV2) - resp, err := s.client.Do(ctx, req, project) + var project *ProjectV2 + resp, err := s.client.Do(req, &project) if err != nil { return nil, resp, err } + return project, resp, nil } // ListOrganizationProjectFields lists Projects V2 for an organization. // -// GitHub API docs: https://docs.github.com/rest/projects/fields#list-project-fields-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28#list-project-fields-for-organization // //meta:operation GET /orgs/{org}/projectsV2/{project_number}/fields func (s *ProjectsService) ListOrganizationProjectFields(ctx context.Context, org string, projectNumber int, opts *ListProjectsOptions) ([]*ProjectV2Field, *Response, error) { @@ -374,22 +378,23 @@ func (s *ProjectsService) ListOrganizationProjectFields(ctx context.Context, org return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var fields []*ProjectV2Field - resp, err := s.client.Do(ctx, req, &fields) + resp, err := s.client.Do(req, &fields) if err != nil { return nil, resp, err } + return fields, resp, nil } // ListUserProjectFields lists Projects V2 for a user. // -// GitHub API docs: https://docs.github.com/rest/projects/fields#list-project-fields-for-user +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28#list-project-fields-for-user // //meta:operation GET /users/{username}/projectsV2/{project_number}/fields func (s *ProjectsService) ListUserProjectFields(ctx context.Context, user string, projectNumber int, opts *ListProjectsOptions) ([]*ProjectV2Field, *Response, error) { @@ -399,56 +404,59 @@ func (s *ProjectsService) ListUserProjectFields(ctx context.Context, user string return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var fields []*ProjectV2Field - resp, err := s.client.Do(ctx, req, &fields) + resp, err := s.client.Do(req, &fields) if err != nil { return nil, resp, err } + return fields, resp, nil } // GetOrganizationProjectField gets a single project field from an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/fields#get-project-field-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28#get-project-field-for-organization // //meta:operation GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id} func (s *ProjectsService) GetOrganizationProjectField(ctx context.Context, org string, projectNumber int, fieldID int64) (*ProjectV2Field, *Response, error) { u := fmt.Sprintf("orgs/%v/projectsV2/%v/fields/%v", org, projectNumber, fieldID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - field := new(ProjectV2Field) - resp, err := s.client.Do(ctx, req, field) + var field *ProjectV2Field + resp, err := s.client.Do(req, &field) if err != nil { return nil, resp, err } + return field, resp, nil } // GetUserProjectField gets a single project field from a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/fields#get-project-field-for-user +// GitHub API docs: https://docs.github.com/rest/projects/fields?apiVersion=2022-11-28#get-project-field-for-user // //meta:operation GET /users/{username}/projectsV2/{project_number}/fields/{field_id} func (s *ProjectsService) GetUserProjectField(ctx context.Context, user string, projectNumber int, fieldID int64) (*ProjectV2Field, *Response, error) { u := fmt.Sprintf("users/%v/projectsV2/%v/fields/%v", user, projectNumber, fieldID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - field := new(ProjectV2Field) - resp, err := s.client.Do(ctx, req, field) + var field *ProjectV2Field + resp, err := s.client.Do(req, &field) if err != nil { return nil, resp, err } + return field, resp, nil } @@ -478,7 +486,7 @@ type AddProjectItemOptions struct { // UpdateProjectV2Field represents a field update for a project item. // -// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#update-project-item-for-organization type UpdateProjectV2Field struct { // ID is the field ID to update. ID int64 `json:"id"` @@ -505,7 +513,7 @@ type UpdateProjectItemOptions struct { // ListOrganizationProjectItems lists items for an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#list-items-for-an-organization-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#list-items-for-an-organization-owned-project // //meta:operation GET /orgs/{org}/projectsV2/{project_number}/items func (s *ProjectsService) ListOrganizationProjectItems(ctx context.Context, org string, projectNumber int, opts *ListProjectItemsOptions) ([]*ProjectV2Item, *Response, error) { @@ -515,42 +523,44 @@ func (s *ProjectsService) ListOrganizationProjectItems(ctx context.Context, org return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var items []*ProjectV2Item - resp, err := s.client.Do(ctx, req, &items) + resp, err := s.client.Do(req, &items) if err != nil { return nil, resp, err } + return items, resp, nil } // AddOrganizationProjectItem adds an issue or pull request item to an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#add-item-to-organization-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#add-item-to-organization-owned-project // //meta:operation POST /orgs/{org}/projectsV2/{project_number}/items func (s *ProjectsService) AddOrganizationProjectItem(ctx context.Context, org string, projectNumber int, opts *AddProjectItemOptions) (*ProjectV2Item, *Response, error) { u := fmt.Sprintf("orgs/%v/projectsV2/%v/items", org, projectNumber) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + var item *ProjectV2Item + resp, err := s.client.Do(req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // GetOrganizationProjectItem gets a single item from an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#get-an-item-for-an-organization-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#get-an-item-for-an-organization-owned-project // //meta:operation GET /orgs/{org}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) GetOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64, opts *GetProjectItemOptions) (*ProjectV2Item, *Response, error) { @@ -559,54 +569,60 @@ func (s *ProjectsService) GetOrganizationProjectItem(ctx context.Context, org st if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // UpdateOrganizationProjectItem updates an item in an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#update-project-item-for-organization // //meta:operation PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) UpdateOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64, opts *UpdateProjectItemOptions) (*ProjectV2Item, *Response, error) { u := fmt.Sprintf("orgs/%v/projectsV2/%v/items/%v", org, projectNumber, itemID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // DeleteOrganizationProjectItem deletes an item from an organization owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#delete-project-item-for-organization +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#delete-project-item-for-organization // //meta:operation DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) DeleteOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/projectsV2/%v/items/%v", org, projectNumber, itemID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + + return s.client.Do(req, nil) } // ListUserProjectItems lists items for a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#list-items-for-a-user-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#list-items-for-a-user-owned-project // //meta:operation GET /users/{username}/projectsV2/{project_number}/items func (s *ProjectsService) ListUserProjectItems(ctx context.Context, username string, projectNumber int, opts *ListProjectItemsOptions) ([]*ProjectV2Item, *Response, error) { @@ -615,40 +631,45 @@ func (s *ProjectsService) ListUserProjectItems(ctx context.Context, username str if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } + var items []*ProjectV2Item - resp, err := s.client.Do(ctx, req, &items) + resp, err := s.client.Do(req, &items) if err != nil { return nil, resp, err } + return items, resp, nil } // AddUserProjectItem adds an issue or pull request item to a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#add-item-to-user-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#add-item-to-user-owned-project // //meta:operation POST /users/{username}/projectsV2/{project_number}/items func (s *ProjectsService) AddUserProjectItem(ctx context.Context, username string, projectNumber int, opts *AddProjectItemOptions) (*ProjectV2Item, *Response, error) { u := fmt.Sprintf("users/%v/projectsV2/%v/items", username, projectNumber) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // GetUserProjectItem gets a single item from a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#get-an-item-for-a-user-owned-project +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#get-an-item-for-a-user-owned-project // //meta:operation GET /users/{username}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) GetUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64, opts *GetProjectItemOptions) (*ProjectV2Item, *Response, error) { @@ -657,47 +678,53 @@ func (s *ProjectsService) GetUserProjectItem(ctx context.Context, username strin if err != nil { return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // UpdateUserProjectItem updates an item in a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-user +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#update-project-item-for-user // //meta:operation PATCH /users/{username}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) UpdateUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64, opts *UpdateProjectItemOptions) (*ProjectV2Item, *Response, error) { u := fmt.Sprintf("users/%v/projectsV2/%v/items/%v", username, projectNumber, itemID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } - item := new(ProjectV2Item) - resp, err := s.client.Do(ctx, req, item) + + var item *ProjectV2Item + resp, err := s.client.Do(req, &item) if err != nil { return nil, resp, err } + return item, resp, nil } // DeleteUserProjectItem deletes an item from a user owned project. // -// GitHub API docs: https://docs.github.com/rest/projects/items#delete-project-item-for-user +// GitHub API docs: https://docs.github.com/rest/projects/items?apiVersion=2022-11-28#delete-project-item-for-user // //meta:operation DELETE /users/{username}/projectsV2/{project_number}/items/{item_id} func (s *ProjectsService) DeleteUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64) (*Response, error) { u := fmt.Sprintf("users/%v/projectsV2/%v/items/%v", username, projectNumber, itemID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/pulls.go b/vendor/github.com/google/go-github/v88/github/pulls.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/pulls.go rename to vendor/github.com/google/go-github/v88/github/pulls.go index aefd08a6d..d70167980 100644 --- a/vendor/github.com/google/go-github/v84/github/pulls.go +++ b/vendor/github.com/google/go-github/v88/github/pulls.go @@ -15,7 +15,7 @@ import ( // PullRequestsService handles communication with the pull request related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/pulls/ +// GitHub API docs: https://docs.github.com/rest/pulls?apiVersion=2022-11-28 type PullRequestsService service // PullRequestAutoMerge represents the "auto_merge" response for a PullRequest. @@ -59,7 +59,7 @@ type PullRequest struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Pull Requests REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/pulls/pulls#get-a-pull-request + // See: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` NodeID *string `json:"node_id,omitempty"` RequestedReviewers []*User `json:"requested_reviewers,omitempty"` @@ -151,7 +151,7 @@ type PullRequestListOptions struct { // List the pull requests for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests // //meta:operation GET /repos/{owner}/{repo}/pulls func (s *PullRequestsService) List(ctx context.Context, owner, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { @@ -161,13 +161,13 @@ func (s *PullRequestsService) List(ctx context.Context, owner, repo string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var pulls []*PullRequest - resp, err := s.client.Do(ctx, req, &pulls) + resp, err := s.client.Do(req, &pulls) if err != nil { return nil, resp, err } @@ -182,7 +182,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner, repo string, opts // not present in the repository's default branch, the result will only include // open pull requests. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-pull-requests-associated-with-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) { @@ -192,14 +192,14 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeListPullsOrBranchesForCommitPreview) var pulls []*PullRequest - resp, err := s.client.Do(ctx, req, &pulls) + resp, err := s.client.Do(req, &pulls) if err != nil { return nil, resp, err } @@ -209,18 +209,18 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow // Get a single pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Get(ctx context.Context, owner, repo string, number int) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v", owner, repo, number) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - pull := new(PullRequest) - resp, err := s.client.Do(ctx, req, pull) + var pull *PullRequest + resp, err := s.client.Do(req, &pull) if err != nil { return nil, resp, err } @@ -230,12 +230,12 @@ func (s *PullRequestsService) Get(ctx context.Context, owner, repo string, numbe // GetRaw gets a single pull request in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) GetRaw(ctx context.Context, owner, repo string, number int, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v", owner, repo, number) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return "", nil, err } @@ -250,7 +250,7 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner, repo string, nu } var buf bytes.Buffer - resp, err := s.client.Do(ctx, req, &buf) + resp, err := s.client.Do(req, &buf) if err != nil { return "", resp, err } @@ -279,18 +279,18 @@ type NewPullRequest struct { // Create a new pull request on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#create-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls func (s *PullRequestsService) Create(ctx context.Context, owner, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) - req, err := s.client.NewRequest("POST", u, pull) + req, err := s.client.NewRequest(ctx, "POST", u, pull) if err != nil { return nil, nil, err } - p := new(PullRequest) - resp, err := s.client.Do(ctx, req, p) + var p *PullRequest + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -320,21 +320,21 @@ type PullRequestBranchUpdateResponse struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#update-a-pull-request-branch // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch func (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo string, number int, opts *PullRequestBranchUpdateOptions) (*PullRequestBranchUpdateResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/update-branch", owner, repo, number) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeUpdatePullRequestBranchPreview) - p := new(PullRequestBranchUpdateResponse) - resp, err := s.client.Do(ctx, req, p) + var p *PullRequestBranchUpdateResponse + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -356,7 +356,7 @@ type pullRequestUpdate struct { // The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify. // Base.Ref updates the base branch of the pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#update-a-pull-request // //meta:operation PATCH /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Edit(ctx context.Context, owner, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { @@ -379,13 +379,13 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner, repo string, numb update.Base = pull.Base.Ref } - req, err := s.client.NewRequest("PATCH", u, update) + req, err := s.client.NewRequest(ctx, "PATCH", u, update) if err != nil { return nil, nil, err } - p := new(PullRequest) - resp, err := s.client.Do(ctx, req, p) + var p *PullRequest + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -395,7 +395,7 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner, repo string, numb // ListCommits lists the commits in a pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#list-commits-on-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/commits func (s *PullRequestsService) ListCommits(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { @@ -405,13 +405,13 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner, repo strin return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var commits []*RepositoryCommit - resp, err := s.client.Do(ctx, req, &commits) + resp, err := s.client.Do(req, &commits) if err != nil { return nil, resp, err } @@ -421,7 +421,7 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner, repo strin // ListFiles lists the files in a pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests-files // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/files func (s *PullRequestsService) ListFiles(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { @@ -431,13 +431,13 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var commitFiles []*CommitFile - resp, err := s.client.Do(ctx, req, &commitFiles) + resp, err := s.client.Do(req, &commitFiles) if err != nil { return nil, resp, err } @@ -447,17 +447,17 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner, repo string, // IsMerged checks if a pull request has been merged. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#check-if-a-pull-request-has-been-merged // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/merge func (s *PullRequestsService) IsMerged(ctx context.Context, owner, repo string, number int) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/merge", owner, repo, number) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) merged, err := parseBoolResponse(err) return merged, resp, err } @@ -491,13 +491,13 @@ type pullRequestMergeRequest struct { // Merge a pull request. // commitMessage is an extra detail to append to automatic commit message. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls?apiVersion=2022-11-28#merge-a-pull-request // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge func (s *PullRequestsService) Merge(ctx context.Context, owner, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/merge", owner, repo, number) - pullRequestBody := &pullRequestMergeRequest{} + var pullRequestBody pullRequestMergeRequest if commitMessage != "" { pullRequestBody.CommitMessage = &commitMessage } @@ -509,13 +509,13 @@ func (s *PullRequestsService) Merge(ctx context.Context, owner, repo string, num pullRequestBody.CommitMessage = &commitMessage } } - req, err := s.client.NewRequest("PUT", u, pullRequestBody) + req, err := s.client.NewRequest(ctx, "PUT", u, &pullRequestBody) if err != nil { return nil, nil, err } - mergeResult := new(PullRequestMergeResult) - resp, err := s.client.Do(ctx, req, mergeResult) + var mergeResult *PullRequestMergeResult + resp, err := s.client.Do(req, &mergeResult) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/pulls_comments.go b/vendor/github.com/google/go-github/v88/github/pulls_comments.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/pulls_comments.go rename to vendor/github.com/google/go-github/v88/github/pulls_comments.go index 4d601730b..e85d45a55 100644 --- a/vendor/github.com/google/go-github/v84/github/pulls_comments.go +++ b/vendor/github.com/google/go-github/v88/github/pulls_comments.go @@ -40,12 +40,12 @@ type PullRequestComment struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Pull Request Comments REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request + // See: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#get-a-review-comment-for-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` - // Can be one of: LINE, FILE from https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request + // Can be one of: LINE, FILE from https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request SubjectType *string `json:"subject_type,omitempty"` } @@ -72,9 +72,9 @@ type PullRequestListCommentsOptions struct { // pull request number of 0 will return all comments on all pull requests for // the repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#list-review-comments-in-a-repository // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#list-review-comments-on-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/comments //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/comments @@ -90,7 +90,7 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -99,7 +99,7 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var comments []*PullRequestComment - resp, err := s.client.Do(ctx, req, &comments) + resp, err := s.client.Do(req, &comments) if err != nil { return nil, resp, err } @@ -109,12 +109,12 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri // GetComment fetches the specified pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#get-a-review-comment-for-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v", owner, repo, commentID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -122,8 +122,8 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - comment := new(PullRequestComment) - resp, err := s.client.Do(ctx, req, comment) + var comment *PullRequestComment + resp, err := s.client.Do(req, &comment) if err != nil { return nil, resp, err } @@ -133,20 +133,20 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string // CreateComment creates a new comment on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo string, number int, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/comments", owner, repo, number) - req, err := s.client.NewRequest("POST", u, comment) + req, err := s.client.NewRequest(ctx, "POST", u, comment) if err != nil { return nil, nil, err } acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - c := new(PullRequestComment) - resp, err := s.client.Do(ctx, req, c) + var c *PullRequestComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -156,7 +156,7 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo str // CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) { @@ -168,13 +168,13 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, InReplyTo: commentID, } u := fmt.Sprintf("repos/%v/%v/pulls/%v/comments", owner, repo, number) - req, err := s.client.NewRequest("POST", u, comment) + req, err := s.client.NewRequest(ctx, "POST", u, comment) if err != nil { return nil, nil, err } - c := new(PullRequestComment) - resp, err := s.client.Do(ctx, req, c) + var c *PullRequestComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -185,18 +185,18 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, // EditComment updates a pull request comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#update-a-review-comment-for-a-pull-request // //meta:operation PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v", owner, repo, commentID) - req, err := s.client.NewRequest("PATCH", u, comment) + req, err := s.client.NewRequest(ctx, "PATCH", u, comment) if err != nil { return nil, nil, err } - c := new(PullRequestComment) - resp, err := s.client.Do(ctx, req, c) + var c *PullRequestComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -206,14 +206,15 @@ func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo strin // DeleteComment deletes a pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments?apiVersion=2022-11-28#delete-a-review-comment-for-a-pull-request // //meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v", owner, repo, commentID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v88/github/pulls_reviewers.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v88/github/pulls_reviewers.go index daa171fae..612291a51 100644 --- a/vendor/github.com/google/go-github/v84/github/pulls_reviewers.go +++ b/vendor/github.com/google/go-github/v88/github/pulls_reviewers.go @@ -32,18 +32,18 @@ type removeReviewersRequest struct { // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests?apiVersion=2022-11-28#request-reviewers-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/requested_reviewers", owner, repo, number) - req, err := s.client.NewRequest("POST", u, &reviewers) + req, err := s.client.NewRequest(ctx, "POST", u, &reviewers) if err != nil { return nil, nil, err } - r := new(PullRequest) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequest + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -53,19 +53,19 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo // ListReviewers lists reviewers whose reviews have been requested on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests?apiVersion=2022-11-28#get-all-requested-reviewers-for-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int) (*Reviewers, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/requested_reviewers", owner, repo, number) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - reviewers := new(Reviewers) - resp, err := s.client.Do(ctx, req, reviewers) + var reviewers *Reviewers + resp, err := s.client.Do(req, &reviewers) if err != nil { return nil, resp, err } @@ -75,7 +75,7 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // RemoveReviewers removes the review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests?apiVersion=2022-11-28#remove-requested-reviewers-from-a-pull-request // //meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { @@ -90,10 +90,10 @@ func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo s } u := fmt.Sprintf("repos/%v/%v/pulls/%v/requested_reviewers", owner, repo, number) - req, err := s.client.NewRequest("DELETE", u, &removeRequest) + req, err := s.client.NewRequest(ctx, "DELETE", u, &removeRequest) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/pulls_reviews.go b/vendor/github.com/google/go-github/v88/github/pulls_reviews.go similarity index 82% rename from vendor/github.com/google/go-github/v84/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v88/github/pulls_reviews.go index e8cf7a75b..716ddc9a2 100644 --- a/vendor/github.com/google/go-github/v84/github/pulls_reviews.go +++ b/vendor/github.com/google/go-github/v88/github/pulls_reviews.go @@ -29,7 +29,7 @@ type PullRequestReview struct { // // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. // Use the Pull Request Reviews REST API endpoint to retrieve this information. - // See: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request + // See: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#get-a-review-for-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` } @@ -104,7 +104,7 @@ func (r PullRequestReviewDismissalRequest) String() string { // ListReviews lists all reviews on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#list-reviews-for-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*PullRequestReview, *Response, error) { @@ -114,13 +114,13 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var reviews []*PullRequestReview - resp, err := s.client.Do(ctx, req, &reviews) + resp, err := s.client.Do(req, &reviews) if err != nil { return nil, resp, err } @@ -130,19 +130,19 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin // GetReview fetches the specified pull request review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#get-a-review-for-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/reviews/%v", owner, repo, number, reviewID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - review := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, review) + var review *PullRequestReview + resp, err := s.client.Do(req, &review) if err != nil { return nil, resp, err } @@ -152,19 +152,19 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, // DeletePendingReview deletes the specified pull request pending review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#delete-a-pending-review-for-a-pull-request // //meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/reviews/%v", owner, repo, number, reviewID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, nil, err } - review := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, review) + var review *PullRequestReview + resp, err := s.client.Do(req, &review) if err != nil { return nil, resp, err } @@ -174,7 +174,7 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re // ListReviewComments lists all the comments for the specified review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#list-comments-for-a-pull-request-review // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) { @@ -184,13 +184,13 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var comments []*PullRequestComment - resp, err := s.client.Do(ctx, req, &comments) + resp, err := s.client.Do(req, &comments) if err != nil { return nil, resp, err } @@ -234,13 +234,13 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // It is waaaaaay better. // ``` // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#create-a-review-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/reviews", owner, repo, number) - req, err := s.client.NewRequest("POST", u, review) + req, err := s.client.NewRequest(ctx, "POST", u, review) if err != nil { return nil, nil, err } @@ -254,8 +254,8 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri req.Header.Set("Accept", mediaTypeMultiLineCommentsPreview) } - r := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReview + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -265,7 +265,7 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri // UpdateReview updates the review summary on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#update-a-review-for-a-pull-request // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo string, number int, reviewID int64, body string) (*PullRequestReview, *Response, error) { @@ -274,13 +274,13 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri }{Body: body} u := fmt.Sprintf("repos/%v/%v/pulls/%v/reviews/%v", owner, repo, number, reviewID) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, nil, err } - review := &PullRequestReview{} - resp, err := s.client.Do(ctx, req, review) + var review *PullRequestReview + resp, err := s.client.Do(req, &review) if err != nil { return nil, resp, err } @@ -290,19 +290,19 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri // SubmitReview submits a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#submit-a-review-for-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/reviews/%v/events", owner, repo, number, reviewID) - req, err := s.client.NewRequest("POST", u, review) + req, err := s.client.NewRequest(ctx, "POST", u, review) if err != nil { return nil, nil, err } - r := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReview + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -312,19 +312,19 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri // DismissReview dismisses a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews?apiVersion=2022-11-28#dismiss-a-review-for-a-pull-request // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%v/reviews/%v/dismissals", owner, repo, number, reviewID) - req, err := s.client.NewRequest("PUT", u, review) + req, err := s.client.NewRequest(ctx, "PUT", u, review) if err != nil { return nil, nil, err } - r := new(PullRequestReview) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReview + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/pulls_threads.go b/vendor/github.com/google/go-github/v88/github/pulls_threads.go similarity index 100% rename from vendor/github.com/google/go-github/v84/github/pulls_threads.go rename to vendor/github.com/google/go-github/v88/github/pulls_threads.go diff --git a/vendor/github.com/google/go-github/v84/github/rate_limit.go b/vendor/github.com/google/go-github/v88/github/rate_limit.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/rate_limit.go rename to vendor/github.com/google/go-github/v88/github/rate_limit.go index a26a23c93..a63f8382d 100644 --- a/vendor/github.com/google/go-github/v84/github/rate_limit.go +++ b/vendor/github.com/google/go-github/v88/github/rate_limit.go @@ -26,7 +26,7 @@ type Rate struct { // The rate limit resource that the request counted against. // For more information about the different resources, see REST API endpoints for rate limits. - // GitHub API docs: https://docs.github.com/en/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user + // GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit?apiVersion=2022-11-28#get-rate-limit-status-for-the-authenticated-user Resource string `json:"resource,omitempty"` } @@ -40,20 +40,20 @@ type RateLimits struct { // requests are limited to 60 per hour. Authenticated requests are // limited to 5,000 per hour. // - // GitHub API docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting + // GitHub API docs: https://docs.github.com/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting Core *Rate `json:"core"` // The rate limit for search API requests. Unauthenticated requests // are limited to 10 requests per minutes. Authenticated requests are // limited to 30 per minute. // - // GitHub API docs: https://docs.github.com/en/rest/search#rate-limit + // GitHub API docs: https://docs.github.com/rest/search?apiVersion=2022-11-28#rate-limit Search *Rate `json:"search"` // GitHub API docs: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit GraphQL *Rate `json:"graphql"` - // GitHub API dos: https://docs.github.com/en/rest/rate-limit + // GitHub API docs: https://docs.github.com/rest/rate-limit?apiVersion=2022-11-28 IntegrationManifest *Rate `json:"integration_manifest"` SourceImport *Rate `json:"source_import"` @@ -72,11 +72,16 @@ func (r RateLimits) String() string { // Get returns the rate limits for the current client. // -// GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit?apiVersion=2022-11-28#get-rate-limit-status-for-the-authenticated-user // //meta:operation GET /rate_limit func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, error) { - req, err := s.client.NewRequest("GET", "rate_limit", nil) + // This resource is not subject to rate limits. + if !s.client.disableRateLimitCheck { + ctx = context.WithValue(ctx, BypassRateLimitCheck, true) + } + + req, err := s.client.NewRequest(ctx, "GET", "rate_limit", nil) if err != nil { return nil, nil, err } @@ -85,9 +90,7 @@ func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, err Resources *RateLimits `json:"resources"` }) - // This resource is not subject to rate limits. - ctx = context.WithValue(ctx, BypassRateLimitCheck, true) - resp, err := s.client.Do(ctx, req, response) + resp, err := s.client.Do(req, response) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/reactions.go b/vendor/github.com/google/go-github/v88/github/reactions.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/reactions.go rename to vendor/github.com/google/go-github/v88/github/reactions.go index f8b4023c2..daf44c36f 100644 --- a/vendor/github.com/google/go-github/v84/github/reactions.go +++ b/vendor/github.com/google/go-github/v88/github/reactions.go @@ -13,7 +13,7 @@ import ( // ReactionsService provides access to the reactions-related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/rest/reactions +// GitHub API docs: https://docs.github.com/rest/reactions?apiVersion=2022-11-28 type ReactionsService service // Reaction represents a GitHub reaction. @@ -59,7 +59,7 @@ type ListReactionOptions struct { // ListCommentReactions lists the reactions for a commit comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-commit-comment // //meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}/reactions func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -69,7 +69,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -77,7 +77,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -90,22 +90,22 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-commit-comment // //meta:operation POST /repos/{owner}/{repo}/comments/{comment_id}/reactions func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: Ptr(content)} - req, err := s.client.NewRequest("POST", u, body) + body := &Reaction{Content: &content} + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -115,7 +115,7 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep // DeleteCommentReaction deletes the reaction for a commit comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-commit-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { @@ -126,7 +126,7 @@ func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, rep // DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-commit-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { @@ -137,7 +137,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // ListIssueReactions lists the reactions for an issue. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/reactions func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -147,7 +147,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -155,7 +155,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -168,22 +168,22 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/reactions func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - body := &Reaction{Content: Ptr(content)} - req, err := s.client.NewRequest("POST", u, body) + body := &Reaction{Content: &content} + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -193,7 +193,7 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo // DeleteIssueReaction deletes the reaction to an issue. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-an-issue-reaction // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { @@ -204,7 +204,7 @@ func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo // DeleteIssueReactionByID deletes the reaction to an issue by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-an-issue-reaction // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { @@ -215,7 +215,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // ListIssueCommentReactions lists the reactions for an issue comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-an-issue-comment // //meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -225,7 +225,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -233,7 +233,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -246,22 +246,22 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-an-issue-comment // //meta:operation POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: Ptr(content)} - req, err := s.client.NewRequest("POST", u, body) + body := &Reaction{Content: &content} + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -271,7 +271,7 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReaction deletes the reaction to an issue comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-an-issue-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { @@ -282,7 +282,7 @@ func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-an-issue-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { @@ -293,7 +293,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-pull-request-review-comment // //meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -303,7 +303,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -311,7 +311,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -324,22 +324,22 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-pull-request-review-comment // //meta:operation POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: Ptr(content)} - req, err := s.client.NewRequest("POST", u, body) + body := &Reaction{Content: &content} + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -349,7 +349,7 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-pull-request-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { @@ -360,7 +360,7 @@ func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-pull-request-comment-reaction // //meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { @@ -381,7 +381,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -389,7 +389,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -406,16 +406,16 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - body := &Reaction{Content: Ptr(content)} - req, err := s.client.NewRequest("POST", u, body) + body := &Reaction{Content: &content} + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -457,7 +457,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -465,7 +465,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -481,16 +481,16 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - body := &Reaction{Content: Ptr(content)} - req, err := s.client.NewRequest("POST", u, body) + body := &Reaction{Content: &content} + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -521,14 +521,14 @@ func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(c } func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest("DELETE", url, nil) + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // CreateReleaseReaction creates a reaction to a release. @@ -536,22 +536,22 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res // added the reaction type to this release. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-release // //meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/reactions func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) - body := &Reaction{Content: Ptr(content)} - req, err := s.client.NewRequest("POST", u, body) + body := &Reaction{Content: &content} + req, err := s.client.NewRequest(ctx, "POST", u, body) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) + var m *Reaction + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -561,7 +561,7 @@ func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, rep // ListReleaseReactions lists the reactions for a release. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-release // //meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/reactions func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo string, releaseID int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { @@ -571,7 +571,7 @@ func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -579,7 +579,7 @@ func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo req.Header.Set("Accept", mediaTypeReactionsPreview) var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) + resp, err := s.client.Do(req, &m) if err != nil { return nil, resp, err } @@ -589,7 +589,7 @@ func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo // DeleteReleaseReaction deletes the reaction for a release. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-release-reaction // //meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteReleaseReaction(ctx context.Context, owner, repo string, releaseID, reactionID int64) (*Response, error) { @@ -600,7 +600,7 @@ func (s *ReactionsService) DeleteReleaseReaction(ctx context.Context, owner, rep // DeleteReleaseReactionByID deletes the reaction for a release by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-release-reaction // //meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteReleaseReactionByID(ctx context.Context, repoID, releaseID, reactionID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v84/github/repos.go b/vendor/github.com/google/go-github/v88/github/repos.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/repos.go rename to vendor/github.com/google/go-github/v88/github/repos.go index ac76f1f3f..b3e41a5f7 100644 --- a/vendor/github.com/google/go-github/v84/github/repos.go +++ b/vendor/github.com/google/go-github/v88/github/repos.go @@ -22,7 +22,7 @@ var ErrBranchNotProtected = errors.New("branch is not protected") // RepositoriesService handles communication with the repository related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/repos/ +// GitHub API docs: https://docs.github.com/rest/repos?apiVersion=2022-11-28 type RepositoriesService service // Repository represents a GitHub repository. @@ -142,7 +142,7 @@ type Repository struct { TeamsURL *string `json:"teams_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search?apiVersion=2022-11-28#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Visibility is only used for Create and Edit endpoints. The visibility field @@ -151,7 +151,7 @@ type Repository struct { Visibility *string `json:"visibility,omitempty"` // RoleName is only returned by the API 'check team permissions for a repository'. - // See: teams.go (IsTeamRepoByID) https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository + // See: teams.go (IsTeamRepoByID) https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository RoleName *string `json:"role_name,omitempty"` } @@ -200,6 +200,7 @@ type SecurityAndAnalysis struct { SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` DependabotSecurityUpdates *DependabotSecurityUpdates `json:"dependabot_security_updates,omitempty"` SecretScanningValidityChecks *SecretScanningValidityChecks `json:"secret_scanning_validity_checks,omitempty"` + CodeSecurity *CodeSecurity `json:"code_security,omitempty"` } // RepositoryPermissions represents the permissions a user has for a repository. @@ -266,14 +267,25 @@ type SecretScanningValidityChecks struct { Status *string `json:"status,omitempty"` } +// CodeSecurity represents the state of code security on a repository. +// +// GitHub API docs: https://docs.github.com/en/code-security/getting-started/github-security-features#available-with-github-code-security +type CodeSecurity struct { + Status *string `json:"status,omitempty"` +} + +func (c CodeSecurity) String() string { + return Stringify(c) +} + // List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser // depending on whether user is empty. // // Deprecated: Use RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser instead. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-a-user // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user // //meta:operation GET /user/repos //meta:operation GET /users/{username}/repos @@ -322,7 +334,7 @@ type RepositoryListByUserOptions struct { // ListByUser lists public repositories for the specified user. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-a-user // //meta:operation GET /users/{username}/repos func (s *RepositoriesService) ListByUser(ctx context.Context, user string, opts *RepositoryListByUserOptions) ([]*Repository, *Response, error) { @@ -332,13 +344,13 @@ func (s *RepositoriesService) ListByUser(ctx context.Context, user string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var repos []*Repository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -385,7 +397,7 @@ type RepositoryListByAuthenticatedUserOptions struct { // ListByAuthenticatedUser lists repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user // //meta:operation GET /user/repos func (s *RepositoriesService) ListByAuthenticatedUser(ctx context.Context, opts *RepositoryListByAuthenticatedUserOptions) ([]*Repository, *Response, error) { @@ -395,13 +407,13 @@ func (s *RepositoriesService) ListByAuthenticatedUser(ctx context.Context, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var repos []*Repository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -429,7 +441,7 @@ type RepositoryListByOrgOptions struct { // ListByOrg lists the repositories for an organization. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-organization-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories // //meta:operation GET /orgs/{org}/repos func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) { @@ -439,7 +451,7 @@ func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *R return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -448,7 +460,7 @@ func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *R req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var repos []*Repository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -465,7 +477,7 @@ type RepositoryListAllOptions struct { // ListAll lists all GitHub repositories in the order that they were created. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-public-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-public-repositories // //meta:operation GET /repositories func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) { @@ -474,13 +486,13 @@ func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListA return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var repos []*Repository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -540,9 +552,9 @@ type createRepoRequest struct { // changes propagate throughout its servers. You may set up a loop with // exponential back-off to verify repository's creation. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#create-an-organization-repository // //meta:operation POST /orgs/{org}/repos //meta:operation POST /user/repos @@ -588,15 +600,15 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo CustomProperties: repo.CustomProperties, } - req, err := s.client.NewRequest("POST", u, repoReq) + req, err := s.client.NewRequest(ctx, "POST", u, repoReq) if err != nil { return nil, nil, err } acceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -617,20 +629,20 @@ type TemplateRepoRequest struct { // CreateFromTemplate generates a repository from a template. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-using-a-template // //meta:operation POST /repos/{template_owner}/{template_repo}/generate func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/generate", templateOwner, templateRepo) - req, err := s.client.NewRequest("POST", u, templateRepoReq) + req, err := s.client.NewRequest(ctx, "POST", u, templateRepoReq) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeRepositoryTemplatePreview) - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -640,17 +652,17 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#get-a-repository // //meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - // https://docs.github.com/rest/licenses/#get-a-repositorys-license + // https://docs.github.com/rest/licenses?apiVersion=2022-11-28#get-a-repositorys-license acceptHeaders := []string{ mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, @@ -659,8 +671,8 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) + var repository *Repository + resp, err := s.client.Do(req, &repository) if err != nil { return nil, resp, err } @@ -669,23 +681,23 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } // GetCodeOfConduct gets the contents of a repository's code of conduct. -// Note that https://docs.github.com/rest/codes-of-conduct#about-the-codes-of-conduct-api +// Note that https://docs.github.com/rest/codes-of-conduct?apiVersion=2022-11-28#about-the-codes-of-conduct-api // says to use the GET /repos/{owner}/{repo} endpoint. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#get-a-repository // //meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeCodesOfConductPreview) - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -700,13 +712,13 @@ func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo //meta:operation GET /repositories/{repository_id} func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repository, *Response, error) { u := fmt.Sprintf("repositories/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) + var repository *Repository + resp, err := s.client.Do(req, &repository) if err != nil { return nil, resp, err } @@ -716,20 +728,20 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor // Edit updates a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#update-a-repository // //meta:operation PATCH /repos/{owner}/{repo} func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) - req, err := s.client.NewRequest("PATCH", u, repository) + req, err := s.client.NewRequest(ctx, "PATCH", u, repository) if err != nil { return nil, nil, err } acceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -739,17 +751,17 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo // Delete a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#delete-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#delete-a-repository // //meta:operation DELETE /repos/{owner}/{repo} func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Contributor represents a repository contributor. @@ -788,75 +800,75 @@ type ListContributorsOptions struct { // GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-vulnerability-alerts-are-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } req.Header.Set("Accept", mediaTypeRequiredVulnerabilityAlertsPreview) - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) vulnerabilityAlertsEnabled, err := parseBoolResponse(err) return vulnerabilityAlertsEnabled, resp, err } // EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#enable-vulnerability-alerts // //meta:operation PUT /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeRequiredVulnerabilityAlertsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DisableVulnerabilityAlerts disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#disable-vulnerability-alerts // //meta:operation DELETE /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeRequiredVulnerabilityAlertsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-dependabot-security-updates-are-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - p := new(AutomatedSecurityFixes) - resp, err := s.client.Do(ctx, req, p) + var p *AutomatedSecurityFixes + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -865,39 +877,39 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#enable-dependabot-security-updates // //meta:operation PUT /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#disable-dependabot-security-updates // //meta:operation DELETE /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListContributors lists contributors for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-contributors +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-contributors // //meta:operation GET /repos/{owner}/{repo}/contributors func (s *RepositoriesService) ListContributors(ctx context.Context, owner, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { @@ -907,13 +919,13 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner, repos return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var contributor []*Contributor - resp, err := s.client.Do(ctx, req, &contributor) + resp, err := s.client.Do(req, &contributor) if err != nil { return nil, resp, err } @@ -930,18 +942,18 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner, repos // "Python": 7769 // } // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-languages +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-languages // //meta:operation GET /repos/{owner}/{repo}/languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner, repo string) (map[string]int, *Response, error) { u := fmt.Sprintf("repos/%v/%v/languages", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } languages := make(map[string]int) - resp, err := s.client.Do(ctx, req, &languages) + resp, err := s.client.Do(req, &languages) if err != nil { return nil, resp, err } @@ -951,7 +963,7 @@ func (s *RepositoriesService) ListLanguages(ctx context.Context, owner, repo str // ListTeams lists the teams for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-teams +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-teams // //meta:operation GET /repos/{owner}/{repo}/teams func (s *RepositoriesService) ListTeams(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Team, *Response, error) { @@ -961,13 +973,13 @@ func (s *RepositoriesService) ListTeams(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -985,7 +997,7 @@ type RepositoryTag struct { // ListTags lists tags for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-tags +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-tags // //meta:operation GET /repos/{owner}/{repo}/tags func (s *RepositoriesService) ListTags(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { @@ -995,13 +1007,13 @@ func (s *RepositoriesService) ListTags(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var tags []*RepositoryTag - resp, err := s.client.Do(ctx, req, &tags) + resp, err := s.client.Do(req, &tags) if err != nil { return nil, resp, err } @@ -1419,7 +1431,7 @@ type AutomatedSecurityFixes struct { // ListBranches lists branches for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#list-branches +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#list-branches // //meta:operation GET /repos/{owner}/{repo}/branches func (s *RepositoriesService) ListBranches(ctx context.Context, owner, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { @@ -1429,13 +1441,13 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner, repo stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var branches []*Branch - resp, err := s.client.Do(ctx, req, &branches) + resp, err := s.client.Do(req, &branches) if err != nil { return nil, resp, err } @@ -1447,7 +1459,7 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner, repo stri // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branches#get-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#get-a-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch} func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, maxRedirects int) (*Branch, *Response, error) { @@ -1463,8 +1475,8 @@ func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } - b := new(Branch) - err = json.NewDecoder(resp.Body).Decode(b) + var b *Branch + err = json.NewDecoder(resp.Body).Decode(&b) return b, newResponse(resp), err } @@ -1480,19 +1492,19 @@ type renameBranchRequest struct { // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branches#rename-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#rename-a-branch // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/rename func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, url.PathEscape(branch)) r := &renameBranchRequest{NewName: newName} - req, err := s.client.NewRequest("POST", u, r) + req, err := s.client.NewRequest(ctx, "POST", u, r) if err != nil { return nil, nil, err } - b := new(Branch) - resp, err := s.client.Do(ctx, req, b) + var b *Branch + resp, err := s.client.Do(req, &b) if err != nil { return nil, resp, err } @@ -1504,20 +1516,20 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-branch-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - p := new(Protection) - resp, err := s.client.Do(ctx, req, p) + var p *Protection + resp, err := s.client.Do(req, &p) if err != nil { if isBranchNotProtected(err) { err = ErrBranchNotProtected @@ -1532,18 +1544,18 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-status-checks-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - p := new(RequiredStatusChecks) - resp, err := s.client.Do(ctx, req, p) + var p *RequiredStatusChecks + resp, err := s.client.Do(req, &p) if err != nil { if isBranchNotProtected(err) { err = ErrBranchNotProtected @@ -1558,17 +1570,17 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-all-status-check-contexts // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks/contexts", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - resp, err = s.client.Do(ctx, req, &contexts) + resp, err = s.client.Do(req, &contexts) if err != nil { if isBranchNotProtected(err) { err = ErrBranchNotProtected @@ -1583,20 +1595,20 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#update-branch-protection // //meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("PUT", u, preq) + req, err := s.client.NewRequest(ctx, "PUT", u, preq) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - p := new(Protection) - resp, err := s.client.Do(ctx, req, p) + var p *Protection + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -1608,37 +1620,37 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#delete-branch-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetSignaturesProtectedBranch gets required signatures of protected branch. // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-commit-signature-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSignaturePreview) - p := new(SignaturesProtectedBranch) - resp, err := s.client.Do(ctx, req, p) + var p *SignaturesProtectedBranch + resp, err := s.client.Do(req, &p) if err != nil { if isBranchNotProtected(err) { err = ErrBranchNotProtected @@ -1654,20 +1666,20 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#create-commit-signature-protection // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeSignaturePreview) - r := new(SignaturesProtectedBranch) - resp, err := s.client.Do(ctx, req, r) + var r *SignaturesProtectedBranch + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -1679,37 +1691,37 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#delete-commit-signature-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeSignaturePreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UpdateRequiredStatusChecks updates the required status checks for a given protected branch. // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#update-status-check-protection // //meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("PATCH", u, sreq) + req, err := s.client.NewRequest(ctx, "PATCH", u, sreq) if err != nil { return nil, nil, err } - sc := new(RequiredStatusChecks) - resp, err := s.client.Do(ctx, req, sc) + var sc *RequiredStatusChecks + resp, err := s.client.Do(req, &sc) if err != nil { return nil, resp, err } @@ -1721,33 +1733,33 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#remove-status-check-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // License gets the contents of a repository's license if one is detected. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository +// GitHub API docs: https://docs.github.com/rest/licenses/licenses?apiVersion=2022-11-28#get-the-license-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/license func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) { u := fmt.Sprintf("repos/%v/%v/license", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - r := &RepositoryLicense{} - resp, err := s.client.Do(ctx, req, r) + var r *RepositoryLicense + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -1759,20 +1771,20 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-pull-request-review-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - r := new(PullRequestReviewsEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReviewsEnforcement + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -1785,20 +1797,20 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#update-pull-request-review-protection // //meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("PATCH", u, patch) + req, err := s.client.NewRequest(ctx, "PATCH", u, patch) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - r := new(PullRequestReviewsEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReviewsEnforcement + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -1811,7 +1823,7 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#update-pull-request-review-protection // //meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { @@ -1821,15 +1833,15 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, DismissalRestrictionsRequest `json:"dismissal_restrictions"` }) - req, err := s.client.NewRequest("PATCH", u, data) + req, err := s.client.NewRequest(ctx, "PATCH", u, data) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeRequiredApprovingReviewsPreview) - r := new(PullRequestReviewsEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *PullRequestReviewsEnforcement + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -1841,35 +1853,35 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#delete-pull-request-review-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetAdminEnforcement gets admin enforcement information of a protected branch. // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-admin-branch-protection // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - r := new(AdminEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *AdminEnforcement + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -1882,18 +1894,18 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#set-admin-branch-protection // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - r := new(AdminEnforcement) - resp, err := s.client.Do(ctx, req, r) + var r *AdminEnforcement + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -1905,17 +1917,17 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#delete-admin-branch-protection // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // repositoryTopics represents a collection of repository topics. @@ -1925,7 +1937,7 @@ type repositoryTopics struct { // ListAllTopics lists topics for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#get-all-repository-topics // //meta:operation GET /repos/{owner}/{repo}/topics func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string, opts *ListOptions) ([]string, *Response, error) { @@ -1935,15 +1947,15 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeTopicsPreview) - topics := new(repositoryTopics) - resp, err := s.client.Do(ctx, req, topics) + var topics *repositoryTopics + resp, err := s.client.Do(req, &topics) if err != nil { return nil, resp, err } @@ -1953,7 +1965,7 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str // ReplaceAllTopics replaces all repository topics. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#replace-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#replace-all-repository-topics // //meta:operation PUT /repos/{owner}/{repo}/topics func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) { @@ -1964,7 +1976,7 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo if t.Names == nil { t.Names = []string{} } - req, err := s.client.NewRequest("PUT", u, t) + req, err := s.client.NewRequest(ctx, "PUT", u, t) if err != nil { return nil, nil, err } @@ -1972,7 +1984,7 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo req.Header.Set("Accept", mediaTypeTopicsPreview) t = new(repositoryTopics) - resp, err := s.client.Do(ctx, req, t) + resp, err := s.client.Do(req, t) if err != nil { return nil, resp, err } @@ -1987,18 +1999,18 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // // Deprecated: Please use ListAppRestrictions instead. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-apps-with-access-to-the-protected-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var apps []*App - resp, err := s.client.Do(ctx, req, &apps) + resp, err := s.client.Do(req, &apps) if err != nil { return nil, resp, err } @@ -2011,7 +2023,7 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch // // Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-apps-with-access-to-the-protected-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { @@ -2026,18 +2038,18 @@ func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#set-app-access-restrictions // //meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("PUT", u, apps) + req, err := s.client.NewRequest(ctx, "PUT", u, apps) if err != nil { return nil, nil, err } var newApps []*App - resp, err := s.client.Do(ctx, req, &newApps) + resp, err := s.client.Do(req, &newApps) if err != nil { return nil, resp, err } @@ -2052,18 +2064,18 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#add-app-access-restrictions // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("POST", u, apps) + req, err := s.client.NewRequest(ctx, "POST", u, apps) if err != nil { return nil, nil, err } var newApps []*App - resp, err := s.client.Do(ctx, req, &newApps) + resp, err := s.client.Do(req, &newApps) if err != nil { return nil, resp, err } @@ -2078,18 +2090,18 @@ func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, rep // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#remove-app-access-restrictions // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("DELETE", u, apps) + req, err := s.client.NewRequest(ctx, "DELETE", u, apps) if err != nil { return nil, nil, err } var newApps []*App - resp, err := s.client.Do(ctx, req, &newApps) + resp, err := s.client.Do(req, &newApps) if err != nil { return nil, resp, err } @@ -2102,18 +2114,18 @@ func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-teams-with-access-to-the-protected-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -2129,18 +2141,18 @@ func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, r // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#set-team-access-restrictions // //meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("PUT", u, teams) + req, err := s.client.NewRequest(ctx, "PUT", u, teams) if err != nil { return nil, nil, err } var newTeams []*Team - resp, err := s.client.Do(ctx, req, &newTeams) + resp, err := s.client.Do(req, &newTeams) if err != nil { return nil, resp, err } @@ -2155,18 +2167,18 @@ func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#add-team-access-restrictions // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("POST", u, teams) + req, err := s.client.NewRequest(ctx, "POST", u, teams) if err != nil { return nil, nil, err } var newTeams []*Team - resp, err := s.client.Do(ctx, req, &newTeams) + resp, err := s.client.Do(req, &newTeams) if err != nil { return nil, resp, err } @@ -2181,18 +2193,18 @@ func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#remove-team-access-restrictions // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("DELETE", u, teams) + req, err := s.client.NewRequest(ctx, "DELETE", u, teams) if err != nil { return nil, nil, err } var newTeams []*Team - resp, err := s.client.Do(ctx, req, &newTeams) + resp, err := s.client.Do(req, &newTeams) if err != nil { return nil, resp, err } @@ -2205,18 +2217,18 @@ func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#get-users-with-access-to-the-protected-branch // //meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var users []*User - resp, err := s.client.Do(ctx, req, &users) + resp, err := s.client.Do(req, &users) if err != nil { return nil, resp, err } @@ -2232,18 +2244,18 @@ func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, r // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#set-user-access-restrictions // //meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("PUT", u, users) + req, err := s.client.NewRequest(ctx, "PUT", u, users) if err != nil { return nil, nil, err } var newUsers []*User - resp, err := s.client.Do(ctx, req, &newUsers) + resp, err := s.client.Do(req, &newUsers) if err != nil { return nil, resp, err } @@ -2258,18 +2270,18 @@ func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#add-user-access-restrictions // //meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("POST", u, users) + req, err := s.client.NewRequest(ctx, "POST", u, users) if err != nil { return nil, nil, err } var newUsers []*User - resp, err := s.client.Do(ctx, req, &newUsers) + resp, err := s.client.Do(req, &newUsers) if err != nil { return nil, resp, err } @@ -2284,18 +2296,18 @@ func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection?apiVersion=2022-11-28#remove-user-access-restrictions // //meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) - req, err := s.client.NewRequest("DELETE", u, users) + req, err := s.client.NewRequest(ctx, "DELETE", u, users) if err != nil { return nil, nil, err } var newUsers []*User - resp, err := s.client.Do(ctx, req, &newUsers) + resp, err := s.client.Do(req, &newUsers) if err != nil { return nil, resp, err } @@ -2318,19 +2330,19 @@ type TransferRequest struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#transfer-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#transfer-a-repository // //meta:operation POST /repos/{owner}/{repo}/transfer func (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, transfer TransferRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/transfer", owner, repo) - req, err := s.client.NewRequest("POST", u, &transfer) + req, err := s.client.NewRequest(ctx, "POST", u, &transfer) if err != nil { return nil, nil, err } - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -2349,19 +2361,19 @@ type DispatchRequestOptions struct { // Dispatch triggers a repository_dispatch event in a GitHub Actions workflow. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event // //meta:operation POST /repos/{owner}/{repo}/dispatches func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, opts DispatchRequestOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dispatches", owner, repo) - req, err := s.client.NewRequest("POST", u, &opts) + req, err := s.client.NewRequest(ctx, "POST", u, &opts) if err != nil { return nil, nil, err } - r := new(Repository) - resp, err := s.client.Do(ctx, req, r) + var r *Repository + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -2379,18 +2391,18 @@ func isBranchNotProtected(err error) bool { // EnablePrivateReporting enables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#enable-private-vulnerability-reporting-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -2401,18 +2413,18 @@ func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, // DisablePrivateReporting disables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#disable-private-vulnerability-reporting-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -2428,19 +2440,19 @@ type checkPrivateReporting struct { // IsPrivateReportingEnabled checks if private vulnerability reporting is enabled // for the repository and returns a boolean indicating the status. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-private-vulnerability-reporting-is-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) IsPrivateReportingEnabled(ctx context.Context, owner, repo string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - privateReporting := new(checkPrivateReporting) - resp, err := s.client.Do(ctx, req, privateReporting) + var privateReporting checkPrivateReporting + resp, err := s.client.Do(req, &privateReporting) return privateReporting.Enabled, resp, err } @@ -2516,7 +2528,7 @@ type RepositoryActivity struct { // ListRepositoryActivities lists the activities for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-activities +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-activities // //meta:operation GET /repos/{owner}/{repo}/activity func (s *RepositoriesService) ListRepositoryActivities(ctx context.Context, owner, repo string, opts *ListRepositoryActivityOptions) ([]*RepositoryActivity, *Response, error) { @@ -2526,13 +2538,13 @@ func (s *RepositoriesService) ListRepositoryActivities(ctx context.Context, owne return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var activities []*RepositoryActivity - resp, err := s.client.Do(ctx, req, &activities) + resp, err := s.client.Do(req, &activities) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_actions_access.go b/vendor/github.com/google/go-github/v88/github/repos_actions_access.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/repos_actions_access.go rename to vendor/github.com/google/go-github/v88/github/repos_actions_access.go index 2da1f01cc..42739999f 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_actions_access.go +++ b/vendor/github.com/google/go-github/v88/github/repos_actions_access.go @@ -12,7 +12,7 @@ import ( // RepositoryActionsAccessLevel represents the repository actions access level. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-the-level-of-access-for-workflows-outside-of-the-repository type RepositoryActionsAccessLevel struct { // AccessLevel specifies the level of access that workflows outside of the repository have // to actions and reusable workflows within the repository. @@ -23,18 +23,18 @@ type RepositoryActionsAccessLevel struct { // GetActionsAccessLevel gets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-the-level-of-access-for-workflows-outside-of-the-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/access func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - raal := new(RepositoryActionsAccessLevel) - resp, err := s.client.Do(ctx, req, raal) + var raal *RepositoryActionsAccessLevel + resp, err := s.client.Do(req, &raal) if err != nil { return nil, resp, err } @@ -45,15 +45,15 @@ func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, // EditActionsAccessLevel sets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-the-level-of-access-for-workflows-outside-of-the-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/access func (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) - req, err := s.client.NewRequest("PUT", u, repositoryActionsAccessLevel) + req, err := s.client.NewRequest(ctx, "PUT", u, repositoryActionsAccessLevel) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_actions_allowed.go b/vendor/github.com/google/go-github/v88/github/repos_actions_allowed.go similarity index 76% rename from vendor/github.com/google/go-github/v84/github/repos_actions_allowed.go rename to vendor/github.com/google/go-github/v88/github/repos_actions_allowed.go index e9ebff1d3..d8a019e67 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_actions_allowed.go +++ b/vendor/github.com/google/go-github/v88/github/repos_actions_allowed.go @@ -12,18 +12,18 @@ import ( // GetActionsAllowed gets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-allowed-actions-and-reusable-workflows-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/selected-actions func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - actionsAllowed := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, actionsAllowed) + var actionsAllowed *ActionsAllowed + resp, err := s.client.Do(req, &actionsAllowed) if err != nil { return nil, resp, err } @@ -33,18 +33,18 @@ func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo s // EditActionsAllowed sets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-allowed-actions-and-reusable-workflows-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/selected-actions func (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) - req, err := s.client.NewRequest("PUT", u, actionsAllowed) + req, err := s.client.NewRequest(ctx, "PUT", u, actionsAllowed) if err != nil { return nil, nil, err } - p := new(ActionsAllowed) - resp, err := s.client.Do(ctx, req, p) + var p *ActionsAllowed + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_actions_permissions.go b/vendor/github.com/google/go-github/v88/github/repos_actions_permissions.go similarity index 77% rename from vendor/github.com/google/go-github/v84/github/repos_actions_permissions.go rename to vendor/github.com/google/go-github/v88/github/repos_actions_permissions.go index 7e56c3f39..ea4bed00a 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_actions_permissions.go +++ b/vendor/github.com/google/go-github/v88/github/repos_actions_permissions.go @@ -12,7 +12,7 @@ import ( // ActionsPermissionsRepository represents a policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type ActionsPermissionsRepository struct { Enabled *bool `json:"enabled,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -26,7 +26,7 @@ func (a ActionsPermissionsRepository) String() string { // DefaultWorkflowPermissionRepository represents the default permissions for GitHub Actions workflows for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28 type DefaultWorkflowPermissionRepository struct { DefaultWorkflowPermissions *string `json:"default_workflow_permissions,omitempty"` CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` @@ -34,19 +34,19 @@ type DefaultWorkflowPermissionRepository struct { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-github-actions-permissions-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(ActionsPermissionsRepository) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *ActionsPermissionsRepository + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -56,18 +56,18 @@ func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, // UpdateActionsPermissions sets the permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-github-actions-permissions-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) UpdateActionsPermissions(ctx context.Context, owner, repo string, actionsPermissionsRepository ActionsPermissionsRepository) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) - req, err := s.client.NewRequest("PUT", u, actionsPermissionsRepository) + req, err := s.client.NewRequest(ctx, "PUT", u, actionsPermissionsRepository) if err != nil { return nil, nil, err } - permissions := new(ActionsPermissionsRepository) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *ActionsPermissionsRepository + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -77,19 +77,19 @@ func (s *RepositoriesService) UpdateActionsPermissions(ctx context.Context, owne // GetDefaultWorkflowPermissions gets the GitHub Actions default workflow permissions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-default-workflow-permissions-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/workflow func (s *RepositoriesService) GetDefaultWorkflowPermissions(ctx context.Context, owner, repo string) (*DefaultWorkflowPermissionRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/workflow", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(DefaultWorkflowPermissionRepository) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *DefaultWorkflowPermissionRepository + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -99,18 +99,18 @@ func (s *RepositoriesService) GetDefaultWorkflowPermissions(ctx context.Context, // UpdateDefaultWorkflowPermissions sets the GitHub Actions default workflow permissions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/workflow func (s *RepositoriesService) UpdateDefaultWorkflowPermissions(ctx context.Context, owner, repo string, permissions DefaultWorkflowPermissionRepository) (*DefaultWorkflowPermissionRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/workflow", owner, repo) - req, err := s.client.NewRequest("PUT", u, permissions) + req, err := s.client.NewRequest(ctx, "PUT", u, permissions) if err != nil { return nil, nil, err } - p := new(DefaultWorkflowPermissionRepository) - resp, err := s.client.Do(ctx, req, p) + var p *DefaultWorkflowPermissionRepository + resp, err := s.client.Do(req, &p) if err != nil { return nil, resp, err } @@ -120,19 +120,19 @@ func (s *RepositoriesService) UpdateDefaultWorkflowPermissions(ctx context.Conte // GetArtifactAndLogRetentionPeriod gets the artifact and log retention period for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-artifact-and-log-retention-settings-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention func (s *RepositoriesService) GetArtifactAndLogRetentionPeriod(ctx context.Context, owner, repo string) (*ArtifactPeriod, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/artifact-and-log-retention", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - arp := new(ArtifactPeriod) - resp, err := s.client.Do(ctx, req, arp) + var arp *ArtifactPeriod + resp, err := s.client.Do(req, &arp) if err != nil { return nil, resp, err } @@ -142,34 +142,34 @@ func (s *RepositoriesService) GetArtifactAndLogRetentionPeriod(ctx context.Conte // UpdateArtifactAndLogRetentionPeriod sets the artifact and log retention period for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-artifact-and-log-retention-settings-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention func (s *RepositoriesService) UpdateArtifactAndLogRetentionPeriod(ctx context.Context, owner, repo string, period ArtifactPeriodOpt) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/artifact-and-log-retention", owner, repo) - req, err := s.client.NewRequest("PUT", u, period) + req, err := s.client.NewRequest(ctx, "PUT", u, period) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetPrivateRepoForkPRWorkflowSettings gets the settings for whether workflows from fork pull requests can run on a private repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-private-repo-fork-pr-workflow-settings-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos func (s *RepositoriesService) GetPrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string) (*WorkflowsPermissions, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/fork-pr-workflows-private-repos", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - permissions := new(WorkflowsPermissions) - resp, err := s.client.Do(ctx, req, permissions) + var permissions *WorkflowsPermissions + resp, err := s.client.Do(req, &permissions) if err != nil { return nil, resp, err } @@ -179,34 +179,34 @@ func (s *RepositoriesService) GetPrivateRepoForkPRWorkflowSettings(ctx context.C // UpdatePrivateRepoForkPRWorkflowSettings sets the settings for whether workflows from fork pull requests can run on a private repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-private-repo-fork-pr-workflow-settings-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos func (s *RepositoriesService) UpdatePrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string, permissions *WorkflowsPermissionsOpt) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/fork-pr-workflows-private-repos", owner, repo) - req, err := s.client.NewRequest("PUT", u, permissions) + req, err := s.client.NewRequest(ctx, "PUT", u, permissions) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#get-fork-pr-contributor-approval-permissions-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) GetForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string) (*ContributorApprovalPermissions, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/fork-pr-contributor-approval", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - policy := new(ContributorApprovalPermissions) - resp, err := s.client.Do(ctx, req, policy) + var policy *ContributorApprovalPermissions + resp, err := s.client.Do(req, &policy) if err != nil { return nil, resp, err } @@ -216,15 +216,15 @@ func (s *ActionsService) GetForkPRContributorApprovalPermissions(ctx context.Con // UpdateForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions?apiVersion=2022-11-28#set-fork-pr-contributor-approval-permissions-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval func (s *ActionsService) UpdateForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string, policy ContributorApprovalPermissions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/fork-pr-contributor-approval", owner, repo) - req, err := s.client.NewRequest("PUT", u, policy) + req, err := s.client.NewRequest(ctx, "PUT", u, policy) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_attestations.go b/vendor/github.com/google/go-github/v88/github/repos_attestations.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/repos_attestations.go rename to vendor/github.com/google/go-github/v88/github/repos_attestations.go index 31690a2d8..edca5dc66 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_attestations.go +++ b/vendor/github.com/google/go-github/v88/github/repos_attestations.go @@ -13,7 +13,7 @@ import ( // ListAttestations returns a collection of artifact attestations // with a given subject digest that are associated with a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/attestations#list-attestations +// GitHub API docs: https://docs.github.com/rest/repos/attestations?apiVersion=2022-11-28#list-attestations // //meta:operation GET /repos/{owner}/{repo}/attestations/{subject_digest} func (s *RepositoriesService) ListAttestations(ctx context.Context, owner, repo, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { @@ -24,13 +24,13 @@ func (s *RepositoriesService) ListAttestations(ctx context.Context, owner, repo, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var attestations *AttestationsResponse - resp, err := s.client.Do(ctx, req, &attestations) + resp, err := s.client.Do(req, &attestations) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_autolinks.go b/vendor/github.com/google/go-github/v88/github/repos_autolinks.go similarity index 83% rename from vendor/github.com/google/go-github/v84/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v88/github/repos_autolinks.go index 2deb9f5a6..91656c51f 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_autolinks.go +++ b/vendor/github.com/google/go-github/v88/github/repos_autolinks.go @@ -28,19 +28,19 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks?apiVersion=2022-11-28#get-all-autolinks-of-a-repository // //meta:operation GET /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string) ([]*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var autolinks []*Autolink - resp, err := s.client.Do(ctx, req, &autolinks) + resp, err := s.client.Do(req, &autolinks) if err != nil { return nil, resp, err } @@ -51,18 +51,18 @@ func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo str // AddAutolink creates an autolink reference for a repository. // Users with admin access to the repository can create an autolink. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks?apiVersion=2022-11-28#create-an-autolink-reference-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo string, opts *AutolinkOptions) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - al := new(Autolink) - resp, err := s.client.Do(ctx, req, al) + var al *Autolink + resp, err := s.client.Do(req, &al) if err != nil { return nil, resp, err } @@ -72,19 +72,19 @@ func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo strin // GetAutolink returns a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks?apiVersion=2022-11-28#get-an-autolink-reference-of-a-repository // //meta:operation GET /repos/{owner}/{repo}/autolinks/{autolink_id} func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo string, id int64) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var autolink *Autolink - resp, err := s.client.Do(ctx, req, &autolink) + resp, err := s.client.Do(req, &autolink) if err != nil { return nil, resp, err } @@ -95,14 +95,14 @@ func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo strin // DeleteAutolink deletes a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks?apiVersion=2022-11-28#delete-an-autolink-reference-from-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} func (s *RepositoriesService) DeleteAutolink(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_codeowners.go b/vendor/github.com/google/go-github/v88/github/repos_codeowners.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/repos_codeowners.go rename to vendor/github.com/google/go-github/v88/github/repos_codeowners.go index 93eeae09b..d178294f7 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_codeowners.go +++ b/vendor/github.com/google/go-github/v88/github/repos_codeowners.go @@ -36,7 +36,7 @@ type CodeownersError struct { // GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-codeowners-errors +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-codeowners-errors // //meta:operation GET /repos/{owner}/{repo}/codeowners/errors func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string, opts *GetCodeownersErrorsOptions) (*CodeownersErrors, *Response, error) { @@ -46,13 +46,13 @@ func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, re return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - codeownersErrors := &CodeownersErrors{} - resp, err := s.client.Do(ctx, req, codeownersErrors) + var codeownersErrors *CodeownersErrors + resp, err := s.client.Do(req, &codeownersErrors) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_collaborators.go b/vendor/github.com/google/go-github/v88/github/repos_collaborators.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v88/github/repos_collaborators.go index a46f45294..582f47b23 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_collaborators.go +++ b/vendor/github.com/google/go-github/v88/github/repos_collaborators.go @@ -34,7 +34,7 @@ type ListCollaboratorsOptions struct { } // CollaboratorInvitation represents an invitation created when adding a collaborator. -// GitHub API docs: https://docs.github.com/rest/repos/collaborators/#response-when-a-new-invitation-is-created +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#add-a-repository-collaborator type CollaboratorInvitation struct { ID *int64 `json:"id,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -48,7 +48,7 @@ type CollaboratorInvitation struct { // ListCollaborators lists the GitHub users that have access to the repository. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#list-repository-collaborators // //meta:operation GET /repos/{owner}/{repo}/collaborators func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opts *ListCollaboratorsOptions) ([]*User, *Response, error) { @@ -58,13 +58,13 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var users []*User - resp, err := s.client.Do(ctx, req, &users) + resp, err := s.client.Do(req, &users) if err != nil { return nil, resp, err } @@ -77,17 +77,17 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo // Note: This will return false if the user is not a collaborator OR the user // is not a GitHub user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#check-if-a-user-is-a-repository-collaborator // //meta:operation GET /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) isCollab, err := parseBoolResponse(err) return isCollab, resp, err } @@ -105,18 +105,18 @@ type RepositoryPermissionLevel struct { // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#get-repository-permissions-for-a-user // //meta:operation GET /repos/{owner}/{repo}/collaborators/{username}/permission func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v/permission", owner, repo, user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - rpl := new(RepositoryPermissionLevel) - resp, err := s.client.Do(ctx, req, rpl) + var rpl *RepositoryPermissionLevel + resp, err := s.client.Do(req, &rpl) if err != nil { return nil, resp, err } @@ -142,18 +142,18 @@ type RepositoryAddCollaboratorOptions struct { // AddCollaborator sends an invitation to the specified GitHub user // to become a collaborator to the given repo. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#add-a-repository-collaborator // //meta:operation PUT /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, opts *RepositoryAddCollaboratorOptions) (*CollaboratorInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, nil, err } - acr := new(CollaboratorInvitation) - resp, err := s.client.Do(ctx, req, acr) + var acr *CollaboratorInvitation + resp, err := s.client.Do(req, &acr) if err != nil { return nil, resp, err } @@ -164,15 +164,15 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, // RemoveCollaborator removes the specified GitHub user as collaborator from the given repo. // Note: Does not return error if a valid user that is not a collaborator is removed. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators?apiVersion=2022-11-28#remove-a-repository-collaborator // //meta:operation DELETE /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_comments.go b/vendor/github.com/google/go-github/v88/github/repos_comments.go similarity index 83% rename from vendor/github.com/google/go-github/v84/github/repos_comments.go rename to vendor/github.com/google/go-github/v88/github/repos_comments.go index 3d02a1999..b94337589 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_comments.go +++ b/vendor/github.com/google/go-github/v88/github/repos_comments.go @@ -35,7 +35,7 @@ func (r RepositoryComment) String() string { // ListComments lists all the comments for the repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#list-commit-comments-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/comments func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { @@ -45,7 +45,7 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri req.Header.Set("Accept", mediaTypeReactionsPreview) var comments []*RepositoryComment - resp, err := s.client.Do(ctx, req, &comments) + resp, err := s.client.Do(req, &comments) if err != nil { return nil, resp, err } @@ -63,7 +63,7 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri // ListCommitComments lists all the comments for a given commit SHA. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#list-commit-comments // //meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/comments func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { @@ -73,7 +73,7 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -81,7 +81,7 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep req.Header.Set("Accept", mediaTypeReactionsPreview) var comments []*RepositoryComment - resp, err := s.client.Do(ctx, req, &comments) + resp, err := s.client.Do(req, &comments) if err != nil { return nil, resp, err } @@ -92,18 +92,18 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep // CreateComment creates a comment for the given commit. // Note: GitHub allows for comments to be created for non-existing files and positions. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#create-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#create-a-commit-comment // //meta:operation POST /repos/{owner}/{repo}/commits/{commit_sha}/comments func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) - req, err := s.client.NewRequest("POST", u, comment) + req, err := s.client.NewRequest(ctx, "POST", u, comment) if err != nil { return nil, nil, err } - c := new(RepositoryComment) - resp, err := s.client.Do(ctx, req, c) + var c *RepositoryComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -113,20 +113,20 @@ func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sh // GetComment gets a single comment from a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#get-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#get-a-commit-comment // //meta:operation GET /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int64) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeReactionsPreview) - c := new(RepositoryComment) - resp, err := s.client.Do(ctx, req, c) + var c *RepositoryComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -136,18 +136,18 @@ func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string // UpdateComment updates the body of a single comment. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#update-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#update-a-commit-comment // //meta:operation PATCH /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int64, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) - req, err := s.client.NewRequest("PATCH", u, comment) + req, err := s.client.NewRequest(ctx, "PATCH", u, comment) if err != nil { return nil, nil, err } - c := new(RepositoryComment) - resp, err := s.client.Do(ctx, req, c) + var c *RepositoryComment + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } @@ -157,14 +157,15 @@ func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo str // DeleteComment deletes a single comment from a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#delete-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments?apiVersion=2022-11-28#delete-a-commit-comment // //meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_commits.go b/vendor/github.com/google/go-github/v88/github/repos_commits.go similarity index 90% rename from vendor/github.com/google/go-github/v84/github/repos_commits.go rename to vendor/github.com/google/go-github/v88/github/repos_commits.go index 36192cd3e..cf380af1a 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_commits.go +++ b/vendor/github.com/google/go-github/v88/github/repos_commits.go @@ -124,7 +124,7 @@ type BranchCommit struct { // ListCommits lists the commits of a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-commits // //meta:operation GET /repos/{owner}/{repo}/commits func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) { @@ -134,13 +134,13 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var commits []*RepositoryCommit - resp, err := s.client.Do(ctx, req, &commits) + resp, err := s.client.Do(req, &commits) if err != nil { return nil, resp, err } @@ -150,7 +150,7 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // GetCommit fetches the specified commit, including all details about it. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#get-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { @@ -160,13 +160,13 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - commit := new(RepositoryCommit) - resp, err := s.client.Do(ctx, req, commit) + var commit *RepositoryCommit + resp, err := s.client.Do(req, &commit) if err != nil { return nil, resp, err } @@ -176,12 +176,12 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st // GetCommitRaw fetches the specified commit in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#get-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner, repo, sha string, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return "", nil, err } @@ -196,7 +196,7 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner, repo, sha } var buf bytes.Buffer - resp, err := s.client.Do(ctx, req, &buf) + resp, err := s.client.Do(req, &buf) if err != nil { return "", resp, err } @@ -207,13 +207,13 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner, repo, sha // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#get-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, refURLEscape(ref)) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return "", nil, err } @@ -224,7 +224,7 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re req.Header.Set("Accept", mediaTypeV3SHA) var buf bytes.Buffer - resp, err := s.client.Do(ctx, req, &buf) + resp, err := s.client.Do(req, &buf) if err != nil { return "", resp, err } @@ -234,7 +234,7 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // CompareCommits compares a range of commits with each other. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits // //meta:operation GET /repos/{owner}/{repo}/compare/{basehead} func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { @@ -247,13 +247,13 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo, b return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - comp := new(CommitsComparison) - resp, err := s.client.Do(ctx, req, comp) + var comp *CommitsComparison + resp, err := s.client.Do(req, &comp) if err != nil { return nil, resp, err } @@ -267,7 +267,7 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo, b // To compare branches across other repositories in the same network as "repo", // use the format ":branch". // -// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits // //meta:operation GET /repos/{owner}/{repo}/compare/{basehead} func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo, base, head string, opts RawOptions) (string, *Response, error) { @@ -276,7 +276,7 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo u := fmt.Sprintf("repos/%v/%v/compare/%v...%v", owner, repo, escapedBase, escapedHead) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return "", nil, err } @@ -291,7 +291,7 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo } var buf bytes.Buffer - resp, err := s.client.Do(ctx, req, &buf) + resp, err := s.client.Do(req, &buf) if err != nil { return "", resp, err } @@ -302,20 +302,20 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo // ListBranchesHeadCommit gets all branches where the given commit SHA is the HEAD, // or latest commit for the branch. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits?apiVersion=2022-11-28#list-branches-for-head-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head func (s *RepositoriesService) ListBranchesHeadCommit(ctx context.Context, owner, repo, sha string) ([]*BranchCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/branches-where-head", owner, repo, sha) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeListPullsOrBranchesForCommitPreview) var branchCommits []*BranchCommit - resp, err := s.client.Do(ctx, req, &branchCommits) + resp, err := s.client.Do(req, &branchCommits) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_community_health.go b/vendor/github.com/google/go-github/v88/github/repos_community_health.go similarity index 91% rename from vendor/github.com/google/go-github/v84/github/repos_community_health.go rename to vendor/github.com/google/go-github/v88/github/repos_community_health.go index 54d1b414e..143da8c4e 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_community_health.go +++ b/vendor/github.com/google/go-github/v88/github/repos_community_health.go @@ -43,18 +43,18 @@ type CommunityHealthMetrics struct { // GetCommunityHealthMetrics retrieves all the community health metrics for a repository. // -// GitHub API docs: https://docs.github.com/rest/metrics/community#get-community-profile-metrics +// GitHub API docs: https://docs.github.com/rest/metrics/community?apiVersion=2022-11-28#get-community-profile-metrics // //meta:operation GET /repos/{owner}/{repo}/community/profile func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) { u := fmt.Sprintf("repos/%v/%v/community/profile", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - metrics := &CommunityHealthMetrics{} - resp, err := s.client.Do(ctx, req, metrics) + var metrics *CommunityHealthMetrics + resp, err := s.client.Do(req, &metrics) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_contents.go b/vendor/github.com/google/go-github/v88/github/repos_contents.go similarity index 72% rename from vendor/github.com/google/go-github/v84/github/repos_contents.go rename to vendor/github.com/google/go-github/v88/github/repos_contents.go index 73321e260..024496fe5 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v88/github/repos_contents.go @@ -4,7 +4,7 @@ // license that can be found in the LICENSE file. // Repository contents API methods. -// GitHub API docs: https://docs.github.com/rest/repos/contents/ +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28 package github @@ -17,11 +17,17 @@ import ( "io" "net/http" "net/url" - "path" "strings" ) -var ErrPathForbidden = errors.New("path must not contain '..' due to auth vulnerability issue") +// ErrContentsDirectory indicates that the contents are not available for a directory. +var ErrContentsDirectory = errors.New("contents not available for directory") + +// ErrContentsSubmodule indicates that the contents are not available for a submodule. +var ErrContentsSubmodule = errors.New("contents not available for submodule") + +// ErrContentsNoDownloadURL indicates that the contents download URL is empty, which may occur when file size > 100 MB. +var ErrContentsNoDownloadURL = errors.New("contents download url is empty") // RepositoryContent represents a file or directory in a github repository. type RepositoryContent struct { @@ -100,7 +106,7 @@ func (r *RepositoryContent) GetContent() (string, error) { // GetReadme gets the Readme file for the repository. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-a-repository-readme +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#get-a-repository-readme // //meta:operation GET /repos/{owner}/{repo}/readme func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opts *RepositoryContentGetOptions) (*RepositoryContent, *Response, error) { @@ -110,13 +116,13 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - readme := new(RepositoryContent) - resp, err := s.client.Do(ctx, req, readme) + var readme *RepositoryContent + resp, err := s.client.Do(req, &readme) if err != nil { return nil, resp, err } @@ -133,44 +139,16 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// DownloadContents returns [ErrContentsDirectory] if the path references a +// directory, [ErrContentsSubmodule] if the path references a submodule, and +// [ErrContentsNoDownloadURL] if the file's download URL is empty. +// +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#get-repository-content // //meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { - dir := path.Dir(filepath) - filename := path.Base(filepath) - fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) - if err == nil && fileContent != nil { - content, err := fileContent.GetContent() - if err == nil && content != "" { - return io.NopCloser(strings.NewReader(content)), resp, nil - } - } - - _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) - if err != nil { - return nil, resp, err - } - - for _, contents := range dirContents { - if contents.GetName() == filename { - if contents.GetDownloadURL() == "" { - return nil, resp, fmt.Errorf("no download link found for %v", filepath) - } - dlReq, err := http.NewRequestWithContext(ctx, "GET", *contents.DownloadURL, nil) - if err != nil { - return nil, resp, err - } - dlResp, err := s.client.client.Do(dlReq) - if err != nil { - return nil, &Response{Response: dlResp}, err - } - - return dlResp.Body, &Response{Response: dlResp}, nil - } - } - - return nil, resp, fmt.Errorf("no file named %v found in %v", filename, dir) + rc, _, resp, err := s.DownloadContentsWithMeta(ctx, owner, repo, filepath, opts) + return rc, resp, err } // DownloadContentsWithMeta is identical to DownloadContents but additionally @@ -182,44 +160,49 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// DownloadContentsWithMeta returns [ErrContentsDirectory] if the path +// references a directory, [ErrContentsSubmodule] if the path references a +// submodule, and [ErrContentsNoDownloadURL] if the file's download URL is +// empty. +// +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#get-repository-content // //meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { - dir := path.Dir(filepath) - filename := path.Base(filepath) fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) - if err == nil && fileContent != nil { - content, err := fileContent.GetContent() - if err == nil && content != "" { - return io.NopCloser(strings.NewReader(content)), fileContent, resp, nil - } + if err != nil { + return nil, nil, resp, err + } + + if fileContent == nil { + return nil, nil, resp, ErrContentsDirectory + } + + if fileContent.GetType() == "submodule" { + return nil, fileContent, resp, ErrContentsSubmodule + } + + content, err := fileContent.GetContent() + if err == nil && content != "" { + return io.NopCloser(strings.NewReader(content)), fileContent, resp, nil } - _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) + downloadURL := fileContent.GetDownloadURL() + if downloadURL == "" { + return nil, fileContent, resp, ErrContentsNoDownloadURL + } + + dlReq, err := http.NewRequestWithContext(ctx, "GET", downloadURL, nil) if err != nil { - return nil, nil, resp, err + return nil, fileContent, resp, err } - for _, contents := range dirContents { - if contents.GetName() == filename { - if contents.GetDownloadURL() == "" { - return nil, contents, resp, fmt.Errorf("no download link found for %v", filepath) - } - dlReq, err := http.NewRequestWithContext(ctx, "GET", *contents.DownloadURL, nil) - if err != nil { - return nil, contents, resp, err - } - dlResp, err := s.client.client.Do(dlReq) - if err != nil { - return nil, contents, &Response{Response: dlResp}, err - } - - return dlResp.Body, contents, &Response{Response: dlResp}, nil - } + dlResp, err := s.client.client.Do(dlReq) + if err != nil { + return nil, fileContent, &Response{Response: dlResp}, err } - return nil, nil, resp, fmt.Errorf("no file named %v found in %v", filename, dir) + return dlResp.Body, fileContent, &Response{Response: dlResp}, nil } // GetContents can return either the metadata and content of a single file @@ -229,17 +212,10 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // as possible, both result types will be returned but only one will contain a // value and the other will be nil. // -// Due to an auth vulnerability issue in the GitHub v3 API, ".." is not allowed -// to appear anywhere in the "path" or this method will return an error. -// -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#get-repository-content // //meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { - if strings.Contains(path, "..") { - return nil, nil, nil, ErrPathForbidden - } - escapedPath := (&url.URL{Path: strings.TrimSuffix(path, "/")}).String() u := fmt.Sprintf("repos/%v/%v/contents/%v", owner, repo, escapedPath) u, err = addOptions(u, opts) @@ -247,13 +223,13 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path return nil, nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, nil, err } var rawJSON json.RawMessage - resp, err = s.client.Do(ctx, req, &rawJSON) + resp, err = s.client.Do(req, &rawJSON) if err != nil { return nil, nil, resp, err } @@ -274,18 +250,18 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path // CreateFile creates a new file in a repository at the given path and returns // the commit and file metadata. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents // //meta:operation PUT /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contents/%v", owner, repo, path) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, nil, err } - createResponse := new(RepositoryContentResponse) - resp, err := s.client.Do(ctx, req, createResponse) + var createResponse *RepositoryContentResponse + resp, err := s.client.Do(req, &createResponse) if err != nil { return nil, resp, err } @@ -296,18 +272,18 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path // UpdateFile updates a file in a repository at the given path and returns the // commit and file metadata. Requires the blob SHA of the file being updated. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents // //meta:operation PUT /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contents/%v", owner, repo, path) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, nil, err } - updateResponse := new(RepositoryContentResponse) - resp, err := s.client.Do(ctx, req, updateResponse) + var updateResponse *RepositoryContentResponse + resp, err := s.client.Do(req, &updateResponse) if err != nil { return nil, resp, err } @@ -318,18 +294,18 @@ func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path // DeleteFile deletes a file from a repository and returns the commit. // Requires the blob SHA of the file to be deleted. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#delete-a-file +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#delete-a-file // //meta:operation DELETE /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contents/%v", owner, repo, path) - req, err := s.client.NewRequest("DELETE", u, opts) + req, err := s.client.NewRequest(ctx, "DELETE", u, opts) if err != nil { return nil, nil, err } - deleteResponse := new(RepositoryContentResponse) - resp, err := s.client.Do(ctx, req, deleteResponse) + var deleteResponse *RepositoryContentResponse + resp, err := s.client.Do(req, &deleteResponse) if err != nil { return nil, resp, err } @@ -352,9 +328,9 @@ const ( // repository. The archiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#download-a-repository-archive-tar // -// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip +// GitHub API docs: https://docs.github.com/rest/repos/contents?apiVersion=2022-11-28#download-a-repository-archive-zip // //meta:operation GET /repos/{owner}/{repo}/tarball/{ref} //meta:operation GET /repos/{owner}/{repo}/zipball/{ref} @@ -364,7 +340,7 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st u += fmt.Sprintf("/%v", opts.Ref) } - if s.client.RateLimitRedirectionalEndpoints { + if s.client.rateLimitRedirectionalEndpoints { return s.getArchiveLinkWithRateLimit(ctx, u, maxRedirects) } @@ -391,12 +367,12 @@ func (s *RepositoriesService) getArchiveLinkWithoutRateLimit(ctx context.Context } func (s *RepositoriesService) getArchiveLinkWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + url, resp, err := s.client.bareDoUntilFound(req, maxRedirects) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_deployment_branch_policies.go b/vendor/github.com/google/go-github/v88/github/repos_deployment_branch_policies.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/repos_deployment_branch_policies.go rename to vendor/github.com/google/go-github/v88/github/repos_deployment_branch_policies.go index 41088f117..e4760f22e 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_deployment_branch_policies.go +++ b/vendor/github.com/google/go-github/v88/github/repos_deployment_branch_policies.go @@ -32,7 +32,7 @@ type DeploymentBranchPolicyRequest struct { // ListDeploymentBranchPolicies lists the deployment branch policies for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#list-deployment-branch-policies // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string, opts *ListOptions) (*DeploymentBranchPolicyResponse, *Response, error) { @@ -42,13 +42,13 @@ func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var list *DeploymentBranchPolicyResponse - resp, err := s.client.Do(ctx, req, &list) + resp, err := s.client.Do(req, &list) if err != nil { return nil, resp, err } @@ -58,19 +58,19 @@ func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, // GetDeploymentBranchPolicy gets a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#get-a-deployment-branch-policy // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var policy *DeploymentBranchPolicy - resp, err := s.client.Do(ctx, req, &policy) + resp, err := s.client.Do(req, &policy) if err != nil { return nil, resp, err } @@ -80,19 +80,19 @@ func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, own // CreateDeploymentBranchPolicy creates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#create-a-deployment-branch-policy // //meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } var policy *DeploymentBranchPolicy - resp, err := s.client.Do(ctx, req, &policy) + resp, err := s.client.Do(req, &policy) if err != nil { return nil, resp, err } @@ -102,19 +102,19 @@ func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, // UpdateDeploymentBranchPolicy updates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#update-a-deployment-branch-policy // //meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) - req, err := s.client.NewRequest("PUT", u, request) + req, err := s.client.NewRequest(ctx, "PUT", u, request) if err != nil { return nil, nil, err } var policy *DeploymentBranchPolicy - resp, err := s.client.Do(ctx, req, &policy) + resp, err := s.client.Do(req, &policy) if err != nil { return nil, resp, err } @@ -124,16 +124,16 @@ func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, // DeleteDeploymentBranchPolicy deletes a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#delete-a-deployment-branch-policy // //meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) DeleteDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_deployment_protection_rules.go b/vendor/github.com/google/go-github/v88/github/repos_deployment_protection_rules.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/repos_deployment_protection_rules.go rename to vendor/github.com/google/go-github/v88/github/repos_deployment_protection_rules.go index 3454f1f28..50c3901d7 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_deployment_protection_rules.go +++ b/vendor/github.com/google/go-github/v88/github/repos_deployment_protection_rules.go @@ -45,19 +45,19 @@ type CustomDeploymentProtectionRuleRequest struct { // GetAllDeploymentProtectionRules gets all the deployment protection rules for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#get-all-deployment-protection-rules-for-an-environment // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules func (s *RepositoriesService) GetAllDeploymentProtectionRules(ctx context.Context, owner, repo, environment string) (*ListDeploymentProtectionRuleResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules", owner, repo, environment) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var list *ListDeploymentProtectionRuleResponse - resp, err := s.client.Do(ctx, req, &list) + resp, err := s.client.Do(req, &list) if err != nil { return nil, resp, err } @@ -67,19 +67,19 @@ func (s *RepositoriesService) GetAllDeploymentProtectionRules(ctx context.Contex // CreateCustomDeploymentProtectionRule creates a custom deployment protection rule on an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#create-a-custom-deployment-protection-rule-on-an-environment // //meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules func (s *RepositoriesService) CreateCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, request *CustomDeploymentProtectionRuleRequest) (*CustomDeploymentProtectionRule, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules", owner, repo, environment) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - protectionRule := new(CustomDeploymentProtectionRule) - resp, err := s.client.Do(ctx, req, protectionRule) + var protectionRule *CustomDeploymentProtectionRule + resp, err := s.client.Do(req, &protectionRule) if err != nil { return nil, resp, err } @@ -89,7 +89,7 @@ func (s *RepositoriesService) CreateCustomDeploymentProtectionRule(ctx context.C // ListCustomDeploymentRuleIntegrations lists the custom deployment rule integrations for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#list-custom-deployment-rule-integrations-available-for-an-environment // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps func (s *RepositoriesService) ListCustomDeploymentRuleIntegrations(ctx context.Context, owner, repo, environment string, opts *ListOptions) (*ListCustomDeploymentRuleIntegrationsResponse, *Response, error) { @@ -99,13 +99,13 @@ func (s *RepositoriesService) ListCustomDeploymentRuleIntegrations(ctx context.C return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var list *ListCustomDeploymentRuleIntegrationsResponse - resp, err := s.client.Do(ctx, req, &list) + resp, err := s.client.Do(req, &list) if err != nil { return nil, resp, err } @@ -115,19 +115,19 @@ func (s *RepositoriesService) ListCustomDeploymentRuleIntegrations(ctx context.C // GetCustomDeploymentProtectionRule gets a custom deployment protection rule for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#get-a-custom-deployment-protection-rule // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} func (s *RepositoriesService) GetCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, protectionRuleID int64) (*CustomDeploymentProtectionRule, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules/%v", owner, repo, environment, protectionRuleID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var protectionRule *CustomDeploymentProtectionRule - resp, err := s.client.Do(ctx, req, &protectionRule) + resp, err := s.client.Do(req, &protectionRule) if err != nil { return nil, resp, err } @@ -137,16 +137,16 @@ func (s *RepositoriesService) GetCustomDeploymentProtectionRule(ctx context.Cont // DisableCustomDeploymentProtectionRule disables a custom deployment protection rule for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules?apiVersion=2022-11-28#disable-a-custom-protection-rule-for-an-environment // //meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} func (s *RepositoriesService) DisableCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, protectionRuleID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment_protection_rules/%v", owner, repo, environment, protectionRuleID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_deployments.go b/vendor/github.com/google/go-github/v88/github/repos_deployments.go similarity index 88% rename from vendor/github.com/google/go-github/v84/github/repos_deployments.go rename to vendor/github.com/google/go-github/v88/github/repos_deployments.go index 637067491..541436df5 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/v88/github/repos_deployments.go @@ -63,7 +63,7 @@ type DeploymentsListOptions struct { // ListDeployments lists the deployments of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#list-deployments +// GitHub API docs: https://docs.github.com/rest/deployments/deployments?apiVersion=2022-11-28#list-deployments // //meta:operation GET /repos/{owner}/{repo}/deployments func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opts *DeploymentsListOptions) ([]*Deployment, *Response, error) { @@ -73,13 +73,13 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var deployments []*Deployment - resp, err := s.client.Do(ctx, req, &deployments) + resp, err := s.client.Do(req, &deployments) if err != nil { return nil, resp, err } @@ -89,19 +89,19 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s // GetDeployment returns a single deployment of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#get-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments?apiVersion=2022-11-28#get-a-deployment // //meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id} func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - deployment := new(Deployment) - resp, err := s.client.Do(ctx, req, deployment) + var deployment *Deployment + resp, err := s.client.Do(req, &deployment) if err != nil { return nil, resp, err } @@ -111,13 +111,13 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str // CreateDeployment creates a new deployment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#create-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments?apiVersion=2022-11-28#create-a-deployment // //meta:operation POST /repos/{owner}/{repo}/deployments func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } @@ -125,8 +125,8 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - d := new(Deployment) - resp, err := s.client.Do(ctx, req, d) + var d *Deployment + resp, err := s.client.Do(req, &d) if err != nil { return nil, resp, err } @@ -136,16 +136,16 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo // DeleteDeployment deletes an existing deployment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#delete-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments?apiVersion=2022-11-28#delete-a-deployment // //meta:operation DELETE /repos/{owner}/{repo}/deployments/{deployment_id} func (s *RepositoriesService) DeleteDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeploymentStatus represents the status of a @@ -182,7 +182,7 @@ type DeploymentStatusRequest struct { // ListDeploymentStatuses lists the statuses of a given deployment of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses +// GitHub API docs: https://docs.github.com/rest/deployments/statuses?apiVersion=2022-11-28#list-deployment-statuses // //meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opts *ListOptions) ([]*DeploymentStatus, *Response, error) { @@ -192,7 +192,7 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -201,7 +201,7 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var statuses []*DeploymentStatus - resp, err := s.client.Do(ctx, req, &statuses) + resp, err := s.client.Do(req, &statuses) if err != nil { return nil, resp, err } @@ -211,13 +211,13 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, // GetDeploymentStatus returns a single deployment status of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses?apiVersion=2022-11-28#get-a-deployment-status // //meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int64) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses/%v", owner, repo, deploymentID, deploymentStatusID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -225,8 +225,8 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - d := new(DeploymentStatus) - resp, err := s.client.Do(ctx, req, d) + var d *DeploymentStatus + resp, err := s.client.Do(req, &d) if err != nil { return nil, resp, err } @@ -236,13 +236,13 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re // CreateDeploymentStatus creates a new status for a deployment. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses?apiVersion=2022-11-28#create-a-deployment-status // //meta:operation POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int64, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } @@ -250,8 +250,8 @@ func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, acceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - d := new(DeploymentStatus) - resp, err := s.client.Do(ctx, req, d) + var d *DeploymentStatus + resp, err := s.client.Do(req, &d) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_environments.go b/vendor/github.com/google/go-github/v88/github/repos_environments.go similarity index 90% rename from vendor/github.com/google/go-github/v84/github/repos_environments.go rename to vendor/github.com/google/go-github/v88/github/repos_environments.go index 7bc8394ac..74b5faf6f 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_environments.go +++ b/vendor/github.com/google/go-github/v88/github/repos_environments.go @@ -107,7 +107,7 @@ func (r *RequiredReviewer) UnmarshalJSON(data []byte) error { // ListEnvironments lists all environments for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#list-environments +// GitHub API docs: https://docs.github.com/rest/deployments/environments?apiVersion=2022-11-28#list-environments // //meta:operation GET /repos/{owner}/{repo}/environments func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) { @@ -117,13 +117,13 @@ func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var list *EnvResponse - resp, err := s.client.Do(ctx, req, &list) + resp, err := s.client.Do(req, &list) if err != nil { return nil, resp, err } @@ -132,19 +132,18 @@ func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo // GetEnvironment get a single environment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#get-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments?apiVersion=2022-11-28#get-an-environment // //meta:operation GET /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, name string) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v", owner, repo, name) - - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var env *Environment - resp, err := s.client.Do(ctx, req, &env) + resp, err := s.client.Do(req, &env) if err != nil { return nil, resp, err } @@ -154,8 +153,8 @@ func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, n // MarshalJSON implements the json.Marshaler interface. // As the only way to clear a WaitTimer is to set it to 0, a missing WaitTimer object should default to 0, not null. // As the default value for CanAdminsBypass is true, a nil value here marshals to true. -func (c *CreateUpdateEnvironment) MarshalJSON() ([]byte, error) { - type Alias CreateUpdateEnvironment +func (c CreateUpdateEnvironment) MarshalJSON() ([]byte, error) { + type alias CreateUpdateEnvironment if c.WaitTimer == nil { c.WaitTimer = Ptr(0) } @@ -163,9 +162,9 @@ func (c *CreateUpdateEnvironment) MarshalJSON() ([]byte, error) { c.CanAdminsBypass = Ptr(true) } return json.Marshal(&struct { - *Alias + alias }{ - Alias: (*Alias)(c), + alias: alias(c), }) } @@ -190,19 +189,18 @@ type createUpdateEnvironmentNoEnterprise struct { // CreateUpdateEnvironment create or update a new environment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments?apiVersion=2022-11-28#create-or-update-an-environment // //meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner, repo, name string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v", owner, repo, name) - - req, err := s.client.NewRequest("PUT", u, environment) + req, err := s.client.NewRequest(ctx, "PUT", u, environment) if err != nil { return nil, nil, err } - e := new(Environment) - resp, err := s.client.Do(ctx, req, e) + var e *Environment + resp, err := s.client.Do(req, &e) if err != nil { // The API returns 422 when the pricing plan doesn't support all the fields sent. // This path will be executed for Pro/Teams private repos. @@ -215,38 +213,40 @@ func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner } return nil, resp, err } + return e, resp, nil } // createNewEnvNoEnterprise is an internal function for cases where the original call returned 422. // Currently only the `deployment_branch_policy` parameter is supported for Pro/Team private repos. func (s *RepositoriesService) createNewEnvNoEnterprise(ctx context.Context, u string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { - req, err := s.client.NewRequest("PUT", u, &createUpdateEnvironmentNoEnterprise{ + req, err := s.client.NewRequest(ctx, "PUT", u, &createUpdateEnvironmentNoEnterprise{ DeploymentBranchPolicy: environment.DeploymentBranchPolicy, }) if err != nil { return nil, nil, err } - e := new(Environment) - resp, err := s.client.Do(ctx, req, e) + var e *Environment + resp, err := s.client.Do(req, &e) if err != nil { return nil, resp, err } + return e, resp, nil } // DeleteEnvironment delete an environment from a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#delete-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments?apiVersion=2022-11-28#delete-an-environment // //meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) DeleteEnvironment(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v", owner, repo, name) - - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_forks.go b/vendor/github.com/google/go-github/v88/github/repos_forks.go similarity index 82% rename from vendor/github.com/google/go-github/v84/github/repos_forks.go rename to vendor/github.com/google/go-github/v88/github/repos_forks.go index cffc87e9b..2e4ec16d7 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_forks.go +++ b/vendor/github.com/google/go-github/v88/github/repos_forks.go @@ -24,7 +24,7 @@ type RepositoryListForksOptions struct { // ListForks lists the forks of the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/forks#list-forks +// GitHub API docs: https://docs.github.com/rest/repos/forks?apiVersion=2022-11-28#list-forks // //meta:operation GET /repos/{owner}/{repo}/forks func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opts *RepositoryListForksOptions) ([]*Repository, *Response, error) { @@ -34,7 +34,7 @@ func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -42,7 +42,7 @@ func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, req.Header.Set("Accept", mediaTypeTopicsPreview) var repos []*Repository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -68,31 +68,31 @@ type RepositoryCreateForkOptions struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/repos/forks#create-a-fork +// GitHub API docs: https://docs.github.com/rest/repos/forks?apiVersion=2022-11-28#create-a-fork // //meta:operation POST /repos/{owner}/{repo}/forks func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - fork := new(Repository) - resp, err := s.client.Do(ctx, req, fork) + var fork Repository + resp, err := s.client.Do(req, &fork) if err != nil { // Persist AcceptedError's metadata to the Repository object. var aerr *AcceptedError if errors.As(err, &aerr) { - if err := json.Unmarshal(aerr.Raw, fork); err != nil { - return fork, resp, err + if err := json.Unmarshal(aerr.Raw, &fork); err != nil { + return &fork, resp, err } - return fork, resp, err + return &fork, resp, err } return nil, resp, err } - return fork, resp, nil + return &fork, resp, nil } diff --git a/vendor/github.com/google/go-github/v84/github/repos_hooks.go b/vendor/github.com/google/go-github/v88/github/repos_hooks.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/repos_hooks.go rename to vendor/github.com/google/go-github/v88/github/repos_hooks.go index bbadab800..9bdd8428b 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v88/github/repos_hooks.go @@ -80,7 +80,7 @@ type createHookRequest struct { // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#create-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { @@ -97,13 +97,13 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string Config: hook.Config, } - req, err := s.client.NewRequest("POST", u, hookReq) + req, err := s.client.NewRequest(ctx, "POST", u, hookReq) if err != nil { return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + var h *Hook + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -113,7 +113,7 @@ func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string // ListHooks lists all Hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#list-repository-webhooks // //meta:operation GET /repos/{owner}/{repo}/hooks func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) { @@ -123,13 +123,13 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var hooks []*Hook - resp, err := s.client.Do(ctx, req, &hooks) + resp, err := s.client.Do(req, &hooks) if err != nil { return nil, resp, err } @@ -139,17 +139,18 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#get-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + + var h *Hook + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -159,17 +160,18 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#update-a-repository-webhook // //meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v", owner, repo, id) - req, err := s.client.NewRequest("PATCH", u, hook) + req, err := s.client.NewRequest(ctx, "PATCH", u, hook) if err != nil { return nil, nil, err } - h := new(Hook) - resp, err := s.client.Do(ctx, req, h) + + var h *Hook + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -179,44 +181,45 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#delete-a-repository-webhook // //meta:operation DELETE /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v", owner, repo, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + + return s.client.Do(req, nil) } // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#ping-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/pings func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/pings", owner, repo, id) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // TestHook triggers a test Hook by github. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#test-the-push-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/tests func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/tests", owner, repo, id) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Subscribe lets servers register to receive updates when a topic is updated. @@ -225,12 +228,12 @@ func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, // //meta:operation POST /hub func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { - req, err := s.createWebSubRequest("subscribe", owner, repo, event, callback, secret) + req, err := s.createWebSubRequest(ctx, "subscribe", owner, repo, event, callback, secret) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Unsubscribe lets servers unregister to no longer receive updates when a topic is updated. @@ -239,19 +242,19 @@ func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, // //meta:operation POST /hub func (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { - req, err := s.createWebSubRequest("unsubscribe", owner, repo, event, callback, secret) + req, err := s.createWebSubRequest(ctx, "unsubscribe", owner, repo, event, callback, secret) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // createWebSubRequest returns a subscribe/unsubscribe request that implements // the WebSub (formerly PubSubHubbub) protocol. // // See: https://www.w3.org/TR/websub/#subscriber-sends-subscription-request -func (s *RepositoriesService) createWebSubRequest(hubMode, owner, repo, event, callback string, secret []byte) (*http.Request, error) { +func (s *RepositoriesService) createWebSubRequest(ctx context.Context, hubMode, owner, repo, event, callback string, secret []byte) (*http.Request, error) { topic := fmt.Sprintf( "https://github.com/%v/%v/events/%v", owner, @@ -267,7 +270,7 @@ func (s *RepositoriesService) createWebSubRequest(hubMode, owner, repo, event, c } body := strings.NewReader(form.Encode()) - req, err := s.client.NewFormRequest("hub", body) + req, err := s.client.NewFormRequest(ctx, "hub", body) if err != nil { return nil, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_hooks_configuration.go b/vendor/github.com/google/go-github/v88/github/repos_hooks_configuration.go similarity index 79% rename from vendor/github.com/google/go-github/v84/github/repos_hooks_configuration.go rename to vendor/github.com/google/go-github/v88/github/repos_hooks_configuration.go index 69d1f4060..37880922b 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_hooks_configuration.go +++ b/vendor/github.com/google/go-github/v88/github/repos_hooks_configuration.go @@ -27,18 +27,18 @@ type HookConfig struct { // GetHookConfiguration returns the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - config := new(HookConfig) - resp, err := s.client.Do(ctx, req, config) + var config *HookConfig + resp, err := s.client.Do(req, &config) if err != nil { return nil, resp, err } @@ -48,18 +48,18 @@ func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, r // EditHookConfiguration updates the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) - req, err := s.client.NewRequest("PATCH", u, config) + req, err := s.client.NewRequest(ctx, "PATCH", u, config) if err != nil { return nil, nil, err } - c := new(HookConfig) - resp, err := s.client.Do(ctx, req, c) + var c *HookConfig + resp, err := s.client.Do(req, &c) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v88/github/repos_hooks_deliveries.go similarity index 83% rename from vendor/github.com/google/go-github/v84/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v88/github/repos_hooks_deliveries.go index 526d82c6f..85b83e045 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v88/github/repos_hooks_deliveries.go @@ -15,8 +15,8 @@ import ( // HookDelivery represents the data that is received from GitHub's Webhook Delivery API // // GitHub API docs: -// - https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook -// - https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// - https://docs.github.com/rest/webhooks/repo-deliveries?apiVersion=2022-11-28#list-deliveries-for-a-repository-webhook +// - https://docs.github.com/rest/webhooks/repo-deliveries?apiVersion=2022-11-28#get-a-delivery-for-a-repository-webhook type HookDelivery struct { ID *int64 `json:"id,omitempty"` GUID *string `json:"guid,omitempty"` @@ -84,7 +84,7 @@ func (r HookResponse) String() string { // ListHookDeliveries lists webhook deliveries for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#list-deliveries-for-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { @@ -94,13 +94,13 @@ func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, rep return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } deliveries := []*HookDelivery{} - resp, err := s.client.Do(ctx, req, &deliveries) + resp, err := s.client.Do(req, &deliveries) if err != nil { return nil, resp, err } @@ -110,18 +110,18 @@ func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, rep // GetHookDelivery returns a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#get-a-delivery-for-a-repository-webhook // //meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v", owner, repo, hookID, deliveryID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -131,18 +131,18 @@ func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo s // RedeliverHookDelivery redelivers a delivery for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks?apiVersion=2022-11-28#redeliver-a-delivery-for-a-repository-webhook // //meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v/attempts", owner, repo, hookID, deliveryID) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - h := new(HookDelivery) - resp, err := s.client.Do(ctx, req, h) + var h *HookDelivery + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v88/github/repos_immutable_releases.go b/vendor/github.com/google/go-github/v88/github/repos_immutable_releases.go new file mode 100644 index 000000000..db91b6d02 --- /dev/null +++ b/vendor/github.com/google/go-github/v88/github/repos_immutable_releases.go @@ -0,0 +1,82 @@ +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// RepoImmutableReleasesStatus represents the immutable releases status for a repository. +type RepoImmutableReleasesStatus struct { + Enabled *bool `json:"enabled,omitempty"` + EnforcedByOwner *bool `json:"enforced_by_owner,omitempty"` +} + +// EnableImmutableReleases enables immutable releases for a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#enable-immutable-releases +// +//meta:operation PUT /repos/{owner}/{repo}/immutable-releases +func (s *RepositoriesService) EnableImmutableReleases(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/immutable-releases", owner, repo) + + req, err := s.client.NewRequest(ctx, "PUT", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// DisableImmutableReleases disables immutable releases for a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#disable-immutable-releases +// +//meta:operation DELETE /repos/{owner}/{repo}/immutable-releases +func (s *RepositoriesService) DisableImmutableReleases(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/immutable-releases", owner, repo) + + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// AreImmutableReleasesEnabled checks if immutable releases are enabled for +// the repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-immutable-releases-are-enabled-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/immutable-releases +func (s *RepositoriesService) AreImmutableReleasesEnabled(ctx context.Context, owner, repo string) (*RepoImmutableReleasesStatus, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/immutable-releases", owner, repo) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var status *RepoImmutableReleasesStatus + resp, err := s.client.Do(req, &status) + if err != nil { + return nil, resp, err + } + + return status, resp, nil +} diff --git a/vendor/github.com/google/go-github/v84/github/repos_invitations.go b/vendor/github.com/google/go-github/v88/github/repos_invitations.go similarity index 85% rename from vendor/github.com/google/go-github/v84/github/repos_invitations.go rename to vendor/github.com/google/go-github/v88/github/repos_invitations.go index 98fe01d1c..944610134 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_invitations.go +++ b/vendor/github.com/google/go-github/v88/github/repos_invitations.go @@ -28,7 +28,7 @@ type RepositoryInvitation struct { // ListInvitations lists all currently-open repository invitations. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#list-repository-invitations // //meta:operation GET /repos/{owner}/{repo}/invitations func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { @@ -38,13 +38,13 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } invites := []*RepositoryInvitation{} - resp, err := s.client.Do(ctx, req, &invites) + resp, err := s.client.Do(req, &invites) if err != nil { return nil, resp, err } @@ -54,17 +54,17 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s // DeleteInvitation deletes a repository invitation. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#delete-a-repository-invitation // //meta:operation DELETE /repos/{owner}/{repo}/invitations/{invitation_id} func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations/%v", owner, repo, invitationID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UpdateInvitation updates the permissions associated with a repository @@ -73,7 +73,7 @@ func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo // permissions represents the permissions that the associated user will have // on the repository. Possible values are: "read", "write", "admin". // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#update-a-repository-invitation // //meta:operation PATCH /repos/{owner}/{repo}/invitations/{invitation_id} func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) { @@ -81,13 +81,13 @@ func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo Permissions string `json:"permissions"` }{Permissions: permissions} u := fmt.Sprintf("repos/%v/%v/invitations/%v", owner, repo, invitationID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } - invite := &RepositoryInvitation{} - resp, err := s.client.Do(ctx, req, invite) + var invite *RepositoryInvitation + resp, err := s.client.Do(req, &invite) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_keys.go b/vendor/github.com/google/go-github/v88/github/repos_keys.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/repos_keys.go rename to vendor/github.com/google/go-github/v88/github/repos_keys.go index 0d050c803..0635c4a20 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_keys.go +++ b/vendor/github.com/google/go-github/v88/github/repos_keys.go @@ -14,7 +14,7 @@ import ( // ListKeys lists the deploy keys for a repository. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys?apiVersion=2022-11-28#list-deploy-keys // //meta:operation GET /repos/{owner}/{repo}/keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Key, *Response, error) { @@ -24,13 +24,13 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner, repo string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var keys []*Key - resp, err := s.client.Do(ctx, req, &keys) + resp, err := s.client.Do(req, &keys) if err != nil { return nil, resp, err } @@ -40,19 +40,19 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner, repo string, // GetKey fetches a single deploy key. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys?apiVersion=2022-11-28#get-a-deploy-key // //meta:operation GET /repos/{owner}/{repo}/keys/{key_id} func (s *RepositoriesService) GetKey(ctx context.Context, owner, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - key := new(Key) - resp, err := s.client.Do(ctx, req, key) + var key *Key + resp, err := s.client.Do(req, &key) if err != nil { return nil, resp, err } @@ -62,19 +62,19 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner, repo string, id // CreateKey adds a deploy key for a repository. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys?apiVersion=2022-11-28#create-a-deploy-key // //meta:operation POST /repos/{owner}/{repo}/keys func (s *RepositoriesService) CreateKey(ctx context.Context, owner, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) - req, err := s.client.NewRequest("POST", u, key) + req, err := s.client.NewRequest(ctx, "POST", u, key) if err != nil { return nil, nil, err } - k := new(Key) - resp, err := s.client.Do(ctx, req, k) + var k *Key + resp, err := s.client.Do(req, &k) if err != nil { return nil, resp, err } @@ -84,16 +84,16 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner, repo string, // DeleteKey deletes a deploy key. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys?apiVersion=2022-11-28#delete-a-deploy-key // //meta:operation DELETE /repos/{owner}/{repo}/keys/{key_id} func (s *RepositoriesService) DeleteKey(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_lfs.go b/vendor/github.com/google/go-github/v88/github/repos_lfs.go similarity index 77% rename from vendor/github.com/google/go-github/v84/github/repos_lfs.go rename to vendor/github.com/google/go-github/v88/github/repos_lfs.go index f0153c080..685e17b27 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_lfs.go +++ b/vendor/github.com/google/go-github/v88/github/repos_lfs.go @@ -12,18 +12,18 @@ import ( // EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#enable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs?apiVersion=2022-11-28#enable-git-lfs-for-a-repository // //meta:operation PUT /repos/{owner}/{repo}/lfs func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -33,18 +33,18 @@ func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) // DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#disable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs?apiVersion=2022-11-28#disable-git-lfs-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/lfs func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_merging.go b/vendor/github.com/google/go-github/v88/github/repos_merging.go similarity index 84% rename from vendor/github.com/google/go-github/v84/github/repos_merging.go rename to vendor/github.com/google/go-github/v88/github/repos_merging.go index b26e5da1a..2ec93ebc1 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_merging.go +++ b/vendor/github.com/google/go-github/v88/github/repos_merging.go @@ -34,18 +34,18 @@ type RepoMergeUpstreamResult struct { // Merge a branch in the specified repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#merge-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#merge-a-branch // //meta:operation POST /repos/{owner}/{repo}/merges func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merges", owner, repo) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - commit := new(RepositoryCommit) - resp, err := s.client.Do(ctx, req, commit) + var commit *RepositoryCommit + resp, err := s.client.Do(req, &commit) if err != nil { return nil, resp, err } @@ -56,18 +56,18 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req // MergeUpstream syncs a branch of a forked repository to keep it up-to-date // with the upstream repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#sync-a-fork-branch-with-the-upstream-repository // //meta:operation POST /repos/{owner}/{repo}/merge-upstream func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merge-upstream", owner, repo) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } - result := new(RepoMergeUpstreamResult) - resp, err := s.client.Do(ctx, req, result) + var result *RepoMergeUpstreamResult + resp, err := s.client.Do(req, &result) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_pages.go b/vendor/github.com/google/go-github/v88/github/repos_pages.go similarity index 83% rename from vendor/github.com/google/go-github/v84/github/repos_pages.go rename to vendor/github.com/google/go-github/v88/github/repos_pages.go index 92110f598..9064bcf65 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_pages.go +++ b/vendor/github.com/google/go-github/v88/github/repos_pages.go @@ -104,7 +104,7 @@ type createPagesRequest struct { // EnablePages enables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#create-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#create-a-github-pages-site // //meta:operation POST /repos/{owner}/{repo}/pages func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { @@ -119,15 +119,15 @@ func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo strin Source: pages.Source, } - req, err := s.client.NewRequest("POST", u, pagesReq) + req, err := s.client.NewRequest(ctx, "POST", u, pagesReq) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeEnablePagesAPIPreview) - enable := new(Pages) - resp, err := s.client.Do(ctx, req, enable) + var enable *Pages + resp, err := s.client.Do(req, &enable) if err != nil { return nil, resp, err } @@ -160,18 +160,18 @@ type PagesUpdate struct { // UpdatePages updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#update-information-about-a-github-pages-site // //meta:operation PUT /repos/{owner}/{repo}/pages func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -189,18 +189,18 @@ type PagesUpdateWithoutCNAME struct { // UpdatePagesGHES updates GitHub Pages for the named repo in GitHub Enterprise Servers. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#update-information-about-a-github-pages-site // //meta:operation PUT /repos/{owner}/{repo}/pages func (s *RepositoriesService) UpdatePagesGHES(ctx context.Context, owner, repo string, opts *PagesUpdateWithoutCNAME) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } @@ -209,35 +209,35 @@ func (s *RepositoriesService) UpdatePagesGHES(ctx context.Context, owner, repo s // DisablePages disables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#delete-a-github-pages-site // //meta:operation DELETE /repos/{owner}/{repo}/pages func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeEnablePagesAPIPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // GetPagesInfo fetches information about a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#get-a-github-pages-site // //meta:operation GET /repos/{owner}/{repo}/pages func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - site := new(Pages) - resp, err := s.client.Do(ctx, req, site) + var site *Pages + resp, err := s.client.Do(req, &site) if err != nil { return nil, resp, err } @@ -247,7 +247,7 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri // ListPagesBuilds lists the builds for a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#list-github-pages-builds +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#list-github-pages-builds // //meta:operation GET /repos/{owner}/{repo}/pages/builds func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) { @@ -257,13 +257,13 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var pages []*PagesBuild - resp, err := s.client.Do(ctx, req, &pages) + resp, err := s.client.Do(req, &pages) if err != nil { return nil, resp, err } @@ -273,18 +273,18 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-latest-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#get-latest-pages-build // //meta:operation GET /repos/{owner}/{repo}/pages/builds/latest func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - build := new(PagesBuild) - resp, err := s.client.Do(ctx, req, build) + var build *PagesBuild + resp, err := s.client.Do(req, &build) if err != nil { return nil, resp, err } @@ -294,18 +294,18 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#get-github-pages-build // //meta:operation GET /repos/{owner}/{repo}/pages/builds/{build_id} func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - build := new(PagesBuild) - resp, err := s.client.Do(ctx, req, build) + var build *PagesBuild + resp, err := s.client.Do(req, &build) if err != nil { return nil, resp, err } @@ -315,18 +315,18 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#request-a-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#request-a-github-pages-build // //meta:operation POST /repos/{owner}/{repo}/pages/builds func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, nil, err } - build := new(PagesBuild) - resp, err := s.client.Do(ctx, req, build) + var build *PagesBuild + resp, err := s.client.Do(req, &build) if err != nil { return nil, resp, err } @@ -336,18 +336,18 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo // GetPageHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages +// GitHub API docs: https://docs.github.com/rest/pages/pages?apiVersion=2022-11-28#get-a-dns-health-check-for-github-pages // //meta:operation GET /repos/{owner}/{repo}/pages/health func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/health", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - healthCheckResponse := new(PagesHealthCheckResponse) - resp, err := s.client.Do(ctx, req, healthCheckResponse) + var healthCheckResponse *PagesHealthCheckResponse + resp, err := s.client.Do(req, &healthCheckResponse) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v88/github/repos_prereceive_hooks.go similarity index 82% rename from vendor/github.com/google/go-github/v84/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v88/github/repos_prereceive_hooks.go index eec1360c8..7119fd60e 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_prereceive_hooks.go +++ b/vendor/github.com/google/go-github/v88/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -34,7 +34,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -42,7 +42,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re req.Header.Set("Accept", mediaTypePreReceiveHooksPreview) var hooks []*PreReceiveHook - resp, err := s.client.Do(ctx, req, &hooks) + resp, err := s.client.Do(req, &hooks) if err != nil { return nil, resp, err } @@ -52,20 +52,20 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypePreReceiveHooksPreview) - h := new(PreReceiveHook) - resp, err := s.client.Do(ctx, req, h) + var h *PreReceiveHook + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -75,20 +75,20 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%v", owner, repo, id) - req, err := s.client.NewRequest("PATCH", u, hook) + req, err := s.client.NewRequest(ctx, "PATCH", u, hook) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypePreReceiveHooksPreview) - h := new(PreReceiveHook) - resp, err := s.client.Do(ctx, req, h) + var h *PreReceiveHook + resp, err := s.client.Do(req, &h) if err != nil { return nil, resp, err } @@ -98,17 +98,17 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%v", owner, repo, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypePreReceiveHooksPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_properties.go b/vendor/github.com/google/go-github/v88/github/repos_properties.go similarity index 80% rename from vendor/github.com/google/go-github/v84/github/repos_properties.go rename to vendor/github.com/google/go-github/v88/github/repos_properties.go index 5b12bc8b3..11be33bc9 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_properties.go +++ b/vendor/github.com/google/go-github/v88/github/repos_properties.go @@ -12,19 +12,19 @@ import ( // GetAllCustomPropertyValues gets all custom property values that are set for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/custom-properties?apiVersion=2022-11-28#get-all-custom-property-values-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/properties/values func (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, org, repo string) ([]*CustomPropertyValue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/properties/values", org, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var customPropertyValues []*CustomPropertyValue - resp, err := s.client.Do(ctx, req, &customPropertyValues) + resp, err := s.client.Do(req, &customPropertyValues) if err != nil { return nil, resp, err } @@ -34,7 +34,7 @@ func (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, or // CreateOrUpdateCustomProperties creates new or updates existing custom property values for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/custom-properties?apiVersion=2022-11-28#create-or-update-custom-property-values-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/properties/values func (s *RepositoriesService) CreateOrUpdateCustomProperties(ctx context.Context, org, repo string, customPropertyValues []*CustomPropertyValue) (*Response, error) { @@ -46,12 +46,12 @@ func (s *RepositoriesService) CreateOrUpdateCustomProperties(ctx context.Context Properties: customPropertyValues, } - req, err := s.client.NewRequest("PATCH", u, params) + req, err := s.client.NewRequest(ctx, "PATCH", u, params) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_releases.go b/vendor/github.com/google/go-github/v88/github/repos_releases.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/repos_releases.go rename to vendor/github.com/google/go-github/v88/github/repos_releases.go index ba35d8041..cedd0a7e4 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_releases.go +++ b/vendor/github.com/google/go-github/v88/github/repos_releases.go @@ -90,7 +90,7 @@ func (r ReleaseAsset) String() string { // ListReleases lists the releases for a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#list-releases +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#list-releases // //meta:operation GET /repos/{owner}/{repo}/releases func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryRelease, *Response, error) { @@ -100,13 +100,13 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var releases []*RepositoryRelease - resp, err := s.client.Do(ctx, req, &releases) + resp, err := s.client.Do(req, &releases) if err != nil { return nil, resp, err } @@ -115,7 +115,7 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri // GetRelease fetches a single release. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#get-a-release // //meta:operation GET /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) { @@ -125,7 +125,7 @@ func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string // GetLatestRelease fetches the latest published release for the repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-the-latest-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release // //meta:operation GET /repos/{owner}/{repo}/releases/latest func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) { @@ -135,7 +135,7 @@ func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo // GetReleaseByTag fetches a release with the specified tag. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#get-a-release-by-tag-name // //meta:operation GET /repos/{owner}/{repo}/releases/tags/{tag} func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error) { @@ -145,18 +145,18 @@ func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, // GenerateReleaseNotes generates the release notes for the given tag. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#generate-release-notes-content-for-a-release // //meta:operation POST /repos/{owner}/{repo}/releases/generate-notes func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/generate-notes", owner, repo) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - r := new(RepositoryReleaseNotes) - resp, err := s.client.Do(ctx, req, r) + var r *RepositoryReleaseNotes + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } @@ -165,16 +165,17 @@ func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, r } func (s *RepositoriesService) getSingleRelease(ctx context.Context, url string) (*RepositoryRelease, *Response, error) { - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - release := new(RepositoryRelease) - resp, err := s.client.Do(ctx, req, release) + var release *RepositoryRelease + resp, err := s.client.Do(req, &release) if err != nil { return nil, resp, err } + return release, resp, nil } @@ -201,7 +202,7 @@ type repositoryReleaseRequest struct { // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#create-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#create-a-release // //meta:operation POST /repos/{owner}/{repo}/releases func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { @@ -223,16 +224,17 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str GenerateReleaseNotes: release.GenerateReleaseNotes, } - req, err := s.client.NewRequest("POST", u, releaseReq) + req, err := s.client.NewRequest(ctx, "POST", u, releaseReq) if err != nil { return nil, nil, err } - r := new(RepositoryRelease) - resp, err := s.client.Do(ctx, req, r) + var r *RepositoryRelease + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } + return r, resp, nil } @@ -241,7 +243,7 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#update-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#update-a-release // //meta:operation PATCH /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { @@ -262,37 +264,38 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin DiscussionCategoryName: release.DiscussionCategoryName, } - req, err := s.client.NewRequest("PATCH", u, releaseReq) + req, err := s.client.NewRequest(ctx, "PATCH", u, releaseReq) if err != nil { return nil, nil, err } - r := new(RepositoryRelease) - resp, err := s.client.Do(ctx, req, r) + var r *RepositoryRelease + resp, err := s.client.Do(req, &r) if err != nil { return nil, resp, err } + return r, resp, nil } // DeleteRelease delete a single release from a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#delete-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases?apiVersion=2022-11-28#delete-a-release // //meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v", owner, repo, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListReleaseAssets lists the release's assets. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#list-release-assets +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#list-release-assets // //meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*ReleaseAsset, *Response, error) { @@ -302,13 +305,13 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var assets []*ReleaseAsset - resp, err := s.client.Do(ctx, req, &assets) + resp, err := s.client.Do(req, &assets) if err != nil { return nil, resp, err } @@ -317,22 +320,23 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo // GetReleaseAsset fetches a single release asset. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#get-a-release-asset // //meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int64) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/assets/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - asset := new(ReleaseAsset) - resp, err := s.client.Do(ctx, req, asset) + var asset *ReleaseAsset + resp, err := s.client.Do(req, &asset) if err != nil { return nil, resp, err } + return asset, resp, nil } @@ -349,56 +353,46 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // it's necessary to pass an http.Client that performs authenticated requests. // If nil is passed the redirectURL will be returned instead. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#get-a-release-asset // //meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) { u := fmt.Sprintf("repos/%v/%v/releases/assets/%v", owner, repo, id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, "", err } req.Header.Set("Accept", defaultMediaType) - s.client.clientMu.Lock() - defer s.client.clientMu.Unlock() - - var loc string - saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { - loc = req.URL.String() - return errors.New("disable redirect") + loc, resp, err := s.client.bareDoUntilFound(req, 10) + if err != nil { + return nil, "", err } - defer func() { s.client.client.CheckRedirect = saveRedirect }() - req = withContext(ctx, req) - resp, err := s.client.client.Do(req) - if err != nil { - if !strings.Contains(err.Error(), "disable redirect") { - return nil, "", err - } - if followRedirectsClient != nil { - rc, err := s.downloadReleaseAssetFromURL(ctx, followRedirectsClient, loc) - return rc, "", err - } - return nil, loc, nil // Intentionally return no error with valid redirect URL. + // No redirect, stream the response body directly. + if loc == nil { + return resp.Body, "", nil } - if err := CheckResponse(resp); err != nil { - _ = resp.Body.Close() - return nil, "", err + // Close body as it's not needed when following redirects or returning the redirect URL. + _ = resp.Body.Close() + + // Got a redirect URL. + redirectStr := loc.String() + if followRedirectsClient != nil { + rc, err := s.downloadReleaseAssetFromURL(ctx, followRedirectsClient, redirectStr) + return rc, "", err } - return resp.Body, "", nil + return nil, redirectStr, nil } func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, followRedirectsClient *http.Client, url string) (rc io.ReadCloser, err error) { - req, err := http.NewRequest("GET", url, nil) + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, err } - req = withContext(ctx, req) req.Header.Set("Accept", defaultMediaType) resp, err := followRedirectsClient.Do(req) if err != nil { @@ -413,44 +407,45 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f // EditReleaseAsset edits a repository release asset. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#update-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#update-a-release-asset // //meta:operation PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int64, release *ReleaseAsset) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/assets/%v", owner, repo, id) - req, err := s.client.NewRequest("PATCH", u, release) + req, err := s.client.NewRequest(ctx, "PATCH", u, release) if err != nil { return nil, nil, err } - asset := new(ReleaseAsset) - resp, err := s.client.Do(ctx, req, asset) + var asset *ReleaseAsset + resp, err := s.client.Do(req, &asset) if err != nil { return nil, resp, err } + return asset, resp, nil } // DeleteReleaseAsset delete a single release asset from a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#delete-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#delete-a-release-asset // //meta:operation DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/assets/%v", owner, repo, id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UploadReleaseAsset creates an asset by uploading a file into a release repository. // To upload assets that cannot be represented by an os.File, call NewUploadRequest directly. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset // //meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) { @@ -477,16 +472,17 @@ func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, rep mediaType = opts.MediaType } - req, err := s.client.NewUploadRequest(u, file, stat.Size(), mediaType) + req, err := s.client.NewUploadRequest(ctx, u, file, stat.Size(), mediaType) if err != nil { return nil, nil, err } - asset := new(ReleaseAsset) - resp, err := s.client.Do(ctx, req, asset) + var asset *ReleaseAsset + resp, err := s.client.Do(req, &asset) if err != nil { return nil, resp, err } + return asset, resp, nil } @@ -497,7 +493,7 @@ func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, rep // templated like "https://uploads.github.com/.../assets{?name,label}") and uploads // the provided data (reader + size) using the existing upload helpers. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset // //meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) UploadReleaseAssetFromRelease( @@ -550,15 +546,16 @@ func (s *RepositoriesService) UploadReleaseAssetFromRelease( } } - req, err := s.client.NewUploadRequest(u, reader, size, mediaType) + req, err := s.client.NewUploadRequest(ctx, u, reader, size, mediaType) if err != nil { return nil, nil, err } - asset := new(ReleaseAsset) - resp, err := s.client.Do(ctx, req, asset) + var asset *ReleaseAsset + resp, err := s.client.Do(req, &asset) if err != nil { return nil, resp, err } + return asset, resp, nil } diff --git a/vendor/github.com/google/go-github/v88/github/repos_rules.go b/vendor/github.com/google/go-github/v88/github/repos_rules.go new file mode 100644 index 000000000..ddf8929e2 --- /dev/null +++ b/vendor/github.com/google/go-github/v88/github/repos_rules.go @@ -0,0 +1,300 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" + "iter" +) + +// ListRulesForBranch gets all the repository rules that apply to the specified branch. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#get-rules-for-a-branch +// +//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} +func (s *RepositoriesService) ListRulesForBranch(ctx context.Context, owner, repo, branch string, opts *ListOptions) (*BranchRules, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var rules *BranchRules + resp, err := s.client.Do(req, &rules) + if err != nil { + return nil, resp, err + } + + return rules, resp, nil +} + +// ListRulesForBranchIter returns an iterator that paginates through all results of ListRulesForBranch. +// +// Note that since [BranchRules] contains a large number of slices, this iterator +// returns type `any` and it is therefore the responsibility of the caller to perform a +// type switch to determine what item is being returned for each iteration. +func (s *RepositoriesService) ListRulesForBranchIter(ctx context.Context, owner, repo, branch string, opts *ListOptions) iter.Seq2[any, error] { + return func(yield func(any, error) bool) { + // Create a copy of opts to avoid mutating the caller's struct + if opts == nil { + opts = &ListOptions{} + } else { + opts = Ptr(*opts) + } + + for { + results, resp, err := s.ListRulesForBranch(ctx, owner, repo, branch, opts) + if err != nil { + yield(nil, err) + return + } + + // Now iterate through ALL possible results from [BranchRules]. + for _, item := range results.Creation { + if !yield(item, nil) { + return + } + } + for _, item := range results.Update { + if !yield(item, nil) { + return + } + } + for _, item := range results.Deletion { + if !yield(item, nil) { + return + } + } + for _, item := range results.RequiredLinearHistory { + if !yield(item, nil) { + return + } + } + for _, item := range results.MergeQueue { + if !yield(item, nil) { + return + } + } + for _, item := range results.RequiredDeployments { + if !yield(item, nil) { + return + } + } + for _, item := range results.RequiredSignatures { + if !yield(item, nil) { + return + } + } + for _, item := range results.PullRequest { + if !yield(item, nil) { + return + } + } + for _, item := range results.RequiredStatusChecks { + if !yield(item, nil) { + return + } + } + for _, item := range results.NonFastForward { + if !yield(item, nil) { + return + } + } + for _, item := range results.CommitMessagePattern { + if !yield(item, nil) { + return + } + } + for _, item := range results.CommitAuthorEmailPattern { + if !yield(item, nil) { + return + } + } + for _, item := range results.CommitterEmailPattern { + if !yield(item, nil) { + return + } + } + for _, item := range results.BranchNamePattern { + if !yield(item, nil) { + return + } + } + for _, item := range results.TagNamePattern { + if !yield(item, nil) { + return + } + } + for _, item := range results.Workflows { + if !yield(item, nil) { + return + } + } + for _, item := range results.CodeScanning { + if !yield(item, nil) { + return + } + } + for _, item := range results.CopilotCodeReview { + if !yield(item, nil) { + return + } + } + for _, item := range results.FileExtensionRestriction { + if !yield(item, nil) { + return + } + } + for _, item := range results.FilePathRestriction { + if !yield(item, nil) { + return + } + } + for _, item := range results.MaxFilePathLength { + if !yield(item, nil) { + return + } + } + for _, item := range results.MaxFileSize { + if !yield(item, nil) { + return + } + } + + if resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + } +} + +// RepositoryListRulesetsOptions specifies optional parameters to the +// RepositoriesService.GetAllRulesets method. +type RepositoryListRulesetsOptions struct { + // IncludesParents indicates whether to include rulesets configured at the organization or enterprise level that apply to the repository. + IncludesParents *bool `url:"includes_parents,omitempty"` + ListOptions +} + +// GetAllRulesets gets all the repository rulesets for the specified repository. +// By default, this endpoint will include rulesets configured at the organization or enterprise level that apply to the repository. +// To exclude those rulesets, set the `RepositoryListRulesetsOptions.IncludesParents` parameter to `false`. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#get-all-repository-rulesets +// +//meta:operation GET /repos/{owner}/{repo}/rulesets +func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, opts *RepositoryListRulesetsOptions) ([]*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset []*RepositoryRuleset + resp, err := s.client.Do(req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// CreateRuleset creates a repository ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#create-a-repository-ruleset +// +//meta:operation POST /repos/{owner}/{repo}/rulesets +func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) + + req, err := s.client.NewRequest(ctx, "POST", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// GetRuleset gets a repository ruleset for the specified repository. +// If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#get-a-repository-ruleset +// +//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) + + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset *RepositoryRuleset + resp, err := s.client.Do(req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateRuleset updates a repository ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + req, err := s.client.NewRequest(ctx, "PUT", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// DeleteRuleset deletes a repository ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#delete-a-repository-ruleset +// +//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} diff --git a/vendor/github.com/google/go-github/v84/github/repos_stats.go b/vendor/github.com/google/go-github/v88/github/repos_stats.go similarity index 90% rename from vendor/github.com/google/go-github/v84/github/repos_stats.go rename to vendor/github.com/google/go-github/v88/github/repos_stats.go index b05bae6da..8234886f0 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_stats.go +++ b/vendor/github.com/google/go-github/v88/github/repos_stats.go @@ -45,18 +45,18 @@ func (w WeeklyStats) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-all-contributor-commit-activity // //meta:operation GET /repos/{owner}/{repo}/stats/contributors func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/contributors", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var contributorStats []*ContributorStats - resp, err := s.client.Do(ctx, req, &contributorStats) + resp, err := s.client.Do(req, &contributorStats) if err != nil { return nil, resp, err } @@ -86,18 +86,18 @@ func (w WeeklyCommitActivity) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-the-last-year-of-commit-activity // //meta:operation GET /repos/{owner}/{repo}/stats/commit_activity func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/commit_activity", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var weeklyCommitActivity []*WeeklyCommitActivity - resp, err := s.client.Do(ctx, req, &weeklyCommitActivity) + resp, err := s.client.Do(req, &weeklyCommitActivity) if err != nil { return nil, resp, err } @@ -115,18 +115,18 @@ func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, rep // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-the-weekly-commit-activity // //meta:operation GET /repos/{owner}/{repo}/stats/code_frequency func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/code_frequency", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var weeks [][]int - resp, err := s.client.Do(ctx, req, &weeks) + resp, err := s.client.Do(req, &weeks) if err != nil { return nil, resp, err } @@ -173,18 +173,18 @@ func (r RepositoryParticipation) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-the-weekly-commit-count // //meta:operation GET /repos/{owner}/{repo}/stats/participation func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/participation", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - participation := new(RepositoryParticipation) - resp, err := s.client.Do(ctx, req, participation) + var participation *RepositoryParticipation + resp, err := s.client.Do(req, &participation) if err != nil { return nil, resp, err } @@ -208,18 +208,18 @@ type PunchCard struct { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +// GitHub API docs: https://docs.github.com/rest/metrics/statistics?apiVersion=2022-11-28#get-the-hourly-commit-count-for-each-day // //meta:operation GET /repos/{owner}/{repo}/stats/punch_card func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/punch_card", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var results [][]int - resp, err := s.client.Do(ctx, req, &results) + resp, err := s.client.Do(req, &results) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_statuses.go b/vendor/github.com/google/go-github/v88/github/repos_statuses.go similarity index 88% rename from vendor/github.com/google/go-github/v84/github/repos_statuses.go rename to vendor/github.com/google/go-github/v88/github/repos_statuses.go index 547cc1f12..2b845b1a4 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_statuses.go +++ b/vendor/github.com/google/go-github/v88/github/repos_statuses.go @@ -45,7 +45,7 @@ func (r RepoStatus) String() string { // ListStatuses lists the statuses of a repository at the specified // reference. The ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses?apiVersion=2022-11-28#list-commit-statuses-for-a-reference // //meta:operation GET /repos/{owner}/{repo}/commits/{ref}/statuses func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) { @@ -55,13 +55,13 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var statuses []*RepoStatus - resp, err := s.client.Do(ctx, req, &statuses) + resp, err := s.client.Do(req, &statuses) if err != nil { return nil, resp, err } @@ -72,18 +72,18 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // CreateStatus creates a new status for a repository at the specified // reference. The ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#create-a-commit-status +// GitHub API docs: https://docs.github.com/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status // //meta:operation POST /repos/{owner}/{repo}/statuses/{sha} func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status RepoStatus) (*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, refURLEscape(ref)) - req, err := s.client.NewRequest("POST", u, &status) + req, err := s.client.NewRequest(ctx, "POST", u, &status) if err != nil { return nil, nil, err } - repoStatus := new(RepoStatus) - resp, err := s.client.Do(ctx, req, repoStatus) + var repoStatus *RepoStatus + resp, err := s.client.Do(req, &repoStatus) if err != nil { return nil, resp, err } @@ -113,7 +113,7 @@ func (s CombinedStatus) String() string { // GetCombinedStatus returns the combined status of a repository at the specified // reference. The ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses?apiVersion=2022-11-28#get-the-combined-status-for-a-specific-reference // //meta:operation GET /repos/{owner}/{repo}/commits/{ref}/status func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) { @@ -123,13 +123,13 @@ func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - status := new(CombinedStatus) - resp, err := s.client.Do(ctx, req, status) + var status *CombinedStatus + resp, err := s.client.Do(req, &status) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/repos_tags.go b/vendor/github.com/google/go-github/v88/github/repos_tags.go similarity index 82% rename from vendor/github.com/google/go-github/v84/github/repos_tags.go rename to vendor/github.com/google/go-github/v88/github/repos_tags.go index 07f9e3aa9..a45e76cc5 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_tags.go +++ b/vendor/github.com/google/go-github/v88/github/repos_tags.go @@ -24,7 +24,7 @@ type tagProtectionRequest struct { // ListTagProtection lists tag protection of the specified repository. // -// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#get-all-repository-rulesets // // GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository // @@ -32,13 +32,13 @@ type tagProtectionRequest struct { func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var tagProtections []*TagProtection - resp, err := s.client.Do(ctx, req, &tagProtections) + resp, err := s.client.Do(req, &tagProtections) if err != nil { return nil, resp, err } @@ -48,7 +48,7 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo // CreateTagProtection creates the tag protection of the specified repository. // -// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#create-a-repository-ruleset // // GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository // @@ -56,13 +56,13 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) r := &tagProtectionRequest{Pattern: pattern} - req, err := s.client.NewRequest("POST", u, r) + req, err := s.client.NewRequest(ctx, "POST", u, r) if err != nil { return nil, nil, err } - tagProtection := new(TagProtection) - resp, err := s.client.Do(ctx, req, tagProtection) + var tagProtection *TagProtection + resp, err := s.client.Do(req, &tagProtection) if err != nil { return nil, resp, err } @@ -72,17 +72,17 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re // DeleteTagProtection deletes a tag protection from the specified repository. // -// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +// Deprecated: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules?apiVersion=2022-11-28#delete-a-repository-ruleset // // GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection/%v", owner, repo, tagProtectionID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/repos_traffic.go b/vendor/github.com/google/go-github/v88/github/repos_traffic.go similarity index 86% rename from vendor/github.com/google/go-github/v84/github/repos_traffic.go rename to vendor/github.com/google/go-github/v88/github/repos_traffic.go index ae2f1a86b..b67af094b 100644 --- a/vendor/github.com/google/go-github/v84/github/repos_traffic.go +++ b/vendor/github.com/google/go-github/v88/github/repos_traffic.go @@ -54,19 +54,19 @@ type TrafficBreakdownOptions struct { // ListTrafficReferrers list the top 10 referrers over the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources +// GitHub API docs: https://docs.github.com/rest/metrics/traffic?apiVersion=2022-11-28#get-top-referral-sources // //meta:operation GET /repos/{owner}/{repo}/traffic/popular/referrers func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/referrers", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var trafficReferrers []*TrafficReferrer - resp, err := s.client.Do(ctx, req, &trafficReferrers) + resp, err := s.client.Do(req, &trafficReferrers) if err != nil { return nil, resp, err } @@ -76,19 +76,19 @@ func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, r // ListTrafficPaths list the top 10 popular content over the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths +// GitHub API docs: https://docs.github.com/rest/metrics/traffic?apiVersion=2022-11-28#get-top-referral-paths // //meta:operation GET /repos/{owner}/{repo}/traffic/popular/paths func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/paths", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var paths []*TrafficPath - resp, err := s.client.Do(ctx, req, &paths) + resp, err := s.client.Do(req, &paths) if err != nil { return nil, resp, err } @@ -98,7 +98,7 @@ func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo // ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-page-views +// GitHub API docs: https://docs.github.com/rest/metrics/traffic?apiVersion=2022-11-28#get-page-views // //meta:operation GET /repos/{owner}/{repo}/traffic/views func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficViews, *Response, error) { @@ -108,13 +108,13 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - trafficViews := new(TrafficViews) - resp, err := s.client.Do(ctx, req, &trafficViews) + var trafficViews *TrafficViews + resp, err := s.client.Do(req, &trafficViews) if err != nil { return nil, resp, err } @@ -124,7 +124,7 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-repository-clones +// GitHub API docs: https://docs.github.com/rest/metrics/traffic?apiVersion=2022-11-28#get-repository-clones // //meta:operation GET /repos/{owner}/{repo}/traffic/clones func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) { @@ -134,13 +134,13 @@ func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - trafficClones := new(TrafficClones) - resp, err := s.client.Do(ctx, req, &trafficClones) + var trafficClones *TrafficClones + resp, err := s.client.Do(req, &trafficClones) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/rules.go b/vendor/github.com/google/go-github/v88/github/rules.go similarity index 98% rename from vendor/github.com/google/go-github/v84/github/rules.go rename to vendor/github.com/google/go-github/v88/github/rules.go index d4e94edc2..93ccf95ad 100644 --- a/vendor/github.com/google/go-github/v84/github/rules.go +++ b/vendor/github.com/google/go-github/v88/github/rules.go @@ -8,6 +8,7 @@ package github import ( "encoding/json" "fmt" + "strconv" ) // RulesetTarget represents a GitHub ruleset target. @@ -486,6 +487,37 @@ type RulesetReviewer struct { Type *RulesetReviewerType `json:"type,omitempty"` } +// UnmarshalJSON is a custom JSON unmarshaler for RulesetReviewer. +func (r *RulesetReviewer) UnmarshalJSON(data []byte) error { + var aux struct { + ID any `json:"id,omitempty"` + Type *RulesetReviewerType `json:"type,omitempty"` + } + + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + + r.Type = aux.Type + + if aux.ID != nil { + switch id := aux.ID.(type) { + case float64: + r.ID = Ptr(int64(id)) + case string: + i, err := strconv.ParseInt(id, 10, 64) + if err != nil { + return err + } + r.ID = &i + default: + return fmt.Errorf("unexpected type for reviewer.ID: %T", id) + } + } + + return nil +} + // RequiredStatusChecksRuleParameters represents the required status checks rule parameters. type RequiredStatusChecksRuleParameters struct { DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` @@ -579,7 +611,7 @@ type repositoryRulesetRuleWrapper struct { } // MarshalJSON is a custom JSON marshaler for RulesetRules. -func (r *RepositoryRulesetRules) MarshalJSON() ([]byte, error) { +func (r RepositoryRulesetRules) MarshalJSON() ([]byte, error) { var rawRules []json.RawMessage if r.Creation != nil { diff --git a/vendor/github.com/google/go-github/v84/github/scim.go b/vendor/github.com/google/go-github/v88/github/scim.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/scim.go rename to vendor/github.com/google/go-github/v88/github/scim.go index 8e89796a4..f82b6bc38 100644 --- a/vendor/github.com/google/go-github/v84/github/scim.go +++ b/vendor/github.com/google/go-github/v88/github/scim.go @@ -14,12 +14,12 @@ import ( // SCIMService provides access to SCIM related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/rest/scim +// GitHub API docs: https://docs.github.com/rest/scim?apiVersion=2022-11-28 type SCIMService service // SCIMUserAttributes represents supported SCIM User attributes. // -// GitHub Enterprise Cloud API docs: https://docs.github.com/rest/scim#supported-scim-user-attributes +// GitHub Enterprise Cloud API docs: https://docs.github.com/rest/scim?apiVersion=2022-11-28#supported-scim-user-attributes // GitHub Enterprise Server API docs: https://docs.github.com/en/enterprise-server@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#supported-scim-user-attributes type SCIMUserAttributes struct { UserName string `json:"userName"` // Configured by the admin. Could be an email, login, or username. (Required.) @@ -95,7 +95,7 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#list-scim-provisioned-identities // //meta:operation GET /scim/v2/organizations/{org}/Users func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { @@ -105,13 +105,13 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - identities := new(SCIMProvisionedIdentities) - resp, err := s.client.Do(ctx, req, identities) + var identities *SCIMProvisionedIdentities + resp, err := s.client.Do(req, &identities) if err != nil { return nil, resp, err } @@ -121,19 +121,19 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#provision-and-invite-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#provision-and-invite-a-scim-user // //meta:operation POST /scim/v2/organizations/{org}/Users func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest(ctx, "POST", u, opts) if err != nil { return nil, nil, err } - user := new(SCIMUserAttributes) - resp, err := s.client.Do(ctx, req, user) + var user *SCIMUserAttributes + resp, err := s.client.Do(req, &user) if err != nil { return nil, resp, err } @@ -143,18 +143,18 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#get-scim-provisioning-information-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#get-scim-provisioning-information-for-a-user // //meta:operation GET /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - user := new(SCIMUserAttributes) - resp, err := s.client.Do(ctx, req, &user) + var user *SCIMUserAttributes + resp, err := s.client.Do(req, &user) if err != nil { return nil, resp, err } @@ -164,7 +164,7 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-a-provisioned-organization-membership +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#update-a-provisioned-organization-membership // //meta:operation PUT /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { @@ -174,12 +174,12 @@ func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, s return nil, err } - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UpdateAttributeForSCIMUserOptions represents options for UpdateAttributeForSCIMUser. @@ -199,7 +199,7 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-an-attribute-for-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#update-an-attribute-for-a-scim-user // //meta:operation PATCH /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { @@ -209,25 +209,25 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU return nil, err } - req, err := s.client.NewRequest("PATCH", u, nil) + req, err := s.client.NewRequest(ctx, "PATCH", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#delete-a-scim-user-from-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim?apiVersion=2022-11-28#delete-a-scim-user-from-an-organization // //meta:operation DELETE /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/search.go b/vendor/github.com/google/go-github/v88/github/search.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/search.go rename to vendor/github.com/google/go-github/v88/github/search.go index eb8ea2236..ee7d33357 100644 --- a/vendor/github.com/google/go-github/v84/github/search.go +++ b/vendor/github.com/google/go-github/v88/github/search.go @@ -32,7 +32,7 @@ import ( // For example, querying with "language:c++" and "leveldb", then query should be // "language:c++ leveldb" but not "language:c+++leveldb". // -// GitHub API docs: https://docs.github.com/rest/search/ +// GitHub API docs: https://docs.github.com/rest/search?apiVersion=2022-11-28 type SearchService service // SearchOptions specifies optional parameters to the SearchService methods. @@ -75,12 +75,12 @@ type RepositoriesSearchResult struct { // Repositories searches repositories via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-repositories +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-repositories // //meta:operation GET /search/repositories func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) { - result := new(RepositoriesSearchResult) - resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, result) + var result *RepositoriesSearchResult + resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -113,12 +113,12 @@ type TopicResult struct { // Please see https://help.github.com/articles/searching-topics for more // information about search qualifiers. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-topics +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-topics // //meta:operation GET /search/topics func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) { - result := new(TopicsSearchResult) - resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, result) + var result *TopicsSearchResult + resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -150,12 +150,12 @@ type CommitResult struct { // Commits searches commits via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-commits +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-commits // //meta:operation GET /search/commits func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) { - result := new(CommitsSearchResult) - resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, result) + var result *CommitsSearchResult + resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -172,12 +172,12 @@ type IssuesSearchResult struct { // Issues searches issues via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-issues-and-pull-requests +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-issues-and-pull-requests // //meta:operation GET /search/issues func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { - result := new(IssuesSearchResult) - resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) + var result *IssuesSearchResult + resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -194,12 +194,12 @@ type UsersSearchResult struct { // Users searches users via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-users +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-users // //meta:operation GET /search/users func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) { - result := new(UsersSearchResult) - resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, result) + var result *UsersSearchResult + resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -249,12 +249,12 @@ func (c CodeResult) String() string { // Code searches code via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-code +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-code // //meta:operation GET /search/code func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) { - result := new(CodeSearchResult) - resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, result) + var result *CodeSearchResult + resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -286,12 +286,12 @@ func (l LabelResult) String() string { // Labels searches labels in the repository with ID repoID via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-labels +// GitHub API docs: https://docs.github.com/rest/search/search?apiVersion=2022-11-28#search-labels // //meta:operation GET /search/labels func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) { - result := new(LabelsSearchResult) - resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, result) + var result *LabelsSearchResult + resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, &result) if err != nil { return nil, resp, err } @@ -316,7 +316,7 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter params.Set("q", parameters.Query) u := fmt.Sprintf("search/%v?%v", searchType, params.Encode()) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, err } @@ -332,7 +332,7 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter // Accept header for search issues based on reactions preview endpoint acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview) } - // https://docs.github.com/rest/search#search-repositories + // https://docs.github.com/rest/search?apiVersion=2022-11-28#search-repositories // Accept header defaults to "application/vnd.github.v3+json" // We change it here to fetch back text-match metadata if opts != nil && opts.TextMatch { @@ -340,5 +340,5 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter } req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - return s.client.Do(ctx, req, result) + return s.client.Do(req, result) } diff --git a/vendor/github.com/google/go-github/v84/github/secret_scanning.go b/vendor/github.com/google/go-github/v88/github/secret_scanning.go similarity index 91% rename from vendor/github.com/google/go-github/v84/github/secret_scanning.go rename to vendor/github.com/google/go-github/v88/github/secret_scanning.go index 248abadc6..74a7dfb3d 100644 --- a/vendor/github.com/google/go-github/v84/github/secret_scanning.go +++ b/vendor/github.com/google/go-github/v88/github/secret_scanning.go @@ -99,9 +99,9 @@ type SecretScanningAlertListOptions struct { // List options can vary on the Enterprise type. // On Enterprise Cloud, Secret Scan alerts support requesting by page number // along with providing a cursor for an "after" param. - // See: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // See: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-an-organization // Whereas on Enterprise Server, pagination is by index. - // See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-an-organization ListOptions } @@ -172,7 +172,7 @@ type SecretScanningScanHistory struct { // To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { @@ -182,13 +182,13 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var alerts []*SecretScanningAlert - resp, err := s.client.Do(ctx, req, &alerts) + resp, err := s.client.Do(req, &alerts) if err != nil { return nil, resp, err } @@ -201,7 +201,7 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-an-organization // //meta:operation GET /orgs/{org}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { @@ -211,13 +211,13 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var alerts []*SecretScanningAlert - resp, err := s.client.Do(ctx, req, &alerts) + resp, err := s.client.Do(req, &alerts) if err != nil { return nil, resp, err } @@ -230,7 +230,7 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { @@ -240,13 +240,13 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var alerts []*SecretScanningAlert - resp, err := s.client.Do(ctx, req, &alerts) + resp, err := s.client.Do(req, &alerts) if err != nil { return nil, resp, err } @@ -259,19 +259,19 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#get-a-secret-scanning-alert // //meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var alert *SecretScanningAlert - resp, err := s.client.Do(ctx, req, &alert) + resp, err := s.client.Do(req, &alert) if err != nil { return nil, resp, err } @@ -284,19 +284,19 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#update-a-secret-scanning-alert // //meta:operation PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } var alert *SecretScanningAlert - resp, err := s.client.Do(ctx, req, &alert) + resp, err := s.client.Do(req, &alert) if err != nil { return nil, resp, err } @@ -309,7 +309,7 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-locations-for-a-secret-scanning-alert // //meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) { @@ -319,13 +319,13 @@ func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var locations []*SecretScanningAlertLocation - resp, err := s.client.Do(ctx, req, &locations) + resp, err := s.client.Do(req, &locations) if err != nil { return nil, resp, err } @@ -338,19 +338,19 @@ func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#create-a-push-protection-bypass // //meta:operation POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses func (s *SecretScanningService) CreatePushProtectionBypass(ctx context.Context, owner, repo string, request PushProtectionBypassRequest) (*PushProtectionBypass, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/push-protection-bypasses", owner, repo) - req, err := s.client.NewRequest("POST", u, request) + req, err := s.client.NewRequest(ctx, "POST", u, request) if err != nil { return nil, nil, err } var pushProtectionBypass *PushProtectionBypass - resp, err := s.client.Do(ctx, req, &pushProtectionBypass) + resp, err := s.client.Do(req, &pushProtectionBypass) if err != nil { return nil, resp, err } @@ -362,19 +362,19 @@ func (s *SecretScanningService) CreatePushProtectionBypass(ctx context.Context, // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope and gitHub advanced security or secret scanning must be enabled. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#get-secret-scanning-scan-history-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/secret-scanning/scan-history func (s *SecretScanningService) GetScanHistory(ctx context.Context, owner, repo string) (*SecretScanningScanHistory, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/scan-history", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var secretScanningHistory *SecretScanningScanHistory - resp, err := s.client.Do(ctx, req, &secretScanningHistory) + resp, err := s.client.Do(req, &secretScanningHistory) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/secret_scanning_pattern_configs.go b/vendor/github.com/google/go-github/v88/github/secret_scanning_pattern_configs.go similarity index 89% rename from vendor/github.com/google/go-github/v84/github/secret_scanning_pattern_configs.go rename to vendor/github.com/google/go-github/v88/github/secret_scanning_pattern_configs.go index 5eb51c459..4599b0faf 100644 --- a/vendor/github.com/google/go-github/v84/github/secret_scanning_pattern_configs.go +++ b/vendor/github.com/google/go-github/v88/github/secret_scanning_pattern_configs.go @@ -78,19 +78,19 @@ type SecretScanningCustomPatternSetting struct { // ListPatternConfigsForEnterprise lists the secret scanning pattern configurations for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection#list-enterprise-pattern-configurations +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection?apiVersion=2022-11-28#list-enterprise-pattern-configurations // //meta:operation GET /enterprises/{enterprise}/secret-scanning/pattern-configurations func (s *SecretScanningService) ListPatternConfigsForEnterprise(ctx context.Context, enterprise string) (*SecretScanningPatternConfigs, *Response, error) { u := fmt.Sprintf("enterprises/%v/secret-scanning/pattern-configurations", enterprise) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var patternConfigs *SecretScanningPatternConfigs - resp, err := s.client.Do(ctx, req, &patternConfigs) + resp, err := s.client.Do(req, &patternConfigs) if err != nil { return nil, resp, err } @@ -100,19 +100,19 @@ func (s *SecretScanningService) ListPatternConfigsForEnterprise(ctx context.Cont // ListPatternConfigsForOrg lists the secret scanning pattern configurations for an organization. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection#list-organization-pattern-configurations +// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection?apiVersion=2022-11-28#list-organization-pattern-configurations // //meta:operation GET /orgs/{org}/secret-scanning/pattern-configurations func (s *SecretScanningService) ListPatternConfigsForOrg(ctx context.Context, org string) (*SecretScanningPatternConfigs, *Response, error) { u := fmt.Sprintf("orgs/%v/secret-scanning/pattern-configurations", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var patternConfigs *SecretScanningPatternConfigs - resp, err := s.client.Do(ctx, req, &patternConfigs) + resp, err := s.client.Do(req, &patternConfigs) if err != nil { return nil, resp, err } @@ -122,19 +122,19 @@ func (s *SecretScanningService) ListPatternConfigsForOrg(ctx context.Context, or // UpdatePatternConfigsForEnterprise updates the secret scanning pattern configurations for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection#update-enterprise-pattern-configurations +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection?apiVersion=2022-11-28#update-enterprise-pattern-configurations // //meta:operation PATCH /enterprises/{enterprise}/secret-scanning/pattern-configurations func (s *SecretScanningService) UpdatePatternConfigsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningPatternConfigsUpdateOptions) (*SecretScanningPatternConfigsUpdate, *Response, error) { u := fmt.Sprintf("enterprises/%v/secret-scanning/pattern-configurations", enterprise) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } var patternConfigsUpdate *SecretScanningPatternConfigsUpdate - resp, err := s.client.Do(ctx, req, &patternConfigsUpdate) + resp, err := s.client.Do(req, &patternConfigsUpdate) if err != nil { return nil, resp, err } @@ -144,19 +144,19 @@ func (s *SecretScanningService) UpdatePatternConfigsForEnterprise(ctx context.Co // UpdatePatternConfigsForOrg updates the secret scanning pattern configurations for an organization. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection#update-organization-pattern-configurations +// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection?apiVersion=2022-11-28#update-organization-pattern-configurations // //meta:operation PATCH /orgs/{org}/secret-scanning/pattern-configurations func (s *SecretScanningService) UpdatePatternConfigsForOrg(ctx context.Context, org string, opts *SecretScanningPatternConfigsUpdateOptions) (*SecretScanningPatternConfigsUpdate, *Response, error) { u := fmt.Sprintf("orgs/%v/secret-scanning/pattern-configurations", org) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } var patternConfigsUpdate *SecretScanningPatternConfigsUpdate - resp, err := s.client.Do(ctx, req, &patternConfigsUpdate) + resp, err := s.client.Do(req, &patternConfigsUpdate) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/security_advisories.go b/vendor/github.com/google/go-github/v88/github/security_advisories.go similarity index 88% rename from vendor/github.com/google/go-github/v84/github/security_advisories.go rename to vendor/github.com/google/go-github/v88/github/security_advisories.go index 5c7b8fd4e..c749f0b1b 100644 --- a/vendor/github.com/google/go-github/v84/github/security_advisories.go +++ b/vendor/github.com/google/go-github/v88/github/security_advisories.go @@ -15,7 +15,7 @@ import ( // SecurityAdvisoriesService handles communication with the security advisories // related methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/security-advisories +// GitHub API docs: https://docs.github.com/rest/security-advisories?apiVersion=2022-11-28 type SecurityAdvisoriesService service // SecurityAdvisorySubmission represents the Security Advisory Submission. @@ -131,18 +131,18 @@ type Credit struct { // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#request-a-cve-for-a-repository-security-advisory // //meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/cve", owner, repo, ghsaID) - req, err := s.client.NewRequest("POST", url, nil) + req, err := s.client.NewRequest(ctx, "POST", url, nil) if err != nil { return nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) if err != nil { if errors.As(err, new(*AcceptedError)) { return resp, nil @@ -157,37 +157,37 @@ func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, // CreateTemporaryPrivateFork creates a temporary private fork to collaborate on fixing a security vulnerability in your repository. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#create-a-temporary-private-fork // //meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks func (s *SecurityAdvisoriesService) CreateTemporaryPrivateFork(ctx context.Context, owner, repo, ghsaID string) (*Repository, *Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/forks", owner, repo, ghsaID) - req, err := s.client.NewRequest("POST", url, nil) + req, err := s.client.NewRequest(ctx, "POST", url, nil) if err != nil { return nil, nil, err } - fork := new(Repository) - resp, err := s.client.Do(ctx, req, fork) + var fork Repository + resp, err := s.client.Do(req, &fork) if err != nil { var aerr *AcceptedError if errors.As(err, &aerr) { - if err := json.Unmarshal(aerr.Raw, fork); err != nil { - return fork, resp, err + if err := json.Unmarshal(aerr.Raw, &fork); err != nil { + return &fork, resp, err } - return fork, resp, err + return &fork, resp, err } return nil, resp, err } - return fork, resp, nil + return &fork, resp, nil } // ListRepositorySecurityAdvisoriesForOrg lists the repository security advisories for an organization. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization // //meta:operation GET /orgs/{org}/security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx context.Context, org string, opts *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { @@ -197,13 +197,13 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx c return nil, nil, err } - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } var advisories []*SecurityAdvisory - resp, err := s.client.Do(ctx, req, &advisories) + resp, err := s.client.Do(req, &advisories) if err != nil { return nil, resp, err } @@ -213,7 +213,7 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx c // ListRepositorySecurityAdvisories lists the security advisories in a repository. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories // //meta:operation GET /repos/{owner}/{repo}/security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context.Context, owner, repo string, opts *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { @@ -223,13 +223,13 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context return nil, nil, err } - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } var advisories []*SecurityAdvisory - resp, err := s.client.Do(ctx, req, &advisories) + resp, err := s.client.Do(req, &advisories) if err != nil { return nil, resp, err } @@ -239,7 +239,7 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context // ListGlobalSecurityAdvisories lists all global security advisories. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories +// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories?apiVersion=2022-11-28#list-global-security-advisories // //meta:operation GET /advisories func (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisories(ctx context.Context, opts *ListGlobalSecurityAdvisoriesOptions) ([]*GlobalSecurityAdvisory, *Response, error) { @@ -249,13 +249,13 @@ func (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisories(ctx context.Con return nil, nil, err } - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } var advisories []*GlobalSecurityAdvisory - resp, err := s.client.Do(ctx, req, &advisories) + resp, err := s.client.Do(req, &advisories) if err != nil { return nil, resp, err } @@ -265,18 +265,18 @@ func (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisories(ctx context.Con // GetGlobalSecurityAdvisories gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory +// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories?apiVersion=2022-11-28#get-a-global-security-advisory // //meta:operation GET /advisories/{ghsa_id} func (s *SecurityAdvisoriesService) GetGlobalSecurityAdvisories(ctx context.Context, ghsaID string) (*GlobalSecurityAdvisory, *Response, error) { url := fmt.Sprintf("advisories/%v", ghsaID) - req, err := s.client.NewRequest("GET", url, nil) + req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } var advisory *GlobalSecurityAdvisory - resp, err := s.client.Do(ctx, req, &advisory) + resp, err := s.client.Do(req, &advisory) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/strings.go b/vendor/github.com/google/go-github/v88/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v84/github/strings.go rename to vendor/github.com/google/go-github/v88/github/strings.go diff --git a/vendor/github.com/google/go-github/v84/github/sub_issue.go b/vendor/github.com/google/go-github/v88/github/sub_issue.go similarity index 76% rename from vendor/github.com/google/go-github/v84/github/sub_issue.go rename to vendor/github.com/google/go-github/v88/github/sub_issue.go index 02f7f505c..f56980f89 100644 --- a/vendor/github.com/google/go-github/v84/github/sub_issue.go +++ b/vendor/github.com/google/go-github/v88/github/sub_issue.go @@ -15,7 +15,7 @@ import ( // // Sub-issues help you group and manage your issues with a parent/child relationship. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28 type SubIssueService service // SubIssue represents a GitHub sub-issue on a repository. @@ -46,19 +46,19 @@ type SubIssueRequest struct { // Remove a sub-issue from the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#remove-sub-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issue", owner, repo, issueNumber) - req, err := s.client.NewRequest("DELETE", u, subIssue) + req, err := s.client.NewRequest(ctx, "DELETE", u, subIssue) if err != nil { return nil, nil, err } - si := new(SubIssue) - resp, err := s.client.Do(ctx, req, si) + var si *SubIssue + resp, err := s.client.Do(req, &si) if err != nil { return nil, resp, err } @@ -68,7 +68,7 @@ func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueN // ListByIssue lists all sub-issues for the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#list-sub-issues +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#list-sub-issues // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, issueNumber int64, opts *ListOptions) ([]*SubIssue, *Response, error) { @@ -78,13 +78,13 @@ func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, i return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var subIssues []*SubIssue - resp, err := s.client.Do(ctx, req, &subIssues) + resp, err := s.client.Do(req, &subIssues) if err != nil { return nil, resp, err } @@ -97,18 +97,18 @@ func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, i // The sub-issue to be added must belong to the same repository owner as the parent issue. // To replace the existing parent of a sub-issue, set replaceParent to true. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#add-sub-issue +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#add-sub-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) - req, err := s.client.NewRequest("POST", u, subIssue) + req, err := s.client.NewRequest(ctx, "POST", u, subIssue) if err != nil { return nil, nil, err } - si := new(SubIssue) - resp, err := s.client.Do(ctx, req, si) + var si *SubIssue + resp, err := s.client.Do(req, &si) if err != nil { return nil, resp, err } @@ -120,21 +120,42 @@ func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumb // // Either afterId or beforeId must be specified to determine the new position of the sub-issue. // -// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#reprioritize-sub-issue // //meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues/priority", owner, repo, issueNumber) - req, err := s.client.NewRequest("PATCH", u, subIssue) + req, err := s.client.NewRequest(ctx, "PATCH", u, subIssue) if err != nil { return nil, nil, err } - si := new(SubIssue) - resp, err := s.client.Do(ctx, req, si) + var si *SubIssue + resp, err := s.client.Do(req, &si) if err != nil { return nil, resp, err } return si, resp, nil } + +// GetParentIssue gets the parent issue of a sub-issue. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#get-parent-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/parent +func (s *SubIssueService) GetParentIssue(ctx context.Context, owner, repo string, subIssueNumber int64) (*Issue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/parent", owner, repo, subIssueNumber) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + if err != nil { + return nil, nil, err + } + + var parentIssue *Issue + resp, err := s.client.Do(req, &parentIssue) + if err != nil { + return nil, resp, err + } + + return parentIssue, resp, nil +} diff --git a/vendor/github.com/google/go-github/v84/github/teams.go b/vendor/github.com/google/go-github/v88/github/teams.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/teams.go rename to vendor/github.com/google/go-github/v88/github/teams.go index cf9a616d3..e8fddad79 100644 --- a/vendor/github.com/google/go-github/v84/github/teams.go +++ b/vendor/github.com/google/go-github/v88/github/teams.go @@ -14,7 +14,7 @@ import ( // TeamsService provides access to the team-related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/teams/ +// GitHub API docs: https://docs.github.com/rest/teams?apiVersion=2022-11-28 type TeamsService service // Team represents a team within a GitHub organization. Teams are used to @@ -92,7 +92,7 @@ func (i Invitation) String() string { // ListTeams lists all of the teams for an organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-teams // //meta:operation GET /orgs/{org}/teams func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOptions) ([]*Team, *Response, error) { @@ -102,13 +102,13 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -120,18 +120,18 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // // Deprecated: Use GetTeamBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#get-a-team-by-name // //meta:operation GET /orgs/{org}/teams/{team_slug} func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -141,18 +141,18 @@ func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*T // GetTeamBySlug fetches a team, given a specified organization name, by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#get-a-team-by-name // //meta:operation GET /orgs/{org}/teams/{team_slug} func (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -196,18 +196,18 @@ func (s NewTeam) String() string { // CreateTeam creates a new team within an organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#create-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#create-a-team // //meta:operation POST /orgs/{org}/teams func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) - req, err := s.client.NewRequest("POST", u, team) + req, err := s.client.NewRequest(ctx, "POST", u, team) if err != nil { return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -248,7 +248,7 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // // Deprecated: Use EditTeamBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#update-a-team // //meta:operation PATCH /orgs/{org}/teams/{team_slug} func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, team NewTeam, removeParent bool) (*Team, *Response, error) { @@ -258,16 +258,16 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te var err error if removeParent { teamRemoveParent := copyNewTeamWithoutParent(&team) - req, err = s.client.NewRequest("PATCH", u, teamRemoveParent) + req, err = s.client.NewRequest(ctx, "PATCH", u, teamRemoveParent) } else { - req, err = s.client.NewRequest("PATCH", u, team) + req, err = s.client.NewRequest(ctx, "PATCH", u, team) } if err != nil { return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -277,7 +277,7 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te // EditTeamBySlug edits a team, given an organization name, by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#update-a-team // //meta:operation PATCH /orgs/{org}/teams/{team_slug} func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, team NewTeam, removeParent bool) (*Team, *Response, error) { @@ -287,16 +287,16 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea var err error if removeParent { teamRemoveParent := copyNewTeamWithoutParent(&team) - req, err = s.client.NewRequest("PATCH", u, teamRemoveParent) + req, err = s.client.NewRequest(ctx, "PATCH", u, teamRemoveParent) } else { - req, err = s.client.NewRequest("PATCH", u, team) + req, err = s.client.NewRequest(ctx, "PATCH", u, team) } if err != nil { return nil, nil, err } - t := new(Team) - resp, err := s.client.Do(ctx, req, t) + var t *Team + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -308,39 +308,39 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // // Deprecated: Use DeleteTeamBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#delete-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug} func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteTeamBySlug deletes a team reference by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#delete-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug} func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListChildTeamsByParentID lists child teams for a parent team given parent ID. // // Deprecated: Use ListChildTeamsByParentSlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-child-teams // //meta:operation GET /orgs/{org}/teams/{team_slug}/teams func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) { @@ -350,13 +350,13 @@ func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, team return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -366,7 +366,7 @@ func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, team // ListChildTeamsByParentSlug lists child teams for a parent team given parent slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-child-teams // //meta:operation GET /orgs/{org}/teams/{team_slug}/teams func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Team, *Response, error) { @@ -376,13 +376,13 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -394,7 +394,7 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // // Deprecated: Use ListTeamReposBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-team-repositories // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) { @@ -404,7 +404,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -412,7 +412,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 req.Header.Set("Accept", mediaTypeTopicsPreview) var repos []*Repository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -422,7 +422,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 // ListTeamReposBySlug lists the repositories given a team slug that the specified team has access to. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-team-repositories // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Repository, *Response, error) { @@ -432,7 +432,7 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -440,7 +440,7 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string req.Header.Set("Accept", mediaTypeTopicsPreview) var repos []*Repository - resp, err := s.client.Do(ctx, req, &repos) + resp, err := s.client.Do(req, &repos) if err != nil { return nil, resp, err } @@ -454,20 +454,20 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // // Deprecated: Use IsTeamRepoBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeOrgPermissionRepo) - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) + var repository *Repository + resp, err := s.client.Do(req, &repository) if err != nil { return nil, resp, err } @@ -479,20 +479,20 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeOrgPermissionRepo) - repository := new(Repository) - resp, err := s.client.Do(ctx, req, repository) + var repository *Repository + resp, err := s.client.Do(req, &repository) if err != nil { return nil, resp, err } @@ -521,34 +521,34 @@ type TeamAddTeamRepoOptions struct { // // Deprecated: Use AddTeamRepoBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions // //meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddTeamRepoBySlug adds a repository to be managed by the specified team given the team slug. // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions // //meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveTeamRepoByID removes a repository from being managed by the specified @@ -557,39 +557,39 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // // Deprecated: Use RemoveTeamRepoBySlug instead. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#remove-a-repository-from-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveTeamRepoBySlug removes a repository from being managed by the specified // team given the team slug. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#remove-a-repository-from-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListUserTeams lists a user's teams // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#list-teams-for-the-authenticated-user // //meta:operation GET /user/teams func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]*Team, *Response, error) { @@ -599,13 +599,13 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teams []*Team - resp, err := s.client.Do(ctx, req, &teams) + resp, err := s.client.Do(req, &teams) if err != nil { return nil, resp, err } @@ -623,7 +623,7 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*ProjectV2, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -631,7 +631,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i req.Header.Set("Accept", mediaTypeProjectsPreview) var projects []*ProjectV2 - resp, err := s.client.Do(ctx, req, &projects) + resp, err := s.client.Do(req, &projects) if err != nil { return nil, resp, err } @@ -647,7 +647,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*ProjectV2, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects", org, slug) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -655,7 +655,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str req.Header.Set("Accept", mediaTypeProjectsPreview) var projects []*ProjectV2 - resp, err := s.client.Do(ctx, req, &projects) + resp, err := s.client.Do(req, &projects) if err != nil { return nil, resp, err } @@ -673,15 +673,15 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str //meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*ProjectV2, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeProjectsPreview) - projects := &ProjectV2{} - resp, err := s.client.Do(ctx, req, &projects) + var projects *ProjectV2 + resp, err := s.client.Do(req, &projects) if err != nil { return nil, resp, err } @@ -697,15 +697,15 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID //meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*ProjectV2, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } req.Header.Set("Accept", mediaTypeProjectsPreview) - projects := &ProjectV2{} - resp, err := s.client.Do(ctx, req, &projects) + var projects *ProjectV2 + resp, err := s.client.Do(req, &projects) if err != nil { return nil, resp, err } @@ -736,14 +736,14 @@ type TeamProjectOptions struct { //meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeProjectsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // AddTeamProjectBySlug adds an organization project to a team given the team slug. @@ -755,14 +755,14 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr //meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeProjectsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveTeamProjectByID removes an organization project from a team given team ID. @@ -779,14 +779,14 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin //meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeProjectsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveTeamProjectBySlug removes an organization project from a team given team slug. @@ -801,14 +801,14 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, //meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeProjectsPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListIDPGroupsOptions specifies the optional parameters to the ListIDPGroupsInOrganization method. @@ -833,7 +833,7 @@ type IDPGroup struct { // ListIDPGroupsInOrganization lists IDP groups available in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#list-idp-groups-for-an-organization // //meta:operation GET /orgs/{org}/team-sync/groups func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListIDPGroupsOptions) (*IDPGroupList, *Response, error) { @@ -843,13 +843,13 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(req, &groups) if err != nil { return nil, resp, err } @@ -862,19 +862,19 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // // Deprecated: Use ListIDPGroupsForTeamBySlug instead. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#list-idp-groups-for-a-team // //meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(req, &groups) if err != nil { return nil, resp, err } @@ -885,19 +885,19 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team // ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub // given organization name and team slug. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#list-idp-groups-for-a-team // //meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(req, &groups) if err != nil { return nil, resp, err } @@ -910,19 +910,19 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // // Deprecated: Use CreateOrUpdateIDPGroupConnectionsBySlug instead. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#create-or-update-idp-group-connections // //meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(req, &groups) if err != nil { return nil, resp, err } @@ -933,19 +933,19 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context // CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection // between a team and an IDP group given organization name and team slug. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync?apiVersion=2022-11-28#create-or-update-idp-group-connections // //meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest(ctx, "PATCH", u, opts) if err != nil { return nil, nil, err } - groups := new(IDPGroupList) - resp, err := s.client.Do(ctx, req, groups) + var groups *IDPGroupList + resp, err := s.client.Do(req, &groups) if err != nil { return nil, resp, err } @@ -983,18 +983,18 @@ type ExternalGroupList struct { // GetExternalGroup fetches an external group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#get-an-external-group // //meta:operation GET /orgs/{org}/external-group/{group_id} func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/external-group/%v", org, groupID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - externalGroup := new(ExternalGroup) - resp, err := s.client.Do(ctx, req, externalGroup) + var externalGroup *ExternalGroup + resp, err := s.client.Do(req, &externalGroup) if err != nil { return nil, resp, err } @@ -1012,7 +1012,7 @@ type ListExternalGroupsOptions struct { // ListExternalGroups lists external groups in an organization on GitHub. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-available-to-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#list-external-groups-available-to-an-organization // //meta:operation GET /orgs/{org}/external-groups func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { @@ -1022,13 +1022,13 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - externalGroups := new(ExternalGroupList) - resp, err := s.client.Do(ctx, req, externalGroups) + var externalGroups *ExternalGroupList + resp, err := s.client.Do(req, &externalGroups) if err != nil { return nil, resp, err } @@ -1038,19 +1038,19 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts // ListExternalGroupsForTeamBySlug lists external groups connected to a team on GitHub. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#list-a-connection-between-an-external-group-and-a-team // //meta:operation GET /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, slug string) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - externalGroups := new(ExternalGroupList) - resp, err := s.client.Do(ctx, req, externalGroups) + var externalGroups *ExternalGroupList + resp, err := s.client.Do(req, &externalGroups) if err != nil { return nil, resp, err } @@ -1060,19 +1060,19 @@ func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, // UpdateConnectedExternalGroup updates the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#update-the-connection-between-an-external-group-and-a-team // //meta:operation PATCH /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) - req, err := s.client.NewRequest("PATCH", u, eg) + req, err := s.client.NewRequest(ctx, "PATCH", u, eg) if err != nil { return nil, nil, err } - externalGroup := new(ExternalGroup) - resp, err := s.client.Do(ctx, req, externalGroup) + var externalGroup *ExternalGroup + resp, err := s.client.Do(req, &externalGroup) if err != nil { return nil, resp, err } @@ -1082,16 +1082,16 @@ func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, sl // RemoveConnectedExternalGroup removes the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#remove-the-connection-between-an-external-group-and-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v88/github/teams_discussion_comments.go similarity index 88% rename from vendor/github.com/google/go-github/v84/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v88/github/teams_discussion_comments.go index 0080dac18..fe9ea1770 100644 --- a/vendor/github.com/google/go-github/v84/github/teams_discussion_comments.go +++ b/vendor/github.com/google/go-github/v88/github/teams_discussion_comments.go @@ -53,13 +53,13 @@ func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64 return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var comments []*DiscussionComment - resp, err := s.client.Do(ctx, req, &comments) + resp, err := s.client.Do(req, &comments) if err != nil { return nil, resp, err } @@ -80,13 +80,13 @@ func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var comments []*DiscussionComment - resp, err := s.client.Do(ctx, req, &comments) + resp, err := s.client.Do(req, &comments) if err != nil { return nil, resp, err } @@ -102,13 +102,13 @@ func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, //meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(req, &discussionComment) if err != nil { return nil, resp, err } @@ -125,13 +125,13 @@ func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(req, &discussionComment) if err != nil { return nil, resp, err } @@ -147,13 +147,13 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d //meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) - req, err := s.client.NewRequest("POST", u, comment) + req, err := s.client.NewRequest(ctx, "POST", u, comment) if err != nil { return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(req, &discussionComment) if err != nil { return nil, resp, err } @@ -169,13 +169,13 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 //meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discussionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) - req, err := s.client.NewRequest("POST", u, comment) + req, err := s.client.NewRequest(ctx, "POST", u, comment) if err != nil { return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(req, &discussionComment) if err != nil { return nil, resp, err } @@ -192,13 +192,13 @@ func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string //meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) - req, err := s.client.NewRequest("PATCH", u, comment) + req, err := s.client.NewRequest(ctx, "PATCH", u, comment) if err != nil { return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(req, &discussionComment) if err != nil { return nil, resp, err } @@ -215,13 +215,13 @@ func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, //meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) - req, err := s.client.NewRequest("PATCH", u, comment) + req, err := s.client.NewRequest(ctx, "PATCH", u, comment) if err != nil { return nil, nil, err } - discussionComment := &DiscussionComment{} - resp, err := s.client.Do(ctx, req, discussionComment) + var discussionComment *DiscussionComment + resp, err := s.client.Do(req, &discussionComment) if err != nil { return nil, resp, err } @@ -237,12 +237,12 @@ func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, //meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteCommentBySlug deletes a comment on a team discussion by team slug. @@ -253,10 +253,10 @@ func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int6 //meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) DeleteCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/teams_discussions.go b/vendor/github.com/google/go-github/v88/github/teams_discussions.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/teams_discussions.go rename to vendor/github.com/google/go-github/v88/github/teams_discussions.go index a06adecf5..224409068 100644 --- a/vendor/github.com/google/go-github/v84/github/teams_discussions.go +++ b/vendor/github.com/google/go-github/v88/github/teams_discussions.go @@ -59,13 +59,13 @@ func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID in return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teamDiscussions []*TeamDiscussion - resp, err := s.client.Do(ctx, req, &teamDiscussions) + resp, err := s.client.Do(req, &teamDiscussions) if err != nil { return nil, resp, err } @@ -86,13 +86,13 @@ func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var teamDiscussions []*TeamDiscussion - resp, err := s.client.Do(ctx, req, &teamDiscussions) + resp, err := s.client.Do(req, &teamDiscussions) if err != nil { return nil, resp, err } @@ -108,13 +108,13 @@ func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug stri //meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -130,13 +130,13 @@ func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int6 //meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -152,13 +152,13 @@ func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string //meta:operation POST /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) - req, err := s.client.NewRequest("POST", u, discussion) + req, err := s.client.NewRequest(ctx, "POST", u, discussion) if err != nil { return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -174,13 +174,13 @@ func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID i //meta:operation POST /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug string, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) - req, err := s.client.NewRequest("POST", u, discussion) + req, err := s.client.NewRequest(ctx, "POST", u, discussion) if err != nil { return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -197,13 +197,13 @@ func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug str //meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) - req, err := s.client.NewRequest("PATCH", u, discussion) + req, err := s.client.NewRequest(ctx, "PATCH", u, discussion) if err != nil { return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -220,13 +220,13 @@ func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int //meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) - req, err := s.client.NewRequest("PATCH", u, discussion) + req, err := s.client.NewRequest(ctx, "PATCH", u, discussion) if err != nil { return nil, nil, err } - teamDiscussion := &TeamDiscussion{} - resp, err := s.client.Do(ctx, req, teamDiscussion) + var teamDiscussion *TeamDiscussion + resp, err := s.client.Do(req, &teamDiscussion) if err != nil { return nil, resp, err } @@ -242,12 +242,12 @@ func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug strin //meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeleteDiscussionBySlug deletes a discussion from team's page given Organization name and Team's slug. @@ -258,10 +258,10 @@ func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID i //meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) DeleteDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/teams_members.go b/vendor/github.com/google/go-github/v88/github/teams_members.go similarity index 75% rename from vendor/github.com/google/go-github/v84/github/teams_members.go rename to vendor/github.com/google/go-github/v88/github/teams_members.go index 059d993a3..bbea68504 100644 --- a/vendor/github.com/google/go-github/v84/github/teams_members.go +++ b/vendor/github.com/google/go-github/v88/github/teams_members.go @@ -23,7 +23,7 @@ type TeamListTeamMembersOptions struct { // ListTeamMembersByID lists all of the users who are members of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-team-members // //meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { @@ -33,13 +33,13 @@ func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID in return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var members []*User - resp, err := s.client.Do(ctx, req, &members) + resp, err := s.client.Do(req, &members) if err != nil { return nil, resp, err } @@ -50,7 +50,7 @@ func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID in // ListTeamMembersBySlug lists all of the users who are members of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-team-members // //meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { @@ -60,13 +60,13 @@ func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var members []*User - resp, err := s.client.Do(ctx, req, &members) + resp, err := s.client.Do(req, &members) if err != nil { return nil, resp, err } @@ -77,18 +77,18 @@ func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug stri // GetTeamMembershipByID returns the membership status for a user in a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-team-members // //meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) + var t *Membership + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -99,18 +99,18 @@ func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID // GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#get-team-membership-for-a-user // //meta:operation GET /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) + var t *Membership + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -135,18 +135,18 @@ type TeamAddTeamMembershipOptions struct { // AddTeamMembershipByID adds or invites a user to a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#add-or-update-team-membership-for-a-user // //meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, nil, err } - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) + var t *Membership + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -157,18 +157,18 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID // AddTeamMembershipBySlug adds or invites a user to a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#add-or-update-team-membership-for-a-user // //meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, nil, err } - t := new(Membership) - resp, err := s.client.Do(ctx, req, t) + var t *Membership + resp, err := s.client.Do(req, &t) if err != nil { return nil, resp, err } @@ -179,39 +179,39 @@ func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, u // RemoveTeamMembershipByID removes a user from a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#remove-team-membership-for-a-user // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RemoveTeamMembershipBySlug removes a user from a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#remove-team-membership-for-a-user // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-pending-team-invitations // //meta:operation GET /orgs/{org}/teams/{team_slug}/invitations func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) { @@ -221,13 +221,13 @@ func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var pendingInvitations []*Invitation - resp, err := s.client.Do(ctx, req, &pendingInvitations) + resp, err := s.client.Do(req, &pendingInvitations) if err != nil { return nil, resp, err } @@ -238,7 +238,7 @@ func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID // ListPendingTeamInvitationsBySlug get pending invitation list of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#list-pending-team-invitations // //meta:operation GET /orgs/{org}/teams/{team_slug}/invitations func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) { @@ -248,13 +248,13 @@ func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var pendingInvitations []*Invitation - resp, err := s.client.Do(ctx, req, &pendingInvitations) + resp, err := s.client.Do(req, &pendingInvitations) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/timestamp.go b/vendor/github.com/google/go-github/v88/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v84/github/timestamp.go rename to vendor/github.com/google/go-github/v88/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v88/github/url.go b/vendor/github.com/google/go-github/v88/github/url.go new file mode 100644 index 000000000..f0411dccc --- /dev/null +++ b/vendor/github.com/google/go-github/v88/github/url.go @@ -0,0 +1,33 @@ +// Copyright 2026 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "errors" + "fmt" + "net/url" + "strings" +) + +// parseURL parses the given string as a URL and ensures that the path ends +// with a slash. If the input string is empty, it returns an error. If the URL +// cannot be parsed, it returns the parsing error. +func parseURL(s string) (*url.URL, error) { + if s == "" { + return nil, errors.New("url cannot be empty") + } + + u, err := url.Parse(s) + if err != nil { + return nil, fmt.Errorf("invalid url: %w", err) + } + + if !strings.HasSuffix(u.Path, "/") { + u.Path += "/" + } + + return u, nil +} diff --git a/vendor/github.com/google/go-github/v84/github/users.go b/vendor/github.com/google/go-github/v88/github/users.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/users.go rename to vendor/github.com/google/go-github/v88/github/users.go index ae5027d31..00108a9ba 100644 --- a/vendor/github.com/google/go-github/v84/github/users.go +++ b/vendor/github.com/google/go-github/v88/github/users.go @@ -13,13 +13,14 @@ import ( // UsersService handles communication with the user related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/rest/users/ +// GitHub API docs: https://docs.github.com/rest/users?apiVersion=2022-11-28 type UsersService service // User represents a GitHub user. type User struct { Login *string `json:"login,omitempty"` ID *int64 `json:"id,omitempty"` + UserViewType *string `json:"user_view_type,omitempty"` NodeID *string `json:"node_id,omitempty"` AvatarURL *string `json:"avatar_url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` @@ -29,6 +30,7 @@ type User struct { Blog *string `json:"blog,omitempty"` Location *string `json:"location,omitempty"` Email *string `json:"email,omitempty"` + NotificationEmail *string `json:"notification_email,omitempty"` Hireable *bool `json:"hireable,omitempty"` Bio *string `json:"bio,omitempty"` TwitterUsername *string `json:"twitter_username,omitempty"` @@ -48,6 +50,7 @@ type User struct { Collaborators *int `json:"collaborators,omitempty"` TwoFactorAuthentication *bool `json:"two_factor_authentication,omitempty"` Plan *Plan `json:"plan,omitempty"` + BusinessPlus *bool `json:"business_plus,omitempty"` LdapDn *string `json:"ldap_dn,omitempty"` // API URLs @@ -63,7 +66,7 @@ type User struct { SubscriptionsURL *string `json:"subscriptions_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search?apiVersion=2022-11-28#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Permissions and RoleName identify the permissions and role that a user has on a given @@ -87,9 +90,9 @@ func (u User) String() string { // Get fetches a user. Passing the empty string will fetch the authenticated // user. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#get-a-user // -// GitHub API docs: https://docs.github.com/rest/users/users#get-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user // //meta:operation GET /user //meta:operation GET /users/{username} @@ -100,13 +103,13 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, } else { u = "user" } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - uResp := new(User) - resp, err := s.client.Do(ctx, req, uResp) + var uResp *User + resp, err := s.client.Do(req, &uResp) if err != nil { return nil, resp, err } @@ -116,18 +119,18 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, // GetByID fetches a user. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user-using-their-id +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#get-a-user-using-their-id // //meta:operation GET /user/{account_id} func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error) { u := fmt.Sprintf("user/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - user := new(User) - resp, err := s.client.Do(ctx, req, user) + var user *User + resp, err := s.client.Do(req, &user) if err != nil { return nil, resp, err } @@ -137,18 +140,18 @@ func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, // Edit the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/users#update-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#update-the-authenticated-user // //meta:operation PATCH /user func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error) { u := "user" - req, err := s.client.NewRequest("PATCH", u, user) + req, err := s.client.NewRequest(ctx, "PATCH", u, user) if err != nil { return nil, nil, err } - uResp := new(User) - resp, err := s.client.Do(ctx, req, uResp) + var uResp *User + resp, err := s.client.Do(req, &uResp) if err != nil { return nil, resp, err } @@ -181,7 +184,7 @@ type UserContext struct { // GetHovercard fetches contextual information about user. It requires authentication // via Basic Auth or via OAuth with the repo scope. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#get-contextual-information-for-a-user // //meta:operation GET /users/{username}/hovercard func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *HovercardOptions) (*Hovercard, *Response, error) { @@ -191,13 +194,13 @@ func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *Hove return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - hc := new(Hovercard) - resp, err := s.client.Do(ctx, req, hc) + var hc *Hovercard + resp, err := s.client.Do(req, &hc) if err != nil { return nil, resp, err } @@ -217,7 +220,7 @@ type UserListOptions struct { // // To paginate through all users, populate 'Since' with the ID of the last user. // -// GitHub API docs: https://docs.github.com/rest/users/users#list-users +// GitHub API docs: https://docs.github.com/rest/users/users?apiVersion=2022-11-28#list-users // //meta:operation GET /users func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error) { @@ -226,13 +229,13 @@ func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*U return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var users []*User - resp, err := s.client.Do(ctx, req, &users) + resp, err := s.client.Do(req, &users) if err != nil { return nil, resp, err } @@ -243,7 +246,7 @@ func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*U // ListInvitations lists all currently-open repository invitations for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#list-repository-invitations-for-the-authenticated-user // //meta:operation GET /user/repository_invitations func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { @@ -252,13 +255,13 @@ func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ( return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } invites := []*RepositoryInvitation{} - resp, err := s.client.Do(ctx, req, &invites) + resp, err := s.client.Do(req, &invites) if err != nil { return nil, resp, err } @@ -269,31 +272,31 @@ func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ( // AcceptInvitation accepts the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#accept-a-repository-invitation // //meta:operation PATCH /user/repository_invitations/{invitation_id} func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) - req, err := s.client.NewRequest("PATCH", u, nil) + req, err := s.client.NewRequest(ctx, "PATCH", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DeclineInvitation declines the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations?apiVersion=2022-11-28#decline-a-repository-invitation // //meta:operation DELETE /user/repository_invitations/{invitation_id} func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/users_administration.go b/vendor/github.com/google/go-github/v88/github/users_administration.go similarity index 77% rename from vendor/github.com/google/go-github/v84/github/users_administration.go rename to vendor/github.com/google/go-github/v88/github/users_administration.go index 83da04ece..2f09e408a 100644 --- a/vendor/github.com/google/go-github/v84/github/users_administration.go +++ b/vendor/github.com/google/go-github/v88/github/users_administration.go @@ -12,34 +12,34 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UserSuspendOptions represents the reason to suspend a user. @@ -49,32 +49,32 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) - req, err := s.client.NewRequest("PUT", u, opts) + req, err := s.client.NewRequest(ctx, "PUT", u, opts) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/users_attestations.go b/vendor/github.com/google/go-github/v88/github/users_attestations.go similarity index 87% rename from vendor/github.com/google/go-github/v84/github/users_attestations.go rename to vendor/github.com/google/go-github/v88/github/users_attestations.go index d63634500..23200cad3 100644 --- a/vendor/github.com/google/go-github/v84/github/users_attestations.go +++ b/vendor/github.com/google/go-github/v88/github/users_attestations.go @@ -14,7 +14,7 @@ import ( // with a given subject digest that are associated with repositories // owned by a user. // -// GitHub API docs: https://docs.github.com/rest/users/attestations#list-attestations +// GitHub API docs: https://docs.github.com/rest/users/attestations?apiVersion=2022-11-28#list-attestations // //meta:operation GET /users/{username}/attestations/{subject_digest} func (s *UsersService) ListAttestations(ctx context.Context, user, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { @@ -25,13 +25,13 @@ func (s *UsersService) ListAttestations(ctx context.Context, user, subjectDigest return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var attestations *AttestationsResponse - res, err := s.client.Do(ctx, req, &attestations) + res, err := s.client.Do(req, &attestations) if err != nil { return nil, res, err } diff --git a/vendor/github.com/google/go-github/v84/github/users_blocking.go b/vendor/github.com/google/go-github/v88/github/users_blocking.go similarity index 69% rename from vendor/github.com/google/go-github/v84/github/users_blocking.go rename to vendor/github.com/google/go-github/v88/github/users_blocking.go index 39d89d34c..9fa4da631 100644 --- a/vendor/github.com/google/go-github/v84/github/users_blocking.go +++ b/vendor/github.com/google/go-github/v88/github/users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the blocked users by the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#list-users-blocked-by-the-authenticated-user // //meta:operation GET /user/blocks func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error) { @@ -22,7 +22,7 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } @@ -30,7 +30,7 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) req.Header.Set("Accept", mediaTypeBlockUsersPreview) var blockedUsers []*User - resp, err := s.client.Do(ctx, req, &blockedUsers) + resp, err := s.client.Do(req, &blockedUsers) if err != nil { return nil, resp, err } @@ -40,56 +40,56 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) // IsBlocked reports whether specified user is blocked by the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#check-if-a-user-is-blocked-by-the-authenticated-user // //meta:operation GET /user/blocks/{username} func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) { u := fmt.Sprintf("user/blocks/%v", user) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } req.Header.Set("Accept", mediaTypeBlockUsersPreview) - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) isBlocked, err := parseBoolResponse(err) return isBlocked, resp, err } // BlockUser blocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#block-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#block-a-user // //meta:operation PUT /user/blocks/{username} func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeBlockUsersPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // UnblockUser unblocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#unblock-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#unblock-a-user // //meta:operation DELETE /user/blocks/{username} func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } req.Header.Set("Accept", mediaTypeBlockUsersPreview) - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/users_emails.go b/vendor/github.com/google/go-github/v88/github/users_emails.go similarity index 69% rename from vendor/github.com/google/go-github/v84/github/users_emails.go rename to vendor/github.com/google/go-github/v88/github/users_emails.go index 3d0e1bfaa..33e0f261c 100644 --- a/vendor/github.com/google/go-github/v84/github/users_emails.go +++ b/vendor/github.com/google/go-github/v88/github/users_emails.go @@ -17,7 +17,7 @@ type UserEmail struct { // ListEmails lists all email addresses for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#list-email-addresses-for-the-authenticated-user // //meta:operation GET /user/emails func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error) { @@ -27,13 +27,13 @@ func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*Us return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var emails []*UserEmail - resp, err := s.client.Do(ctx, req, &emails) + resp, err := s.client.Do(req, &emails) if err != nil { return nil, resp, err } @@ -43,18 +43,18 @@ func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*Us // AddEmails adds email addresses of the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#add-an-email-address-for-the-authenticated-user // //meta:operation POST /user/emails func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) { u := "user/emails" - req, err := s.client.NewRequest("POST", u, emails) + req, err := s.client.NewRequest(ctx, "POST", u, emails) if err != nil { return nil, nil, err } var e []*UserEmail - resp, err := s.client.Do(ctx, req, &e) + resp, err := s.client.Do(req, &e) if err != nil { return nil, resp, err } @@ -64,23 +64,23 @@ func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserE // DeleteEmails deletes email addresses from authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#delete-an-email-address-for-the-authenticated-user // //meta:operation DELETE /user/emails func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error) { u := "user/emails" - req, err := s.client.NewRequest("DELETE", u, emails) + req, err := s.client.NewRequest(ctx, "DELETE", u, emails) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // SetEmailVisibility sets the visibility for the primary email address of the authenticated user. // `visibility` can be "private" or "public". // -// GitHub API docs: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#set-primary-email-visibility-for-the-authenticated-user // //meta:operation PATCH /user/email/visibility func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { @@ -90,13 +90,13 @@ func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string Visibility: &visibility, } - req, err := s.client.NewRequest("PATCH", u, updateVisibilityReq) + req, err := s.client.NewRequest(ctx, "PATCH", u, updateVisibilityReq) if err != nil { return nil, nil, err } var e []*UserEmail - resp, err := s.client.Do(ctx, req, &e) + resp, err := s.client.Do(req, &e) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/users_followers.go b/vendor/github.com/google/go-github/v88/github/users_followers.go similarity index 78% rename from vendor/github.com/google/go-github/v84/github/users_followers.go rename to vendor/github.com/google/go-github/v88/github/users_followers.go index 6833d8df6..4543cb8ec 100644 --- a/vendor/github.com/google/go-github/v84/github/users_followers.go +++ b/vendor/github.com/google/go-github/v88/github/users_followers.go @@ -13,9 +13,9 @@ import ( // ListFollowers lists the followers for a user. Passing the empty string will // fetch followers for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#list-followers-of-a-user // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#list-followers-of-the-authenticated-user // //meta:operation GET /user/followers //meta:operation GET /users/{username}/followers @@ -31,13 +31,13 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var users []*User - resp, err := s.client.Do(ctx, req, &users) + resp, err := s.client.Do(req, &users) if err != nil { return nil, resp, err } @@ -48,9 +48,9 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis // ListFollowing lists the people that a user is following. Passing the empty // string will list people the authenticated user is following. // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#list-the-people-a-user-follows // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#list-the-people-the-authenticated-user-follows // //meta:operation GET /user/following //meta:operation GET /users/{username}/following @@ -66,13 +66,13 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var users []*User - resp, err := s.client.Do(ctx, req, &users) + resp, err := s.client.Do(req, &users) if err != nil { return nil, resp, err } @@ -83,9 +83,9 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis // IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // -// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#check-if-a-person-is-followed-by-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#check-if-a-user-follows-another-user // //meta:operation GET /user/following/{username} //meta:operation GET /users/{username}/following/{target_user} @@ -97,42 +97,42 @@ func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bo u = fmt.Sprintf("user/following/%v", target) } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return false, nil, err } - resp, err := s.client.Do(ctx, req, nil) + resp, err := s.client.Do(req, nil) following, err := parseBoolResponse(err) return following, resp, err } // Follow will cause the authenticated user to follow the specified user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#follow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#follow-a-user // //meta:operation PUT /user/following/{username} func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) - req, err := s.client.NewRequest("PUT", u, nil) + req, err := s.client.NewRequest(ctx, "PUT", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // Unfollow will cause the authenticated user to unfollow the specified user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#unfollow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers?apiVersion=2022-11-28#unfollow-a-user // //meta:operation DELETE /user/following/{username} func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v88/github/users_gpg_keys.go similarity index 77% rename from vendor/github.com/google/go-github/v84/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v88/github/users_gpg_keys.go index d33564cab..f22ab81b2 100644 --- a/vendor/github.com/google/go-github/v84/github/users_gpg_keys.go +++ b/vendor/github.com/google/go-github/v88/github/users_gpg_keys.go @@ -44,9 +44,9 @@ type GPGEmail struct { // string will fetch keys for the authenticated user. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#list-gpg-keys-for-a-user // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#list-gpg-keys-for-the-authenticated-user // //meta:operation GET /user/gpg_keys //meta:operation GET /users/{username}/gpg_keys @@ -62,13 +62,13 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListO return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var keys []*GPGKey - resp, err := s.client.Do(ctx, req, &keys) + resp, err := s.client.Do(req, &keys) if err != nil { return nil, resp, err } @@ -79,18 +79,18 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListO // GetGPGKey gets extended details for a single GPG key. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#get-a-gpg-key-for-the-authenticated-user // //meta:operation GET /user/gpg_keys/{gpg_key_id} func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - key := &GPGKey{} - resp, err := s.client.Do(ctx, req, key) + var key *GPGKey + resp, err := s.client.Do(req, &key) if err != nil { return nil, resp, err } @@ -101,20 +101,20 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo // CreateGPGKey creates a GPG key. It requires authentication via Basic Auth // or OAuth with at least write:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#create-a-gpg-key-for-the-authenticated-user // //meta:operation POST /user/gpg_keys func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) { gpgKey := &struct { ArmoredPublicKey string `json:"armored_public_key"` }{ArmoredPublicKey: armoredPublicKey} - req, err := s.client.NewRequest("POST", "user/gpg_keys", gpgKey) + req, err := s.client.NewRequest(ctx, "POST", "user/gpg_keys", gpgKey) if err != nil { return nil, nil, err } - key := &GPGKey{} - resp, err := s.client.Do(ctx, req, key) + var key *GPGKey + resp, err := s.client.Do(req, &key) if err != nil { return nil, resp, err } @@ -125,15 +125,15 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string // DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or // via OAuth with at least admin:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys?apiVersion=2022-11-28#delete-a-gpg-key-for-the-authenticated-user // //meta:operation DELETE /user/gpg_keys/{gpg_key_id} func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/users_keys.go b/vendor/github.com/google/go-github/v88/github/users_keys.go similarity index 69% rename from vendor/github.com/google/go-github/v84/github/users_keys.go rename to vendor/github.com/google/go-github/v88/github/users_keys.go index 350a684b7..0c981d712 100644 --- a/vendor/github.com/google/go-github/v84/github/users_keys.go +++ b/vendor/github.com/google/go-github/v88/github/users_keys.go @@ -30,9 +30,9 @@ func (k Key) String() string { // ListKeys lists the verified public keys for a user. Passing the empty // string will fetch keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#list-public-keys-for-a-user // -// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#list-public-ssh-keys-for-the-authenticated-user // //meta:operation GET /user/keys //meta:operation GET /users/{username}/keys @@ -48,13 +48,13 @@ func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOpti return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var keys []*Key - resp, err := s.client.Do(ctx, req, &keys) + resp, err := s.client.Do(req, &keys) if err != nil { return nil, resp, err } @@ -64,19 +64,19 @@ func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOpti // GetKey fetches a single public key. // -// GitHub API docs: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#get-a-public-ssh-key-for-the-authenticated-user // //meta:operation GET /user/keys/{key_id} func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error) { u := fmt.Sprintf("user/keys/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - key := new(Key) - resp, err := s.client.Do(ctx, req, key) + var key *Key + resp, err := s.client.Do(req, &key) if err != nil { return nil, resp, err } @@ -86,19 +86,19 @@ func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, e // CreateKey adds a public key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#create-a-public-ssh-key-for-the-authenticated-user // //meta:operation POST /user/keys func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error) { u := "user/keys" - req, err := s.client.NewRequest("POST", u, key) + req, err := s.client.NewRequest(ctx, "POST", u, key) if err != nil { return nil, nil, err } - k := new(Key) - resp, err := s.client.Do(ctx, req, k) + var k *Key + resp, err := s.client.Do(req, &k) if err != nil { return nil, resp, err } @@ -108,16 +108,16 @@ func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response // DeleteKey deletes a public key. // -// GitHub API docs: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys?apiVersion=2022-11-28#delete-a-public-ssh-key-for-the-authenticated-user // //meta:operation DELETE /user/keys/{key_id} func (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/keys/%v", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/users_packages.go b/vendor/github.com/google/go-github/v88/github/users_packages.go similarity index 81% rename from vendor/github.com/google/go-github/v84/github/users_packages.go rename to vendor/github.com/google/go-github/v88/github/users_packages.go index f0c152dd5..8a1fad3b6 100644 --- a/vendor/github.com/google/go-github/v84/github/users_packages.go +++ b/vendor/github.com/google/go-github/v88/github/users_packages.go @@ -14,9 +14,9 @@ import ( // ListPackages lists the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-packages-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-packages-for-the-authenticated-users-namespace // //meta:operation GET /user/packages //meta:operation GET /users/{username}/packages @@ -32,13 +32,13 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var packages []*Package - resp, err := s.client.Do(ctx, req, &packages) + resp, err := s.client.Do(req, &packages) if err != nil { return nil, resp, err } @@ -49,9 +49,9 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // GetPackage gets a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-for-the-authenticated-user // //meta:operation GET /user/packages/{package_type}/{package_name} //meta:operation GET /users/{username}/packages/{package_type}/{package_name} @@ -63,13 +63,13 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag u = fmt.Sprintf("user/packages/%v/%v", packageType, url.PathEscape(packageName)) } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var pack *Package - resp, err := s.client.Do(ctx, req, &pack) + resp, err := s.client.Do(req, &pack) if err != nil { return nil, resp, err } @@ -80,9 +80,9 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // DeletePackage deletes a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-a-package-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-a-package-for-the-authenticated-user // //meta:operation DELETE /user/packages/{package_type}/{package_name} //meta:operation DELETE /users/{username}/packages/{package_type}/{package_name} @@ -94,20 +94,20 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac u = fmt.Sprintf("user/packages/%v/%v", packageType, packageName) } - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // RestorePackage restores a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-a-package-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-a-package-for-the-authenticated-user // //meta:operation POST /user/packages/{package_type}/{package_name}/restore //meta:operation POST /users/{username}/packages/{package_type}/{package_name}/restore @@ -119,12 +119,12 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa u = fmt.Sprintf("user/packages/%v/%v/restore", packageType, packageName) } - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListPackageVersionsOptions specifies the optional parameters to the UsersService.ListPackageVersions. @@ -137,7 +137,7 @@ type ListPackageVersionsOptions struct { // ListPackageVersions gets all versions of a package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-the-authenticated-user // //meta:operation GET /user/packages/{package_type}/{package_name}/versions func (s *UsersService) ListPackageVersions(ctx context.Context, packageType, packageName string, opts *ListPackageVersionsOptions) ([]*PackageVersion, *Response, error) { @@ -147,13 +147,13 @@ func (s *UsersService) ListPackageVersions(ctx context.Context, packageType, pac return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var versions []*PackageVersion - resp, err := s.client.Do(ctx, req, &versions) + resp, err := s.client.Do(req, &versions) if err != nil { return nil, resp, err } @@ -163,19 +163,19 @@ func (s *UsersService) ListPackageVersions(ctx context.Context, packageType, pac // ListUserPackageVersions returns package versions for a public package owned by a specified user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-a-user // //meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions func (s *UsersService) ListUserPackageVersions(ctx context.Context, user, packageType, packageName string) ([]*PackageVersion, *Response, error) { u := fmt.Sprintf("users/%v/packages/%v/%v/versions", user, packageType, packageName) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var versions []*PackageVersion - resp, err := s.client.Do(ctx, req, &versions) + resp, err := s.client.Do(req, &versions) if err != nil { return nil, resp, err } @@ -186,9 +186,9 @@ func (s *UsersService) ListUserPackageVersions(ctx context.Context, user, packag // PackageGetVersion gets a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-version-for-a-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#get-a-package-version-for-the-authenticated-user // //meta:operation GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} //meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} @@ -200,13 +200,13 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, u = fmt.Sprintf("user/packages/%v/%v/versions/%v", packageType, packageName, packageVersionID) } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var version *PackageVersion - resp, err := s.client.Do(ctx, req, &version) + resp, err := s.client.Do(req, &version) if err != nil { return nil, resp, err } @@ -217,9 +217,9 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // PackageDeleteVersion deletes a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-a-package-version-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#delete-package-version-for-a-user // //meta:operation DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} //meta:operation DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} @@ -231,20 +231,20 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy u = fmt.Sprintf("user/packages/%v/%v/versions/%v", packageType, packageName, packageVersionID) } - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // PackageRestoreVersion restores a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-a-package-version-for-the-authenticated-user // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages?apiVersion=2022-11-28#restore-package-version-for-a-user // //meta:operation POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore //meta:operation POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore @@ -256,10 +256,10 @@ func (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageT u = fmt.Sprintf("user/packages/%v/%v/versions/%v/restore", packageType, packageName, packageVersionID) } - req, err := s.client.NewRequest("POST", u, nil) + req, err := s.client.NewRequest(ctx, "POST", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/github.com/google/go-github/v84/github/users_social_accounts.go b/vendor/github.com/google/go-github/v88/github/users_social_accounts.go similarity index 77% rename from vendor/github.com/google/go-github/v84/github/users_social_accounts.go rename to vendor/github.com/google/go-github/v88/github/users_social_accounts.go index e7642c6d6..ebef40265 100644 --- a/vendor/github.com/google/go-github/v84/github/users_social_accounts.go +++ b/vendor/github.com/google/go-github/v88/github/users_social_accounts.go @@ -23,7 +23,7 @@ type socialAccountsRequest struct { // ListSocialAccounts lists all social accounts for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/social-accounts?apiVersion=2022-11-28#list-social-accounts-for-the-authenticated-user // //meta:operation GET /user/social_accounts func (s *UsersService) ListSocialAccounts(ctx context.Context, opts *ListOptions) ([]*SocialAccount, *Response, error) { @@ -33,13 +33,13 @@ func (s *UsersService) ListSocialAccounts(ctx context.Context, opts *ListOptions return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var socialAccounts []*SocialAccount - resp, err := s.client.Do(ctx, req, &socialAccounts) + resp, err := s.client.Do(req, &socialAccounts) if err != nil { return nil, resp, err } @@ -49,18 +49,18 @@ func (s *UsersService) ListSocialAccounts(ctx context.Context, opts *ListOptions // AddSocialAccounts adds social accounts for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/social-accounts?apiVersion=2022-11-28#add-social-accounts-for-the-authenticated-user // //meta:operation POST /user/social_accounts func (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLs []string) ([]*SocialAccount, *Response, error) { u := "user/social_accounts" - req, err := s.client.NewRequest("POST", u, &socialAccountsRequest{AccountURLs: accountURLs}) + req, err := s.client.NewRequest(ctx, "POST", u, &socialAccountsRequest{AccountURLs: accountURLs}) if err != nil { return nil, nil, err } var accounts []*SocialAccount - resp, err := s.client.Do(ctx, req, &accounts) + resp, err := s.client.Do(req, &accounts) if err != nil { return nil, resp, err } @@ -70,22 +70,22 @@ func (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLs []stri // DeleteSocialAccounts deletes social accounts for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/social-accounts?apiVersion=2022-11-28#delete-social-accounts-for-the-authenticated-user // //meta:operation DELETE /user/social_accounts func (s *UsersService) DeleteSocialAccounts(ctx context.Context, accountURLs []string) (*Response, error) { u := "user/social_accounts" - req, err := s.client.NewRequest("DELETE", u, &socialAccountsRequest{AccountURLs: accountURLs}) + req, err := s.client.NewRequest(ctx, "DELETE", u, &socialAccountsRequest{AccountURLs: accountURLs}) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } // ListUserSocialAccounts lists all social accounts for a user. // -// GitHub API docs: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/social-accounts?apiVersion=2022-11-28#list-social-accounts-for-a-user // //meta:operation GET /users/{username}/social_accounts func (s *UsersService) ListUserSocialAccounts(ctx context.Context, username string, opts *ListOptions) ([]*SocialAccount, *Response, error) { @@ -95,13 +95,13 @@ func (s *UsersService) ListUserSocialAccounts(ctx context.Context, username stri return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var addedAccounts []*SocialAccount - resp, err := s.client.Do(ctx, req, &addedAccounts) + resp, err := s.client.Do(req, &addedAccounts) if err != nil { return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v84/github/users_ssh_signing_keys.go b/vendor/github.com/google/go-github/v88/github/users_ssh_signing_keys.go similarity index 77% rename from vendor/github.com/google/go-github/v84/github/users_ssh_signing_keys.go rename to vendor/github.com/google/go-github/v88/github/users_ssh_signing_keys.go index 968401f02..1ddda7fd8 100644 --- a/vendor/github.com/google/go-github/v84/github/users_ssh_signing_keys.go +++ b/vendor/github.com/google/go-github/v88/github/users_ssh_signing_keys.go @@ -25,9 +25,9 @@ func (k SSHSigningKey) String() string { // ListSSHSigningKeys lists the SSH signing keys for a user. Passing an empty // username string will fetch SSH signing keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#list-ssh-signing-keys-for-a-user // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#list-ssh-signing-keys-for-the-authenticated-user // //meta:operation GET /user/ssh_signing_keys //meta:operation GET /users/{username}/ssh_signing_keys @@ -43,13 +43,13 @@ func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts return nil, nil, err } - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } var keys []*SSHSigningKey - resp, err := s.client.Do(ctx, req, &keys) + resp, err := s.client.Do(req, &keys) if err != nil { return nil, resp, err } @@ -59,19 +59,19 @@ func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts // GetSSHSigningKey fetches a single SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#get-an-ssh-signing-key-for-the-authenticated-user // //meta:operation GET /user/ssh_signing_keys/{ssh_signing_key_id} func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest(ctx, "GET", u, nil) if err != nil { return nil, nil, err } - key := new(SSHSigningKey) - resp, err := s.client.Do(ctx, req, key) + var key *SSHSigningKey + resp, err := s.client.Do(req, &key) if err != nil { return nil, resp, err } @@ -81,19 +81,19 @@ func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSign // CreateSSHSigningKey adds a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#create-a-ssh-signing-key-for-the-authenticated-user // //meta:operation POST /user/ssh_signing_keys func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHSigningKey, *Response, error) { u := "user/ssh_signing_keys" - req, err := s.client.NewRequest("POST", u, key) + req, err := s.client.NewRequest(ctx, "POST", u, key) if err != nil { return nil, nil, err } - k := new(SSHSigningKey) - resp, err := s.client.Do(ctx, req, k) + var k *SSHSigningKey + resp, err := s.client.Do(req, &k) if err != nil { return nil, resp, err } @@ -103,16 +103,16 @@ func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHS // DeleteSSHSigningKey deletes a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys?apiVersion=2022-11-28#delete-an-ssh-signing-key-for-the-authenticated-user // //meta:operation DELETE /user/ssh_signing_keys/{ssh_signing_key_id} func (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) - req, err := s.client.NewRequest("DELETE", u, nil) + req, err := s.client.NewRequest(ctx, "DELETE", u, nil) if err != nil { return nil, err } - return s.client.Do(ctx, req, nil) + return s.client.Do(req, nil) } diff --git a/vendor/modules.txt b/vendor/modules.txt index c8104e085..d75dbf6b7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -202,7 +202,7 @@ github.com/bmatcuk/doublestar/v4 # github.com/bombsimon/logrusr/v4 v4.1.0 ## explicit; go 1.17 github.com/bombsimon/logrusr/v4 -# github.com/bradleyfalzon/ghinstallation/v2 v2.18.0 +# github.com/bradleyfalzon/ghinstallation/v2 v2.19.0 ## explicit; go 1.25.0 github.com/bradleyfalzon/ghinstallation/v2 # github.com/casbin/casbin/v2 v2.135.0 @@ -489,9 +489,9 @@ github.com/google/go-cmp/cmp/internal/value # github.com/google/go-github/v69 v69.2.0 ## explicit; go 1.22.0 github.com/google/go-github/v69/github -# github.com/google/go-github/v84 v84.0.0 +# github.com/google/go-github/v88 v88.0.0 ## explicit; go 1.25.0 -github.com/google/go-github/v84/github +github.com/google/go-github/v88/github # github.com/google/go-querystring v1.2.0 ## explicit; go 1.13 github.com/google/go-querystring/query