From aaa5b5b310a3accb9a0a28910357654062907d98 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 06:03:33 -0400 Subject: [PATCH 01/37] Add Copilot Endpoints --- github/copilot.go | 264 +++++++++++++++++++++ github/copilot_test.go | 407 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 40 ++++ github/github-accessors_test.go | 44 ++++ github/github.go | 2 + 5 files changed, 757 insertions(+) create mode 100644 github/copilot.go create mode 100644 github/copilot_test.go diff --git a/github/copilot.go b/github/copilot.go new file mode 100644 index 0000000000..6863ec1716 --- /dev/null +++ b/github/copilot.go @@ -0,0 +1,264 @@ +// 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" + "fmt" +) + +// 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 + +// OrganizationDetails represents the details of an organization's Copilot for Business supbscription. +type OrganizationCopilotDetails struct { + SeatBreakdown *SeatBreakdown `json:"seat_breakdown"` + PublicCodeSuggestions string `json:"public_code_suggestions"` + CopilotChat string `json:"copilot_chat"` + SeatManagementSetting string `json:"seat_management_setting"` +} + +// SeatBreakdown represents the breakdown of Copilot for Business seats for the organization. +type SeatBreakdown struct { + Total int64 `json:"total"` + AddedThisCycle int64 `json:"added_this_cycle"` + PendingCancellation int64 `json:"pending_cancellation"` + PendingInvitation int64 `json:"pending_invitation"` + ActiveThisCycle int64 `json:"active_this_cycle"` + InactiveThisCycle int64 `json:"inactive_this_cycle"` +} + +type CopilotSeats struct { + TotalSeats int64 `json:"total_seats"` + Seats []CopilotSeatDetails `json:"seats"` +} + +// CopilotSeatDetail represents the details of a Copilot for Business seat. +// Assignee can either be a User, Team, or Organization. +type CopilotSeatDetails struct { + Assignee interface{} `json:"assignee"` + AssigningTeam *Team `json:"assigning_team,omitempty"` + PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` + LastActivityAt *string `json:"last_activity_at,omitempty"` + LastActivityEditor *string `json:"last_activity_editor,omitempty"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at,omitempty"` +} + +// SelectedTeams represents the teams selected for the Copilot for Business subscription. +type SelectedTeams struct { + SelectedTeams []string `json:"selected_teams"` +} + +// SelectedUsers represents the users selected for the Copilot for Business subscription. +type SelectedUsers struct { + SelectedUsers []string `json:"selected_users"` +} + +// SeatAssignments represents the number of seats assigned. +type SeatAssignments struct { + SeatsCreated int64 `json:"seats_created"` +} + +// SeatCancellations represents the number of seats cancelled. +type SeatCancellations struct { + SeatsCancelled int64 `json:"seats_cancelled"` +} + +func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { + 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 + + switch v := seatDetail.Assignee.(type) { + case map[string]interface{}: + jsonData, err := json.Marshal(seatDetail.Assignee) + if err != nil { + panic(err) + } + if v["type"].(string) == "User" { + user := &User{} + if err := json.Unmarshal(jsonData, user); err != nil { + return err + } + cp.Assignee = user + } else if v["type"].(string) == "Team" { + team := &Team{} + if err := json.Unmarshal(jsonData, team); err != nil { + return err + } + cp.Assignee = team + } else if v["type"].(string) == "Organization" { + organization := &Organization{} + if err := json.Unmarshal(jsonData, organization); err != nil { + return err + } + cp.Assignee = organization + } else { + return fmt.Errorf("unsupported type %s", v["type"].(string)) + } + default: + // return fmt.Errorf("unable to unmarshal CopilotSeatDetail, Assignee is not a User, Team, or Organization. Assignee details: %v", seatDetail.Assignee) + return fmt.Errorf("unsupported type %T", v) + } + + return nil +} + +// Get Copilot for Business seat information and settings for an organization +// +// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization +func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*OrganizationCopilotDetails, *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 *OrganizationCopilotDetails + resp, err := s.client.Do(ctx, req, &copilotDetails) + if err != nil { + return nil, resp, err + } + + return copilotDetails, resp, nil +} + +// Get Copilot for Business seat assignments for an organization +// +// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization +func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string) (*CopilotSeats, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var copilotSeats *CopilotSeats + resp, err := s.client.Do(ctx, req, &copilotSeats) + if err != nil { + return nil, resp, err + } + + return copilotSeats, resp, nil +} + +// Add teams to the Copilot for Business subscription for an organization +// +// https://docs.github.com/en/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization +func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teams SelectedTeams) (*SeatAssignments, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) + + req, err := s.client.NewRequest("PUT", u, teams) + 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 +} + +// Remove teams from the Copilot for Business subscription for an organization +// +// https://docs.github.com/en/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization + +func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teams SelectedTeams) (*SeatCancellations, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) + + req, err := s.client.NewRequest("DELETE", u, teams) + 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 +} + +// Add users to the Copilot for Business subscription for an organization +// +// https://docs.github.com/en/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization +func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users SelectedUsers) (*SeatAssignments, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) + + req, err := s.client.NewRequest("PUT", u, users) + 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 +} + +// Remove users from the Copilot for Business subscription for an organization +// +// https://docs.github.com/en/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization +func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users SelectedUsers) (*SeatCancellations, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) + + req, err := s.client.NewRequest("DELETE", u, users) + 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 +} + +// Get Copilot for Business seat assignment details for a user +// +// https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user +func (s *CopilotService) GetSeatDetails(ctx context.Context, org string, 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 +} diff --git a/github/copilot_test.go b/github/copilot_test.go new file mode 100644 index 0000000000..6be1c3565f --- /dev/null +++ b/github/copilot_test.go @@ -0,0 +1,407 @@ +package github + +import ( + "context" + "fmt" + "net/http" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestCopilotService_GetCopilotBilling(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "seat_breakdown": { + "total": 12, + "added_this_cycle": 9, + "pending_invitation": 0, + "pending_cancellation": 0, + "active_this_cycle": 12, + "inactive_this_cycle": 11 + }, + "seat_management_setting": "assign_selected", + "public_code_suggestions": "block" + }`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.GetCopilotBilling(ctx, "o") + if err != nil { + t.Errorf("Copilot.GetCopilotBilling returned error: %v", err) + } + + want := &OrganizationCopilotDetails{ + SeatBreakdown: &SeatBreakdown{ + Total: 12, + AddedThisCycle: 9, + PendingInvitation: 0, + PendingCancellation: 0, + ActiveThisCycle: 12, + InactiveThisCycle: 11, + }, + PublicCodeSuggestions: "block", + CopilotChat: "", + SeatManagementSetting: "assign_selected", + } + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetCopilotBilling returned %+v, want %+v", got, want) + } +} + +func TestCopilotService_ListCopilotSeats(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "total_seats": 2, + "seats": [ + { + "created_at": "2021-08-03T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": null, + "last_activity_at": "2021-10-14T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "assigning_team": { + "id": 1, + "node_id": "MDQ6VGVhbTE=", + "url": "https://api.github.com/teams/1", + "html_url": "https://github.com/orgs/github/teams/justice-league", + "name": "Justice League", + "slug": "justice-league", + "description": "A great team.", + "privacy": "closed", + "notification_setting": "notifications_enabled", + "permission": "admin", + "members_url": "https://api.github.com/teams/1/members{/member}", + "repositories_url": "https://api.github.com/teams/1/repos", + "parent": null + } + }, + { + "created_at": "2021-09-23T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": "2021-11-01", + "last_activity_at": "2021-10-13T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "login": "octokitten", + "id": 1, + "node_id": "MDQ76VNlcjE=", + "avatar_url": "https://github.com/images/error/octokitten_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octokitten", + "html_url": "https://github.com/octokitten", + "followers_url": "https://api.github.com/users/octokitten/followers", + "following_url": "https://api.github.com/users/octokitten/following{/other_user}", + "gists_url": "https://api.github.com/users/octokitten/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octokitten/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octokitten/subscriptions", + "organizations_url": "https://api.github.com/users/octokitten/orgs", + "repos_url": "https://api.github.com/users/octokitten/repos", + "events_url": "https://api.github.com/users/octokitten/events{/privacy}", + "received_events_url": "https://api.github.com/users/octokitten/received_events", + "type": "User", + "site_admin": false + } + } + ] + }`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.ListCopilotSeats(ctx, "o") + if err != nil { + t.Errorf("Copilot.ListCopilotSeats returned error: %v", err) + } + + want := &CopilotSeats{ + TotalSeats: 2, + Seats: []CopilotSeatDetails{ + { + Assignee: &User{ + Login: String("octocat"), + ID: Int64(1), + NodeID: String("MDQ6VXNlcjE="), + AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octocat"), + HTMLURL: String("https://github.com/octocat"), + FollowersURL: String("https://api.github.com/users/octocat/followers"), + FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), + ReposURL: String("https://api.github.com/users/octocat/repos"), + EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + AssigningTeam: &Team{ + ID: Int64(1), + NodeID: String("MDQ6VGVhbTE="), + URL: String("https://api.github.com/teams/1"), + HTMLURL: String("https://github.com/orgs/github/teams/justice-league"), + Name: String("Justice League"), + Slug: String("justice-league"), + Description: String("A great team."), + Privacy: String("closed"), + Permission: String("admin"), + MembersURL: String("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: String("https://api.github.com/teams/1/repos"), + Parent: nil, + }, + CreatedAt: "2021-08-03T18:00:00-06:00", + UpdatedAt: "2021-09-23T15:00:00-06:00", + PendingCancellationDate: nil, + LastActivityAt: String("2021-10-14T00:53:32-06:00"), + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + }, + { + Assignee: &User{ + Login: String("octokitten"), + ID: Int64(1), + NodeID: String("MDQ76VNlcjE="), + AvatarURL: String("https://github.com/images/error/octokitten_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octokitten"), + HTMLURL: String("https://github.com/octokitten"), + FollowersURL: String("https://api.github.com/users/octokitten/followers"), + FollowingURL: String("https://api.github.com/users/octokitten/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octokitten/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octokitten/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octokitten/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octokitten/orgs"), + ReposURL: String("https://api.github.com/users/octokitten/repos"), + EventsURL: String("https://api.github.com/users/octokitten/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octokitten/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + AssigningTeam: nil, + CreatedAt: "2021-09-23T18:00:00-06:00", + UpdatedAt: "2021-09-23T15:00:00-06:00", + PendingCancellationDate: String("2021-11-01"), + LastActivityAt: String("2021-10-13T00:53:32-06:00"), + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + }, + }, + } + if !cmp.Equal(got, want) { + t.Errorf("Copilot.ListCopilotSeats returned %+v, want %+v", got, want) + } +} + +func TestCopilotService_AddCopilotTeams(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{"seats_created": 2}`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.AddCopilotTeams(ctx, "o", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + if err != nil { + t.Errorf("Copilot.AddCopilotTeams returned error: %v", err) + } + + want := &SeatAssignments{SeatsCreated: 2} + if !cmp.Equal(got, want) { + t.Errorf("Copilot.AddCopilotTeams returned %+v, want %+v", got, want) + } +} + +func TestCopilotService_RemoveCopilotTeams(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `{"seats_cancelled": 2}`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.RemoveCopilotTeams(ctx, "o", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + if err != nil { + t.Errorf("Copilot.RemoveCopilotTeams returned error: %v", err) + } + + want := &SeatCancellations{SeatsCancelled: 2} + if !cmp.Equal(got, want) { + t.Errorf("Copilot.RemoveCopilotTeams returned %+v, want %+v", got, want) + } +} + +func TestCopilotService_AddCopilotUsers(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "PUT") + fmt.Fprint(w, `{"seats_created": 2}`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.AddCopilotUsers(ctx, "o", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + if err != nil { + t.Errorf("Copilot.AddCopilotUsers returned error: %v", err) + } + + want := &SeatAssignments{SeatsCreated: 2} + if !cmp.Equal(got, want) { + t.Errorf("Copilot.AddCopilotUsers returned %+v, want %+v", got, want) + } +} + +func TestCopilotService_RemoveCopilotUsers(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + fmt.Fprint(w, `{"seats_cancelled": 2}`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.RemoveCopilotUsers(ctx, "o", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + if err != nil { + t.Errorf("Copilot.RemoveCopilotUsers returned error: %v", err) + } + + want := &SeatCancellations{SeatsCancelled: 2} + if !cmp.Equal(got, want) { + t.Errorf("Copilot.RemoveCopilotUsers returned %+v, want %+v", got, want) + } +} + +func TestCopilotService_GetSeatDetails(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/orgs/o/members/u/copilot", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "created_at": "2021-08-03T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": null, + "last_activity_at": "2021-10-14T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "assigning_team": { + "id": 1, + "node_id": "MDQ6VGVhbTE=", + "url": "https://api.github.com/teams/1", + "html_url": "https://github.com/orgs/github/teams/justice-league", + "name": "Justice League", + "slug": "justice-league", + "description": "A great team.", + "privacy": "closed", + "notification_setting": "notifications_enabled", + "permission": "admin", + "members_url": "https://api.github.com/teams/1/members{/member}", + "repositories_url": "https://api.github.com/teams/1/repos", + "parent": null + } + }`) + }) + + ctx := context.Background() + got, _, err := client.Copilot.GetSeatDetails(ctx, "o", "u") + if err != nil { + t.Errorf("Copilot.GetSeatDetails returned error: %v", err) + } + + want := &CopilotSeatDetails{ + Assignee: &User{ + Login: String("octocat"), + ID: Int64(1), + NodeID: String("MDQ6VXNlcjE="), + AvatarURL: String("https://github.com/images/error/octocat_happy.gif"), + GravatarID: String(""), + URL: String("https://api.github.com/users/octocat"), + HTMLURL: String("https://github.com/octocat"), + FollowersURL: String("https://api.github.com/users/octocat/followers"), + FollowingURL: String("https://api.github.com/users/octocat/following{/other_user}"), + GistsURL: String("https://api.github.com/users/octocat/gists{/gist_id}"), + StarredURL: String("https://api.github.com/users/octocat/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/octocat/subscriptions"), + OrganizationsURL: String("https://api.github.com/users/octocat/orgs"), + ReposURL: String("https://api.github.com/users/octocat/repos"), + EventsURL: String("https://api.github.com/users/octocat/events{/privacy}"), + ReceivedEventsURL: String("https://api.github.com/users/octocat/received_events"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + AssigningTeam: &Team{ + ID: Int64(1), + NodeID: String("MDQ6VGVhbTE="), + URL: String("https://api.github.com/teams/1"), + HTMLURL: String("https://github.com/orgs/github/teams/justice-league"), + Name: String("Justice League"), + Slug: String("justice-league"), + Description: String("A great team."), + Privacy: String("closed"), + Permission: String("admin"), + MembersURL: String("https://api.github.com/teams/1/members{/member}"), + RepositoriesURL: String("https://api.github.com/teams/1/repos"), + Parent: nil, + }, + CreatedAt: "2021-08-03T18:00:00-06:00", + UpdatedAt: "2021-09-23T15:00:00-06:00", + PendingCancellationDate: nil, + LastActivityAt: String("2021-10-14T00:53:32-06:00"), + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + } + if !cmp.Equal(got, want) { + t.Errorf("Copilot.GetSeatDetails returned %+v, want %+v", got, want) + } +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 199c9b8a37..985e7436ab 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4486,6 +4486,38 @@ func (c *ContributorStats) GetTotal() int { return *c.Total } +// GetAssigningTeam returns the AssigningTeam field. +func (c *CopilotSeatDetails) GetAssigningTeam() *Team { + if c == nil { + return nil + } + return c.AssigningTeam +} + +// GetLastActivityAt returns the LastActivityAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetLastActivityAt() string { + if c == nil || c.LastActivityAt == nil { + return "" + } + return *c.LastActivityAt +} + +// GetLastActivityEditor returns the LastActivityEditor field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetLastActivityEditor() string { + if c == nil || c.LastActivityEditor == nil { + return "" + } + return *c.LastActivityEditor +} + +// GetPendingCancellationDate returns the PendingCancellationDate field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetPendingCancellationDate() string { + if c == nil || c.PendingCancellationDate == nil { + return "" + } + return *c.PendingCancellationDate +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { if c == nil || c.CompletedAt == nil { @@ -12542,6 +12574,14 @@ func (o *Organization) GetWebCommitSignoffRequired() bool { return *o.WebCommitSignoffRequired } +// GetSeatBreakdown returns the SeatBreakdown field. +func (o *OrganizationCopilotDetails) GetSeatBreakdown() *SeatBreakdown { + if o == nil { + return nil + } + return o.SeatBreakdown +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationCustomRepoRoles) GetTotalCount() int { if o == nil || o.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index d179a92775..026af96966 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5290,6 +5290,43 @@ func TestContributorStats_GetTotal(tt *testing.T) { c.GetTotal() } +func TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) { + c := &CopilotSeatDetails{} + c.GetAssigningTeam() + c = nil + c.GetAssigningTeam() +} + +func TestCopilotSeatDetails_GetLastActivityAt(tt *testing.T) { + var zeroValue string + c := &CopilotSeatDetails{LastActivityAt: &zeroValue} + c.GetLastActivityAt() + c = &CopilotSeatDetails{} + c.GetLastActivityAt() + c = nil + c.GetLastActivityAt() +} + +func TestCopilotSeatDetails_GetLastActivityEditor(tt *testing.T) { + var zeroValue string + c := &CopilotSeatDetails{LastActivityEditor: &zeroValue} + c.GetLastActivityEditor() + c = &CopilotSeatDetails{} + c.GetLastActivityEditor() + c = nil + c.GetLastActivityEditor() +} + +func TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) { + var zeroValue string + c := &CopilotSeatDetails{PendingCancellationDate: &zeroValue} + c.GetPendingCancellationDate() + c = &CopilotSeatDetails{} + c.GetPendingCancellationDate() + c = nil + c.GetPendingCancellationDate() +} + func TestCreateCheckRunOptions_GetCompletedAt(tt *testing.T) { var zeroValue Timestamp c := &CreateCheckRunOptions{CompletedAt: &zeroValue} @@ -14697,6 +14734,13 @@ func TestOrganization_GetWebCommitSignoffRequired(tt *testing.T) { o.GetWebCommitSignoffRequired() } +func TestOrganizationCopilotDetails_GetSeatBreakdown(tt *testing.T) { + o := &OrganizationCopilotDetails{} + o.GetSeatBreakdown() + o = nil + o.GetSeatBreakdown() +} + func TestOrganizationCustomRepoRoles_GetTotalCount(tt *testing.T) { var zeroValue int o := &OrganizationCustomRepoRoles{TotalCount: &zeroValue} diff --git a/github/github.go b/github/github.go index 834aa86bc6..56b7fd36fc 100644 --- a/github/github.go +++ b/github/github.go @@ -185,6 +185,7 @@ type Client struct { CodeScanning *CodeScanningService CodesOfConduct *CodesOfConductService Codespaces *CodespacesService + Copilot *CopilotService Dependabot *DependabotService DependencyGraph *DependencyGraphService Emojis *EmojisService @@ -407,6 +408,7 @@ func (c *Client) initialize() { c.CodeScanning = (*CodeScanningService)(&c.common) c.Codespaces = (*CodespacesService)(&c.common) c.CodesOfConduct = (*CodesOfConductService)(&c.common) + c.Copilot = (*CopilotService)(&c.common) c.Dependabot = (*DependabotService)(&c.common) c.DependencyGraph = (*DependencyGraphService)(&c.common) c.Emojis = (*EmojisService)(&c.common) From 67e0a689e74479565d99e39532e932c88b452ed5 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 06:08:16 -0400 Subject: [PATCH 02/37] clean up unmarshal func --- github/copilot.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 6863ec1716..ed2dbe07b5 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -91,7 +91,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { case map[string]interface{}: jsonData, err := json.Marshal(seatDetail.Assignee) if err != nil { - panic(err) + return err } if v["type"].(string) == "User" { user := &User{} @@ -112,11 +112,10 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { } cp.Assignee = organization } else { - return fmt.Errorf("unsupported type %s", v["type"].(string)) + return fmt.Errorf("unsupported assignee type %s", v["type"].(string)) } default: - // return fmt.Errorf("unable to unmarshal CopilotSeatDetail, Assignee is not a User, Team, or Organization. Assignee details: %v", seatDetail.Assignee) - return fmt.Errorf("unsupported type %T", v) + return fmt.Errorf("unsupported assignee type %T", v) } return nil From 3e32babcfb8d11d99cc175d470338c7f34f8617d Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 06:40:57 -0400 Subject: [PATCH 03/37] Add coverage and adddress linting issues --- github/copilot.go | 18 +++++++++--------- github/orgs_rules.go | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index ed2dbe07b5..83ff7ecf14 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -17,7 +17,7 @@ import ( // GitHub API docs: https://docs.github.com/en/rest/copilot/ type CopilotService service -// OrganizationDetails represents the details of an organization's Copilot for Business supbscription. +// OrganizationCopilotDetails represents the details of an organization's Copilot for Business supbscription. type OrganizationCopilotDetails struct { SeatBreakdown *SeatBreakdown `json:"seat_breakdown"` PublicCodeSuggestions string `json:"public_code_suggestions"` @@ -40,7 +40,7 @@ type CopilotSeats struct { Seats []CopilotSeatDetails `json:"seats"` } -// CopilotSeatDetail represents the details of a Copilot for Business seat. +// CopilotSeatDetails represents the details of a Copilot for Business seat. // Assignee can either be a User, Team, or Organization. type CopilotSeatDetails struct { Assignee interface{} `json:"assignee"` @@ -121,7 +121,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { return nil } -// Get Copilot for Business seat information and settings for an organization +// GetCopilotBilling Gets Copilot for Business seat information and settings for an organization // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*OrganizationCopilotDetails, *Response, error) { @@ -141,7 +141,7 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Or return copilotDetails, resp, nil } -// Get Copilot for Business seat assignments for an organization +// ListCopilotSeats Gets Copilot for Business seat assignments for an organization // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string) (*CopilotSeats, *Response, error) { @@ -161,7 +161,7 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string) (*Cop return copilotSeats, resp, nil } -// Add teams to the Copilot for Business subscription for an organization +// AddCopilotTeams Adds teams to the Copilot for Business subscription for an organization // // https://docs.github.com/en/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teams SelectedTeams) (*SeatAssignments, *Response, error) { @@ -181,7 +181,7 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teams return seatAssignments, resp, nil } -// Remove teams from the Copilot for Business subscription for an organization +// RemoveCopilotTeams Removes teams from the Copilot for Business subscription for an organization // // https://docs.github.com/en/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization @@ -202,7 +202,7 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea return SeatCancellations, resp, nil } -// Add users to the Copilot for Business subscription for an organization +// AddCopilotUsers Adds users to the Copilot for Business subscription for an organization // // https://docs.github.com/en/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users SelectedUsers) (*SeatAssignments, *Response, error) { @@ -222,7 +222,7 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users return seatAssignments, resp, nil } -// Remove users from the Copilot for Business subscription for an organization +// RemoveCopilotUsers Removes users from the Copilot for Business subscription for an organization // // https://docs.github.com/en/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users SelectedUsers) (*SeatCancellations, *Response, error) { @@ -242,7 +242,7 @@ func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, use return SeatCancellations, resp, nil } -// Get Copilot for Business seat assignment details for a user +// GetSeatDetails Gets Copilot for Business seat assignment details for a user // // https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user func (s *CopilotService) GetSeatDetails(ctx context.Context, org string, user string) (*CopilotSeatDetails, *Response, error) { diff --git a/github/orgs_rules.go b/github/orgs_rules.go index a3905af8fb..845d6b2cd6 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -36,6 +36,7 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) + rs.normalizeBypassActors() req, err := s.client.NewRequest("POST", u, rs) if err != nil { return nil, nil, err @@ -76,6 +77,7 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, org string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + rs.normalizeBypassActors() req, err := s.client.NewRequest("PUT", u, rs) if err != nil { return nil, nil, err From 8dddf5f9ae2b0528a64aeb2ffcf72991dc781ecd Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 06:44:02 -0400 Subject: [PATCH 04/37] undo wrong file committed --- github/copilot_test.go | 160 +++++++++++++++++++++++++++++++++++++++++ github/orgs_rules.go | 2 - 2 files changed, 160 insertions(+), 2 deletions(-) diff --git a/github/copilot_test.go b/github/copilot_test.go index 6be1c3565f..36f2750210 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -51,6 +51,21 @@ func TestCopilotService_GetCopilotBilling(t *testing.T) { if !cmp.Equal(got, want) { t.Errorf("Copilot.GetCopilotBilling returned %+v, want %+v", got, want) } + + const methodName = "GetCopilotBilling" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetCopilotBilling(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetCopilotBilling(ctx, "o") + if got != nil { + t.Errorf("Copilot.GetCopilotBilling returned %+v, want nil", got) + } + return resp, err + }) } func TestCopilotService_ListCopilotSeats(t *testing.T) { @@ -130,6 +145,30 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { "type": "User", "site_admin": false } + }, + { + "created_at": "2021-09-23T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": "2021-11-01", + "last_activity_at": "2021-10-13T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "name": "octokittens", + "id": 1, + "type": "Team" + } + }, + { + "created_at": "2021-09-23T18:00:00-06:00", + "updated_at": "2021-09-23T15:00:00-06:00", + "pending_cancellation_date": "2021-11-01", + "last_activity_at": "2021-10-13T00:53:32-06:00", + "last_activity_editor": "vscode/1.77.3/copilot/1.86.82", + "assignee": { + "name": "octocats", + "id": 1, + "type": "Organization" + } } ] }`) @@ -213,11 +252,52 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { LastActivityAt: String("2021-10-13T00:53:32-06:00"), LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), }, + { + Assignee: &Team{ + ID: Int64(1), + Name: String("octokittens"), + }, + AssigningTeam: nil, + CreatedAt: "2021-09-23T18:00:00-06:00", + UpdatedAt: "2021-09-23T15:00:00-06:00", + PendingCancellationDate: String("2021-11-01"), + LastActivityAt: String("2021-10-13T00:53:32-06:00"), + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + }, + { + Assignee: &Organization{ + ID: Int64(1), + Name: String("octocats"), + Type: String("Organization"), + }, + AssigningTeam: nil, + CreatedAt: "2021-09-23T18:00:00-06:00", + UpdatedAt: "2021-09-23T15:00:00-06:00", + PendingCancellationDate: String("2021-11-01"), + LastActivityAt: String("2021-10-13T00:53:32-06:00"), + LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), + }, }, } + if !cmp.Equal(got, want) { t.Errorf("Copilot.ListCopilotSeats returned %+v, want %+v", got, want) } + + const methodName = "ListCopilotSeats" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.ListCopilotSeats(ctx, "") + if got != nil { + t.Errorf("Copilot.ListCopilotSeats returned %+v, want nil", got) + } + return resp, err + }) } func TestCopilotService_AddCopilotTeams(t *testing.T) { @@ -236,9 +316,25 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { } want := &SeatAssignments{SeatsCreated: 2} + if !cmp.Equal(got, want) { t.Errorf("Copilot.AddCopilotTeams returned %+v, want %+v", got, want) } + + const methodName = "AddCopilotTeams" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.AddCopilotTeams(ctx, "\n", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.AddCopilotTeams(ctx, "o", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + if got != nil { + t.Errorf("Copilot.AddCopilotTeams returned %+v, want nil", got) + } + return resp, err + }) } func TestCopilotService_RemoveCopilotTeams(t *testing.T) { @@ -257,9 +353,25 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { } want := &SeatCancellations{SeatsCancelled: 2} + if !cmp.Equal(got, want) { t.Errorf("Copilot.RemoveCopilotTeams returned %+v, want %+v", got, want) } + + const methodName = "RemoveCopilotTeams" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.RemoveCopilotTeams(ctx, "\n", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.RemoveCopilotTeams(ctx, "o", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + if got != nil { + t.Errorf("Copilot.RemoveCopilotTeams returned %+v, want nil", got) + } + return resp, err + }) } func TestCopilotService_AddCopilotUsers(t *testing.T) { @@ -278,9 +390,25 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { } want := &SeatAssignments{SeatsCreated: 2} + if !cmp.Equal(got, want) { t.Errorf("Copilot.AddCopilotUsers returned %+v, want %+v", got, want) } + + const methodName = "AddCopilotUsers" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.AddCopilotUsers(ctx, "\n", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.AddCopilotUsers(ctx, "o", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + if got != nil { + t.Errorf("Copilot.AddCopilotUsers returned %+v, want nil", got) + } + return resp, err + }) } func TestCopilotService_RemoveCopilotUsers(t *testing.T) { @@ -299,9 +427,25 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { } want := &SeatCancellations{SeatsCancelled: 2} + if !cmp.Equal(got, want) { t.Errorf("Copilot.RemoveCopilotUsers returned %+v, want %+v", got, want) } + + const methodName = "RemoveCopilotUsers" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.RemoveCopilotUsers(ctx, "\n", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.RemoveCopilotUsers(ctx, "o", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + if got != nil { + t.Errorf("Copilot.RemoveCopilotUsers returned %+v, want nil", got) + } + return resp, err + }) } func TestCopilotService_GetSeatDetails(t *testing.T) { @@ -401,7 +545,23 @@ func TestCopilotService_GetSeatDetails(t *testing.T) { LastActivityAt: String("2021-10-14T00:53:32-06:00"), LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), } + if !cmp.Equal(got, want) { t.Errorf("Copilot.GetSeatDetails returned %+v, want %+v", got, want) } + + const methodName = "GetSeatDetails" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Copilot.GetSeatDetails(ctx, "\n", "u") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Copilot.GetSeatDetails(ctx, "o", "u") + if got != nil { + t.Errorf("Copilot.GetSeatDetails returned %+v, want nil", got) + } + return resp, err + }) } diff --git a/github/orgs_rules.go b/github/orgs_rules.go index 845d6b2cd6..a3905af8fb 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -36,7 +36,6 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) - rs.normalizeBypassActors() req, err := s.client.NewRequest("POST", u, rs) if err != nil { return nil, nil, err @@ -77,7 +76,6 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, org string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) - rs.normalizeBypassActors() req, err := s.client.NewRequest("PUT", u, rs) if err != nil { return nil, nil, err From 08641678f8ae88a493a2ff5d579d5f117e0c172b Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 07:32:16 -0400 Subject: [PATCH 05/37] Add json unmarshal tests for seat details --- github/copilot_test.go | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/github/copilot_test.go b/github/copilot_test.go index 36f2750210..0c3030b123 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -9,6 +9,78 @@ import ( "github.com/google/go-cmp/cmp" ) +// Test invalid JSON responses, vlaid responses are covered in the other tests +func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { + tests := map[string]struct { + data string + want *CopilotSeatDetails + wantErr bool + }{ + "Invalid JSON": { + data: `{`, + want: &CopilotSeatDetails{ + Assignee: nil, + }, + wantErr: true, + }, + "Invalid Assignee Type": { + data: `{ + "assignee": { + "name": "octokittens", + "id": 1, + "type": "None" + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + "Invalid User": { + data: `{ + "assignee": { + "type": "User", + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + "Invalid Team": { + data: `{ + "assignee": { + "type": "Team", + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + "Invalid Organization": { + data: `{ + "assignee": { + "type": "Organization", + } + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, + } + + for name, tc := range tests { + seatDetails := &CopilotSeatDetails{} + + t.Run(name, func(t *testing.T) { + err := seatDetails.UnmarshalJSON([]byte(tc.data)) + if err == nil && tc.wantErr { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned nil instead of an error") + } + if err != nil && !tc.wantErr { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + if !cmp.Equal(tc.want, seatDetails) { + t.Errorf("CopilotSeatDetails.UnmarshalJSON expected %+v, got %+v", tc.want, seatDetails) + } + }) + } +} + func TestCopilotService_GetCopilotBilling(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -66,6 +138,7 @@ func TestCopilotService_GetCopilotBilling(t *testing.T) { } return resp, err }) + } func TestCopilotService_ListCopilotSeats(t *testing.T) { From 9d5be6775169d5064d1e4a2eba165de07305fbb9 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 07:40:25 -0400 Subject: [PATCH 06/37] update seat details unmarshal tests --- github/copilot_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/github/copilot_test.go b/github/copilot_test.go index 0c3030b123..01ff872c9a 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -23,6 +23,13 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { }, wantErr: true, }, + "Invalid Assignee Field Type": { + data: `{ + "assignee": "test" + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, "Invalid Assignee Type": { data: `{ "assignee": { @@ -38,6 +45,7 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { data: `{ "assignee": { "type": "User", + "id": "bad", } }`, want: &CopilotSeatDetails{}, @@ -47,6 +55,7 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { data: `{ "assignee": { "type": "Team", + "id": "bad", } }`, want: &CopilotSeatDetails{}, @@ -56,6 +65,7 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { data: `{ "assignee": { "type": "Organization", + "id": "bad", } }`, want: &CopilotSeatDetails{}, @@ -138,7 +148,6 @@ func TestCopilotService_GetCopilotBilling(t *testing.T) { } return resp, err }) - } func TestCopilotService_ListCopilotSeats(t *testing.T) { From 3e27021eb2b1dacef492942856b95eb5dc81f58f Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 11:01:42 -0400 Subject: [PATCH 07/37] Apply suggestions from code review Co-authored-by: WillAbides <233500+WillAbides@users.noreply.github.com> Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- github/copilot.go | 55 +++++++++++++++++++++--------------------- github/copilot_test.go | 5 ++++ 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 83ff7ecf14..832fb84e14 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -17,7 +17,7 @@ import ( // GitHub API docs: https://docs.github.com/en/rest/copilot/ type CopilotService service -// OrganizationCopilotDetails represents the details of an organization's Copilot for Business supbscription. +// OrganizationCopilotDetails represents the details of an organization's Copilot for Business subscription. type OrganizationCopilotDetails struct { SeatBreakdown *SeatBreakdown `json:"seat_breakdown"` PublicCodeSuggestions string `json:"public_code_suggestions"` @@ -27,22 +27,22 @@ type OrganizationCopilotDetails struct { // SeatBreakdown represents the breakdown of Copilot for Business seats for the organization. type SeatBreakdown struct { - Total int64 `json:"total"` - AddedThisCycle int64 `json:"added_this_cycle"` - PendingCancellation int64 `json:"pending_cancellation"` - PendingInvitation int64 `json:"pending_invitation"` - ActiveThisCycle int64 `json:"active_this_cycle"` - InactiveThisCycle int64 `json:"inactive_this_cycle"` + 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"` } type CopilotSeats struct { TotalSeats int64 `json:"total_seats"` - Seats []CopilotSeatDetails `json:"seats"` + Seats []*CopilotSeatDetails `json:"seats"` } // CopilotSeatDetails represents the details of a Copilot for Business seat. -// Assignee can either be a User, Team, or Organization. type CopilotSeatDetails struct { + // Assignee can either be a User, Team, or Organization. Assignee interface{} `json:"assignee"` AssigningTeam *Team `json:"assigning_team,omitempty"` PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` @@ -64,17 +64,17 @@ type SelectedUsers struct { // SeatAssignments represents the number of seats assigned. type SeatAssignments struct { - SeatsCreated int64 `json:"seats_created"` + SeatsCreated int `json:"seats_created"` } // SeatCancellations represents the number of seats cancelled. type SeatCancellations struct { - SeatsCancelled int64 `json:"seats_cancelled"` + SeatsCancelled int `json:"seats_cancelled"` } func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { - type Alias CopilotSeatDetails - var seatDetail Alias + type alias CopilotSeatDetails + var seatDetail alias if err := json.Unmarshal(data, &seatDetail); err != nil { return err @@ -121,7 +121,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { return nil } -// GetCopilotBilling Gets Copilot for Business seat information and settings for an organization +// GetCopilotBilling gets Copilot for Business billing information and settings for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*OrganizationCopilotDetails, *Response, error) { @@ -141,7 +141,7 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Or return copilotDetails, resp, nil } -// ListCopilotSeats Gets Copilot for Business seat assignments for an organization +// ListCopilotSeats lists Copilot for Business seat assignments for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string) (*CopilotSeats, *Response, error) { @@ -161,13 +161,13 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string) (*Cop return copilotSeats, resp, nil } -// AddCopilotTeams Adds teams to the Copilot for Business subscription for an organization +// AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // -// https://docs.github.com/en/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teams SelectedTeams) (*SeatAssignments, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - req, err := s.client.NewRequest("PUT", u, teams) + req, err := s.client.NewRequest("POST", u, teams) if err != nil { return nil, nil, err } @@ -181,10 +181,9 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teams return seatAssignments, resp, nil } -// RemoveCopilotTeams Removes teams from the Copilot for Business subscription for an organization +// RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. // -// https://docs.github.com/en/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization - +// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teams SelectedTeams) (*SeatCancellations, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) @@ -204,11 +203,11 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea // AddCopilotUsers Adds users to the Copilot for Business subscription for an organization // -// https://docs.github.com/en/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users SelectedUsers) (*SeatAssignments, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - req, err := s.client.NewRequest("PUT", u, users) + req, err := s.client.NewRequest("POST", u, users) if err != nil { return nil, nil, err } @@ -222,9 +221,9 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users return seatAssignments, resp, nil } -// RemoveCopilotUsers Removes users from the Copilot for Business subscription for an organization +// RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. // -// https://docs.github.com/en/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users SelectedUsers) (*SeatCancellations, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) @@ -242,10 +241,10 @@ func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, use return SeatCancellations, resp, nil } -// GetSeatDetails Gets Copilot for Business seat assignment details for a user +// GetSeatDetails gets Copilot for Business seat assignment details for a user. // -// https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user -func (s *CopilotService) GetSeatDetails(ctx context.Context, org string, user string) (*CopilotSeatDetails, *Response, error) { +// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user +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) diff --git a/github/copilot_test.go b/github/copilot_test.go index 01ff872c9a..c62911b79c 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -1,3 +1,8 @@ +// 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 ( From 568617ddc3681b3c52d2f46e03500a0d0e0548f2 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 19:33:56 -0400 Subject: [PATCH 08/37] code review comments --- github/copilot.go | 97 +++++++++++++++++++-------------- github/copilot_test.go | 70 +++++++++++++----------- github/github-accessors.go | 16 +++--- github/github-accessors_test.go | 14 ++--- 4 files changed, 111 insertions(+), 86 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 832fb84e14..d498ad426a 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -17,16 +17,16 @@ import ( // GitHub API docs: https://docs.github.com/en/rest/copilot/ type CopilotService service -// OrganizationCopilotDetails represents the details of an organization's Copilot for Business subscription. -type OrganizationCopilotDetails struct { - SeatBreakdown *SeatBreakdown `json:"seat_breakdown"` - PublicCodeSuggestions string `json:"public_code_suggestions"` - CopilotChat string `json:"copilot_chat"` - SeatManagementSetting string `json:"seat_management_setting"` +// 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"` } -// SeatBreakdown represents the breakdown of Copilot for Business seats for the organization. -type SeatBreakdown struct { +// 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"` @@ -35,8 +35,9 @@ type SeatBreakdown struct { InactiveThisCycle int `json:"inactive_this_cycle"` } -type CopilotSeats struct { - TotalSeats int64 `json:"total_seats"` +// ListCopilotSeatsResponse represents the Copilot for Business seat assignments for an organization. +type ListCopilotSeatsResponse struct { + TotalSeats int64 `json:"total_seats"` Seats []*CopilotSeatDetails `json:"seats"` } @@ -52,16 +53,6 @@ type CopilotSeatDetails struct { UpdatedAt string `json:"updated_at,omitempty"` } -// SelectedTeams represents the teams selected for the Copilot for Business subscription. -type SelectedTeams struct { - SelectedTeams []string `json:"selected_teams"` -} - -// SelectedUsers represents the users selected for the Copilot for Business subscription. -type SelectedUsers struct { - SelectedUsers []string `json:"selected_users"` -} - // SeatAssignments represents the number of seats assigned. type SeatAssignments struct { SeatsCreated int `json:"seats_created"` @@ -121,10 +112,34 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { return nil } +// GetUser gets the User from the CopilotSeatDetails if the assignee is a user. +func (cp *CopilotSeatDetails) GetUser() (*User, bool) { + if user, ok := cp.Assignee.(*User); ok { + return user, true + } + return nil, false +} + +// GetTeam gets the Team from the CopilotSeatDetails if the assignee is a team. +func (cp *CopilotSeatDetails) GetTeam() (*Team, bool) { + if team, ok := cp.Assignee.(*Team); ok { + return team, true + } + return nil, false +} + +// GetOrganization gets the Organization from the CopilotSeatDetails if the assignee is an organization. +func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { + if organization, ok := cp.Assignee.(*Organization); ok { + return organization, true + } + return nil, false +} + // GetCopilotBilling gets Copilot for Business billing information and settings for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization -func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*OrganizationCopilotDetails, *Response, error) { +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) @@ -132,7 +147,7 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Or return nil, nil, err } - var copilotDetails *OrganizationCopilotDetails + var copilotDetails *CopilotOrganizationDetails resp, err := s.client.Do(ctx, req, &copilotDetails) if err != nil { return nil, resp, err @@ -143,16 +158,18 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Or // 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/en/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization -func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string) (*CopilotSeats, *Response, error) { +func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest("GET", u, opts) if err != nil { return nil, nil, err } - var copilotSeats *CopilotSeats + var copilotSeats *ListCopilotSeatsResponse resp, err := s.client.Do(ctx, req, &copilotSeats) if err != nil { return nil, resp, err @@ -164,10 +181,10 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string) (*Cop // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teams SelectedTeams) (*SeatAssignments, *Response, error) { +func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - req, err := s.client.NewRequest("POST", u, teams) + req, err := s.client.NewRequest("POST", u, teamNames) if err != nil { return nil, nil, err } @@ -184,30 +201,30 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teams // RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teams SelectedTeams) (*SeatCancellations, *Response, error) { +func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - req, err := s.client.NewRequest("DELETE", u, teams) + req, err := s.client.NewRequest("DELETE", u, teamNames) if err != nil { return nil, nil, err } - var SeatCancellations *SeatCancellations - resp, err := s.client.Do(ctx, req, &SeatCancellations) + var seatCancellations *SeatCancellations + resp, err := s.client.Do(ctx, req, &seatCancellations) if err != nil { return nil, resp, err } - return SeatCancellations, resp, nil + return seatCancellations, resp, nil } -// AddCopilotUsers Adds users to the Copilot for Business subscription for an organization +// AddCopilotUsers adds users to the Copilot for Business subscription for an organization // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users SelectedUsers) (*SeatAssignments, *Response, error) { +func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, userNames []string) (*SeatAssignments, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - req, err := s.client.NewRequest("POST", u, users) + req, err := s.client.NewRequest("POST", u, userNames) if err != nil { return nil, nil, err } @@ -224,21 +241,21 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users // RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users SelectedUsers) (*SeatCancellations, *Response, error) { +func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, userNames []string) (*SeatCancellations, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - req, err := s.client.NewRequest("DELETE", u, users) + req, err := s.client.NewRequest("DELETE", u, userNames) if err != nil { return nil, nil, err } - var SeatCancellations *SeatCancellations - resp, err := s.client.Do(ctx, req, &SeatCancellations) + var seatCancellations *SeatCancellations + resp, err := s.client.Do(ctx, req, &seatCancellations) if err != nil { return nil, resp, err } - return SeatCancellations, resp, nil + return seatCancellations, resp, nil } // GetSeatDetails gets Copilot for Business seat assignment details for a user. diff --git a/github/copilot_test.go b/github/copilot_test.go index c62911b79c..3299834b86 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" "net/http" "testing" @@ -16,26 +17,30 @@ import ( // Test invalid JSON responses, vlaid responses are covered in the other tests func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { - tests := map[string]struct { + tests := []struct { + name string data string want *CopilotSeatDetails wantErr bool }{ - "Invalid JSON": { + { + name: "Invalid JSON", data: `{`, want: &CopilotSeatDetails{ Assignee: nil, }, wantErr: true, }, - "Invalid Assignee Field Type": { + { + name: "Invalid Assignee Field Type", data: `{ "assignee": "test" }`, want: &CopilotSeatDetails{}, wantErr: true, }, - "Invalid Assignee Type": { + { + name: "Invalid Assignee Type", data: `{ "assignee": { "name": "octokittens", @@ -46,7 +51,8 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { want: &CopilotSeatDetails{}, wantErr: true, }, - "Invalid User": { + { + name: "Invalid User", data: `{ "assignee": { "type": "User", @@ -56,7 +62,8 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { want: &CopilotSeatDetails{}, wantErr: true, }, - "Invalid Team": { + { + name: "Invalid Team", data: `{ "assignee": { "type": "Team", @@ -66,7 +73,8 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { want: &CopilotSeatDetails{}, wantErr: true, }, - "Invalid Organization": { + { + name: "Invalid Organization", data: `{ "assignee": { "type": "Organization", @@ -78,11 +86,11 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { }, } - for name, tc := range tests { + for _, tc := range tests { seatDetails := &CopilotSeatDetails{} - t.Run(name, func(t *testing.T) { - err := seatDetails.UnmarshalJSON([]byte(tc.data)) + t.Run(tc.name, func(t *testing.T) { + err := json.Unmarshal([]byte(tc.data), seatDetails) if err == nil && tc.wantErr { t.Errorf("CopilotSeatDetails.UnmarshalJSON returned nil instead of an error") } @@ -122,8 +130,8 @@ func TestCopilotService_GetCopilotBilling(t *testing.T) { t.Errorf("Copilot.GetCopilotBilling returned error: %v", err) } - want := &OrganizationCopilotDetails{ - SeatBreakdown: &SeatBreakdown{ + want := &CopilotOrganizationDetails{ + SeatBreakdown: &CopilotSeatBreakdown{ Total: 12, AddedThisCycle: 9, PendingInvitation: 0, @@ -262,14 +270,14 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Copilot.ListCopilotSeats(ctx, "o") + got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", nil) if err != nil { t.Errorf("Copilot.ListCopilotSeats returned error: %v", err) } - want := &CopilotSeats{ + want := &ListCopilotSeatsResponse{ TotalSeats: 2, - Seats: []CopilotSeatDetails{ + Seats: []*CopilotSeatDetails{ { Assignee: &User{ Login: String("octocat"), @@ -374,12 +382,12 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { const methodName = "ListCopilotSeats" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n") + _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", nil) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.ListCopilotSeats(ctx, "") + got, resp, err := client.Copilot.ListCopilotSeats(ctx, "", nil) if got != nil { t.Errorf("Copilot.ListCopilotSeats returned %+v, want nil", got) } @@ -392,12 +400,12 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { defer teardown() mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") + testMethod(t, r, "POST") fmt.Fprint(w, `{"seats_created": 2}`) }) ctx := context.Background() - got, _, err := client.Copilot.AddCopilotTeams(ctx, "o", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + got, _, err := client.Copilot.AddCopilotTeams(ctx, "o", []string{"team1", "team2"}) if err != nil { t.Errorf("Copilot.AddCopilotTeams returned error: %v", err) } @@ -411,12 +419,12 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { const methodName = "AddCopilotTeams" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.AddCopilotTeams(ctx, "\n", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + _, _, err = client.Copilot.AddCopilotTeams(ctx, "\n", []string{"team1", "team2"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.AddCopilotTeams(ctx, "o", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + got, resp, err := client.Copilot.AddCopilotTeams(ctx, "o", []string{"team1", "team2"}) if got != nil { t.Errorf("Copilot.AddCopilotTeams returned %+v, want nil", got) } @@ -434,7 +442,7 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Copilot.RemoveCopilotTeams(ctx, "o", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + got, _, err := client.Copilot.RemoveCopilotTeams(ctx, "o", []string{"team1", "team2"}) if err != nil { t.Errorf("Copilot.RemoveCopilotTeams returned error: %v", err) } @@ -448,12 +456,12 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { const methodName = "RemoveCopilotTeams" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.RemoveCopilotTeams(ctx, "\n", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + _, _, err = client.Copilot.RemoveCopilotTeams(ctx, "\n", []string{"team1", "team2"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.RemoveCopilotTeams(ctx, "o", SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + got, resp, err := client.Copilot.RemoveCopilotTeams(ctx, "o", []string{"team1", "team2"}) if got != nil { t.Errorf("Copilot.RemoveCopilotTeams returned %+v, want nil", got) } @@ -466,12 +474,12 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { defer teardown() mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "PUT") + testMethod(t, r, "POST") fmt.Fprint(w, `{"seats_created": 2}`) }) ctx := context.Background() - got, _, err := client.Copilot.AddCopilotUsers(ctx, "o", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + got, _, err := client.Copilot.AddCopilotUsers(ctx, "o", []string{"team1", "team2"}) if err != nil { t.Errorf("Copilot.AddCopilotUsers returned error: %v", err) } @@ -485,12 +493,12 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { const methodName = "AddCopilotUsers" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.AddCopilotUsers(ctx, "\n", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + _, _, err = client.Copilot.AddCopilotUsers(ctx, "\n", []string{"team1", "team2"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.AddCopilotUsers(ctx, "o", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + got, resp, err := client.Copilot.AddCopilotUsers(ctx, "o", []string{"team1", "team2"}) if got != nil { t.Errorf("Copilot.AddCopilotUsers returned %+v, want nil", got) } @@ -508,7 +516,7 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Copilot.RemoveCopilotUsers(ctx, "o", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + got, _, err := client.Copilot.RemoveCopilotUsers(ctx, "o", []string{"team1", "team2"}) if err != nil { t.Errorf("Copilot.RemoveCopilotUsers returned error: %v", err) } @@ -522,12 +530,12 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { const methodName = "RemoveCopilotUsers" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.RemoveCopilotUsers(ctx, "\n", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + _, _, err = client.Copilot.RemoveCopilotUsers(ctx, "\n", []string{"team1", "team2"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.RemoveCopilotUsers(ctx, "o", SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + got, resp, err := client.Copilot.RemoveCopilotUsers(ctx, "o", []string{"team1", "team2"}) if got != nil { t.Errorf("Copilot.RemoveCopilotUsers returned %+v, want nil", got) } diff --git a/github/github-accessors.go b/github/github-accessors.go index 985e7436ab..3ed95c1c41 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4486,6 +4486,14 @@ func (c *ContributorStats) GetTotal() int { return *c.Total } +// GetSeatBreakdown returns the SeatBreakdown field. +func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { + if c == nil { + return nil + } + return c.SeatBreakdown +} + // GetAssigningTeam returns the AssigningTeam field. func (c *CopilotSeatDetails) GetAssigningTeam() *Team { if c == nil { @@ -12574,14 +12582,6 @@ func (o *Organization) GetWebCommitSignoffRequired() bool { return *o.WebCommitSignoffRequired } -// GetSeatBreakdown returns the SeatBreakdown field. -func (o *OrganizationCopilotDetails) GetSeatBreakdown() *SeatBreakdown { - if o == nil { - return nil - } - return o.SeatBreakdown -} - // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (o *OrganizationCustomRepoRoles) GetTotalCount() int { if o == nil || o.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 026af96966..7e065fe488 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5290,6 +5290,13 @@ func TestContributorStats_GetTotal(tt *testing.T) { c.GetTotal() } +func TestCopilotOrganizationDetails_GetSeatBreakdown(tt *testing.T) { + c := &CopilotOrganizationDetails{} + c.GetSeatBreakdown() + c = nil + c.GetSeatBreakdown() +} + func TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) { c := &CopilotSeatDetails{} c.GetAssigningTeam() @@ -14734,13 +14741,6 @@ func TestOrganization_GetWebCommitSignoffRequired(tt *testing.T) { o.GetWebCommitSignoffRequired() } -func TestOrganizationCopilotDetails_GetSeatBreakdown(tt *testing.T) { - o := &OrganizationCopilotDetails{} - o.GetSeatBreakdown() - o = nil - o.GetSeatBreakdown() -} - func TestOrganizationCustomRepoRoles_GetTotalCount(tt *testing.T) { var zeroValue int o := &OrganizationCustomRepoRoles{TotalCount: &zeroValue} From 19339c2ddc2aa053892929520999258548486dd6 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Tue, 24 Oct 2023 21:06:43 -0400 Subject: [PATCH 09/37] Add coverage for Assignee helper methods --- github/copilot_test.go | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/github/copilot_test.go b/github/copilot_test.go index 3299834b86..0c189ed9c5 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -104,6 +104,86 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { } } +func TestCopilotService_GetSeatDetailsUser(t *testing.T) { + data := `{ + "assignee": { + "type": "User", + "id": 1 + } + }` + + seatDetails := &CopilotSeatDetails{} + + err := json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + want := &User{ + ID: Int64(1), + Type: String("User"), + } + + if got, ok := seatDetails.GetUser(); ok && !cmp.Equal(got, want) { + t.Errorf("CopilotSeatDetails.GetTeam returned %+v, want %+v", got, want) + } else if !ok { + t.Errorf("CopilotSeatDetails.GetUser returned false, expected true") + } +} + +func TestCopilotService_GetSeatDetailsTeam(t *testing.T) { + data := `{ + "assignee": { + "type": "Team", + "id": 1 + } + }` + + seatDetails := &CopilotSeatDetails{} + + err := json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + want := &Team{ + ID: Int64(1), + } + + if got, ok := seatDetails.GetTeam(); ok && !cmp.Equal(got, want) { + t.Errorf("CopilotSeatDetails.GetTeam returned %+v, want %+v", got, want) + } else if !ok { + t.Errorf("CopilotSeatDetails.GetTeam returned false, expected true") + } +} + +func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { + data := `{ + "assignee": { + "type": "Organization", + "id": 1 + } + }` + + seatDetails := &CopilotSeatDetails{} + + err := json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + want := &Organization{ + ID: Int64(1), + Type: String("Organization"), + } + + if got, ok := seatDetails.GetOrganization(); ok && !cmp.Equal(got, want) { + t.Errorf("CopilotSeatDetails.GetOrganization returned %+v, want %+v", got, want) + } else if !ok { + t.Errorf("CopilotSeatDetails.GetOrganization returned false, expected true") + } +} + func TestCopilotService_GetCopilotBilling(t *testing.T) { client, mux, _, teardown := setup() defer teardown() From 4f78d68dfe3967b7e0a66805860d520648635690 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Wed, 25 Oct 2023 09:53:50 -0400 Subject: [PATCH 10/37] Add coverage for Assignee helper methods error cases --- github/copilot_test.go | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/github/copilot_test.go b/github/copilot_test.go index 0c189ed9c5..e301d5d995 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -129,6 +129,27 @@ func TestCopilotService_GetSeatDetailsUser(t *testing.T) { } else if !ok { t.Errorf("CopilotSeatDetails.GetUser returned false, expected true") } + + data = `{ + "assignee": { + "type": "Organization", + "id": 1 + } + }` + + bad := &Organization{ + ID: Int64(1), + Type: String("Organization"), + } + + err = json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + if got, ok := seatDetails.GetUser(); ok { + t.Errorf("CopilotSeatDetails.GetUser returned true, expected false. Returned %v, expected %v", got, bad) + } } func TestCopilotService_GetSeatDetailsTeam(t *testing.T) { @@ -155,6 +176,27 @@ func TestCopilotService_GetSeatDetailsTeam(t *testing.T) { } else if !ok { t.Errorf("CopilotSeatDetails.GetTeam returned false, expected true") } + + data = `{ + "assignee": { + "type": "User", + "id": 1 + } + }` + + bad := &User{ + ID: Int64(1), + Type: String("User"), + } + + err = json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + if got, ok := seatDetails.GetTeam(); ok { + t.Errorf("CopilotSeatDetails.GetTeam returned true, expected false. Returned %v, expected %v", got, bad) + } } func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { @@ -182,6 +224,26 @@ func TestCopilotService_GetSeatDetailsOrganization(t *testing.T) { } else if !ok { t.Errorf("CopilotSeatDetails.GetOrganization returned false, expected true") } + + data = `{ + "assignee": { + "type": "Team", + "id": 1 + } + }` + + bad := &Team{ + ID: Int64(1), + } + + err = json.Unmarshal([]byte(data), seatDetails) + if err != nil { + t.Errorf("CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v", err) + } + + if got, ok := seatDetails.GetOrganization(); ok { + t.Errorf("CopilotSeatDetails.GetOrganization returned true, expected false. Returned %v, expected %v", got, bad) + } } func TestCopilotService_GetCopilotBilling(t *testing.T) { From 2c90d0c3e39f24947f4822e0709dbbb2bd7dce6e Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Wed, 25 Oct 2023 10:22:17 -0400 Subject: [PATCH 11/37] Add requested test case --- github/copilot_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/github/copilot_test.go b/github/copilot_test.go index e301d5d995..e2a33c216c 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -31,6 +31,19 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { }, wantErr: true, }, + { + name: "No Type Field", + data: `{ + "assignee": { + "name": "octokittens", + "id": 1, + } + }`, + want: &CopilotSeatDetails{ + Assignee: nil, + }, + wantErr: true, + }, { name: "Invalid Assignee Field Type", data: `{ From e01ef539cebd025d0d7f8ec27bfa42f91e634bb8 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Wed, 25 Oct 2023 10:33:18 -0400 Subject: [PATCH 12/37] Fix unmarshal test cases --- github/copilot.go | 5 +++++ github/copilot_test.go | 12 +++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index d498ad426a..ba0f39c112 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -84,6 +84,11 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { if err != nil { return err } + + if v["type"] == nil { + return fmt.Errorf("assignee type field is not set") + } + if v["type"].(string) == "User" { user := &User{} if err := json.Unmarshal(jsonData, user); err != nil { diff --git a/github/copilot_test.go b/github/copilot_test.go index e2a33c216c..2ca9218b61 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -36,12 +36,10 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { data: `{ "assignee": { "name": "octokittens", - "id": 1, + "id": 1 } }`, - want: &CopilotSeatDetails{ - Assignee: nil, - }, + want: &CopilotSeatDetails{}, wantErr: true, }, { @@ -69,7 +67,7 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { data: `{ "assignee": { "type": "User", - "id": "bad", + "id": "bad" } }`, want: &CopilotSeatDetails{}, @@ -80,7 +78,7 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { data: `{ "assignee": { "type": "Team", - "id": "bad", + "id": "bad" } }`, want: &CopilotSeatDetails{}, @@ -91,7 +89,7 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { data: `{ "assignee": { "type": "Organization", - "id": "bad", + "id": "bad" } }`, want: &CopilotSeatDetails{}, From 99fe9ba62822e6dcc6b33ac7da7a34a0f5f20b24 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Wed, 25 Oct 2023 11:55:24 -0400 Subject: [PATCH 13/37] Update tests and time types --- github/copilot.go | 14 ++--- github/copilot_test.go | 104 ++++++++++++++++++++++++++------ github/github-accessors.go | 20 +++++- github/github-accessors_test.go | 22 ++++++- 4 files changed, 132 insertions(+), 28 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index ba0f39c112..6139e392ba 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -47,10 +47,10 @@ type CopilotSeatDetails struct { Assignee interface{} `json:"assignee"` AssigningTeam *Team `json:"assigning_team,omitempty"` PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` - LastActivityAt *string `json:"last_activity_at,omitempty"` + LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` LastActivityEditor *string `json:"last_activity_editor,omitempty"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` } // SeatAssignments represents the number of seats assigned. @@ -89,26 +89,26 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { return fmt.Errorf("assignee type field is not set") } - if v["type"].(string) == "User" { + 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 v["type"].(string) == "Team" { + } 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 v["type"].(string) == "Organization" { + } 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 %s", v["type"].(string)) + return fmt.Errorf("unsupported assignee type %v", v["type"]) } default: return fmt.Errorf("unsupported assignee type %T", v) diff --git a/github/copilot_test.go b/github/copilot_test.go index 2ca9218b61..c47106153c 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -11,6 +11,7 @@ import ( "fmt" "net/http" "testing" + "time" "github.com/google/go-cmp/cmp" ) @@ -31,6 +32,19 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { }, wantErr: true, }, + { + name: "Invalid top level type", + data: `{ + "assignee": { + "type": "User", + "name": "octokittens", + "id": 1 + }, + "assigning_team": "this should be an object" + }`, + want: &CopilotSeatDetails{}, + wantErr: true, + }, { name: "No Type Field", data: `{ @@ -56,7 +70,7 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) { "assignee": { "name": "octokittens", "id": 1, - "type": "None" + "type": [] } }`, want: &CopilotSeatDetails{}, @@ -323,7 +337,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { mux.HandleFunc("/orgs/o/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ - "total_seats": 2, + "total_seats": 4, "seats": [ { "created_at": "2021-08-03T18:00:00-06:00", @@ -422,6 +436,42 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { }`) }) + tmp, err := time.Parse(time.RFC3339, "2021-08-03T18:00:00-06:00") + if err != nil { + panic(err) + } + createdAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T15:00:00-06:00") + if err != nil { + panic(err) + } + updatedAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-10-14T00:53:32-06:00") + if err != nil { + panic(err) + } + lastActivityAt1 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T18:00:00-06:00") + if err != nil { + panic(err) + } + createdAt2 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T15:00:00-06:00") + if err != nil { + panic(err) + } + updatedAt2 := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-10-13T00:53:32-06:00") + if err != nil { + panic(err) + } + lastActivityAt2 := Timestamp{tmp} + ctx := context.Background() got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", nil) if err != nil { @@ -429,7 +479,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { } want := &ListCopilotSeatsResponse{ - TotalSeats: 2, + TotalSeats: 4, Seats: []*CopilotSeatDetails{ { Assignee: &User{ @@ -466,10 +516,10 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { RepositoriesURL: String("https://api.github.com/teams/1/repos"), Parent: nil, }, - CreatedAt: "2021-08-03T18:00:00-06:00", - UpdatedAt: "2021-09-23T15:00:00-06:00", + CreatedAt: &createdAt1, + UpdatedAt: &updatedAt1, PendingCancellationDate: nil, - LastActivityAt: String("2021-10-14T00:53:32-06:00"), + LastActivityAt: &lastActivityAt1, LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), }, { @@ -494,10 +544,10 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { SiteAdmin: Bool(false), }, AssigningTeam: nil, - CreatedAt: "2021-09-23T18:00:00-06:00", - UpdatedAt: "2021-09-23T15:00:00-06:00", + CreatedAt: &createdAt2, + UpdatedAt: &updatedAt2, PendingCancellationDate: String("2021-11-01"), - LastActivityAt: String("2021-10-13T00:53:32-06:00"), + LastActivityAt: &lastActivityAt2, LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), }, { @@ -506,10 +556,10 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { Name: String("octokittens"), }, AssigningTeam: nil, - CreatedAt: "2021-09-23T18:00:00-06:00", - UpdatedAt: "2021-09-23T15:00:00-06:00", + CreatedAt: &createdAt2, + UpdatedAt: &updatedAt2, PendingCancellationDate: String("2021-11-01"), - LastActivityAt: String("2021-10-13T00:53:32-06:00"), + LastActivityAt: &lastActivityAt2, LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), }, { @@ -519,10 +569,10 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { Type: String("Organization"), }, AssigningTeam: nil, - CreatedAt: "2021-09-23T18:00:00-06:00", - UpdatedAt: "2021-09-23T15:00:00-06:00", + CreatedAt: &createdAt2, + UpdatedAt: &updatedAt2, PendingCancellationDate: String("2021-11-01"), - LastActivityAt: String("2021-10-13T00:53:32-06:00"), + LastActivityAt: &lastActivityAt2, LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), }, }, @@ -746,6 +796,24 @@ func TestCopilotService_GetSeatDetails(t *testing.T) { }`) }) + tmp, err := time.Parse(time.RFC3339, "2021-08-03T18:00:00-06:00") + if err != nil { + panic(err) + } + createdAt := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-09-23T15:00:00-06:00") + if err != nil { + panic(err) + } + updatedAt := Timestamp{tmp} + + tmp, err = time.Parse(time.RFC3339, "2021-10-14T00:53:32-06:00") + if err != nil { + panic(err) + } + lastActivityAt := Timestamp{tmp} + ctx := context.Background() got, _, err := client.Copilot.GetSeatDetails(ctx, "o", "u") if err != nil { @@ -787,10 +855,10 @@ func TestCopilotService_GetSeatDetails(t *testing.T) { RepositoriesURL: String("https://api.github.com/teams/1/repos"), Parent: nil, }, - CreatedAt: "2021-08-03T18:00:00-06:00", - UpdatedAt: "2021-09-23T15:00:00-06:00", + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, PendingCancellationDate: nil, - LastActivityAt: String("2021-10-14T00:53:32-06:00"), + LastActivityAt: &lastActivityAt, LastActivityEditor: String("vscode/1.77.3/copilot/1.86.82"), } diff --git a/github/github-accessors.go b/github/github-accessors.go index 3ed95c1c41..3deaa35f09 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4502,10 +4502,18 @@ func (c *CopilotSeatDetails) GetAssigningTeam() *Team { return c.AssigningTeam } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + // GetLastActivityAt returns the LastActivityAt field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetLastActivityAt() string { +func (c *CopilotSeatDetails) GetLastActivityAt() Timestamp { if c == nil || c.LastActivityAt == nil { - return "" + return Timestamp{} } return *c.LastActivityAt } @@ -4526,6 +4534,14 @@ func (c *CopilotSeatDetails) GetPendingCancellationDate() string { return *c.PendingCancellationDate } +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { if c == nil || c.CompletedAt == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 7e065fe488..5fb85526a1 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5304,8 +5304,18 @@ func TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) { c.GetAssigningTeam() } +func TestCopilotSeatDetails_GetCreatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CopilotSeatDetails{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CopilotSeatDetails{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + func TestCopilotSeatDetails_GetLastActivityAt(tt *testing.T) { - var zeroValue string + var zeroValue Timestamp c := &CopilotSeatDetails{LastActivityAt: &zeroValue} c.GetLastActivityAt() c = &CopilotSeatDetails{} @@ -5334,6 +5344,16 @@ func TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) { c.GetPendingCancellationDate() } +func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { + var zeroValue Timestamp + c := &CopilotSeatDetails{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CopilotSeatDetails{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + func TestCreateCheckRunOptions_GetCompletedAt(tt *testing.T) { var zeroValue Timestamp c := &CreateCheckRunOptions{CompletedAt: &zeroValue} From f2d32309f5b664cdce333a56270ca6cdab06f2b6 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Thu, 26 Oct 2023 00:25:10 -0400 Subject: [PATCH 14/37] Apply suggestions from code review Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- github/copilot.go | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 6139e392ba..9bbf146aca 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -118,28 +118,13 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { } // GetUser gets the User from the CopilotSeatDetails if the assignee is a user. -func (cp *CopilotSeatDetails) GetUser() (*User, bool) { - if user, ok := cp.Assignee.(*User); ok { - return user, true - } - return nil, false -} +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) { - if team, ok := cp.Assignee.(*Team); ok { - return team, true - } - return nil, false -} +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) { - if organization, ok := cp.Assignee.(*Organization); ok { - return organization, true - } - return nil, false -} +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. // From 2ab8aca5f491b42466d67fa6cc594bf17f45070c Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Thu, 26 Oct 2023 00:43:08 -0400 Subject: [PATCH 15/37] Address review comments --- github/copilot.go | 28 +++++++++++++++++++++------- github/copilot_test.go | 28 ++++++++++++++++------------ 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 9bbf146aca..af9d61a016 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -53,6 +53,16 @@ type CopilotSeatDetails struct { UpdatedAt *Timestamp `json:"updated_at,omitempty"` } +// SelectedTeams represents the teams selected for Copilot for Business. +type SelectedTeams struct { + SelectedTeams []string `json:"selected_teams"` +} + +// SelectedUsers represents the users selected for Copilot for Business. +type SelectedUsers struct { + SelectedUsers []string `json:"selected_users"` +} + // SeatAssignments represents the number of seats assigned. type SeatAssignments struct { SeatsCreated int `json:"seats_created"` @@ -64,6 +74,7 @@ type SeatCancellations struct { } func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { + // Using an alias to avoid infinite recursion when calling json.Unmarshal type alias CopilotSeatDetails var seatDetail alias @@ -124,7 +135,10 @@ func (cp *CopilotSeatDetails) GetUser() (*User, bool) { u, ok := cp.Assignee.(*U 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 } +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. // @@ -171,7 +185,7 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { +func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames *SelectedTeams) (*SeatAssignments, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) req, err := s.client.NewRequest("POST", u, teamNames) @@ -191,7 +205,7 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNa // RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { +func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames *SelectedTeams) (*SeatCancellations, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) req, err := s.client.NewRequest("DELETE", u, teamNames) @@ -211,10 +225,10 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea // AddCopilotUsers adds users to the Copilot for Business subscription for an organization // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, userNames []string) (*SeatAssignments, *Response, error) { +func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users *SelectedUsers) (*SeatAssignments, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - req, err := s.client.NewRequest("POST", u, userNames) + req, err := s.client.NewRequest("POST", u, users) if err != nil { return nil, nil, err } @@ -231,10 +245,10 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, userNa // RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, userNames []string) (*SeatCancellations, *Response, error) { +func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users *SelectedUsers) (*SeatCancellations, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - req, err := s.client.NewRequest("DELETE", u, userNames) + req, err := s.client.NewRequest("DELETE", u, users) if err != nil { return nil, nil, err } diff --git a/github/copilot_test.go b/github/copilot_test.go index c47106153c..03ca8f53d3 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -604,11 +604,12 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") + testBody(t, r, `{"selected_teams":["team1","team2"]}`+"\n") fmt.Fprint(w, `{"seats_created": 2}`) }) ctx := context.Background() - got, _, err := client.Copilot.AddCopilotTeams(ctx, "o", []string{"team1", "team2"}) + got, _, err := client.Copilot.AddCopilotTeams(ctx, "o", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) if err != nil { t.Errorf("Copilot.AddCopilotTeams returned error: %v", err) } @@ -622,12 +623,12 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { const methodName = "AddCopilotTeams" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.AddCopilotTeams(ctx, "\n", []string{"team1", "team2"}) + _, _, err = client.Copilot.AddCopilotTeams(ctx, "\n", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.AddCopilotTeams(ctx, "o", []string{"team1", "team2"}) + got, resp, err := client.Copilot.AddCopilotTeams(ctx, "o", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) if got != nil { t.Errorf("Copilot.AddCopilotTeams returned %+v, want nil", got) } @@ -641,11 +642,12 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { mux.HandleFunc("/orgs/o/copilot/billing/selected_teams", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") + testBody(t, r, `{"selected_teams":["team1","team2"]}`+"\n") fmt.Fprint(w, `{"seats_cancelled": 2}`) }) ctx := context.Background() - got, _, err := client.Copilot.RemoveCopilotTeams(ctx, "o", []string{"team1", "team2"}) + got, _, err := client.Copilot.RemoveCopilotTeams(ctx, "o", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) if err != nil { t.Errorf("Copilot.RemoveCopilotTeams returned error: %v", err) } @@ -659,12 +661,12 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { const methodName = "RemoveCopilotTeams" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.RemoveCopilotTeams(ctx, "\n", []string{"team1", "team2"}) + _, _, err = client.Copilot.RemoveCopilotTeams(ctx, "\n", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.RemoveCopilotTeams(ctx, "o", []string{"team1", "team2"}) + got, resp, err := client.Copilot.RemoveCopilotTeams(ctx, "o", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) if got != nil { t.Errorf("Copilot.RemoveCopilotTeams returned %+v, want nil", got) } @@ -678,11 +680,12 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") + testBody(t, r, `{"selected_users":["user1","user2"]}`+"\n") fmt.Fprint(w, `{"seats_created": 2}`) }) ctx := context.Background() - got, _, err := client.Copilot.AddCopilotUsers(ctx, "o", []string{"team1", "team2"}) + got, _, err := client.Copilot.AddCopilotUsers(ctx, "o", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) if err != nil { t.Errorf("Copilot.AddCopilotUsers returned error: %v", err) } @@ -696,12 +699,12 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { const methodName = "AddCopilotUsers" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.AddCopilotUsers(ctx, "\n", []string{"team1", "team2"}) + _, _, err = client.Copilot.AddCopilotUsers(ctx, "\n", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.AddCopilotUsers(ctx, "o", []string{"team1", "team2"}) + got, resp, err := client.Copilot.AddCopilotUsers(ctx, "o", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) if got != nil { t.Errorf("Copilot.AddCopilotUsers returned %+v, want nil", got) } @@ -715,11 +718,12 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { mux.HandleFunc("/orgs/o/copilot/billing/selected_users", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") + testBody(t, r, `{"selected_users":["user1","user2"]}`+"\n") fmt.Fprint(w, `{"seats_cancelled": 2}`) }) ctx := context.Background() - got, _, err := client.Copilot.RemoveCopilotUsers(ctx, "o", []string{"team1", "team2"}) + got, _, err := client.Copilot.RemoveCopilotUsers(ctx, "o", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) if err != nil { t.Errorf("Copilot.RemoveCopilotUsers returned error: %v", err) } @@ -733,12 +737,12 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { const methodName = "RemoveCopilotUsers" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.RemoveCopilotUsers(ctx, "\n", []string{"team1", "team2"}) + _, _, err = client.Copilot.RemoveCopilotUsers(ctx, "\n", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.RemoveCopilotUsers(ctx, "o", []string{"team1", "team2"}) + got, resp, err := client.Copilot.RemoveCopilotUsers(ctx, "o", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) if got != nil { t.Errorf("Copilot.RemoveCopilotUsers returned %+v, want nil", got) } From 63276a87b8db0d67c2b54c6df914a174a019cc56 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Fri, 17 Nov 2023 13:58:47 +0300 Subject: [PATCH 16/37] Address review comments --- github/copilot.go | 50 +++++++++++++++++++++++++++--------------- github/copilot_test.go | 24 ++++++++++---------- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index af9d61a016..77dc97e4c5 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -53,16 +53,6 @@ type CopilotSeatDetails struct { UpdatedAt *Timestamp `json:"updated_at,omitempty"` } -// SelectedTeams represents the teams selected for Copilot for Business. -type SelectedTeams struct { - SelectedTeams []string `json:"selected_teams"` -} - -// SelectedUsers represents the users selected for Copilot for Business. -type SelectedUsers struct { - SelectedUsers []string `json:"selected_users"` -} - // SeatAssignments represents the number of seats assigned. type SeatAssignments struct { SeatsCreated int `json:"seats_created"` @@ -185,10 +175,16 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames *SelectedTeams) (*SeatAssignments, *Response, error) { +func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - req, err := s.client.NewRequest("POST", u, teamNames) + body := struct { + SelectedTeams []string `json:"selected_teams"` + }{ + SelectedTeams: teamNames, + } + + req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err } @@ -205,10 +201,16 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNa // RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames *SelectedTeams) (*SeatCancellations, *Response, error) { +func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - req, err := s.client.NewRequest("DELETE", u, teamNames) + body := struct { + SelectedTeams []string `json:"selected_teams"` + }{ + SelectedTeams: teamNames, + } + + req, err := s.client.NewRequest("DELETE", u, body) if err != nil { return nil, nil, err } @@ -225,10 +227,16 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea // AddCopilotUsers adds users to the Copilot for Business subscription for an organization // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users *SelectedUsers) (*SeatAssignments, *Response, error) { +func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - req, err := s.client.NewRequest("POST", u, users) + body := struct { + SelectedUsers []string `json:"selected_users"` + }{ + SelectedUsers: users, + } + + req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err } @@ -245,10 +253,16 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users // RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization -func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users *SelectedUsers) (*SeatCancellations, *Response, error) { +func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - req, err := s.client.NewRequest("DELETE", u, users) + body := struct { + SelectedUsers []string `json:"selected_users"` + }{ + SelectedUsers: users, + } + + req, err := s.client.NewRequest("DELETE", u, body) if err != nil { return nil, nil, err } diff --git a/github/copilot_test.go b/github/copilot_test.go index 03ca8f53d3..9df2c9a497 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -609,7 +609,7 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Copilot.AddCopilotTeams(ctx, "o", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + got, _, err := client.Copilot.AddCopilotTeams(ctx, "o", []string{"team1", "team2"}) if err != nil { t.Errorf("Copilot.AddCopilotTeams returned error: %v", err) } @@ -623,12 +623,12 @@ func TestCopilotService_AddCopilotTeams(t *testing.T) { const methodName = "AddCopilotTeams" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.AddCopilotTeams(ctx, "\n", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + _, _, err = client.Copilot.AddCopilotTeams(ctx, "\n", []string{"team1", "team2"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.AddCopilotTeams(ctx, "o", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + got, resp, err := client.Copilot.AddCopilotTeams(ctx, "o", []string{"team1", "team2"}) if got != nil { t.Errorf("Copilot.AddCopilotTeams returned %+v, want nil", got) } @@ -647,7 +647,7 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Copilot.RemoveCopilotTeams(ctx, "o", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + got, _, err := client.Copilot.RemoveCopilotTeams(ctx, "o", []string{"team1", "team2"}) if err != nil { t.Errorf("Copilot.RemoveCopilotTeams returned error: %v", err) } @@ -661,12 +661,12 @@ func TestCopilotService_RemoveCopilotTeams(t *testing.T) { const methodName = "RemoveCopilotTeams" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.RemoveCopilotTeams(ctx, "\n", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + _, _, err = client.Copilot.RemoveCopilotTeams(ctx, "\n", []string{"team1", "team2"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.RemoveCopilotTeams(ctx, "o", &SelectedTeams{SelectedTeams: []string{"team1", "team2"}}) + got, resp, err := client.Copilot.RemoveCopilotTeams(ctx, "o", []string{"team1", "team2"}) if got != nil { t.Errorf("Copilot.RemoveCopilotTeams returned %+v, want nil", got) } @@ -685,7 +685,7 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Copilot.AddCopilotUsers(ctx, "o", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + got, _, err := client.Copilot.AddCopilotUsers(ctx, "o", []string{"user1", "user2"}) if err != nil { t.Errorf("Copilot.AddCopilotUsers returned error: %v", err) } @@ -699,12 +699,12 @@ func TestCopilotService_AddCopilotUsers(t *testing.T) { const methodName = "AddCopilotUsers" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.AddCopilotUsers(ctx, "\n", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + _, _, err = client.Copilot.AddCopilotUsers(ctx, "\n", []string{"user1", "user2"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.AddCopilotUsers(ctx, "o", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + got, resp, err := client.Copilot.AddCopilotUsers(ctx, "o", []string{"user1", "user2"}) if got != nil { t.Errorf("Copilot.AddCopilotUsers returned %+v, want nil", got) } @@ -723,7 +723,7 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { }) ctx := context.Background() - got, _, err := client.Copilot.RemoveCopilotUsers(ctx, "o", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + got, _, err := client.Copilot.RemoveCopilotUsers(ctx, "o", []string{"user1", "user2"}) if err != nil { t.Errorf("Copilot.RemoveCopilotUsers returned error: %v", err) } @@ -737,12 +737,12 @@ func TestCopilotService_RemoveCopilotUsers(t *testing.T) { const methodName = "RemoveCopilotUsers" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.RemoveCopilotUsers(ctx, "\n", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + _, _, err = client.Copilot.RemoveCopilotUsers(ctx, "\n", []string{"user1", "user2"}) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Copilot.RemoveCopilotUsers(ctx, "o", &SelectedUsers{SelectedUsers: []string{"user1", "user2"}}) + got, resp, err := client.Copilot.RemoveCopilotUsers(ctx, "o", []string{"user1", "user2"}) if got != nil { t.Errorf("Copilot.RemoveCopilotUsers returned %+v, want nil", got) } From 78f4db04b7e1ecdda9e46baceef66b0fefc024ff Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Fri, 17 Nov 2023 14:49:57 +0300 Subject: [PATCH 17/37] Add operations metadata --- github/copilot.go | 28 +- openapi_operations.yaml | 2096 ++++++++++++++++++++------------------- 2 files changed, 1076 insertions(+), 1048 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 77dc97e4c5..423b3ba440 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -132,7 +132,9 @@ func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { // GetCopilotBilling gets Copilot for Business billing information and settings for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-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) @@ -154,7 +156,9 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co // // To paginate through all seats, populate 'Page' with the number of the last page. // -// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#list-all-copilot-for-business-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) @@ -174,7 +178,9 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-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) @@ -200,7 +206,9 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNa // RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-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) @@ -226,7 +234,9 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea // AddCopilotUsers adds users to the Copilot for Business subscription for an organization // -// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-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) @@ -252,7 +262,9 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users // RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-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) @@ -278,7 +290,9 @@ func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, use // GetSeatDetails gets Copilot for Business seat assignment details for a user. // -// GitHub API docs: https://docs.github.com/en/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-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) diff --git a/openapi_operations.yaml b/openapi_operations.yaml index f2b1af2884..25dde27337 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -48,258 +48,260 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: c86f07e1ca0d543d0b8fc7591991b02767e02deb +openapi_commit: b164298e5a5db36254a3029219f443f253d79147 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#list-global-webhooks + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#list-global-webhooks openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#create-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#create-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#delete-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#get-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#get-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#update-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#update-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/global-webhooks#ping-a-global-webhook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-public-keys + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#list-public-keys openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/keys/{key_ids} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-public-key + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-public-key openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/ldap/teams/{team_id}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/ldap/teams/{team_id}/sync - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/ldap/users/{username}/mapping - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/ldap/users/{username}/sync - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/organizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#create-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/organizations/{org} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/orgs#update-an-organization-name openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /admin/tokens - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-personal-access-tokens + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#list-personal-access-tokens openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/tokens/{token_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-personal-access-token + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-personal-access-token openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/users - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#update-the-username-for-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#update-the-username-for-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /advisories documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /advisories/{ghsa_id} documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /app-manifests/{code}/conversions documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /app/hook/config documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/hook/deliveries documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/hook/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /app/hook/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/installation-requests documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/installations documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /app/installations/{installation_id} documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /app/installations/{installation_id}/access_tokens documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /app/installations/{installation_id}/suspended documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /applications/grants - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-grants + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#list-your-grants openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#delete-a-grant openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /applications/{client_id}/grant documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /applications/{client_id}/grants/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application openapi_files: @@ -309,25 +311,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /applications/{client_id}/token documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /applications/{client_id}/token/scoped documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /applications/{client_id}/tokens/{access_token} documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application openapi_files: @@ -345,7 +347,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /assignments/{assignment_id} documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment openapi_files: @@ -362,33 +364,33 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /authorizations/clients/{client_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /authorizations/clients/{client_id}/{fingerprint} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /classrooms documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms openapi_files: @@ -409,100 +411,100 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /codes_of_conduct/{key} documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /emojis documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics openapi_files: - descriptions/ghec/ghec.json - name: DELETE /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#remove-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#get-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#get-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#set-the-global-announcement-banner + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/announcement#set-the-global-announcement-banner openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/settings/license - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/license#get-license-information + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/license#get-license-information openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/all - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-all-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/comments - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-comment-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-comment-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/gists - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-gist-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-gist-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-hooks-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-hooks-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/issues - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-issue-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-issue-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/milestones - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-milestone-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-milestone-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/orgs - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-organization-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-organization-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/pages - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pages-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-pages-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/pulls - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pull-request-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-pull-request-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/repos - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-repository-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-repository-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/security-products - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-security-products-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-security-products-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprise/stats/users - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-users-statistics + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-users-statistics openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/cache/usage documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/oidc/customization/issuer documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise openapi_files: @@ -511,177 +513,177 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/permissions/workflow documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: 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 openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations documentation_url: 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 openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: 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 openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} documentation_url: 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 openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runners/downloads documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runners/registration-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runners/remove-token documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /enterprises/{enterprise}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise openapi_files: @@ -698,22 +700,22 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/code-scanning/alerts documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /enterprises/{enterprise}/code_security_and_analysis documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/consumed-licenses documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses openapi_files: @@ -723,7 +725,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/license-sync-status documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status openapi_files: @@ -733,7 +735,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/settings/billing/actions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-actions-billing-for-an-enterprise openapi_files: @@ -742,7 +744,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /enterprises/{enterprise}/settings/billing/packages documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-packages-billing-for-an-enterprise openapi_files: @@ -755,207 +757,207 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /events documentation_url: https://docs.github.com/rest/activity/events#list-public-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /feeds documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /gists documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/public documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/starred documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /gists/{gist_id} documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /gists/{gist_id}/comments documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /gists/{gist_id}/comments/{comment_id} documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/commits documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /gists/{gist_id}/forks documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /gists/{gist_id}/star documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gists/{gist_id}/{sha} documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gitignore/templates documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /gitignore/templates/{name} documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /installation/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /installation/token documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /issues documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /licenses documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /licenses/{license} documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /manage/v1/config/nodes - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /manage/v1/replication/status - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /manage/v1/version - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /markdown documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /markdown/raw documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /marketplace_listing/accounts/{account_id} documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account openapi_files: @@ -991,439 +993,439 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /networks/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /notifications/threads/{thread_id} documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /notifications/threads/{thread_id}/subscription documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /octocat documentation_url: https://docs.github.com/rest/meta/meta#get-octocat openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /organizations documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /organizations/{organization_id}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org} documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/cache/usage-by-repository documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions/repositories documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runner-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/announcement documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/audit-log documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/blocks documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization openapi_files: @@ -1449,7 +1451,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization openapi_files: @@ -1557,27 +1559,27 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/custom-repository-roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/custom-repository-roles/{role_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/custom_roles documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---create-a-custom-role openapi_files: @@ -1599,83 +1601,83 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/events documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/external-group/{group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/failed_invitations documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations openapi_files: @@ -1690,79 +1692,79 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/hooks documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/hooks/{hook_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/hooks/{hook_id}/config documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/hooks/{hook_id}/pings documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/installations documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization openapi_files: @@ -1803,25 +1805,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/members documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/members/{username}/codespaces documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization openapi_files: @@ -1847,235 +1849,235 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/memberships/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/migrations documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/migrations/{migration_id}/archive documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/migrations/{migration_id}/repositories documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/outside_collaborators documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/outside_collaborators/{username} documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/personal-access-token-requests documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/personal-access-tokens documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/personal-access-tokens/{pat_id} documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/properties/schema - documentation_url: https://docs.github.com/rest/orgs/properties#get-all-custom-properties-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: PATCH /orgs/{org}/properties/schema - documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-custom-properties-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/properties/schema/{custom_property_name} - documentation_url: https://docs.github.com/rest/orgs/properties#remove-a-custom-property-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/properties/schema/{custom_property_name} - documentation_url: https://docs.github.com/rest/orgs/properties#get-a-custom-property-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: PUT /orgs/{org}/properties/schema/{custom_property_name} - documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-a-custom-property-for-an-organization + documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/properties/values - documentation_url: https://docs.github.com/rest/orgs/properties#list-custom-property-values-for-organization-repositories + documentation_url: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: PATCH /orgs/{org}/properties/values - documentation_url: https://docs.github.com/rest/orgs/properties#create-or-update-custom-property-values-for-organization-repositories + documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -2084,52 +2086,54 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/public_members/{username} documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/repos documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/repository-fine-grained-permissions documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/rulesets documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites openapi_files: @@ -2145,22 +2149,25 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization openapi_files: @@ -2171,19 +2178,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/security-managers/teams/{team_slug} documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization openapi_files: @@ -2193,7 +2200,7 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/settings/billing/packages documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization openapi_files: @@ -2213,142 +2220,142 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams documentation_url: https://docs.github.com/rest/teams/teams#create-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/teams/{team_slug} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams/{team_slug}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations openapi_files: @@ -2359,73 +2366,73 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team openapi_files: @@ -2439,133 +2446,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /orgs/{org}/{security_product}/{enablement} documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /projects/columns/cards/{card_id} documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /projects/columns/cards/{card_id}/moves documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /projects/columns/{column_id} documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /projects/columns/{column_id}/cards documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /projects/columns/{column_id}/moves documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#get-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /projects/{project_id} documentation_url: https://docs.github.com/rest/projects/projects#update-a-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/{project_id}/collaborators documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /projects/{project_id}/collaborators/{username} documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/{project_id}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /projects/{project_id}/columns documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /rate_limit documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /reactions/{reaction_id} documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy openapi_files: @@ -2575,261 +2582,261 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/artifacts documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/cache/usage documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/caches documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id} documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/organization-secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/organization-variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/permissions documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/permissions/access documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runners documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runners/downloads documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runners/registration-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runners/remove-token documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name} documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request openapi_files: @@ -2840,37 +2847,37 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run openapi_files: @@ -2881,43 +2888,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage openapi_files: @@ -2928,97 +2935,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/variables documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/actions/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/workflows documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage openapi_files: @@ -3029,42 +3036,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/autolinks documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id} documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes openapi_files: @@ -3075,7 +3083,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/automated-security-fixes documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes openapi_files: @@ -3086,319 +3094,319 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch} documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/branches/{branch}/rename documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/check-suites/preferences documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id} documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository openapi_files: @@ -3414,31 +3422,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/code-scanning/sarifs documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/codeowners/errors documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user openapi_files: @@ -3499,133 +3507,133 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/collaborators/{username} documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/comments/{comment_id} documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits documentation_url: https://docs.github.com/rest/commits/commits#list-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref} documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref}/status documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/community/profile documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics openapi_files: @@ -3636,7 +3644,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment openapi_files: @@ -3646,391 +3654,391 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/contents/{path} documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/contributors documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/secrets documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead} documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/dependency-graph/sbom documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/deployments documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id} documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/dispatches documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments documentation_url: https://docs.github.com/rest/deployments/environments#list-environments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name} documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id} documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/events documentation_url: https://docs.github.com/rest/activity/events#list-repository-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#list-forks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/forks documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/blobs documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha} documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/commits documentation_url: https://docs.github.com/rest/git/commits#create-a-commit openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha} documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#list-matching-references openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/ref/{ref} documentation_url: https://docs.github.com/rest/git/refs#get-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/refs documentation_url: https://docs.github.com/rest/git/refs#create-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/git/refs/{ref} documentation_url: https://docs.github.com/rest/git/refs#update-a-reference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/tags documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha} documentation_url: https://docs.github.com/rest/git/tags#get-a-tag openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/git/trees documentation_url: https://docs.github.com/rest/git/trees#create-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha} documentation_url: https://docs.github.com/rest/git/trees#get-a-tree openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks - documentation_url: https://docs.github.com/rest/webhooks/repos#list-repository-webhooks + documentation_url: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/hooks - documentation_url: https://docs.github.com/rest/webhooks/repos#create-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config - documentation_url: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository + documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config - documentation_url: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository + documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries - documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} - documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts - documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests - documentation_url: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook + documentation_url: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/import documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import openapi_files: @@ -4076,7 +4084,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/interaction-limits documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository openapi_files: @@ -4097,410 +4105,410 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/events/{event_id} documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/issues/{issue_number} documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee} documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events documentation_url: https://docs.github.com/rest/issues/events#list-issue-events openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/keys documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/keys/{key_id} documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/labels documentation_url: https://docs.github.com/rest/issues/labels#create-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#get-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/labels/{name} documentation_url: https://docs.github.com/rest/issues/labels#update-a-label openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/languages documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/lfs documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/license documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/merge-upstream documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/merges documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/milestones documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number} documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/notifications documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pages documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pages/builds documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages/builds/latest documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pages/deployment documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pages/health documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository openapi_files: @@ -4516,15 +4524,15 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/properties/values - documentation_url: https://docs.github.com/rest/repos/properties#get-all-custom-property-values-for-a-repository + documentation_url: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -4533,67 +4541,67 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/comments documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number} documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request openapi_files: @@ -4604,242 +4612,245 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/readme documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/readme/{dir} documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#list-releases openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/releases documentation_url: https://docs.github.com/rest/releases/releases#create-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/releases/generate-notes documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/latest documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/tags/{tag} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#get-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/releases/{release_id} documentation_url: https://docs.github.com/rest/releases/releases#update-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/replicas/caches - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/repos/repos#list-repository-cache-replication-status + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/repos/repos#list-repository-cache-replication-status openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/rules/branches/{branch} documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/rulesets documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/rulesets/rule-suites documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites openapi_files: @@ -4855,40 +4866,43 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/security-advisories documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: @@ -4924,115 +4938,115 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/code_frequency documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/commit_activity documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/contributors documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/participation documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/stats/punch_card documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/statuses/{sha} documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/subscribers documentation_url: https://docs.github.com/rest/activity/watching#list-watchers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/subscription documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/tags documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{owner}/{repo}/tags/protection documentation_url: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} documentation_url: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/tarball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/teams documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/topics documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/traffic/clones documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones openapi_files: @@ -5058,163 +5072,163 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repos/{owner}/{repo}/vulnerability-alerts documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repos/{owner}/{repo}/zipball/{ref} documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repos/{template_owner}/{template_repo}/generate documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /repositories/{repository_id}/environments/{environment_name}/variables documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /scim/v2/Groups documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /scim/v2/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /scim/v2/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /scim/v2/Groups/{scim_group_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /scim/v2/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /scim/v2/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /scim/v2/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /scim/v2/Users/{scim_user_id} documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user openapi_files: - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /scim/v2/organizations/{org}/Users documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities openapi_files: @@ -5244,189 +5258,189 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/commits documentation_url: https://docs.github.com/rest/search/search#search-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/issues documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/labels documentation_url: https://docs.github.com/rest/search/search#search-labels openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/repositories documentation_url: https://docs.github.com/rest/search/search#search-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/topics documentation_url: https://docs.github.com/rest/search/search#search-topics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /search/users documentation_url: https://docs.github.com/rest/search/search#search-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /setup/api/configcheck - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-configuration-status + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/configure - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#start-a-configuration-process + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#start-a-configuration-process openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-maintenance-status + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-the-maintenance-status openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-settings + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-settings openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#set-settings + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#set-settings openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/settings/authorized-keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#add-an-authorized-ssh-key + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#add-an-authorized-ssh-key openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/start - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#create-a-github-license + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#create-a-github-license openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /setup/api/upgrade - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#upgrade-a-license + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/management-console#upgrade-a-license openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /teams/{team_id} documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /teams/{team_id}/discussions documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /teams/{team_id}/discussions/{discussion_number} documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/invitations documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy openapi_files: @@ -5437,91 +5451,91 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /teams/{team_id}/members/{username} documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /teams/{team_id}/memberships/{username} documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/projects documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /teams/{team_id}/projects/{project_id} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/repos documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /teams/{team_id}/repos/{owner}/{repo} documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /teams/{team_id}/team-sync/group-mappings documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy openapi_files: @@ -5535,19 +5549,19 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /user documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/blocks documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user openapi_files: @@ -5673,7 +5687,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /user/email/visibility documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user openapi_files: @@ -5684,97 +5698,97 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/emails documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/emails documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /user/following/{username} documentation_url: https://docs.github.com/rest/users/followers#follow-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/gpg_keys/{gpg_key_id} documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/installations documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/installations/{installation_id}/repositories documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /user/installations/{installation_id}/repositories/{repository_id} documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/interaction-limits documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories openapi_files: @@ -5795,31 +5809,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/keys documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/keys/{key_id} documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/marketplace_purchases documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user openapi_files: @@ -5835,31 +5849,31 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /user/memberships/orgs/{org} documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/migrations documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/migrations/{migration_id} documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status openapi_files: @@ -5875,7 +5889,7 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository openapi_files: @@ -5886,343 +5900,343 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/projects documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/public_emails documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/repos documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/repository_invitations documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PATCH /user/repository_invitations/{invitation_id} documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /user/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/ssh_signing_keys/{ssh_signing_key_id} documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /user/starred/{owner}/{repo} documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /user/teams documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users documentation_url: https://docs.github.com/rest/users/users#list-users openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username} documentation_url: https://docs.github.com/rest/users/users#get-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/docker/conflicts documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/events documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/events/orgs/{org} documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/followers documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/following documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/following/{target_user} documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/gists documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/gpg_keys documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/hovercard documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/installation documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/keys documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/orgs documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/packages documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/packages/{package_type}/{package_name} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /users/{username}/packages/{package_type}/{package_name}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/projects documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/received_events documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/received_events/public documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/repos documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/settings/billing/actions documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user openapi_files: @@ -6239,45 +6253,45 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#demote-a-site-administrator openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/social_accounts documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/ssh_signing_keys documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/starred documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /users/{username}/subscriptions documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: DELETE /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#unsuspend-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: PUT /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user + documentation_url: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#suspend-a-user openapi_files: - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json - name: GET /versions documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions openapi_files: @@ -6288,4 +6302,4 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json + - descriptions/ghes-3.11/ghes-3.11.json From da71a5a0c44495f66237ea89afbe7279117281e4 Mon Sep 17 00:00:00 2001 From: Osama Faqhruldin Date: Fri, 17 Nov 2023 14:53:33 +0300 Subject: [PATCH 18/37] Update generated code --- github/admin.go | 4 ++-- github/admin_orgs.go | 6 +++--- github/admin_stats.go | 2 +- github/admin_users.go | 8 ++++---- github/authorizations.go | 4 ++-- github/orgs_properties.go | 14 +++++++------- github/repos_hooks.go | 14 +++++++------- github/repos_hooks_configuration.go | 4 ++-- github/repos_hooks_deliveries.go | 6 +++--- github/repos_prereceive_hooks.go | 8 ++++---- github/users_administration.go | 8 ++++---- 11 files changed, 39 insertions(+), 39 deletions(-) diff --git a/github/admin.go b/github/admin.go index 8eee9854c1..c1f7066c7a 100644 --- a/github/admin.go +++ b/github/admin.go @@ -82,7 +82,7 @@ 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.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -103,7 +103,7 @@ 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.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { diff --git a/github/admin_orgs.go b/github/admin_orgs.go index c734d4de12..e1b3641e00 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,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.10/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -70,7 +70,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.10/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { diff --git a/github/admin_stats.go b/github/admin_stats.go index aa23f5d199..f26b393e02 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,7 @@ 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.10/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/github/admin_users.go b/github/admin_users.go index 3916a470b0..0d3fe9fafc 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -19,7 +19,7 @@ type createUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { @@ -46,7 +46,7 @@ func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*Us // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -99,7 +99,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -121,7 +121,7 @@ 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.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { diff --git a/github/authorizations.go b/github/authorizations.go index 7adc532367..931b77299b 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -257,7 +257,7 @@ 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.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -279,7 +279,7 @@ 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.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { diff --git a/github/orgs_properties.go b/github/orgs_properties.go index 1daac81180..45e3f1f964 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -39,7 +39,7 @@ type CustomPropertyValue struct { // GetAllCustomProperties gets all custom properties that are defined for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#get-all-custom-properties-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#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) { @@ -61,7 +61,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/properties#create-or-update-custom-properties-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#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) { @@ -89,7 +89,7 @@ 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/properties#get-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#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) { @@ -111,7 +111,7 @@ 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/properties#create-or-update-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#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) { @@ -133,7 +133,7 @@ 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/properties#remove-a-custom-property-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#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) { @@ -149,7 +149,7 @@ func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, cu // ListCustomPropertyValues lists all custom property values for repositories in the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/properties#list-custom-property-values-for-organization-repositories +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories // //meta:operation GET /orgs/{org}/properties/values func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListOptions) ([]*RepoCustomPropertyValue, *Response, error) { @@ -175,7 +175,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/properties#create-or-update-custom-property-values-for-organization-repositories +// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#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 []*CustomProperty) (*Response, error) { diff --git a/github/repos_hooks.go b/github/repos_hooks.go index 8768d603d2..3edf647566 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -79,7 +79,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/webhooks/repos#create-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -108,7 +108,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/webhooks/repos#list-repository-webhooks +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -134,7 +134,7 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -154,7 +154,7 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -174,7 +174,7 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -188,7 +188,7 @@ func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -202,7 +202,7 @@ func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, // TestHook triggers a test Hook by github. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { diff --git a/github/repos_hooks_configuration.go b/github/repos_hooks_configuration.go index 2203d7614f..b58eb248e4 100644 --- a/github/repos_hooks_configuration.go +++ b/github/repos_hooks_configuration.go @@ -12,7 +12,7 @@ import ( // GetHookConfiguration returns the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -33,7 +33,7 @@ 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/webhooks/repo-config#update-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index 6e1fd86f99..c8029f626b 100644 --- a/github/repos_hooks_deliveries.go +++ b/github/repos_hooks_deliveries.go @@ -63,7 +63,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/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -89,7 +89,7 @@ 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/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { @@ -110,7 +110,7 @@ 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/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/repos/webhooks#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) { diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index e8361383f5..b1d3f3c818 100644 --- a/github/repos_prereceive_hooks.go +++ b/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.10/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -53,7 +53,7 @@ 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.10/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.11/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) { @@ -77,7 +77,7 @@ 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.10/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.11/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) { @@ -101,7 +101,7 @@ 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.10/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.11/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) { diff --git a/github/users_administration.go b/github/users_administration.go index 02cb894bc3..5b9e1de8c6 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/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) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.11/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { From 766902b707ac1f130c0eee8172aff7a7b8ac073f Mon Sep 17 00:00:00 2001 From: Casey Date: Wed, 22 Nov 2023 11:48:39 -0800 Subject: [PATCH 19/37] Add default branch to repository edit event (#2995) Fixes: #2994. --- github/event_types.go | 16 +++++++++++----- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 17 +++++++++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 6ff1eb8485..327fc56166 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -388,11 +388,12 @@ type GollumEvent struct { // EditChange represents the changes when an issue, pull request, comment, // or repository has been edited. type EditChange struct { - Title *EditTitle `json:"title,omitempty"` - Body *EditBody `json:"body,omitempty"` - Base *EditBase `json:"base,omitempty"` - Repo *EditRepo `json:"repository,omitempty"` - Owner *EditOwner `json:"owner,omitempty"` + Title *EditTitle `json:"title,omitempty"` + Body *EditBody `json:"body,omitempty"` + Base *EditBase `json:"base,omitempty"` + Repo *EditRepo `json:"repository,omitempty"` + Owner *EditOwner `json:"owner,omitempty"` + DefaultBranch *EditDefaultBranch `json:"default_branch,omitempty"` } // EditTitle represents a pull-request title change. @@ -442,6 +443,11 @@ type EditSHA struct { From *string `json:"from,omitempty"` } +// EditDefaultBranch represents a change of repository's default branch name. +type EditDefaultBranch struct { + From *string `json:"from,omitempty"` +} + // ProjectChange represents the changes when a project has been edited. type ProjectChange struct { Name *ProjectName `json:"name,omitempty"` diff --git a/github/github-accessors.go b/github/github-accessors.go index bf1debd174..8579efe6bf 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6734,6 +6734,14 @@ func (e *EditChange) GetBody() *EditBody { return e.Body } +// GetDefaultBranch returns the DefaultBranch field. +func (e *EditChange) GetDefaultBranch() *EditDefaultBranch { + if e == nil { + return nil + } + return e.DefaultBranch +} + // GetOwner returns the Owner field. func (e *EditChange) GetOwner() *EditOwner { if e == nil { @@ -6758,6 +6766,14 @@ func (e *EditChange) GetTitle() *EditTitle { return e.Title } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (e *EditDefaultBranch) GetFrom() string { + if e == nil || e.From == nil { + return "" + } + return *e.From +} + // GetOwnerInfo returns the OwnerInfo field. func (e *EditOwner) GetOwnerInfo() *OwnerInfo { if e == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index b73053627d..c5156ef144 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -7890,6 +7890,13 @@ func TestEditChange_GetBody(tt *testing.T) { e.GetBody() } +func TestEditChange_GetDefaultBranch(tt *testing.T) { + e := &EditChange{} + e.GetDefaultBranch() + e = nil + e.GetDefaultBranch() +} + func TestEditChange_GetOwner(tt *testing.T) { e := &EditChange{} e.GetOwner() @@ -7911,6 +7918,16 @@ func TestEditChange_GetTitle(tt *testing.T) { e.GetTitle() } +func TestEditDefaultBranch_GetFrom(tt *testing.T) { + var zeroValue string + e := &EditDefaultBranch{From: &zeroValue} + e.GetFrom() + e = &EditDefaultBranch{} + e.GetFrom() + e = nil + e.GetFrom() +} + func TestEditOwner_GetOwnerInfo(tt *testing.T) { e := &EditOwner{} e.GetOwnerInfo() From 76779c05ee89b6164d81a79c1fc50f3018a3f932 Mon Sep 17 00:00:00 2001 From: Casey Date: Wed, 22 Nov 2023 19:03:06 -0800 Subject: [PATCH 20/37] Add `Draft` to `Issue` type (#2997) Fixes: #2996. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 3 ++- github/issues.go | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 8579efe6bf..746e9e373b 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9462,6 +9462,14 @@ func (i *Issue) GetCreatedAt() Timestamp { return *i.CreatedAt } +// GetDraft returns the Draft field if it's non-nil, zero value otherwise. +func (i *Issue) GetDraft() bool { + if i == nil || i.Draft == nil { + return false + } + return *i.Draft +} + // GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise. func (i *Issue) GetEventsURL() string { if i == nil || i.EventsURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c5156ef144..2be8d730aa 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11105,6 +11105,16 @@ func TestIssue_GetCreatedAt(tt *testing.T) { i.GetCreatedAt() } +func TestIssue_GetDraft(tt *testing.T) { + var zeroValue bool + i := &Issue{Draft: &zeroValue} + i.GetDraft() + i = &Issue{} + i.GetDraft() + i = nil + i.GetDraft() +} + func TestIssue_GetEventsURL(tt *testing.T) { var zeroValue string i := &Issue{EventsURL: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 1dfd878fd5..a9b719c516 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -768,9 +768,10 @@ func TestIssue_String(t *testing.T) { Repository: &Repository{}, Reactions: &Reactions{}, NodeID: String(""), + Draft: Bool(false), ActiveLockReason: String(""), } - want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", ActiveLockReason:""}` + want := `github.Issue{ID:0, Number:0, State:"", StateReason:"", Locked:false, Title:"", Body:"", AuthorAssociation:"", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:"", HTMLURL:"", CommentsURL:"", EventsURL:"", LabelsURL:"", RepositoryURL:"", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:"", Draft:false, ActiveLockReason:""}` if got := v.String(); got != want { t.Errorf("Issue.String = %v, want %v", got, want) } diff --git a/github/issues.go b/github/issues.go index 1db99328b5..1c07fef827 100644 --- a/github/issues.go +++ b/github/issues.go @@ -54,6 +54,7 @@ type Issue struct { Reactions *Reactions `json:"reactions,omitempty"` Assignees []*User `json:"assignees,omitempty"` NodeID *string `json:"node_id,omitempty"` + Draft *bool `json:"draft,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 From baf2515b4a1b2feaf70cc8543117d48fa41cca1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Sal=C3=A9?= Date: Mon, 27 Nov 2023 01:00:00 +0100 Subject: [PATCH 21/37] Fix secondary rate limits URL (#3001) --- github/github.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/github.go b/github/github.go index 0c2817dc48..709808d9a9 100644 --- a/github/github.go +++ b/github/github.go @@ -1135,7 +1135,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/resources-in-the-rest-api#secondary-rate-limits". +// "documentation_url" field value equal to "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits". type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message @@ -1261,7 +1261,7 @@ func CheckResponse(r *http.Response) error { } case r.StatusCode == http.StatusForbidden && (strings.HasSuffix(errorResponse.DocumentationURL, "#abuse-rate-limits") || - strings.HasSuffix(errorResponse.DocumentationURL, "#secondary-rate-limits")): + strings.HasSuffix(errorResponse.DocumentationURL, "secondary-rate-limits")): abuseRateLimitError := &AbuseRateLimitError{ Response: errorResponse.Response, Message: errorResponse.Message, From 2adca97282073ef467e1b82d6dda8e226ec7c4d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:19:00 -0500 Subject: [PATCH 22/37] Bump golang.org/x/net from 0.18.0 to 0.19.0 in /scrape (#3003) --- scrape/go.mod | 2 +- scrape/go.sum | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scrape/go.mod b/scrape/go.mod index 95c03591b2..05f87b6b3a 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -7,5 +7,5 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/go-github/v56 v56.0.0 github.com/xlzd/gotp v0.1.0 - golang.org/x/net v0.18.0 + golang.org/x/net v0.19.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 78483af2cb..907678b1c1 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -15,7 +15,7 @@ github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8q github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -25,8 +25,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -38,12 +38,12 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From b0181bb898dc983be9e6757f1de1c4b4dfa465e9 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Wed, 29 Nov 2023 15:56:21 +0100 Subject: [PATCH 23/37] Implement global security advisories API (#2993) Fixes: #2851. --- github/github-accessors.go | 168 +++++++++++++ github/github-accessors_test.go | 204 ++++++++++++++++ github/security_advisories.go | 122 ++++++++++ github/security_advisories_test.go | 378 +++++++++++++++++++++++++++++ 4 files changed, 872 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 746e9e373b..0410744d70 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5046,6 +5046,22 @@ func (c *CredentialAuthorization) GetTokenLastEight() string { return *c.TokenLastEight } +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (c *Credit) GetType() string { + if c == nil || c.Type == nil { + return "" + } + return *c.Type +} + +// GetUser returns the User field. +func (c *Credit) GetUser() *User { + if c == nil { + return nil + } + return c.User +} + // GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetDefaultValue() string { if c == nil || c.DefaultValue == nil { @@ -7870,6 +7886,78 @@ func (g *GitObject) GetURL() string { return *g.URL } +// GetGithubReviewedAt returns the GithubReviewedAt field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetGithubReviewedAt() Timestamp { + if g == nil || g.GithubReviewedAt == nil { + return Timestamp{} + } + return *g.GithubReviewedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetID() int64 { + if g == nil || g.ID == nil { + return 0 + } + return *g.ID +} + +// GetNVDPublishedAt returns the NVDPublishedAt field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetNVDPublishedAt() Timestamp { + if g == nil || g.NVDPublishedAt == nil { + return Timestamp{} + } + return *g.NVDPublishedAt +} + +// GetRepositoryAdvisoryURL returns the RepositoryAdvisoryURL field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetRepositoryAdvisoryURL() string { + if g == nil || g.RepositoryAdvisoryURL == nil { + return "" + } + return *g.RepositoryAdvisoryURL +} + +// GetSourceCodeLocation returns the SourceCodeLocation field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetSourceCodeLocation() string { + if g == nil || g.SourceCodeLocation == nil { + return "" + } + return *g.SourceCodeLocation +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityAdvisory) GetType() string { + if g == nil || g.Type == nil { + return "" + } + return *g.Type +} + +// GetFirstPatchedVersion returns the FirstPatchedVersion field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityVulnerability) GetFirstPatchedVersion() string { + if g == nil || g.FirstPatchedVersion == nil { + return "" + } + return *g.FirstPatchedVersion +} + +// GetPackage returns the Package field. +func (g *GlobalSecurityVulnerability) GetPackage() *VulnerabilityPackage { + if g == nil { + return nil + } + return g.Package +} + +// GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise. +func (g *GlobalSecurityVulnerability) GetVulnerableVersionRange() string { + if g == nil || g.VulnerableVersionRange == nil { + return "" + } + return *g.VulnerableVersionRange +} + // GetInstallation returns the Installation field. func (g *GollumEvent) GetInstallation() *Installation { if g == nil { @@ -10846,6 +10934,86 @@ func (l *ListExternalGroupsOptions) GetDisplayName() string { return *l.DisplayName } +// GetAffects returns the Affects field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetAffects() string { + if l == nil || l.Affects == nil { + return "" + } + return *l.Affects +} + +// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetCVEID() string { + if l == nil || l.CVEID == nil { + return "" + } + return *l.CVEID +} + +// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetEcosystem() string { + if l == nil || l.Ecosystem == nil { + return "" + } + return *l.Ecosystem +} + +// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetGHSAID() string { + if l == nil || l.GHSAID == nil { + return "" + } + return *l.GHSAID +} + +// GetIsWithdrawn returns the IsWithdrawn field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetIsWithdrawn() bool { + if l == nil || l.IsWithdrawn == nil { + return false + } + return *l.IsWithdrawn +} + +// GetModified returns the Modified field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetModified() string { + if l == nil || l.Modified == nil { + return "" + } + return *l.Modified +} + +// GetPublished returns the Published field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetPublished() string { + if l == nil || l.Published == nil { + return "" + } + return *l.Published +} + +// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetSeverity() string { + if l == nil || l.Severity == nil { + return "" + } + return *l.Severity +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetType() string { + if l == nil || l.Type == nil { + return "" + } + return *l.Type +} + +// GetUpdated returns the Updated field if it's non-nil, zero value otherwise. +func (l *ListGlobalSecurityAdvisoriesOptions) GetUpdated() string { + if l == nil || l.Updated == nil { + return "" + } + return *l.Updated +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListOrganizations) GetTotalCount() int { if l == nil || l.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 2be8d730aa..3522519fe4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -5963,6 +5963,23 @@ func TestCredentialAuthorization_GetTokenLastEight(tt *testing.T) { c.GetTokenLastEight() } +func TestCredit_GetType(tt *testing.T) { + var zeroValue string + c := &Credit{Type: &zeroValue} + c.GetType() + c = &Credit{} + c.GetType() + c = nil + c.GetType() +} + +func TestCredit_GetUser(tt *testing.T) { + c := &Credit{} + c.GetUser() + c = nil + c.GetUser() +} + func TestCustomProperty_GetDefaultValue(tt *testing.T) { var zeroValue string c := &CustomProperty{DefaultValue: &zeroValue} @@ -9223,6 +9240,93 @@ func TestGitObject_GetURL(tt *testing.T) { g.GetURL() } +func TestGlobalSecurityAdvisory_GetGithubReviewedAt(tt *testing.T) { + var zeroValue Timestamp + g := &GlobalSecurityAdvisory{GithubReviewedAt: &zeroValue} + g.GetGithubReviewedAt() + g = &GlobalSecurityAdvisory{} + g.GetGithubReviewedAt() + g = nil + g.GetGithubReviewedAt() +} + +func TestGlobalSecurityAdvisory_GetID(tt *testing.T) { + var zeroValue int64 + g := &GlobalSecurityAdvisory{ID: &zeroValue} + g.GetID() + g = &GlobalSecurityAdvisory{} + g.GetID() + g = nil + g.GetID() +} + +func TestGlobalSecurityAdvisory_GetNVDPublishedAt(tt *testing.T) { + var zeroValue Timestamp + g := &GlobalSecurityAdvisory{NVDPublishedAt: &zeroValue} + g.GetNVDPublishedAt() + g = &GlobalSecurityAdvisory{} + g.GetNVDPublishedAt() + g = nil + g.GetNVDPublishedAt() +} + +func TestGlobalSecurityAdvisory_GetRepositoryAdvisoryURL(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityAdvisory{RepositoryAdvisoryURL: &zeroValue} + g.GetRepositoryAdvisoryURL() + g = &GlobalSecurityAdvisory{} + g.GetRepositoryAdvisoryURL() + g = nil + g.GetRepositoryAdvisoryURL() +} + +func TestGlobalSecurityAdvisory_GetSourceCodeLocation(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityAdvisory{SourceCodeLocation: &zeroValue} + g.GetSourceCodeLocation() + g = &GlobalSecurityAdvisory{} + g.GetSourceCodeLocation() + g = nil + g.GetSourceCodeLocation() +} + +func TestGlobalSecurityAdvisory_GetType(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityAdvisory{Type: &zeroValue} + g.GetType() + g = &GlobalSecurityAdvisory{} + g.GetType() + g = nil + g.GetType() +} + +func TestGlobalSecurityVulnerability_GetFirstPatchedVersion(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityVulnerability{FirstPatchedVersion: &zeroValue} + g.GetFirstPatchedVersion() + g = &GlobalSecurityVulnerability{} + g.GetFirstPatchedVersion() + g = nil + g.GetFirstPatchedVersion() +} + +func TestGlobalSecurityVulnerability_GetPackage(tt *testing.T) { + g := &GlobalSecurityVulnerability{} + g.GetPackage() + g = nil + g.GetPackage() +} + +func TestGlobalSecurityVulnerability_GetVulnerableVersionRange(tt *testing.T) { + var zeroValue string + g := &GlobalSecurityVulnerability{VulnerableVersionRange: &zeroValue} + g.GetVulnerableVersionRange() + g = &GlobalSecurityVulnerability{} + g.GetVulnerableVersionRange() + g = nil + g.GetVulnerableVersionRange() +} + func TestGollumEvent_GetInstallation(tt *testing.T) { g := &GollumEvent{} g.GetInstallation() @@ -12703,6 +12807,106 @@ func TestListExternalGroupsOptions_GetDisplayName(tt *testing.T) { l.GetDisplayName() } +func TestListGlobalSecurityAdvisoriesOptions_GetAffects(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Affects: &zeroValue} + l.GetAffects() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetAffects() + l = nil + l.GetAffects() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetCVEID(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{CVEID: &zeroValue} + l.GetCVEID() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetCVEID() + l = nil + l.GetCVEID() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetEcosystem(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Ecosystem: &zeroValue} + l.GetEcosystem() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetEcosystem() + l = nil + l.GetEcosystem() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetGHSAID(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{GHSAID: &zeroValue} + l.GetGHSAID() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetGHSAID() + l = nil + l.GetGHSAID() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetIsWithdrawn(tt *testing.T) { + var zeroValue bool + l := &ListGlobalSecurityAdvisoriesOptions{IsWithdrawn: &zeroValue} + l.GetIsWithdrawn() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetIsWithdrawn() + l = nil + l.GetIsWithdrawn() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetModified(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Modified: &zeroValue} + l.GetModified() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetModified() + l = nil + l.GetModified() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetPublished(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Published: &zeroValue} + l.GetPublished() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetPublished() + l = nil + l.GetPublished() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetSeverity(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Severity: &zeroValue} + l.GetSeverity() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetSeverity() + l = nil + l.GetSeverity() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetType(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Type: &zeroValue} + l.GetType() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetType() + l = nil + l.GetType() +} + +func TestListGlobalSecurityAdvisoriesOptions_GetUpdated(tt *testing.T) { + var zeroValue string + l := &ListGlobalSecurityAdvisoriesOptions{Updated: &zeroValue} + l.GetUpdated() + l = &ListGlobalSecurityAdvisoriesOptions{} + l.GetUpdated() + l = nil + l.GetUpdated() +} + func TestListOrganizations_GetTotalCount(tt *testing.T) { var zeroValue int l := &ListOrganizations{TotalCount: &zeroValue} diff --git a/github/security_advisories.go b/github/security_advisories.go index 66e7dba15a..635263748d 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -47,6 +47,81 @@ type ListRepositorySecurityAdvisoriesOptions struct { State string `url:"state,omitempty"` } +// ListGlobalSecurityAdvisoriesOptions specifies the optional parameters to list the global security advisories. +type ListGlobalSecurityAdvisoriesOptions struct { + ListCursorOptions + + // If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned. + GHSAID *string `url:"ghsa_id,omitempty"` + + // If specified, only advisories of this type will be returned. + // By default, a request with no other parameters defined will only return reviewed advisories that are not malware. + // Default: reviewed + // Can be one of: reviewed, malware, unreviewed + Type *string `url:"type,omitempty"` + + // If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned. + CVEID *string `url:"cve_id,omitempty"` + + // If specified, only advisories for these ecosystems will be returned. + // Can be one of: actions, composer, erlang, go, maven, npm, nuget, other, pip, pub, rubygems, rust + Ecosystem *string `url:"ecosystem,omitempty"` + + // If specified, only advisories with these severities will be returned. + // Can be one of: unknown, low, medium, high, critical + Severity *string `url:"severity,omitempty"` + + // If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned. + // Example: cwes=79,284,22 or cwes[]=79&cwes[]=284&cwes[]=22 + CWEs []string `url:"cwes,omitempty"` + + // Whether to only return advisories that have been withdrawn. + IsWithdrawn *bool `url:"is_withdrawn,omitempty"` + + // If specified, only return advisories that affect any of package or package@version. + // A maximum of 1000 packages can be specified. If the query parameter causes + // the URL to exceed the maximum URL length supported by your client, you must specify fewer packages. + // Example: affects=package1,package2@1.0.0,package3@^2.0.0 or affects[]=package1&affects[]=package2@1.0.0 + Affects *string `url:"affects,omitempty"` + + // If specified, only return advisories that were published on a date or date range. + Published *string `url:"published,omitempty"` + + // If specified, only return advisories that were updated on a date or date range. + Updated *string `url:"updated,omitempty"` + + // If specified, only show advisories that were updated or published on a date or date range. + Modified *string `url:"modified,omitempty"` +} + +// GlobalSecurityAdvisory represents the global security advisory object response. +type GlobalSecurityAdvisory struct { + SecurityAdvisory + ID *int64 `json:"id,omitempty"` + RepositoryAdvisoryURL *string `json:"repository_advisory_url,omitempty"` + Type *string `json:"type,omitempty"` + SourceCodeLocation *string `json:"source_code_location,omitempty"` + References []string `json:"references,omitempty"` + Vulnerabilities []*GlobalSecurityVulnerability `json:"vulnerabilities,omitempty"` + GithubReviewedAt *Timestamp `json:"github_reviewed_at,omitempty"` + NVDPublishedAt *Timestamp `json:"nvd_published_at,omitempty"` + Credits []*Credit `json:"credits,omitempty"` +} + +// GlobalSecurityVulnerability represents a vulnerability for a global security advisory. +type GlobalSecurityVulnerability struct { + Package *VulnerabilityPackage `json:"package,omitempty"` + FirstPatchedVersion *string `json:"first_patched_version,omitempty"` + VulnerableVersionRange *string `json:"vulnerable_version_range,omitempty"` + VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` +} + +// Credit represents the credit object for a global security advisory. +type Credit struct { + User *User `json:"user,omitempty"` + Type *string `json:"type,omitempty"` +} + // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // @@ -124,3 +199,50 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context return advisories, resp, nil } + +// ListGlobalSecurityAdvisories lists all global security advisories. +// +// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories +// +//meta:operation GET /advisories +func (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisories(ctx context.Context, opts *ListGlobalSecurityAdvisoriesOptions) ([]*GlobalSecurityAdvisory, *Response, error) { + url := "advisories" + url, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var advisories []*GlobalSecurityAdvisory + resp, err := s.client.Do(ctx, req, &advisories) + if err != nil { + return nil, resp, err + } + + return advisories, resp, nil +} + +// 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 +// +//meta:operation GET /advisories/{ghsa_id} +func (s *SecurityAdvisoriesService) GetGlobalSecurityAdvisories(ctx context.Context, ghsaID string) (*GlobalSecurityAdvisory, *Response, error) { + url := fmt.Sprintf("advisories/%s", ghsaID) + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + var advisory *GlobalSecurityAdvisory + resp, err := s.client.Do(ctx, req, &advisory) + if err != nil { + return nil, resp, err + } + + return advisory, resp, nil +} diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index 5476ef6138..918e3e0500 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -7,9 +7,11 @@ package github import ( "context" + "fmt" "net/http" "strings" "testing" + "time" "github.com/google/go-cmp/cmp" ) @@ -315,3 +317,379 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T return resp, err }) } + +func TestListGlobalSecurityAdvisories(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/advisories", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testFormValues(t, r, values{"cve_id": "CVE-xoxo-1234"}) + + fmt.Fprint(w, `[{ + "id": 1, + "ghsa_id": "GHSA-xoxo-1234-xoxo", + "cve_id": "CVE-xoxo-1234", + "url": "https://api.github.com/advisories/GHSA-xoxo-1234-xoxo", + "html_url": "https://github.com/advisories/GHSA-xoxo-1234-xoxo", + "repository_advisory_url": "https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo", + "summary": "Heartbleed security advisory", + "description": "This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.", + "type": "reviewed", + "severity": "high", + "source_code_location": "https://github.com/project/a-package", + "identifiers": [ + { + "type": "GHSA", + "value": "GHSA-xoxo-1234-xoxo" + }, + { + "type": "CVE", + "value": "CVE-xoxo-1234" + } + ], + "references": ["https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"], + "published_at": "1996-06-20T00:00:00Z", + "updated_at": "1996-06-20T00:00:00Z", + "github_reviewed_at": "1996-06-20T00:00:00Z", + "nvd_published_at": "1996-06-20T00:00:00Z", + "withdrawn_at": null, + "vulnerabilities": [ + { + "package": { + "ecosystem": "npm", + "name": "a-package" + }, + "first_patched_version": "1.0.3", + "vulnerable_version_range": "<=1.0.2", + "vulnerable_functions": ["a_function"] + } + ], + "cvss": { + "vector_string": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H", + "score": 7.6 + }, + "cwes": [ + { + "cwe_id": "CWE-400", + "name": "Uncontrolled Resource Consumption" + } + ], + "credits": [ + { + "user": { + "login": "user", + "id": 1, + "node_id": "12=", + "avatar_url": "a", + "gravatar_id": "", + "url": "a", + "html_url": "b", + "followers_url": "b", + "following_url": "c", + "gists_url": "d", + "starred_url": "e", + "subscriptions_url": "f", + "organizations_url": "g", + "repos_url": "h", + "events_url": "i", + "received_events_url": "j", + "type": "User", + "site_admin": false + }, + "type": "analyst" + } + ] + } + ]`) + }) + + ctx := context.Background() + opts := &ListGlobalSecurityAdvisoriesOptions{CVEID: String("CVE-xoxo-1234")} + + advisories, _, err := client.SecurityAdvisories.ListGlobalSecurityAdvisories(ctx, opts) + if err != nil { + t.Errorf("SecurityAdvisories.ListGlobalSecurityAdvisories returned error: %v", err) + } + + date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} + want := []*GlobalSecurityAdvisory{ + { + ID: Int64(1), + SecurityAdvisory: SecurityAdvisory{ + GHSAID: String("GHSA-xoxo-1234-xoxo"), + CVEID: String("CVE-xoxo-1234"), + URL: String("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), + HTMLURL: String("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), + Severity: String("high"), + Summary: String("Heartbleed security advisory"), + Description: String("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), + Identifiers: []*AdvisoryIdentifier{ + { + Type: String("GHSA"), + Value: String("GHSA-xoxo-1234-xoxo"), + }, + { + Type: String("CVE"), + Value: String("CVE-xoxo-1234"), + }, + }, + PublishedAt: &date, + UpdatedAt: &date, + WithdrawnAt: nil, + CVSS: &AdvisoryCVSS{ + VectorString: String("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), + Score: Float64(7.6), + }, + CWEs: []*AdvisoryCWEs{ + { + CWEID: String("CWE-400"), + Name: String("Uncontrolled Resource Consumption"), + }, + }, + }, + References: []string{"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"}, + Vulnerabilities: []*GlobalSecurityVulnerability{ + { + Package: &VulnerabilityPackage{ + Ecosystem: String("npm"), + Name: String("a-package"), + }, + FirstPatchedVersion: String("1.0.3"), + VulnerableVersionRange: String("<=1.0.2"), + VulnerableFunctions: []string{"a_function"}, + }, + }, + RepositoryAdvisoryURL: String("https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo"), + Type: String("reviewed"), + SourceCodeLocation: String("https://github.com/project/a-package"), + GithubReviewedAt: &date, + NVDPublishedAt: &date, + Credits: []*Credit{ + { + User: &User{ + Login: String("user"), + ID: Int64(1), + NodeID: String("12="), + AvatarURL: String("a"), + GravatarID: String(""), + URL: String("a"), + HTMLURL: String("b"), + FollowersURL: String("b"), + FollowingURL: String("c"), + GistsURL: String("d"), + StarredURL: String("e"), + SubscriptionsURL: String("f"), + OrganizationsURL: String("g"), + ReposURL: String("h"), + EventsURL: String("i"), + ReceivedEventsURL: String("j"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + Type: String("analyst"), + }, + }, + }, + } + + if !cmp.Equal(advisories, want) { + t.Errorf("SecurityAdvisories.ListGlobalSecurityAdvisories %+v, want %+v", advisories, want) + } + + const methodName = "ListGlobalSecurityAdvisories" + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + _, resp, err := client.SecurityAdvisories.ListGlobalSecurityAdvisories(ctx, nil) + return resp, err + }) +} + +func TestGetGlobalSecurityAdvisories(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/advisories/GHSA-xoxo-1234-xoxo", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + + fmt.Fprint(w, `{ + "id": 1, + "ghsa_id": "GHSA-xoxo-1234-xoxo", + "cve_id": "CVE-xoxo-1234", + "url": "https://api.github.com/advisories/GHSA-xoxo-1234-xoxo", + "html_url": "https://github.com/advisories/GHSA-xoxo-1234-xoxo", + "repository_advisory_url": "https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo", + "summary": "Heartbleed security advisory", + "description": "This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.", + "type": "reviewed", + "severity": "high", + "source_code_location": "https://github.com/project/a-package", + "identifiers": [ + { + "type": "GHSA", + "value": "GHSA-xoxo-1234-xoxo" + }, + { + "type": "CVE", + "value": "CVE-xoxo-1234" + } + ], + "references": ["https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"], + "published_at": "1996-06-20T00:00:00Z", + "updated_at": "1996-06-20T00:00:00Z", + "github_reviewed_at": "1996-06-20T00:00:00Z", + "nvd_published_at": "1996-06-20T00:00:00Z", + "withdrawn_at": null, + "vulnerabilities": [ + { + "package": { + "ecosystem": "npm", + "name": "a-package" + }, + "first_patched_version": "1.0.3", + "vulnerable_version_range": "<=1.0.2", + "vulnerable_functions": ["a_function"] + } + ], + "cvss": { + "vector_string": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H", + "score": 7.6 + }, + "cwes": [ + { + "cwe_id": "CWE-400", + "name": "Uncontrolled Resource Consumption" + } + ], + "credits": [ + { + "user": { + "login": "user", + "id": 1, + "node_id": "12=", + "avatar_url": "a", + "gravatar_id": "", + "url": "a", + "html_url": "b", + "followers_url": "b", + "following_url": "c", + "gists_url": "d", + "starred_url": "e", + "subscriptions_url": "f", + "organizations_url": "g", + "repos_url": "h", + "events_url": "i", + "received_events_url": "j", + "type": "User", + "site_admin": false + }, + "type": "analyst" + } + ] + }`) + }) + + ctx := context.Background() + advisory, _, err := client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, "GHSA-xoxo-1234-xoxo") + if err != nil { + t.Errorf("SecurityAdvisories.GetGlobalSecurityAdvisories returned error: %v", err) + } + + date := Timestamp{time.Date(1996, time.June, 20, 00, 00, 00, 0, time.UTC)} + want := &GlobalSecurityAdvisory{ + ID: Int64(1), + SecurityAdvisory: SecurityAdvisory{ + GHSAID: String("GHSA-xoxo-1234-xoxo"), + CVEID: String("CVE-xoxo-1234"), + URL: String("https://api.github.com/advisories/GHSA-xoxo-1234-xoxo"), + HTMLURL: String("https://github.com/advisories/GHSA-xoxo-1234-xoxo"), + Severity: String("high"), + Summary: String("Heartbleed security advisory"), + Description: String("This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information."), + Identifiers: []*AdvisoryIdentifier{ + { + Type: String("GHSA"), + Value: String("GHSA-xoxo-1234-xoxo"), + }, + { + Type: String("CVE"), + Value: String("CVE-xoxo-1234"), + }, + }, + PublishedAt: &date, + UpdatedAt: &date, + WithdrawnAt: nil, + CVSS: &AdvisoryCVSS{ + VectorString: String("CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"), + Score: Float64(7.6), + }, + CWEs: []*AdvisoryCWEs{ + { + CWEID: String("CWE-400"), + Name: String("Uncontrolled Resource Consumption"), + }, + }, + }, + RepositoryAdvisoryURL: String("https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo"), + Type: String("reviewed"), + SourceCodeLocation: String("https://github.com/project/a-package"), + References: []string{"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234"}, + GithubReviewedAt: &date, + NVDPublishedAt: &date, + + Vulnerabilities: []*GlobalSecurityVulnerability{ + { + Package: &VulnerabilityPackage{ + Ecosystem: String("npm"), + Name: String("a-package"), + }, + FirstPatchedVersion: String("1.0.3"), + VulnerableVersionRange: String("<=1.0.2"), + VulnerableFunctions: []string{"a_function"}, + }, + }, + Credits: []*Credit{ + { + User: &User{ + Login: String("user"), + ID: Int64(1), + NodeID: String("12="), + AvatarURL: String("a"), + GravatarID: String(""), + URL: String("a"), + HTMLURL: String("b"), + FollowersURL: String("b"), + FollowingURL: String("c"), + GistsURL: String("d"), + StarredURL: String("e"), + SubscriptionsURL: String("f"), + OrganizationsURL: String("g"), + ReposURL: String("h"), + EventsURL: String("i"), + ReceivedEventsURL: String("j"), + Type: String("User"), + SiteAdmin: Bool(false), + }, + Type: String("analyst"), + }, + }, + } + + if !cmp.Equal(advisory, want) { + t.Errorf("SecurityAdvisories.GetGlobalSecurityAdvisories %+v, want %+v", advisory, want) + } + + const methodName = "GetGlobalSecurityAdvisories" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, "CVE-\n-1234") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, "e") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From c7a9ad716490d9f94eacdfa537cdad547e8c54dc Mon Sep 17 00:00:00 2001 From: Casey Date: Thu, 30 Nov 2023 03:45:17 -0800 Subject: [PATCH 24/37] Change `PushEvent.Pusher` type to `CommitAuthor` (#2999) Fixes: #2998. --- github/event_types.go | 2 +- github/event_types_test.go | 24 +++++++++--------------- github/github-accessors.go | 2 +- github/github-stringify_test.go | 4 ++-- github/repos_hooks_test.go | 6 ++---- 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 327fc56166..badd29b2a0 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1282,7 +1282,7 @@ type PushEvent struct { Compare *string `json:"compare,omitempty"` Repo *PushEventRepository `json:"repository,omitempty"` HeadCommit *HeadCommit `json:"head_commit,omitempty"` - Pusher *User `json:"pusher,omitempty"` + Pusher *CommitAuthor `json:"pusher,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` diff --git a/github/event_types_test.go b/github/event_types_test.go index 91ac291205..80eca61d0f 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -3777,14 +3777,11 @@ func TestPushEvent_Marshal(t *testing.T) { Compare: String("a"), Repo: &PushEventRepository{ID: Int64(1)}, HeadCommit: &HeadCommit{ID: String("id")}, - Pusher: &User{ - Login: String("l"), - ID: Int64(1), - NodeID: String("n"), - URL: String("u"), - ReposURL: String("r"), - EventsURL: String("e"), - AvatarURL: String("a"), + Pusher: &CommitAuthor{ + Login: String("l"), + Date: &Timestamp{referenceTime}, + Name: String("n"), + Email: String("e"), }, Sender: &User{ Login: String("l"), @@ -3937,13 +3934,10 @@ func TestPushEvent_Marshal(t *testing.T) { "id": "id" }, "pusher": { - "login": "l", - "id": 1, - "node_id": "n", - "avatar_url": "a", - "url": "u", - "events_url": "e", - "repos_url": "r" + "date": ` + referenceTimeStr + `, + "name": "n", + "email": "e", + "username": "l" }, "sender": { "login": "l", diff --git a/github/github-accessors.go b/github/github-accessors.go index 0410744d70..cd2a8bd4a2 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17455,7 +17455,7 @@ func (p *PushEvent) GetOrganization() *Organization { } // GetPusher returns the Pusher field. -func (p *PushEvent) GetPusher() *User { +func (p *PushEvent) GetPusher() *CommitAuthor { if p == nil { return nil } diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index a9b719c516..7472edfd59 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1426,12 +1426,12 @@ func TestPushEvent_String(t *testing.T) { Compare: String(""), Repo: &PushEventRepository{}, HeadCommit: &HeadCommit{}, - Pusher: &User{}, + Pusher: &CommitAuthor{}, Sender: &User{}, Installation: &Installation{}, Organization: &Organization{}, } - want := `github.PushEvent{PushID:0, Head:"", Ref:"", Size:0, Before:"", DistinctSize:0, Action:"", After:"", Created:false, Deleted:false, Forced:false, BaseRef:"", Compare:"", Repo:github.PushEventRepository{}, HeadCommit:github.HeadCommit{}, Pusher:github.User{}, Sender:github.User{}, Installation:github.Installation{}, Organization:github.Organization{}}` + want := `github.PushEvent{PushID:0, Head:"", Ref:"", Size:0, Before:"", DistinctSize:0, Action:"", After:"", Created:false, Deleted:false, Forced:false, BaseRef:"", Compare:"", Repo:github.PushEventRepository{}, HeadCommit:github.HeadCommit{}, Pusher:github.CommitAuthor{}, Sender:github.User{}, Installation:github.Installation{}, Organization:github.Organization{}}` if got := v.String(); got != want { t.Errorf("PushEvent.String = %v, want %v", got, want) } diff --git a/github/repos_hooks_test.go b/github/repos_hooks_test.go index 84c9f5ee6f..fa44440ade 100644 --- a/github/repos_hooks_test.go +++ b/github/repos_hooks_test.go @@ -357,9 +357,8 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) { Organization: &Organization{ ID: Int64(22), }, - Pusher: &User{ + Pusher: &CommitAuthor{ Login: String("rd@yahoo.com"), - ID: Int64(112), }, Repo: &PushEventRepository{ ID: Int64(321), @@ -421,8 +420,7 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) { "id" : 22 }, "pusher":{ - "login": "rd@yahoo.com", - "id": 112 + "username": "rd@yahoo.com" }, "repository":{ "id": 321, From 56a8c9507fd83143d4f30b607b5725043b83f484 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:46:26 -0500 Subject: [PATCH 25/37] Bump version of go-github to v57.0.0 (#3009) --- README.md | 15 ++++++++------- example/actionpermissions/main.go | 2 +- example/appengine/app.go | 2 +- example/basicauth/main.go | 2 +- .../codespaces/newreposecretwithxcrypto/main.go | 2 +- .../codespaces/newusersecretwithxcrypto/main.go | 2 +- example/commitpr/main.go | 2 +- example/go.mod | 6 +++--- example/listenvironments/main.go | 2 +- example/migrations/main.go | 2 +- example/newfilewithappauth/main.go | 2 +- example/newrepo/main.go | 2 +- example/newreposecretwithlibsodium/go.mod | 4 ++-- example/newreposecretwithlibsodium/main.go | 2 +- example/newreposecretwithxcrypto/main.go | 2 +- example/ratelimit/main.go | 2 +- example/simple/main.go | 2 +- example/tagprotection/main.go | 2 +- example/tokenauth/main.go | 2 +- example/topics/main.go | 2 +- github/doc.go | 2 +- github/examples_test.go | 2 +- github/github.go | 2 +- go.mod | 2 +- test/fields/fields.go | 2 +- test/integration/activity_test.go | 2 +- test/integration/authorizations_test.go | 2 +- test/integration/github_test.go | 2 +- test/integration/repos_test.go | 2 +- test/integration/users_test.go | 2 +- tools/go.mod | 5 ++++- tools/go.sum | 2 -- tools/metadata/main.go | 2 +- tools/metadata/main_test.go | 2 +- tools/metadata/metadata.go | 2 +- tools/metadata/openapi.go | 2 +- 36 files changed, 48 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index daf57fe027..f10c43df8c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-github # [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v56/github) +[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v57/github) [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests) [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github) [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github) @@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is go-github is compatible with modern Go releases in module mode, with Go installed: ```bash -go get github.com/google/go-github/v56 +go get github.com/google/go-github/v57 ``` will resolve and add the package to the current development module, along with its dependencies. @@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i Alternatively the same can be achieved if you use import in a package: ```go -import "github.com/google/go-github/v56/github" +import "github.com/google/go-github/v57/github" ``` and run `go get` without parameters. @@ -40,13 +40,13 @@ and run `go get` without parameters. Finally, to use the top-of-trunk version of this repo, use the following command: ```bash -go get github.com/google/go-github/v56@master +go get github.com/google/go-github/v57@master ``` ## Usage ## ```go -import "github.com/google/go-github/v56/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) +import "github.com/google/go-github/v57/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled ``` @@ -117,7 +117,7 @@ import ( "net/http" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func main() { @@ -296,7 +296,7 @@ For complete usage of go-github, see the full [package docs][]. [GitHub API v3]: https://docs.github.com/en/rest [personal access token]: https://github.com/blog/1509-personal-api-tokens -[package docs]: https://pkg.go.dev/github.com/google/go-github/v56/github +[package docs]: https://pkg.go.dev/github.com/google/go-github/v57/github [GraphQL API v4]: https://developer.github.com/v4/ [shurcooL/githubv4]: https://github.com/shurcooL/githubv4 [GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads @@ -369,6 +369,7 @@ Versions prior to 48.2.0 are not listed. | go-github Version | GitHub v3 API Version | | ----------------- | --------------------- | +| 57.0.0 | 2022-11-28 | | 56.0.0 | 2022-11-28 | | 55.0.0 | 2022-11-28 | | 54.0.0 | 2022-11-28 | diff --git a/example/actionpermissions/main.go b/example/actionpermissions/main.go index 711906a122..a37c004320 100644 --- a/example/actionpermissions/main.go +++ b/example/actionpermissions/main.go @@ -14,7 +14,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/example/appengine/app.go b/example/appengine/app.go index fff9807f7f..496bca402b 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,7 +12,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "google.golang.org/appengine" "google.golang.org/appengine/log" ) diff --git a/example/basicauth/main.go b/example/basicauth/main.go index e9027efcbc..48f9170b5b 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/term" ) diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 68b67696cf..da1dabab76 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 9264aabad7..860c5161b7 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -37,7 +37,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 15919277f9..9e4098c916 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/example/go.mod b/example/go.mod index 6900dbaafa..a2bfe50f63 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v56/example +module github.com/google/go-github/v57/example go 1.17 @@ -6,7 +6,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 - github.com/google/go-github/v56 v56.0.0 + github.com/google/go-github/v57 v57.0.0 golang.org/x/crypto v0.14.0 golang.org/x/term v0.13.0 google.golang.org/appengine v1.6.7 @@ -24,4 +24,4 @@ require ( ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v56 => ../ +replace github.com/google/go-github/v57 => ../ diff --git a/example/listenvironments/main.go b/example/listenvironments/main.go index ec3e9878ff..936f5470cf 100644 --- a/example/listenvironments/main.go +++ b/example/listenvironments/main.go @@ -18,7 +18,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func main() { diff --git a/example/migrations/main.go b/example/migrations/main.go index 8304b75e96..81872e062f 100644 --- a/example/migrations/main.go +++ b/example/migrations/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func fetchAllUserMigrations() ([]*github.UserMigration, error) { diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 36f56fca5f..670021a99d 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func main() { diff --git a/example/newrepo/main.go b/example/newrepo/main.go index b2d0879c80..21cb7f52a9 100644 --- a/example/newrepo/main.go +++ b/example/newrepo/main.go @@ -16,7 +16,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 6f71c4f9ce..81a013ee37 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -4,8 +4,8 @@ go 1.15 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb - github.com/google/go-github/v56 v56.0.0 + github.com/google/go-github/v57 v57.0.0 ) // Use version at HEAD, not the latest published. -replace github.com/google/go-github/v56 => ../.. +replace github.com/google/go-github/v57 => ../.. diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index aa9ea38a83..c022562d35 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 686b12e7a3..b7366908e1 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -36,7 +36,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/crypto/nacl/box" ) diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 9c07cf301b..67a8b0de48 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/gofri/go-github-ratelimit/github_ratelimit" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func main() { diff --git a/example/simple/main.go b/example/simple/main.go index fcaddd6ae9..70206e7f00 100644 --- a/example/simple/main.go +++ b/example/simple/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) // Fetch all the public organizations' membership of a user. diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go index e0e494e7da..40a00af2b0 100644 --- a/example/tagprotection/main.go +++ b/example/tagprotection/main.go @@ -18,7 +18,7 @@ import ( "os" "strings" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/term" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 9d30ad7966..e27b72b1a0 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,7 +15,7 @@ import ( "log" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/term" ) diff --git a/example/topics/main.go b/example/topics/main.go index 80f5627672..a23f1b3a0d 100644 --- a/example/topics/main.go +++ b/example/topics/main.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) // Fetch and lists all the public topics associated with the specified GitHub topic diff --git a/github/doc.go b/github/doc.go index b10810d533..ca00a4bd04 100644 --- a/github/doc.go +++ b/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v56/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v57/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/github/examples_test.go b/github/examples_test.go index 9338e0b617..d1070be466 100644 --- a/github/examples_test.go +++ b/github/examples_test.go @@ -12,7 +12,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func ExampleMarkdownService_Render() { diff --git a/github/github.go b/github/github.go index 709808d9a9..a7a37b020a 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v56.0.0" + Version = "v57.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" diff --git a/go.mod b/go.mod index 718bedab9d..51c7c0e332 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/v56 +module github.com/google/go-github/v57 require ( github.com/google/go-cmp v0.6.0 diff --git a/test/fields/fields.go b/test/fields/fields.go index 3334569dd3..fc9f29672c 100644 --- a/test/fields/fields.go +++ b/test/fields/fields.go @@ -25,7 +25,7 @@ import ( "reflect" "strings" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go index 52c163c8a9..b32bb5a02f 100644 --- a/test/integration/activity_test.go +++ b/test/integration/activity_test.go @@ -12,7 +12,7 @@ import ( "context" "testing" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) const ( diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go index 66c7952a31..61ec0239fe 100644 --- a/test/integration/authorizations_test.go +++ b/test/integration/authorizations_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present." diff --git a/test/integration/github_test.go b/test/integration/github_test.go index 2d297f0ede..81753b6bbb 100644 --- a/test/integration/github_test.go +++ b/test/integration/github_test.go @@ -15,7 +15,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var ( diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 39a99fef98..a4ead78384 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func TestRepositories_CRUD(t *testing.T) { diff --git a/test/integration/users_test.go b/test/integration/users_test.go index d3a9abb0e8..448b5af7ff 100644 --- a/test/integration/users_test.go +++ b/test/integration/users_test.go @@ -14,7 +14,7 @@ import ( "math/rand" "testing" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func TestUsers_Get(t *testing.T) { diff --git a/tools/go.mod b/tools/go.mod index 40c58020a6..25cef1fd11 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kong v0.8.1 github.com/getkin/kin-openapi v0.120.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v56 v56.0.0 + github.com/google/go-github/v57 v57.0.0 golang.org/x/sync v0.5.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -22,3 +22,6 @@ require ( github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/stretchr/testify v1.8.4 // indirect ) + +// Use version at HEAD, not the latest published. +replace github.com/google/go-github/v57 => ../ diff --git a/tools/go.sum b/tools/go.sum index 7e8be0f06e..099ce0450d 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -17,8 +17,6 @@ github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= -github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 0b0562948f..1ab2b7d2d5 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -15,7 +15,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) var helpVars = kong.Vars{ diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 39fe5357d0..17de07d79a 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func TestUpdateGo(t *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index c60a1cfe21..079ff5c698 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,7 +24,7 @@ import ( "strings" "sync" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "gopkg.in/yaml.v3" ) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 4b858481f5..0804a47020 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" "golang.org/x/sync/errgroup" ) From 5390049d82d22d49ed3108c76ceeca03df73d2c8 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:55:17 -0500 Subject: [PATCH 26/37] Bump go-github from v56 to v57 in /scrape (#3010) --- scrape/apps.go | 2 +- scrape/apps_test.go | 2 +- scrape/go.mod | 2 +- scrape/go.sum | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scrape/apps.go b/scrape/apps.go index 851c4e1d2f..0f26fe8f2e 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -17,7 +17,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) // AppRestrictionsEnabled returns whether the specified organization has diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 155056876b..9b486e6a53 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v56/github" + "github.com/google/go-github/v57/github" ) func Test_AppRestrictionsEnabled(t *testing.T) { diff --git a/scrape/go.mod b/scrape/go.mod index 05f87b6b3a..08daf2365b 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v56 v56.0.0 + github.com/google/go-github/v57 v57.0.0 github.com/xlzd/gotp v0.1.0 golang.org/x/net v0.19.0 ) diff --git a/scrape/go.sum b/scrape/go.sum index 907678b1c1..4405185977 100644 --- a/scrape/go.sum +++ b/scrape/go.sum @@ -3,11 +3,10 @@ github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJs github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= -github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= +github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= +github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/xlzd/gotp v0.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= From 9f70f1f1a392ab5bd6cf0d7a931a3d94cd251961 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Sat, 2 Dec 2023 15:47:01 -0600 Subject: [PATCH 27/37] Update metadata (#3012) --- github/copilot.go | 14 +++---- openapi_operations.yaml | 91 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 90 insertions(+), 15 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 423b3ba440..3f3d73b25b 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -132,7 +132,7 @@ func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { // GetCopilotBilling gets Copilot for Business billing information and settings for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-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) { @@ -156,7 +156,7 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co // // To paginate through all seats, populate 'Page' with the number of the last page. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#list-all-copilot-business-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) { @@ -178,7 +178,7 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#add-teams-to-the-copilot-business-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) { @@ -206,7 +206,7 @@ func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNa // RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#remove-teams-from-the-copilot-business-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) { @@ -234,7 +234,7 @@ func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, tea // AddCopilotUsers adds users to the Copilot for Business subscription for an organization // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#add-users-to-the-copilot-business-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) { @@ -262,7 +262,7 @@ func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users // RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#remove-users-from-the-copilot-business-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) { @@ -290,7 +290,7 @@ func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, use // GetSeatDetails gets Copilot for Business seat assignment details for a user. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-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) { diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 25dde27337..53fe8c5fe5 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -48,7 +48,7 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: b164298e5a5db36254a3029219f443f253d79147 +openapi_commit: 6922a6cfe785e1069e93d6e501805cf6e1891076 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root @@ -1518,32 +1518,32 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/copilot/billing - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-information-and-settings-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/copilot/billing/seats - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#list-all-copilot-business-seat-assignments-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/copilot/billing/selected_teams - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#remove-teams-from-the-copilot-business-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: POST /orgs/{org}/copilot/billing/selected_teams - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#add-teams-to-the-copilot-business-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: DELETE /orgs/{org}/copilot/billing/selected_users - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#remove-users-from-the-copilot-business-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: POST /orgs/{org}/copilot/billing/selected_users - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization + documentation_url: https://docs.github.com/rest/copilot/copilot-business#add-users-to-the-copilot-business-subscription-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -1840,7 +1840,7 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - name: GET /orgs/{org}/members/{username}/copilot - documentation_url: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user + documentation_url: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-assignment-details-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json @@ -1904,6 +1904,76 @@ openapi_operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.11/ghes-3.11.json + - name: GET /orgs/{org}/organization-fine-grained-permissions + documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/organization-roles + documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /orgs/{org}/organization-roles + documentation_url: https://docs.github.com/rest/orgs/organization-roles#create-a-custom-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/users/{username} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PUT /orgs/{org}/organization-roles/users/{username}/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: DELETE /orgs/{org}/organization-roles/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/organization-roles/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: PATCH /orgs/{org}/organization-roles/{role_id} + documentation_url: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/organization-roles/{role_id}/teams + documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/organization-roles/{role_id}/users + documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /orgs/{org}/outside_collaborators documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization openapi_files: @@ -4933,6 +5003,11 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/stargazers documentation_url: https://docs.github.com/rest/activity/starring#list-stargazers openapi_files: From 5e63691feec7aa1d7fda6627f7d3b42d385a03ab Mon Sep 17 00:00:00 2001 From: Peter Aglen <86360391+peter-aglen@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:36:23 +0100 Subject: [PATCH 28/37] Fix broken CreateOrUpdateRepoCustomPropertyValues (#3023) Fixes: #3021. --- github/orgs_properties.go | 6 +++--- github/orgs_properties_test.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/github/orgs_properties.go b/github/orgs_properties.go index 45e3f1f964..2e88b7f4f9 100644 --- a/github/orgs_properties.go +++ b/github/orgs_properties.go @@ -178,12 +178,12 @@ func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org // GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#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 []*CustomProperty) (*Response, error) { +func (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomPropertyValue) (*Response, error) { u := fmt.Sprintf("orgs/%v/properties/values", org) params := struct { - RepositoryNames []string `json:"repository_names"` - Properties []*CustomProperty `json:"properties"` + RepositoryNames []string `json:"repository_names"` + Properties []*CustomPropertyValue `json:"properties"` }{ RepositoryNames: repoNames, Properties: properties, diff --git a/github/orgs_properties_test.go b/github/orgs_properties_test.go index 1a37230604..86daedb3a5 100644 --- a/github/orgs_properties_test.go +++ b/github/orgs_properties_test.go @@ -347,14 +347,14 @@ func TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing. mux.HandleFunc("/orgs/o/properties/values", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") - testBody(t, r, `{"repository_names":["repo"],"properties":[{"property_name":"service","value_type":"string"}]}`+"\n") + testBody(t, r, `{"repository_names":["repo"],"properties":[{"property_name":"service","value":"string"}]}`+"\n") }) ctx := context.Background() - _, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomProperty{ + _, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, "o", []string{"repo"}, []*CustomPropertyValue{ { - PropertyName: String("service"), - ValueType: "string", + PropertyName: "service", + Value: String("string"), }, }) if err != nil { From cec367c016fbb138b46b457fb97e0ad788f08737 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:28:57 -0500 Subject: [PATCH 29/37] Bump actions/setup-go from 4 to 5 (#3027) --- .github/workflows/linter.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f9d6d7e463..24f3d909db 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.x cache-dependency-path: "**/go.sum" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3abd8b6f9..3067b1b0be 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - uses: actions/checkout@v4 From 1080dff58ba136967e09c16ece920ad8f8789cce Mon Sep 17 00:00:00 2001 From: Tomasz Adam Skrzypczak Date: Thu, 14 Dec 2023 09:14:41 -0500 Subject: [PATCH 30/37] Add scanning validity checks (#3026) Fixes: #3006. --- .../enterprise_code_security_and_analysis.go | 1 + ...erprise_code_security_and_analysis_test.go | 5 ++- github/github-accessors.go | 32 ++++++++++++++++ github/github-accessors_test.go | 37 +++++++++++++++++++ github/github-stringify_test.go | 20 +++++----- github/orgs.go | 2 + github/repos.go | 8 ++++ github/repos_test.go | 4 +- 8 files changed, 97 insertions(+), 12 deletions(-) diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go index af8eb0ffb2..159aeae4dc 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -16,6 +16,7 @@ type EnterpriseSecurityAnalysisSettings struct { SecretScanningEnabledForNewRepositories *bool `json:"secret_scanning_enabled_for_new_repositories,omitempty"` SecretScanningPushProtectionEnabledForNewRepositories *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` SecretScanningPushProtectionCustomLink *string `json:"secret_scanning_push_protection_custom_link,omitempty"` + SecretScanningValidityChecksEnabled *bool `json:"secret_scanning_validity_checks_enabled,omitempty"` } // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go index 25dbd94170..17bbe18bea 100644 --- a/github/enterprise_code_security_and_analysis_test.go +++ b/github/enterprise_code_security_and_analysis_test.go @@ -27,7 +27,8 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { "advanced_security_enabled_for_new_repositories": true, "secret_scanning_enabled_for_new_repositories": true, "secret_scanning_push_protection_enabled_for_new_repositories": true, - "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md", + "secret_scanning_validity_checks_enabled": true }`) }) @@ -44,6 +45,7 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { SecretScanningEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), + SecretScanningValidityChecksEnabled: Bool(true), } if !cmp.Equal(settings, want) { @@ -73,6 +75,7 @@ func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { SecretScanningEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), + SecretScanningValidityChecksEnabled: Bool(true), } mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/github-accessors.go b/github/github-accessors.go index cd2a8bd4a2..3fbb799c34 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -7030,6 +7030,14 @@ func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionEnab return *e.SecretScanningPushProtectionEnabledForNewRepositories } +// GetSecretScanningValidityChecksEnabled returns the SecretScanningValidityChecksEnabled field if it's non-nil, zero value otherwise. +func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningValidityChecksEnabled() bool { + if e == nil || e.SecretScanningValidityChecksEnabled == nil { + return false + } + return *e.SecretScanningValidityChecksEnabled +} + // GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. func (e *Environment) GetCanAdminsBypass() bool { if e == nil || e.CanAdminsBypass == nil { @@ -12790,6 +12798,14 @@ func (o *Organization) GetSecretScanningPushProtectionEnabledForNewRepos() bool return *o.SecretScanningPushProtectionEnabledForNewRepos } +// GetSecretScanningValidityChecksEnabled returns the SecretScanningValidityChecksEnabled field if it's non-nil, zero value otherwise. +func (o *Organization) GetSecretScanningValidityChecksEnabled() bool { + if o == nil || o.SecretScanningValidityChecksEnabled == nil { + return false + } + return *o.SecretScanningValidityChecksEnabled +} + // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetTotalPrivateRepos() int64 { if o == nil || o.TotalPrivateRepos == nil { @@ -21646,6 +21662,14 @@ func (s *SecretScanningPushProtection) GetStatus() string { return *s.Status } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SecretScanningValidityChecks) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + // GetAuthor returns the Author field. func (s *SecurityAdvisory) GetAuthor() *User { if s == nil { @@ -21886,6 +21910,14 @@ func (s *SecurityAndAnalysis) GetSecretScanningPushProtection() *SecretScanningP return s.SecretScanningPushProtection } +// GetSecretScanningValidityChecks returns the SecretScanningValidityChecks field. +func (s *SecurityAndAnalysis) GetSecretScanningValidityChecks() *SecretScanningValidityChecks { + if s == nil { + return nil + } + return s.SecretScanningValidityChecks +} + // GetFrom returns the From field. func (s *SecurityAndAnalysisChange) GetFrom() *SecurityAndAnalysisChangeFrom { if s == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3522519fe4..43585d92bf 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8239,6 +8239,16 @@ func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionEnabl e.GetSecretScanningPushProtectionEnabledForNewRepositories() } +func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningValidityChecksEnabled(tt *testing.T) { + var zeroValue bool + e := &EnterpriseSecurityAnalysisSettings{SecretScanningValidityChecksEnabled: &zeroValue} + e.GetSecretScanningValidityChecksEnabled() + e = &EnterpriseSecurityAnalysisSettings{} + e.GetSecretScanningValidityChecksEnabled() + e = nil + e.GetSecretScanningValidityChecksEnabled() +} + func TestEnvironment_GetCanAdminsBypass(tt *testing.T) { var zeroValue bool e := &Environment{CanAdminsBypass: &zeroValue} @@ -14992,6 +15002,16 @@ func TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *test o.GetSecretScanningPushProtectionEnabledForNewRepos() } +func TestOrganization_GetSecretScanningValidityChecksEnabled(tt *testing.T) { + var zeroValue bool + o := &Organization{SecretScanningValidityChecksEnabled: &zeroValue} + o.GetSecretScanningValidityChecksEnabled() + o = &Organization{} + o.GetSecretScanningValidityChecksEnabled() + o = nil + o.GetSecretScanningValidityChecksEnabled() +} + func TestOrganization_GetTotalPrivateRepos(tt *testing.T) { var zeroValue int64 o := &Organization{TotalPrivateRepos: &zeroValue} @@ -25213,6 +25233,16 @@ func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { s.GetStatus() } +func TestSecretScanningValidityChecks_GetStatus(tt *testing.T) { + var zeroValue string + s := &SecretScanningValidityChecks{Status: &zeroValue} + s.GetStatus() + s = &SecretScanningValidityChecks{} + s.GetStatus() + s = nil + s.GetStatus() +} + func TestSecurityAdvisory_GetAuthor(tt *testing.T) { s := &SecurityAdvisory{} s.GetAuthor() @@ -25468,6 +25498,13 @@ func TestSecurityAndAnalysis_GetSecretScanningPushProtection(tt *testing.T) { s.GetSecretScanningPushProtection() } +func TestSecurityAndAnalysis_GetSecretScanningValidityChecks(tt *testing.T) { + s := &SecurityAndAnalysis{} + s.GetSecretScanningValidityChecks() + s = nil + s.GetSecretScanningValidityChecks() +} + func TestSecurityAndAnalysisChange_GetFrom(tt *testing.T) { s := &SecurityAndAnalysisChange{} s.GetFrom() diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 7472edfd59..bb69ce1ad5 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1051,15 +1051,16 @@ func TestOrganization_String(t *testing.T) { DependencyGraphEnabledForNewRepos: Bool(false), SecretScanningEnabledForNewRepos: Bool(false), SecretScanningPushProtectionEnabledForNewRepos: Bool(false), - URL: String(""), - EventsURL: String(""), - HooksURL: String(""), - IssuesURL: String(""), - MembersURL: String(""), - PublicMembersURL: String(""), - ReposURL: String(""), + SecretScanningValidityChecksEnabled: Bool(false), + URL: String(""), + EventsURL: String(""), + HooksURL: String(""), + IssuesURL: String(""), + MembersURL: String(""), + PublicMembersURL: String(""), + ReposURL: String(""), } - want := `github.Organization{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", Name:"", Company:"", Blog:"", Location:"", Email:"", TwitterUsername:"", Description:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, BillingEmail:"", Type:"", Plan:github.Plan{}, TwoFactorRequirementEnabled:false, IsVerified:false, HasOrganizationProjects:false, HasRepositoryProjects:false, DefaultRepoPermission:"", DefaultRepoSettings:"", MembersCanCreateRepos:false, MembersCanCreatePublicRepos:false, MembersCanCreatePrivateRepos:false, MembersCanCreateInternalRepos:false, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` + want := `github.Organization{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", Name:"", Company:"", Blog:"", Location:"", Email:"", TwitterUsername:"", Description:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, BillingEmail:"", Type:"", Plan:github.Plan{}, TwoFactorRequirementEnabled:false, IsVerified:false, HasOrganizationProjects:false, HasRepositoryProjects:false, DefaultRepoPermission:"", DefaultRepoSettings:"", MembersCanCreateRepos:false, MembersCanCreatePublicRepos:false, MembersCanCreatePrivateRepos:false, MembersCanCreateInternalRepos:false, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, SecretScanningValidityChecksEnabled:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` if got := v.String(); got != want { t.Errorf("Organization.String = %v, want %v", got, want) } @@ -1826,8 +1827,9 @@ func TestSecurityAndAnalysis_String(t *testing.T) { SecretScanning: &SecretScanning{}, SecretScanningPushProtection: &SecretScanningPushProtection{}, DependabotSecurityUpdates: &DependabotSecurityUpdates{}, + SecretScanningValidityChecks: &SecretScanningValidityChecks{}, } - want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}, DependabotSecurityUpdates:github.DependabotSecurityUpdates{}}` + want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}, DependabotSecurityUpdates:github.DependabotSecurityUpdates{}, SecretScanningValidityChecks:github.SecretScanningValidityChecks{}}` if got := v.String(); got != want { t.Errorf("SecurityAndAnalysis.String = %v, want %v", got, want) } diff --git a/github/orgs.go b/github/orgs.go index 4d3465271b..27c0f10284 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -95,6 +95,8 @@ type Organization struct { SecretScanningEnabledForNewRepos *bool `json:"secret_scanning_enabled_for_new_repositories,omitempty"` // SecretScanningPushProtectionEnabledForNewRepos toggles whether secret scanning push protection is enabled on new repositories. 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"` // API URLs URL *string `json:"url,omitempty"` diff --git a/github/repos.go b/github/repos.go index 5fcf219b3c..a7574d72f0 100644 --- a/github/repos.go +++ b/github/repos.go @@ -198,6 +198,7 @@ type SecurityAndAnalysis struct { SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` DependabotSecurityUpdates *DependabotSecurityUpdates `json:"dependabot_security_updates,omitempty"` + SecretScanningValidityChecks *SecretScanningValidityChecks `json:"secret_scanning_validity_checks,omitempty"` } func (s SecurityAndAnalysis) String() string { @@ -248,6 +249,13 @@ func (d DependabotSecurityUpdates) String() string { return Stringify(d) } +// SecretScanningValidityChecks represents the state of secret scanning validity checks on a repository. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#allowing-validity-checks-for-partner-patterns-in-a-repository +type SecretScanningValidityChecks struct { + Status *string `json:"status,omitempty"` +} + // List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser // depending on whether user is empty. // diff --git a/github/repos_test.go b/github/repos_test.go index fa49ddd4f5..2e61aeb1b1 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -360,7 +360,7 @@ func TestRepositoriesService_Get(t *testing.T) { mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) - fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"},"dependabot_security_updates":{"status": "enabled"}}}`) + fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"},"dependabot_security_updates":{"status": "enabled"}, "secret_scanning_validity_checks":{"status":"enabled"}}}`) }) ctx := context.Background() @@ -369,7 +369,7 @@ func TestRepositoriesService_Get(t *testing.T) { t.Errorf("Repositories.Get returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{String("enabled")}}} + want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{String("enabled")}, SecretScanningValidityChecks: &SecretScanningValidityChecks{String("enabled")}}} if !cmp.Equal(got, want) { t.Errorf("Repositories.Get returned %+v, want %+v", got, want) } From 27decbb47e684c5952d0131f41a39e7103252d59 Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Fri, 15 Dec 2023 18:55:20 +0100 Subject: [PATCH 31/37] Add Referrer field to AuditEntry (#3032) Fixes: #3031. --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/orgs_audit_log.go | 1 + 3 files changed, 19 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 3fbb799c34..6b34ed145d 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1454,6 +1454,14 @@ func (a *AuditEntry) GetReadOnly() string { return *a.ReadOnly } +// GetReferrer returns the Referrer field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetReferrer() string { + if a == nil || a.Referrer == nil { + return "" + } + return *a.Referrer +} + // GetRepo returns the Repo field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetRepo() string { if a == nil || a.Repo == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 43585d92bf..0b3d64f395 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1731,6 +1731,16 @@ func TestAuditEntry_GetReadOnly(tt *testing.T) { a.GetReadOnly() } +func TestAuditEntry_GetReferrer(tt *testing.T) { + var zeroValue string + a := &AuditEntry{Referrer: &zeroValue} + a.GetReferrer() + a = &AuditEntry{} + a.GetReferrer() + a = nil + a.GetReferrer() +} + func TestAuditEntry_GetRepo(tt *testing.T) { var zeroValue string a := &AuditEntry{Repo: &zeroValue} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index e3afd3117f..aa3591359e 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -95,6 +95,7 @@ type AuditEntry struct { PullRequestURL *string `json:"pull_request_url,omitempty"` ReadOnly *string `json:"read_only,omitempty"` Reasons []*PolicyOverrideReason `json:"reasons,omitempty"` + Referrer *string `json:"referrer,omitempty"` Repo *string `json:"repo,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryPublic *bool `json:"repository_public,omitempty"` From f5b837bb7352b19925bcfc1eff18b91c4a844f05 Mon Sep 17 00:00:00 2001 From: Rufina Talalaeva Date: Fri, 15 Dec 2023 22:20:07 +0300 Subject: [PATCH 32/37] Add code_search and dependency_snapshots for RateLimits (#3019) Fixes: #3018. --- github/github-accessors.go | 16 ++++++++ github/github-accessors_test.go | 14 +++++++ github/github.go | 14 +++++++ github/github_test.go | 10 +++++ github/rate_limit.go | 8 ++++ github/rate_limit_test.go | 68 +++++++++++++++++++++++++++++++-- 6 files changed, 127 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 6b34ed145d..368a96267f 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -17846,6 +17846,14 @@ func (r *RateLimits) GetCodeScanningUpload() *Rate { return r.CodeScanningUpload } +// GetCodeSearch returns the CodeSearch field. +func (r *RateLimits) GetCodeSearch() *Rate { + if r == nil { + return nil + } + return r.CodeSearch +} + // GetCore returns the Core field. func (r *RateLimits) GetCore() *Rate { if r == nil { @@ -17854,6 +17862,14 @@ func (r *RateLimits) GetCore() *Rate { return r.Core } +// GetDependencySnapshots returns the DependencySnapshots field. +func (r *RateLimits) GetDependencySnapshots() *Rate { + if r == nil { + return nil + } + return r.DependencySnapshots +} + // GetGraphQL returns the GraphQL field. func (r *RateLimits) GetGraphQL() *Rate { if r == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 0b3d64f395..057f07b044 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -20700,6 +20700,13 @@ func TestRateLimits_GetCodeScanningUpload(tt *testing.T) { r.GetCodeScanningUpload() } +func TestRateLimits_GetCodeSearch(tt *testing.T) { + r := &RateLimits{} + r.GetCodeSearch() + r = nil + r.GetCodeSearch() +} + func TestRateLimits_GetCore(tt *testing.T) { r := &RateLimits{} r.GetCore() @@ -20707,6 +20714,13 @@ func TestRateLimits_GetCore(tt *testing.T) { r.GetCore() } +func TestRateLimits_GetDependencySnapshots(tt *testing.T) { + r := &RateLimits{} + r.GetDependencySnapshots() + r = nil + r.GetDependencySnapshots() +} + func TestRateLimits_GetGraphQL(tt *testing.T) { r := &RateLimits{} r.GetGraphQL() diff --git a/github/github.go b/github/github.go index a7a37b020a..712bcc0cd1 100644 --- a/github/github.go +++ b/github/github.go @@ -1305,6 +1305,8 @@ const ( codeScanningUploadCategory actionsRunnerRegistrationCategory scimCategory + dependencySnapshotsCategory + codeSearchCategory categories // An array of this length will be able to contain all rate limit categories. ) @@ -1317,6 +1319,12 @@ func category(method, path string) rateLimitCategory { // 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 + case strings.HasPrefix(path, "/search/code") && + method == http.MethodGet: + return codeSearchCategory + case strings.HasPrefix(path, "/search/"): return searchCategory case path == "/graphql": @@ -1339,6 +1347,12 @@ func category(method, path string) rateLimitCategory { // https://docs.github.com/enterprise-cloud@latest/rest/scim 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 + case strings.HasPrefix(path, "/repos/") && + strings.HasSuffix(path, "/dependency-graph/snapshots") && + method == http.MethodPost: + return dependencySnapshotsCategory } } diff --git a/github/github_test.go b/github/github_test.go index b994496cc0..933d29e774 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1153,6 +1153,16 @@ func TestDo_rateLimitCategory(t *testing.T) { url: "/scim/v2/organizations/ORG/Users", category: scimCategory, }, + { + method: http.MethodPost, + url: "/repos/google/go-github/dependency-graph/snapshots", + category: dependencySnapshotsCategory, + }, + { + method: http.MethodGet, + url: "/search/code?q=rate", + category: codeSearchCategory, + }, // missing a check for actionsRunnerRegistrationCategory: API not found } diff --git a/github/rate_limit.go b/github/rate_limit.go index 0fc15f815e..febe5edccf 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -52,6 +52,8 @@ type RateLimits struct { CodeScanningUpload *Rate `json:"code_scanning_upload"` ActionsRunnerRegistration *Rate `json:"actions_runner_registration"` SCIM *Rate `json:"scim"` + DependencySnapshots *Rate `json:"dependency_snapshots"` + CodeSearch *Rate `json:"code_search"` } func (r RateLimits) String() string { @@ -106,6 +108,12 @@ func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, err if response.Resources.SCIM != nil { s.client.rateLimits[scimCategory] = *response.Resources.SCIM } + if response.Resources.DependencySnapshots != nil { + s.client.rateLimits[dependencySnapshotsCategory] = *response.Resources.DependencySnapshots + } + if response.Resources.CodeSearch != nil { + s.client.rateLimits[codeSearchCategory] = *response.Resources.CodeSearch + } s.client.rateMu.Unlock() } diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go index 167288bc88..da8a68c910 100644 --- a/github/rate_limit_test.go +++ b/github/rate_limit_test.go @@ -25,8 +25,10 @@ func TestRateLimits_String(t *testing.T) { CodeScanningUpload: &Rate{}, ActionsRunnerRegistration: &Rate{}, SCIM: &Rate{}, + DependencySnapshots: &Rate{}, + CodeSearch: &Rate{}, } - want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` + want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeSearch:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}` if got := v.String(); got != want { t.Errorf("RateLimits.String = %v, want %v", got, want) } @@ -46,7 +48,9 @@ func TestRateLimits(t *testing.T) { "source_import": {"limit":6,"remaining":5,"reset":1372700877}, "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, - "scim": {"limit":9,"remaining":8,"reset":1372700880} + "scim": {"limit":9,"remaining":8,"reset":1372700880}, + "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881}, + "code_search": {"limit":11,"remaining":10,"reset":1372700882} }}`) }) @@ -97,6 +101,16 @@ func TestRateLimits(t *testing.T) { Remaining: 8, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, }, + DependencySnapshots: &Rate{ + Limit: 10, + Remaining: 9, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()}, + }, + CodeSearch: &Rate{ + Limit: 11, + Remaining: 10, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()}, + }, } if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) @@ -137,6 +151,14 @@ func TestRateLimits(t *testing.T) { category: scimCategory, rate: want.SCIM, }, + { + category: dependencySnapshotsCategory, + rate: want.DependencySnapshots, + }, + { + category: codeSearchCategory, + rate: want.CodeSearch, + }, } for _, tt := range tests { @@ -177,7 +199,9 @@ func TestRateLimits_overQuota(t *testing.T) { "source_import": {"limit":6,"remaining":5,"reset":1372700877}, "code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878}, "actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879}, - "scim": {"limit":9,"remaining":8,"reset":1372700880} + "scim": {"limit":9,"remaining":8,"reset":1372700880}, + "dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881}, + "code_search": {"limit":11,"remaining":10,"reset":1372700882} }}`) }) @@ -228,6 +252,16 @@ func TestRateLimits_overQuota(t *testing.T) { Remaining: 8, Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()}, }, + DependencySnapshots: &Rate{ + Limit: 10, + Remaining: 9, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()}, + }, + CodeSearch: &Rate{ + Limit: 11, + Remaining: 10, + Reset: Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()}, + }, } if !cmp.Equal(rate, want) { t.Errorf("RateLimits returned %+v, want %+v", rate, want) @@ -269,6 +303,14 @@ func TestRateLimits_overQuota(t *testing.T) { category: scimCategory, rate: want.SCIM, }, + { + category: dependencySnapshotsCategory, + rate: want.DependencySnapshots, + }, + { + category: codeSearchCategory, + rate: want.CodeSearch, + }, } for _, tt := range tests { if got, want := client.rateLimits[tt.category], *tt.rate; got != want { @@ -321,6 +363,16 @@ func TestRateLimits_Marshal(t *testing.T) { Remaining: 1, Reset: Timestamp{referenceTime}, }, + DependencySnapshots: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, + CodeSearch: &Rate{ + Limit: 1, + Remaining: 1, + Reset: Timestamp{referenceTime}, + }, } want := `{ @@ -363,6 +415,16 @@ func TestRateLimits_Marshal(t *testing.T) { "limit": 1, "remaining": 1, "reset": ` + referenceTimeStr + ` + }, + "dependency_snapshots": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` + }, + "code_search": { + "limit": 1, + "remaining": 1, + "reset": ` + referenceTimeStr + ` } }` From f53e74d7e761ca1b2c97b8dd64a09250fce1c6fa Mon Sep 17 00:00:00 2001 From: Kiyofumi Sano <62272140+Kiyo510@users.noreply.github.com> Date: Sat, 16 Dec 2023 07:22:57 +0900 Subject: [PATCH 33/37] Support temporary private fork creation via API (#3025) Fixes: #3007. --- github/security_advisories.go | 31 ++ github/security_advisories_test.go | 474 ++++++++++++++++++++++++++++- 2 files changed, 501 insertions(+), 4 deletions(-) diff --git a/github/security_advisories.go b/github/security_advisories.go index 635263748d..b5a43f1aac 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" ) @@ -148,6 +149,36 @@ func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, return resp, nil } +// 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 +// +//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) + if err != nil { + return nil, nil, err + } + + fork := new(Repository) + resp, err := s.client.Do(ctx, req, fork) + if err != nil { + if aerr, ok := err.(*AcceptedError); ok { + if err := json.Unmarshal(aerr.Raw, fork); err != nil { + return fork, resp, err + } + + return fork, resp, err + } + return nil, resp, err + } + + 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 diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go index 918e3e0500..eb8e7d317d 100644 --- a/github/security_advisories_test.go +++ b/github/security_advisories_test.go @@ -56,6 +56,472 @@ func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) { }) } +func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + fmt.Fprint(w, `{ + "id": 1, + "node_id": "R_kgDPP3c6pQ", + "owner": { + "login": "owner", + "id": 2, + "node_id": "MDQ6VXFGcjYyMjcyMTQw", + "avatar_url": "https://avatars.githubusercontent.com/u/111111?v=4", + "html_url": "https://github.com/xxxxx", + "gravatar_id": "", + "type": "User", + "site_admin": false, + "url": "https://api.github.com/users/owner", + "events_url": "https://api.github.com/users/owner/events{/privacy}", + "following_url": "https://api.github.com/users/owner/following{/other_user}", + "followers_url": "https://api.github.com/users/owner/followers", + "gists_url": "https://api.github.com/users/owner/gists{/gist_id}", + "organizations_url": "https://api.github.com/users/owner/orgs", + "received_events_url": "https://api.github.com/users/owner/received_events", + "repos_url": "https://api.github.com/users/owner/repos", + "starred_url": "https://api.github.com/users/owner/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/owner/subscriptions" + }, + "name": "repo-ghsa-xxxx-xxxx-xxxx", + "full_name": "owner/repo-ghsa-xxxx-xxxx-xxxx", + "default_branch": "master", + "created_at": "2023-12-08T17:22:41Z", + "pushed_at": "2023-12-03T11:27:08Z", + "updated_at": "2023-12-08T17:22:42Z", + "html_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx", + "clone_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "git_url": "git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "ssh_url": "git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "svn_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx", + "fork": false, + "forks_count": 0, + "network_count": 0, + "open_issues_count": 0, + "open_issues": 0, + "stargazers_count": 0, + "subscribers_count": 0, + "watchers_count": 0, + "watchers": 0, + "size": 0, + "permissions": { + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true + }, + "allow_forking": true, + "web_commit_signoff_required": false, + "archived": false, + "disabled": false, + "private": true, + "has_issues": false, + "has_wiki": false, + "has_pages": false, + "has_projects": false, + "has_downloads": false, + "has_discussions": false, + "is_template": false, + "url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx", + "archive_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}", + "assignees_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}", + "blobs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}", + "collaborators_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}", + "commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}", + "compare_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}", + "contributors_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors", + "deployments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments", + "downloads_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads", + "events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events", + "forks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks", + "git_commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}", + "hooks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks", + "issue_comment_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}", + "issues_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}", + "keys_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}", + "labels_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}", + "languages_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages", + "merges_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges", + "milestones_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}", + "notifications_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}", + "pulls_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}", + "releases_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}", + "stargazers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers", + "statuses_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers", + "subscription_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription", + "tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags", + "teams_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams", + "visibility": "private" + }`) + }) + + ctx := context.Background() + fork, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id") + if err != nil { + t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned error: %v", err) + } + + want := &Repository{ + ID: Int64(1), + NodeID: String("R_kgDPP3c6pQ"), + Owner: &User{ + Login: String("owner"), + ID: Int64(2), + NodeID: String("MDQ6VXFGcjYyMjcyMTQw"), + AvatarURL: String("https://avatars.githubusercontent.com/u/111111?v=4"), + HTMLURL: String("https://github.com/xxxxx"), + GravatarID: String(""), + Type: String("User"), + SiteAdmin: Bool(false), + URL: String("https://api.github.com/users/owner"), + EventsURL: String("https://api.github.com/users/owner/events{/privacy}"), + FollowingURL: String("https://api.github.com/users/owner/following{/other_user}"), + FollowersURL: String("https://api.github.com/users/owner/followers"), + GistsURL: String("https://api.github.com/users/owner/gists{/gist_id}"), + OrganizationsURL: String("https://api.github.com/users/owner/orgs"), + ReceivedEventsURL: String("https://api.github.com/users/owner/received_events"), + ReposURL: String("https://api.github.com/users/owner/repos"), + StarredURL: String("https://api.github.com/users/owner/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/owner/subscriptions"), + }, + Name: String("repo-ghsa-xxxx-xxxx-xxxx"), + FullName: String("owner/repo-ghsa-xxxx-xxxx-xxxx"), + DefaultBranch: String("master"), + CreatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)}, + PushedAt: &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)}, + HTMLURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + CloneURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + GitURL: String("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SSHURL: String("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SVNURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + Fork: Bool(false), + ForksCount: Int(0), + NetworkCount: Int(0), + OpenIssuesCount: Int(0), + OpenIssues: Int(0), + StargazersCount: Int(0), + SubscribersCount: Int(0), + WatchersCount: Int(0), + Watchers: Int(0), + Size: Int(0), + Permissions: map[string]bool{ + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true, + }, + AllowForking: Bool(true), + WebCommitSignoffRequired: Bool(false), + Archived: Bool(false), + Disabled: Bool(false), + Private: Bool(true), + HasIssues: Bool(false), + HasWiki: Bool(false), + HasPages: Bool(false), + HasProjects: Bool(false), + HasDownloads: Bool(false), + HasDiscussions: Bool(false), + IsTemplate: Bool(false), + URL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"), + ArchiveURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"), + AssigneesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"), + BlobsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"), + BranchesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"), + CollaboratorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"), + CommentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"), + CommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"), + CompareURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"), + ContentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"), + ContributorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"), + DeploymentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"), + DownloadsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"), + EventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"), + ForksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"), + GitCommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"), + GitRefsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"), + GitTagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"), + HooksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"), + IssueCommentURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"), + IssueEventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"), + IssuesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"), + KeysURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"), + LabelsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"), + LanguagesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"), + MergesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"), + MilestonesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"), + NotificationsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"), + PullsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"), + ReleasesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"), + StargazersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"), + StatusesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"), + SubscribersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"), + SubscriptionURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"), + TagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"), + TeamsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"), + Visibility: String("private"), + } + if !cmp.Equal(fork, want) { + t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v", fork, want) + } + + const methodName = "CreateTemporaryPrivateFork" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "\n", "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + w.WriteHeader(http.StatusAccepted) + fmt.Fprint(w, `{ + "id": 1, + "node_id": "R_kgDPP3c6pQ", + "owner": { + "login": "owner", + "id": 2, + "node_id": "MDQ6VXFGcjYyMjcyMTQw", + "avatar_url": "https://avatars.githubusercontent.com/u/111111?v=4", + "html_url": "https://github.com/xxxxx", + "gravatar_id": "", + "type": "User", + "site_admin": false, + "url": "https://api.github.com/users/owner", + "events_url": "https://api.github.com/users/owner/events{/privacy}", + "following_url": "https://api.github.com/users/owner/following{/other_user}", + "followers_url": "https://api.github.com/users/owner/followers", + "gists_url": "https://api.github.com/users/owner/gists{/gist_id}", + "organizations_url": "https://api.github.com/users/owner/orgs", + "received_events_url": "https://api.github.com/users/owner/received_events", + "repos_url": "https://api.github.com/users/owner/repos", + "starred_url": "https://api.github.com/users/owner/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/owner/subscriptions" + }, + "name": "repo-ghsa-xxxx-xxxx-xxxx", + "full_name": "owner/repo-ghsa-xxxx-xxxx-xxxx", + "default_branch": "master", + "created_at": "2023-12-08T17:22:41Z", + "pushed_at": "2023-12-03T11:27:08Z", + "updated_at": "2023-12-08T17:22:42Z", + "html_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx", + "clone_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "git_url": "git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "ssh_url": "git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git", + "svn_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx", + "fork": false, + "forks_count": 0, + "network_count": 0, + "open_issues_count": 0, + "open_issues": 0, + "stargazers_count": 0, + "subscribers_count": 0, + "watchers_count": 0, + "watchers": 0, + "size": 0, + "permissions": { + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true + }, + "allow_forking": true, + "web_commit_signoff_required": false, + "archived": false, + "disabled": false, + "private": true, + "has_issues": false, + "has_wiki": false, + "has_pages": false, + "has_projects": false, + "has_downloads": false, + "has_discussions": false, + "is_template": false, + "url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx", + "archive_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}", + "assignees_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}", + "blobs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}", + "collaborators_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}", + "commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}", + "compare_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}", + "contributors_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors", + "deployments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments", + "downloads_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads", + "events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events", + "forks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks", + "git_commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}", + "hooks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks", + "issue_comment_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}", + "issues_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}", + "keys_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}", + "labels_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}", + "languages_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages", + "merges_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges", + "milestones_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}", + "notifications_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}", + "pulls_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}", + "releases_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}", + "stargazers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers", + "statuses_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers", + "subscription_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription", + "tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags", + "teams_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams", + "visibility": "private" + }`) + }) + + ctx := context.Background() + fork, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id") + if _, ok := err.(*AcceptedError); !ok { + t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned error: %v (want AcceptedError)", err) + } + + want := &Repository{ + ID: Int64(1), + NodeID: String("R_kgDPP3c6pQ"), + Owner: &User{ + Login: String("owner"), + ID: Int64(2), + NodeID: String("MDQ6VXFGcjYyMjcyMTQw"), + AvatarURL: String("https://avatars.githubusercontent.com/u/111111?v=4"), + HTMLURL: String("https://github.com/xxxxx"), + GravatarID: String(""), + Type: String("User"), + SiteAdmin: Bool(false), + URL: String("https://api.github.com/users/owner"), + EventsURL: String("https://api.github.com/users/owner/events{/privacy}"), + FollowingURL: String("https://api.github.com/users/owner/following{/other_user}"), + FollowersURL: String("https://api.github.com/users/owner/followers"), + GistsURL: String("https://api.github.com/users/owner/gists{/gist_id}"), + OrganizationsURL: String("https://api.github.com/users/owner/orgs"), + ReceivedEventsURL: String("https://api.github.com/users/owner/received_events"), + ReposURL: String("https://api.github.com/users/owner/repos"), + StarredURL: String("https://api.github.com/users/owner/starred{/owner}{/repo}"), + SubscriptionsURL: String("https://api.github.com/users/owner/subscriptions"), + }, + Name: String("repo-ghsa-xxxx-xxxx-xxxx"), + FullName: String("owner/repo-ghsa-xxxx-xxxx-xxxx"), + DefaultBranch: String("master"), + CreatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)}, + PushedAt: &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)}, + UpdatedAt: &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)}, + HTMLURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + CloneURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + GitURL: String("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SSHURL: String("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"), + SVNURL: String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"), + Fork: Bool(false), + ForksCount: Int(0), + NetworkCount: Int(0), + OpenIssuesCount: Int(0), + OpenIssues: Int(0), + StargazersCount: Int(0), + SubscribersCount: Int(0), + WatchersCount: Int(0), + Watchers: Int(0), + Size: Int(0), + Permissions: map[string]bool{ + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true, + }, + AllowForking: Bool(true), + WebCommitSignoffRequired: Bool(false), + Archived: Bool(false), + Disabled: Bool(false), + Private: Bool(true), + HasIssues: Bool(false), + HasWiki: Bool(false), + HasPages: Bool(false), + HasProjects: Bool(false), + HasDownloads: Bool(false), + HasDiscussions: Bool(false), + IsTemplate: Bool(false), + URL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"), + ArchiveURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"), + AssigneesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"), + BlobsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"), + BranchesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"), + CollaboratorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"), + CommentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"), + CommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"), + CompareURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"), + ContentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"), + ContributorsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"), + DeploymentsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"), + DownloadsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"), + EventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"), + ForksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"), + GitCommitsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"), + GitRefsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"), + GitTagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"), + HooksURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"), + IssueCommentURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"), + IssueEventsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"), + IssuesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"), + KeysURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"), + LabelsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"), + LanguagesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"), + MergesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"), + MilestonesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"), + NotificationsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"), + PullsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"), + ReleasesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"), + StargazersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"), + StatusesURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"), + SubscribersURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"), + SubscriptionURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"), + TagsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"), + TeamsURL: String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"), + Visibility: String("private"), + } + if !cmp.Equal(fork, want) { + t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v", fork, want) + } +} + +func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_invalidOwner(t *testing.T) { + client, _, _, teardown := setup() + defer teardown() + + ctx := context.Background() + _, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "%", "r", "ghsa_id") + testURLParseError(t, err) +} + func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadRequest(t *testing.T) { client, mux, _, teardown := setup() defer teardown() @@ -146,8 +612,8 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *tes assertWrite(t, w, []byte(`[ { "ghsa_id": "GHSA-abcd-1234-efgh", - "cve_id": "CVE-2050-00000" - } + "cve_id": "CVE-2050-00000" + } ]`)) }) @@ -277,8 +743,8 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T assertWrite(t, w, []byte(`[ { "ghsa_id": "GHSA-abcd-1234-efgh", - "cve_id": "CVE-2050-00000" - } + "cve_id": "CVE-2050-00000" + } ]`)) }) From 0053173886e65006a999918e8afd5ef835a66d3d Mon Sep 17 00:00:00 2001 From: Benjamin Nater Date: Sat, 16 Dec 2023 02:01:49 +0100 Subject: [PATCH 34/37] Escape package names to support names which include a slash (#3002) --- github/orgs_packages.go | 29 ++++++++--- github/orgs_packages_test.go | 95 +++++++++++++++++++++--------------- 2 files changed, 79 insertions(+), 45 deletions(-) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 4fb9a63b42..edd8e508fb 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "net/url" ) // ListPackages lists the packages for an organization. @@ -38,11 +39,13 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // GetPackage gets a package by name from 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#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, packageName) + u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, url.PathEscape(packageName)) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -59,11 +62,13 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // DeletePackage deletes a package from 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#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, packageName) + u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, url.PathEscape(packageName)) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -74,11 +79,13 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // 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 // //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, packageName) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/restore", org, packageType, url.PathEscape(packageName)) req, err := s.client.NewRequest("POST", u, nil) if err != nil { return nil, err @@ -89,11 +96,13 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // 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 // //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) { - u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, packageName) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, url.PathEscape(packageName)) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -115,11 +124,13 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // PackageGetVersion gets a specific version 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#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, packageName, packageVersionID) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, url.PathEscape(packageName), packageVersionID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -136,11 +147,13 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // PackageDeleteVersion deletes a package version from 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#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, packageName, packageVersionID) + u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, url.PathEscape(packageName), packageVersionID) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err @@ -151,11 +164,13 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // 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 // //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, packageName, packageVersionID) + 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) if err != nil { return nil, err diff --git a/github/orgs_packages_test.go b/github/orgs_packages_test.go index f8c8701d30..097cae7628 100644 --- a/github/orgs_packages_test.go +++ b/github/orgs_packages_test.go @@ -7,7 +7,7 @@ package github import ( "context" - "fmt" + "io" "net/http" "testing" @@ -20,7 +20,7 @@ func TestOrganizationsService_ListPackages(t *testing.T) { mux.HandleFunc("/orgs/o/packages", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `[{ + _, err := io.WriteString(w, `[{ "id": 197, "name": "hello_docker", "package_type": "container", @@ -52,6 +52,9 @@ func TestOrganizationsService_ListPackages(t *testing.T) { "html_url": "https://github.com/orgs/github/packages/container/package/hello_docker" } ]`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() @@ -114,35 +117,39 @@ func TestOrganizationsService_GetPackage(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{ + _, err := io.WriteString(w, `{ "id": 197, - "name": "hello_docker", + "name": "hello/hello_docker", "package_type": "container", "version_count": 1, "visibility": "private", - "url": "https://api.github.com/orgs/github/packages/container/hello_docker", + "url": "https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker", "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, - "html_url": "https://github.com/orgs/github/packages/container/package/hello_docker" + "html_url": "https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker" }`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() - packages, _, err := client.Organizations.GetPackage(ctx, "o", "container", "hello_docker") + packages, _, err := client.Organizations.GetPackage(ctx, "o", "container", "hello/hello_docker") if err != nil { t.Errorf("Organizations.GetPackage returned error: %v", err) } want := &Package{ ID: Int64(197), - Name: String("hello_docker"), + Name: String("hello/hello_docker"), PackageType: String("container"), VersionCount: Int64(1), Visibility: String("private"), - URL: String("https://api.github.com/orgs/github/packages/container/hello_docker"), - HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello_docker"), + URL: String("https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker"), + HTMLURL: String("https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, } @@ -169,12 +176,13 @@ func TestOrganizationsService_DeletePackage(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) ctx := context.Background() - _, err := client.Organizations.DeletePackage(ctx, "o", "container", "hello_docker") + _, err := client.Organizations.DeletePackage(ctx, "o", "container", "hello/hello_docker") if err != nil { t.Errorf("Organizations.DeletePackage returned error: %v", err) } @@ -198,12 +206,13 @@ func TestOrganizationsService_RestorePackage(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) ctx := context.Background() - _, err := client.Organizations.RestorePackage(ctx, "o", "container", "hello_docker") + _, err := client.Organizations.RestorePackage(ctx, "o", "container", "hello/hello_docker") if err != nil { t.Errorf("Organizations.RestorePackage returned error: %v", err) } @@ -215,7 +224,7 @@ func TestOrganizationsService_RestorePackage(t *testing.T) { }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - return client.Organizations.RestorePackage(ctx, "", "container", "hello_docker") + return client.Organizations.RestorePackage(ctx, "", "container", "hello/hello_docker") }) } @@ -223,18 +232,19 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testFormValues(t, r, values{"per_page": "2", "page": "1", "state": "deleted", "visibility": "internal", "package_type": "container"}) - fmt.Fprint(w, `[ + _, err := io.WriteString(w, `[ { "id": 45763, "name": "sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9", - "url": "https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763", - "package_html_url": "https://github.com/users/octocat/packages/container/package/hello_docker", + "url": "https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763", + "package_html_url": "https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker", "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, - "html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763", + "html_url": "https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763", "metadata": { "package_type": "container", "container": { @@ -244,13 +254,16 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { } } }]`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() opts := &PackageListOptions{ String("internal"), String("container"), String("deleted"), ListOptions{Page: 1, PerPage: 2}, } - packages, _, err := client.Organizations.PackageGetAllVersions(ctx, "o", "container", "hello_docker", opts) + packages, _, err := client.Organizations.PackageGetAllVersions(ctx, "o", "container", "hello/hello_docker", opts) if err != nil { t.Errorf("Organizations.PackageGetAllVersions returned error: %v", err) } @@ -258,11 +271,11 @@ func TestOrganizationsService_ListPackagesVersions(t *testing.T) { want := []*PackageVersion{{ ID: Int64(45763), Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello_docker"), + URL: String("https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763"), + PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello_docker/45763"), + HTMLURL: String("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), Metadata: &PackageMetadata{ PackageType: String("container"), Container: &PackageContainerMetadata{ @@ -293,17 +306,18 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, ` + _, err := io.WriteString(w, ` { "id": 45763, "name": "sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9", - "url": "https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763", - "package_html_url": "https://github.com/users/octocat/packages/container/package/hello_docker", + "url": "https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763", + "package_html_url": "https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker", "created_at": `+referenceTimeStr+`, "updated_at": `+referenceTimeStr+`, - "html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763", + "html_url": "https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763", "metadata": { "package_type": "container", "container": { @@ -313,10 +327,13 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { } } }`) + if err != nil { + t.Fatal("Failed to write test response: ", err) + } }) ctx := context.Background() - packages, _, err := client.Organizations.PackageGetVersion(ctx, "o", "container", "hello_docker", 45763) + packages, _, err := client.Organizations.PackageGetVersion(ctx, "o", "container", "hello/hello_docker", 45763) if err != nil { t.Errorf("Organizations.PackageGetVersion returned error: %v", err) } @@ -324,11 +341,11 @@ func TestOrganizationsService_PackageGetVersion(t *testing.T) { want := &PackageVersion{ ID: Int64(45763), Name: String("sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9"), - URL: String("https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763"), - PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello_docker"), + URL: String("https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763"), + PackageHTMLURL: String("https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker"), CreatedAt: &Timestamp{referenceTime}, UpdatedAt: &Timestamp{referenceTime}, - HTMLURL: String("https://github.com/users/octocat/packages/container/hello_docker/45763"), + HTMLURL: String("https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763"), Metadata: &PackageMetadata{ PackageType: String("container"), Container: &PackageContainerMetadata{ @@ -359,12 +376,13 @@ func TestOrganizationsService_PackageDeleteVersion(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") }) ctx := context.Background() - _, err := client.Organizations.PackageDeleteVersion(ctx, "o", "container", "hello_docker", 45763) + _, err := client.Organizations.PackageDeleteVersion(ctx, "o", "container", "hello/hello_docker", 45763) if err != nil { t.Errorf("Organizations.PackageDeleteVersion returned error: %v", err) } @@ -384,12 +402,13 @@ func TestOrganizationsService_PackageRestoreVersion(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - mux.HandleFunc("/orgs/o/packages/container/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { + // don't url escape the package name here since mux will convert it to a slash automatically + mux.HandleFunc("/orgs/o/packages/container/hello/hello_docker/versions/45763/restore", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") }) ctx := context.Background() - _, err := client.Organizations.PackageRestoreVersion(ctx, "o", "container", "hello_docker", 45763) + _, err := client.Organizations.PackageRestoreVersion(ctx, "o", "container", "hello/hello_docker", 45763) if err != nil { t.Errorf("Organizations.PackageRestoreVersion returned error: %v", err) } From 25e042b2f6cd6f722c82d3cd66462e1e982aada9 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Fri, 15 Dec 2023 19:07:07 -0600 Subject: [PATCH 35/37] Don't update httpClient passed to NewClient (#3011) --- github/github.go | 8 ++++++- github/github_test.go | 51 +++++++++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/github/github.go b/github/github.go index 712bcc0cd1..0b00655243 100644 --- a/github/github.go +++ b/github/github.go @@ -221,6 +221,8 @@ type service struct { } // Client returns the http.Client used by this GitHub client. +// 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() @@ -316,7 +318,11 @@ func addOptions(s string, opts interface{}) (string, error) { // an http.Client that will perform the authentication for you (such as that // provided by the golang.org/x/oauth2 library). func NewClient(httpClient *http.Client) *Client { - c := &Client{client: httpClient} + if httpClient == nil { + httpClient = &http.Client{} + } + httpClient2 := *httpClient + c := &Client{client: &httpClient2} c.initialize() return c } diff --git a/github/github_test.go b/github/github_test.go index 933d29e774..4d672f6096 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -321,26 +321,45 @@ func TestClient(t *testing.T) { func TestWithAuthToken(t *testing.T) { token := "gh_test_token" - var gotAuthHeaderVals []string - wantAuthHeaderVals := []string{"Bearer " + token} - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - gotAuthHeaderVals = r.Header["Authorization"] - })) - validate := func(c *Client) { + + validate := func(t *testing.T, c *http.Client, token string) { t.Helper() - gotAuthHeaderVals = nil - _, err := c.Client().Get(srv.URL) - if err != nil { - t.Fatalf("Get returned unexpected error: %v", err) + want := token + if want != "" { + want = "Bearer " + want + } + gotReq := false + headerVal := "" + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + gotReq = true + headerVal = r.Header.Get("Authorization") + })) + _, err := c.Get(srv.URL) + assertNilError(t, err) + if !gotReq { + t.Error("request not sent") } - diff := cmp.Diff(wantAuthHeaderVals, gotAuthHeaderVals) - if diff != "" { - t.Errorf("Authorization header values mismatch (-want +got):\n%s", diff) + if headerVal != want { + t.Errorf("Authorization header is %v, want %v", headerVal, want) } } - validate(NewClient(nil).WithAuthToken(token)) - validate(new(Client).WithAuthToken(token)) - validate(NewTokenClient(context.Background(), token)) + + t.Run("zero-value Client", func(t *testing.T) { + c := new(Client).WithAuthToken(token) + validate(t, c.Client(), token) + }) + + t.Run("NewClient", func(t *testing.T) { + httpClient := &http.Client{} + client := NewClient(httpClient).WithAuthToken(token) + validate(t, client.Client(), token) + // make sure the original client isn't setting auth headers now + validate(t, httpClient, "") + }) + + t.Run("NewTokenClient", func(t *testing.T) { + validate(t, NewTokenClient(context.Background(), token).Client(), token) + }) } func TestWithEnterpriseURLs(t *testing.T) { From 6e03d4ecf96a54816a6ba5b841b2f3af958e0a6d Mon Sep 17 00:00:00 2001 From: Daniel Liao <10663736+liaodaniel@users.noreply.github.com> Date: Mon, 18 Dec 2023 06:46:23 +1100 Subject: [PATCH 36/37] Add GetAllCustomPropertyValues for repositories (#3020) Fixes: #3014. --- github/repos_properties.go | 33 +++++++++++++++++ github/repos_properties_test.go | 65 +++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 github/repos_properties.go create mode 100644 github/repos_properties_test.go diff --git a/github/repos_properties.go b/github/repos_properties.go new file mode 100644 index 0000000000..5a8626c453 --- /dev/null +++ b/github/repos_properties.go @@ -0,0 +1,33 @@ +// 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" +) + +// 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 +// +//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) + if err != nil { + return nil, nil, err + } + + var customPropertyValues []*CustomPropertyValue + resp, err := s.client.Do(ctx, req, &customPropertyValues) + if err != nil { + return nil, resp, err + } + + return customPropertyValues, resp, nil +} diff --git a/github/repos_properties_test.go b/github/repos_properties_test.go new file mode 100644 index 0000000000..ee231a138c --- /dev/null +++ b/github/repos_properties_test.go @@ -0,0 +1,65 @@ +// 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" + "net/http" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) { + client, mux, _, teardown := setup() + defer teardown() + + mux.HandleFunc("/repos/o/r/properties/values", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[ + { + "property_name": "environment", + "value": "production" + }, + { + "property_name": "service", + "value": "web" + } + ]`) + }) + + ctx := context.Background() + customPropertyValues, _, err := client.Repositories.GetAllCustomPropertyValues(ctx, "o", "r") + if err != nil { + t.Errorf("Repositories.GetAllCustomPropertyValues returned error: %v", err) + } + + want := []*CustomPropertyValue{ + { + PropertyName: "environment", + Value: String("production"), + }, + { + PropertyName: "service", + Value: String("web"), + }, + } + + if !cmp.Equal(customPropertyValues, want) { + t.Errorf("Repositories.GetAllCustomPropertyValues returned %+v, want %+v", customPropertyValues, want) + } + + const methodName = "GetAllCustomPropertyValues" + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Repositories.GetAllCustomPropertyValues(ctx, "o", "r") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} From 428a0da99bed0bd7377a52802fe551ae2d3b52e8 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Sun, 17 Dec 2023 19:38:55 -0600 Subject: [PATCH 37/37] Remove ambiguous fields from AuditEntry (#3017) Fixes: #3016. --- github/enterprise_audit_log_test.go | 43 +- github/github-accessors.go | 524 +--------------------- github/github-accessors_test.go | 645 +--------------------------- github/github_test.go | 7 + github/orgs_audit_log.go | 177 ++++---- github/orgs_audit_log_test.go | 322 +++++++------- test/integration/audit_log_test.go | 2 +- 7 files changed, 308 insertions(+), 1412 deletions(-) diff --git a/github/enterprise_audit_log_test.go b/github/enterprise_audit_log_test.go index 2e91346ebf..0d9e44a3eb 100644 --- a/github/enterprise_audit_log_test.go +++ b/github/enterprise_audit_log_test.go @@ -11,8 +11,6 @@ import ( "net/http" "testing" "time" - - "github.com/google/go-cmp/cmp" ) func TestEnterpriseService_GetAuditLog(t *testing.T) { @@ -54,34 +52,31 @@ func TestEnterpriseService_GetAuditLog(t *testing.T) { if err != nil { t.Errorf("Enterprise.GetAuditLog returned error: %v", err) } - startedAt, _ := time.Parse(time.RFC3339, "2021-03-07T00:33:04.000Z") - completedAt, _ := time.Parse(time.RFC3339, "2021-03-07T00:35:08.000Z") timestamp := time.Unix(0, 1615077308538*1e6) - want := []*AuditEntry{ { - Timestamp: &Timestamp{timestamp}, - DocumentID: String("beeZYapIUe-wKg5-beadb33"), - Action: String("workflows.completed_workflow_run"), - Actor: String("testactor"), - CompletedAt: &Timestamp{completedAt}, - Conclusion: String("success"), - CreatedAt: &Timestamp{timestamp}, - Event: String("schedule"), - HeadBranch: String("master"), - HeadSHA: String("5acdeadbeef64d1a62388e901e5cdc9358644b37"), - Name: String("Code scanning - action"), - Org: String("o"), - Repo: String("o/blue-crayon-1"), - StartedAt: &Timestamp{startedAt}, - WorkflowID: Int64(123456), - WorkflowRunID: Int64(628312345), + Timestamp: &Timestamp{timestamp}, + DocumentID: String("beeZYapIUe-wKg5-beadb33"), + Action: String("workflows.completed_workflow_run"), + Actor: String("testactor"), + CreatedAt: &Timestamp{timestamp}, + Org: String("o"), + AdditionalFields: map[string]interface{}{ + "completed_at": "2021-03-07T00:35:08.000Z", + "conclusion": "success", + "event": "schedule", + "head_branch": "master", + "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", + "name": "Code scanning - action", + "repo": "o/blue-crayon-1", + "started_at": "2021-03-07T00:33:04.000Z", + "workflow_id": float64(123456), + "workflow_run_id": float64(628312345), + }, }, } - if !cmp.Equal(auditEntries, want) { - t.Errorf("Enterprise.GetAuditLog return \ngot: %+v,\nwant:%+v", auditEntries, want) - } + assertNoDiff(t, want, auditEntries) const methodName = "GetAuditLog" testBadOptions(t, methodName, func() (err error) { diff --git a/github/github-accessors.go b/github/github-accessors.go index 368a96267f..3f24a795e5 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1070,22 +1070,6 @@ func (a *AuditEntry) GetAction() string { return *a.Action } -// GetActive returns the Active field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetActive() bool { - if a == nil || a.Active == nil { - return false - } - return *a.Active -} - -// GetActiveWas returns the ActiveWas field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetActiveWas() bool { - if a == nil || a.ActiveWas == nil { - return false - } - return *a.ActiveWas -} - // GetActor returns the Actor field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetActor() string { if a == nil || a.Actor == nil { @@ -1094,12 +1078,12 @@ func (a *AuditEntry) GetActor() string { return *a.Actor } -// GetActorIP returns the ActorIP field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetActorIP() string { - if a == nil || a.ActorIP == nil { - return "" +// GetActorID returns the ActorID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetActorID() int64 { + if a == nil || a.ActorID == nil { + return 0 } - return *a.ActorIP + return *a.ActorID } // GetActorLocation returns the ActorLocation field. @@ -1110,14 +1094,6 @@ func (a *AuditEntry) GetActorLocation() *ActorLocation { return a.ActorLocation } -// GetBlockedUser returns the BlockedUser field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetBlockedUser() string { - if a == nil || a.BlockedUser == nil { - return "" - } - return *a.BlockedUser -} - // GetBusiness returns the Business field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetBusiness() string { if a == nil || a.Business == nil { @@ -1126,52 +1102,12 @@ func (a *AuditEntry) GetBusiness() string { return *a.Business } -// GetCancelledAt returns the CancelledAt field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetCancelledAt() Timestamp { - if a == nil || a.CancelledAt == nil { - return Timestamp{} - } - return *a.CancelledAt -} - -// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetCompletedAt() Timestamp { - if a == nil || a.CompletedAt == nil { - return Timestamp{} - } - return *a.CompletedAt -} - -// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetConclusion() string { - if a == nil || a.Conclusion == nil { - return "" - } - return *a.Conclusion -} - -// GetConfig returns the Config field. -func (a *AuditEntry) GetConfig() *HookConfig { - if a == nil { - return nil - } - return a.Config -} - -// GetConfigWas returns the ConfigWas field. -func (a *AuditEntry) GetConfigWas() *HookConfig { - if a == nil { - return nil - } - return a.ConfigWas -} - -// GetContentType returns the ContentType field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetContentType() string { - if a == nil || a.ContentType == nil { - return "" +// GetBusinessID returns the BusinessID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetBusinessID() int64 { + if a == nil || a.BusinessID == nil { + return 0 } - return *a.ContentType + return *a.BusinessID } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. @@ -1182,22 +1118,6 @@ func (a *AuditEntry) GetCreatedAt() Timestamp { return *a.CreatedAt } -// GetData returns the Data field. -func (a *AuditEntry) GetData() *AuditEntryData { - if a == nil { - return nil - } - return a.Data -} - -// GetDeployKeyFingerprint returns the DeployKeyFingerprint field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetDeployKeyFingerprint() string { - if a == nil || a.DeployKeyFingerprint == nil { - return "" - } - return *a.DeployKeyFingerprint -} - // GetDocumentID returns the DocumentID field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetDocumentID() string { if a == nil || a.DocumentID == nil { @@ -1206,38 +1126,6 @@ func (a *AuditEntry) GetDocumentID() string { return *a.DocumentID } -// GetEmoji returns the Emoji field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetEmoji() string { - if a == nil || a.Emoji == nil { - return "" - } - return *a.Emoji -} - -// GetEnvironmentName returns the EnvironmentName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetEnvironmentName() string { - if a == nil || a.EnvironmentName == nil { - return "" - } - return *a.EnvironmentName -} - -// GetEvent returns the Event field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetEvent() string { - if a == nil || a.Event == nil { - return "" - } - return *a.Event -} - -// GetExplanation returns the Explanation field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetExplanation() string { - if a == nil || a.Explanation == nil { - return "" - } - return *a.Explanation -} - // GetExternalIdentityNameID returns the ExternalIdentityNameID field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetExternalIdentityNameID() string { if a == nil || a.ExternalIdentityNameID == nil { @@ -1254,14 +1142,6 @@ func (a *AuditEntry) GetExternalIdentityUsername() string { return *a.ExternalIdentityUsername } -// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetFingerprint() string { - if a == nil || a.Fingerprint == nil { - return "" - } - return *a.Fingerprint -} - // GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetHashedToken() string { if a == nil || a.HashedToken == nil { @@ -1270,118 +1150,6 @@ func (a *AuditEntry) GetHashedToken() string { return *a.HashedToken } -// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetHeadBranch() string { - if a == nil || a.HeadBranch == nil { - return "" - } - return *a.HeadBranch -} - -// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetHeadSHA() string { - if a == nil || a.HeadSHA == nil { - return "" - } - return *a.HeadSHA -} - -// GetHookID returns the HookID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetHookID() int64 { - if a == nil || a.HookID == nil { - return 0 - } - return *a.HookID -} - -// GetIsHostedRunner returns the IsHostedRunner field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetIsHostedRunner() bool { - if a == nil || a.IsHostedRunner == nil { - return false - } - return *a.IsHostedRunner -} - -// GetJobName returns the JobName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetJobName() string { - if a == nil || a.JobName == nil { - return "" - } - return *a.JobName -} - -// GetJobWorkflowRef returns the JobWorkflowRef field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetJobWorkflowRef() string { - if a == nil || a.JobWorkflowRef == nil { - return "" - } - return *a.JobWorkflowRef -} - -// GetLimitedAvailability returns the LimitedAvailability field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetLimitedAvailability() bool { - if a == nil || a.LimitedAvailability == nil { - return false - } - return *a.LimitedAvailability -} - -// GetMessage returns the Message field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetMessage() string { - if a == nil || a.Message == nil { - return "" - } - return *a.Message -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetName() string { - if a == nil || a.Name == nil { - return "" - } - return *a.Name -} - -// GetOAuthApplicationID returns the OAuthApplicationID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOAuthApplicationID() int64 { - if a == nil || a.OAuthApplicationID == nil { - return 0 - } - return *a.OAuthApplicationID -} - -// GetOldPermission returns the OldPermission field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOldPermission() string { - if a == nil || a.OldPermission == nil { - return "" - } - return *a.OldPermission -} - -// GetOldUser returns the OldUser field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOldUser() string { - if a == nil || a.OldUser == nil { - return "" - } - return *a.OldUser -} - -// GetOpenSSHPublicKey returns the OpenSSHPublicKey field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOpenSSHPublicKey() string { - if a == nil || a.OpenSSHPublicKey == nil { - return "" - } - return *a.OpenSSHPublicKey -} - -// GetOperationType returns the OperationType field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetOperationType() string { - if a == nil || a.OperationType == nil { - return "" - } - return *a.OperationType -} - // GetOrg returns the Org field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetOrg() string { if a == nil || a.Org == nil { @@ -1398,182 +1166,6 @@ func (a *AuditEntry) GetOrgID() int64 { return *a.OrgID } -// GetPermission returns the Permission field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPermission() string { - if a == nil || a.Permission == nil { - return "" - } - return *a.Permission -} - -// GetPreviousVisibility returns the PreviousVisibility field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPreviousVisibility() string { - if a == nil || a.PreviousVisibility == nil { - return "" - } - return *a.PreviousVisibility -} - -// GetProgrammaticAccessType returns the ProgrammaticAccessType field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetProgrammaticAccessType() string { - if a == nil || a.ProgrammaticAccessType == nil { - return "" - } - return *a.ProgrammaticAccessType -} - -// GetPullRequestID returns the PullRequestID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPullRequestID() int64 { - if a == nil || a.PullRequestID == nil { - return 0 - } - return *a.PullRequestID -} - -// GetPullRequestTitle returns the PullRequestTitle field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPullRequestTitle() string { - if a == nil || a.PullRequestTitle == nil { - return "" - } - return *a.PullRequestTitle -} - -// GetPullRequestURL returns the PullRequestURL field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetPullRequestURL() string { - if a == nil || a.PullRequestURL == nil { - return "" - } - return *a.PullRequestURL -} - -// GetReadOnly returns the ReadOnly field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetReadOnly() string { - if a == nil || a.ReadOnly == nil { - return "" - } - return *a.ReadOnly -} - -// GetReferrer returns the Referrer field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetReferrer() string { - if a == nil || a.Referrer == nil { - return "" - } - return *a.Referrer -} - -// GetRepo returns the Repo field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRepo() string { - if a == nil || a.Repo == nil { - return "" - } - return *a.Repo -} - -// GetRepository returns the Repository field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRepository() string { - if a == nil || a.Repository == nil { - return "" - } - return *a.Repository -} - -// GetRepositoryPublic returns the RepositoryPublic field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRepositoryPublic() bool { - if a == nil || a.RepositoryPublic == nil { - return false - } - return *a.RepositoryPublic -} - -// GetRunAttempt returns the RunAttempt field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunAttempt() int64 { - if a == nil || a.RunAttempt == nil { - return 0 - } - return *a.RunAttempt -} - -// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerGroupID() int64 { - if a == nil || a.RunnerGroupID == nil { - return 0 - } - return *a.RunnerGroupID -} - -// GetRunnerGroupName returns the RunnerGroupName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerGroupName() string { - if a == nil || a.RunnerGroupName == nil { - return "" - } - return *a.RunnerGroupName -} - -// GetRunnerID returns the RunnerID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerID() int64 { - if a == nil || a.RunnerID == nil { - return 0 - } - return *a.RunnerID -} - -// GetRunnerName returns the RunnerName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerName() string { - if a == nil || a.RunnerName == nil { - return "" - } - return *a.RunnerName -} - -// GetRunNumber returns the RunNumber field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunNumber() int64 { - if a == nil || a.RunNumber == nil { - return 0 - } - return *a.RunNumber -} - -// GetSourceVersion returns the SourceVersion field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetSourceVersion() string { - if a == nil || a.SourceVersion == nil { - return "" - } - return *a.SourceVersion -} - -// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetStartedAt() Timestamp { - if a == nil || a.StartedAt == nil { - return Timestamp{} - } - return *a.StartedAt -} - -// GetTargetLogin returns the TargetLogin field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTargetLogin() string { - if a == nil || a.TargetLogin == nil { - return "" - } - return *a.TargetLogin -} - -// GetTargetVersion returns the TargetVersion field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTargetVersion() string { - if a == nil || a.TargetVersion == nil { - return "" - } - return *a.TargetVersion -} - -// GetTeam returns the Team field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTeam() string { - if a == nil || a.Team == nil { - return "" - } - return *a.Team -} - // GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetTimestamp() Timestamp { if a == nil || a.Timestamp == nil { @@ -1598,38 +1190,6 @@ func (a *AuditEntry) GetTokenScopes() string { return *a.TokenScopes } -// GetTopic returns the Topic field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTopic() string { - if a == nil || a.Topic == nil { - return "" - } - return *a.Topic -} - -// GetTransportProtocol returns the TransportProtocol field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTransportProtocol() int { - if a == nil || a.TransportProtocol == nil { - return 0 - } - return *a.TransportProtocol -} - -// GetTransportProtocolName returns the TransportProtocolName field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTransportProtocolName() string { - if a == nil || a.TransportProtocolName == nil { - return "" - } - return *a.TransportProtocolName -} - -// GetTriggerID returns the TriggerID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetTriggerID() int64 { - if a == nil || a.TriggerID == nil { - return 0 - } - return *a.TriggerID -} - // GetUser returns the User field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetUser() string { if a == nil || a.User == nil { @@ -1638,52 +1198,12 @@ func (a *AuditEntry) GetUser() string { return *a.User } -// GetUserAgent returns the UserAgent field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetUserAgent() string { - if a == nil || a.UserAgent == nil { - return "" - } - return *a.UserAgent -} - -// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetVisibility() string { - if a == nil || a.Visibility == nil { - return "" - } - return *a.Visibility -} - -// GetWorkflowID returns the WorkflowID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetWorkflowID() int64 { - if a == nil || a.WorkflowID == nil { +// GetUserID returns the UserID field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetUserID() int64 { + if a == nil || a.UserID == nil { return 0 } - return *a.WorkflowID -} - -// GetWorkflowRunID returns the WorkflowRunID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetWorkflowRunID() int64 { - if a == nil || a.WorkflowRunID == nil { - return 0 - } - return *a.WorkflowRunID -} - -// GetOldLogin returns the OldLogin field if it's non-nil, zero value otherwise. -func (a *AuditEntryData) GetOldLogin() string { - if a == nil || a.OldLogin == nil { - return "" - } - return *a.OldLogin -} - -// GetOldName returns the OldName field if it's non-nil, zero value otherwise. -func (a *AuditEntryData) GetOldName() string { - if a == nil || a.OldName == nil { - return "" - } - return *a.OldName + return *a.UserID } // GetApp returns the App field. @@ -14534,22 +14054,6 @@ func (p *Plan) GetSpace() int { return *p.Space } -// GetCode returns the Code field if it's non-nil, zero value otherwise. -func (p *PolicyOverrideReason) GetCode() string { - if p == nil || p.Code == nil { - return "" - } - return *p.Code -} - -// GetMessage returns the Message field if it's non-nil, zero value otherwise. -func (p *PolicyOverrideReason) GetMessage() string { - if p == nil || p.Message == nil { - return "" - } - return *p.Message -} - // GetConfigURL returns the ConfigURL field if it's non-nil, zero value otherwise. func (p *PreReceiveHook) GetConfigURL() string { if p == nil || p.ConfigURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 057f07b044..e575fea252 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1263,26 +1263,6 @@ func TestAuditEntry_GetAction(tt *testing.T) { a.GetAction() } -func TestAuditEntry_GetActive(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{Active: &zeroValue} - a.GetActive() - a = &AuditEntry{} - a.GetActive() - a = nil - a.GetActive() -} - -func TestAuditEntry_GetActiveWas(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{ActiveWas: &zeroValue} - a.GetActiveWas() - a = &AuditEntry{} - a.GetActiveWas() - a = nil - a.GetActiveWas() -} - func TestAuditEntry_GetActor(tt *testing.T) { var zeroValue string a := &AuditEntry{Actor: &zeroValue} @@ -1293,14 +1273,14 @@ func TestAuditEntry_GetActor(tt *testing.T) { a.GetActor() } -func TestAuditEntry_GetActorIP(tt *testing.T) { - var zeroValue string - a := &AuditEntry{ActorIP: &zeroValue} - a.GetActorIP() +func TestAuditEntry_GetActorID(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{ActorID: &zeroValue} + a.GetActorID() a = &AuditEntry{} - a.GetActorIP() + a.GetActorID() a = nil - a.GetActorIP() + a.GetActorID() } func TestAuditEntry_GetActorLocation(tt *testing.T) { @@ -1310,16 +1290,6 @@ func TestAuditEntry_GetActorLocation(tt *testing.T) { a.GetActorLocation() } -func TestAuditEntry_GetBlockedUser(tt *testing.T) { - var zeroValue string - a := &AuditEntry{BlockedUser: &zeroValue} - a.GetBlockedUser() - a = &AuditEntry{} - a.GetBlockedUser() - a = nil - a.GetBlockedUser() -} - func TestAuditEntry_GetBusiness(tt *testing.T) { var zeroValue string a := &AuditEntry{Business: &zeroValue} @@ -1330,58 +1300,14 @@ func TestAuditEntry_GetBusiness(tt *testing.T) { a.GetBusiness() } -func TestAuditEntry_GetCancelledAt(tt *testing.T) { - var zeroValue Timestamp - a := &AuditEntry{CancelledAt: &zeroValue} - a.GetCancelledAt() - a = &AuditEntry{} - a.GetCancelledAt() - a = nil - a.GetCancelledAt() -} - -func TestAuditEntry_GetCompletedAt(tt *testing.T) { - var zeroValue Timestamp - a := &AuditEntry{CompletedAt: &zeroValue} - a.GetCompletedAt() - a = &AuditEntry{} - a.GetCompletedAt() - a = nil - a.GetCompletedAt() -} - -func TestAuditEntry_GetConclusion(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Conclusion: &zeroValue} - a.GetConclusion() - a = &AuditEntry{} - a.GetConclusion() - a = nil - a.GetConclusion() -} - -func TestAuditEntry_GetConfig(tt *testing.T) { - a := &AuditEntry{} - a.GetConfig() - a = nil - a.GetConfig() -} - -func TestAuditEntry_GetConfigWas(tt *testing.T) { - a := &AuditEntry{} - a.GetConfigWas() - a = nil - a.GetConfigWas() -} - -func TestAuditEntry_GetContentType(tt *testing.T) { - var zeroValue string - a := &AuditEntry{ContentType: &zeroValue} - a.GetContentType() +func TestAuditEntry_GetBusinessID(tt *testing.T) { + var zeroValue int64 + a := &AuditEntry{BusinessID: &zeroValue} + a.GetBusinessID() a = &AuditEntry{} - a.GetContentType() + a.GetBusinessID() a = nil - a.GetContentType() + a.GetBusinessID() } func TestAuditEntry_GetCreatedAt(tt *testing.T) { @@ -1394,23 +1320,6 @@ func TestAuditEntry_GetCreatedAt(tt *testing.T) { a.GetCreatedAt() } -func TestAuditEntry_GetData(tt *testing.T) { - a := &AuditEntry{} - a.GetData() - a = nil - a.GetData() -} - -func TestAuditEntry_GetDeployKeyFingerprint(tt *testing.T) { - var zeroValue string - a := &AuditEntry{DeployKeyFingerprint: &zeroValue} - a.GetDeployKeyFingerprint() - a = &AuditEntry{} - a.GetDeployKeyFingerprint() - a = nil - a.GetDeployKeyFingerprint() -} - func TestAuditEntry_GetDocumentID(tt *testing.T) { var zeroValue string a := &AuditEntry{DocumentID: &zeroValue} @@ -1421,46 +1330,6 @@ func TestAuditEntry_GetDocumentID(tt *testing.T) { a.GetDocumentID() } -func TestAuditEntry_GetEmoji(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Emoji: &zeroValue} - a.GetEmoji() - a = &AuditEntry{} - a.GetEmoji() - a = nil - a.GetEmoji() -} - -func TestAuditEntry_GetEnvironmentName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{EnvironmentName: &zeroValue} - a.GetEnvironmentName() - a = &AuditEntry{} - a.GetEnvironmentName() - a = nil - a.GetEnvironmentName() -} - -func TestAuditEntry_GetEvent(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Event: &zeroValue} - a.GetEvent() - a = &AuditEntry{} - a.GetEvent() - a = nil - a.GetEvent() -} - -func TestAuditEntry_GetExplanation(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Explanation: &zeroValue} - a.GetExplanation() - a = &AuditEntry{} - a.GetExplanation() - a = nil - a.GetExplanation() -} - func TestAuditEntry_GetExternalIdentityNameID(tt *testing.T) { var zeroValue string a := &AuditEntry{ExternalIdentityNameID: &zeroValue} @@ -1481,16 +1350,6 @@ func TestAuditEntry_GetExternalIdentityUsername(tt *testing.T) { a.GetExternalIdentityUsername() } -func TestAuditEntry_GetFingerprint(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Fingerprint: &zeroValue} - a.GetFingerprint() - a = &AuditEntry{} - a.GetFingerprint() - a = nil - a.GetFingerprint() -} - func TestAuditEntry_GetHashedToken(tt *testing.T) { var zeroValue string a := &AuditEntry{HashedToken: &zeroValue} @@ -1501,146 +1360,6 @@ func TestAuditEntry_GetHashedToken(tt *testing.T) { a.GetHashedToken() } -func TestAuditEntry_GetHeadBranch(tt *testing.T) { - var zeroValue string - a := &AuditEntry{HeadBranch: &zeroValue} - a.GetHeadBranch() - a = &AuditEntry{} - a.GetHeadBranch() - a = nil - a.GetHeadBranch() -} - -func TestAuditEntry_GetHeadSHA(tt *testing.T) { - var zeroValue string - a := &AuditEntry{HeadSHA: &zeroValue} - a.GetHeadSHA() - a = &AuditEntry{} - a.GetHeadSHA() - a = nil - a.GetHeadSHA() -} - -func TestAuditEntry_GetHookID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{HookID: &zeroValue} - a.GetHookID() - a = &AuditEntry{} - a.GetHookID() - a = nil - a.GetHookID() -} - -func TestAuditEntry_GetIsHostedRunner(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{IsHostedRunner: &zeroValue} - a.GetIsHostedRunner() - a = &AuditEntry{} - a.GetIsHostedRunner() - a = nil - a.GetIsHostedRunner() -} - -func TestAuditEntry_GetJobName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{JobName: &zeroValue} - a.GetJobName() - a = &AuditEntry{} - a.GetJobName() - a = nil - a.GetJobName() -} - -func TestAuditEntry_GetJobWorkflowRef(tt *testing.T) { - var zeroValue string - a := &AuditEntry{JobWorkflowRef: &zeroValue} - a.GetJobWorkflowRef() - a = &AuditEntry{} - a.GetJobWorkflowRef() - a = nil - a.GetJobWorkflowRef() -} - -func TestAuditEntry_GetLimitedAvailability(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{LimitedAvailability: &zeroValue} - a.GetLimitedAvailability() - a = &AuditEntry{} - a.GetLimitedAvailability() - a = nil - a.GetLimitedAvailability() -} - -func TestAuditEntry_GetMessage(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Message: &zeroValue} - a.GetMessage() - a = &AuditEntry{} - a.GetMessage() - a = nil - a.GetMessage() -} - -func TestAuditEntry_GetName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Name: &zeroValue} - a.GetName() - a = &AuditEntry{} - a.GetName() - a = nil - a.GetName() -} - -func TestAuditEntry_GetOAuthApplicationID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{OAuthApplicationID: &zeroValue} - a.GetOAuthApplicationID() - a = &AuditEntry{} - a.GetOAuthApplicationID() - a = nil - a.GetOAuthApplicationID() -} - -func TestAuditEntry_GetOldPermission(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OldPermission: &zeroValue} - a.GetOldPermission() - a = &AuditEntry{} - a.GetOldPermission() - a = nil - a.GetOldPermission() -} - -func TestAuditEntry_GetOldUser(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OldUser: &zeroValue} - a.GetOldUser() - a = &AuditEntry{} - a.GetOldUser() - a = nil - a.GetOldUser() -} - -func TestAuditEntry_GetOpenSSHPublicKey(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OpenSSHPublicKey: &zeroValue} - a.GetOpenSSHPublicKey() - a = &AuditEntry{} - a.GetOpenSSHPublicKey() - a = nil - a.GetOpenSSHPublicKey() -} - -func TestAuditEntry_GetOperationType(tt *testing.T) { - var zeroValue string - a := &AuditEntry{OperationType: &zeroValue} - a.GetOperationType() - a = &AuditEntry{} - a.GetOperationType() - a = nil - a.GetOperationType() -} - func TestAuditEntry_GetOrg(tt *testing.T) { var zeroValue string a := &AuditEntry{Org: &zeroValue} @@ -1661,226 +1380,6 @@ func TestAuditEntry_GetOrgID(tt *testing.T) { a.GetOrgID() } -func TestAuditEntry_GetPermission(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Permission: &zeroValue} - a.GetPermission() - a = &AuditEntry{} - a.GetPermission() - a = nil - a.GetPermission() -} - -func TestAuditEntry_GetPreviousVisibility(tt *testing.T) { - var zeroValue string - a := &AuditEntry{PreviousVisibility: &zeroValue} - a.GetPreviousVisibility() - a = &AuditEntry{} - a.GetPreviousVisibility() - a = nil - a.GetPreviousVisibility() -} - -func TestAuditEntry_GetProgrammaticAccessType(tt *testing.T) { - var zeroValue string - a := &AuditEntry{ProgrammaticAccessType: &zeroValue} - a.GetProgrammaticAccessType() - a = &AuditEntry{} - a.GetProgrammaticAccessType() - a = nil - a.GetProgrammaticAccessType() -} - -func TestAuditEntry_GetPullRequestID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{PullRequestID: &zeroValue} - a.GetPullRequestID() - a = &AuditEntry{} - a.GetPullRequestID() - a = nil - a.GetPullRequestID() -} - -func TestAuditEntry_GetPullRequestTitle(tt *testing.T) { - var zeroValue string - a := &AuditEntry{PullRequestTitle: &zeroValue} - a.GetPullRequestTitle() - a = &AuditEntry{} - a.GetPullRequestTitle() - a = nil - a.GetPullRequestTitle() -} - -func TestAuditEntry_GetPullRequestURL(tt *testing.T) { - var zeroValue string - a := &AuditEntry{PullRequestURL: &zeroValue} - a.GetPullRequestURL() - a = &AuditEntry{} - a.GetPullRequestURL() - a = nil - a.GetPullRequestURL() -} - -func TestAuditEntry_GetReadOnly(tt *testing.T) { - var zeroValue string - a := &AuditEntry{ReadOnly: &zeroValue} - a.GetReadOnly() - a = &AuditEntry{} - a.GetReadOnly() - a = nil - a.GetReadOnly() -} - -func TestAuditEntry_GetReferrer(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Referrer: &zeroValue} - a.GetReferrer() - a = &AuditEntry{} - a.GetReferrer() - a = nil - a.GetReferrer() -} - -func TestAuditEntry_GetRepo(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Repo: &zeroValue} - a.GetRepo() - a = &AuditEntry{} - a.GetRepo() - a = nil - a.GetRepo() -} - -func TestAuditEntry_GetRepository(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Repository: &zeroValue} - a.GetRepository() - a = &AuditEntry{} - a.GetRepository() - a = nil - a.GetRepository() -} - -func TestAuditEntry_GetRepositoryPublic(tt *testing.T) { - var zeroValue bool - a := &AuditEntry{RepositoryPublic: &zeroValue} - a.GetRepositoryPublic() - a = &AuditEntry{} - a.GetRepositoryPublic() - a = nil - a.GetRepositoryPublic() -} - -func TestAuditEntry_GetRunAttempt(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{RunAttempt: &zeroValue} - a.GetRunAttempt() - a = &AuditEntry{} - a.GetRunAttempt() - a = nil - a.GetRunAttempt() -} - -func TestAuditEntry_GetRunnerGroupID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{RunnerGroupID: &zeroValue} - a.GetRunnerGroupID() - a = &AuditEntry{} - a.GetRunnerGroupID() - a = nil - a.GetRunnerGroupID() -} - -func TestAuditEntry_GetRunnerGroupName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{RunnerGroupName: &zeroValue} - a.GetRunnerGroupName() - a = &AuditEntry{} - a.GetRunnerGroupName() - a = nil - a.GetRunnerGroupName() -} - -func TestAuditEntry_GetRunnerID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{RunnerID: &zeroValue} - a.GetRunnerID() - a = &AuditEntry{} - a.GetRunnerID() - a = nil - a.GetRunnerID() -} - -func TestAuditEntry_GetRunnerName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{RunnerName: &zeroValue} - a.GetRunnerName() - a = &AuditEntry{} - a.GetRunnerName() - a = nil - a.GetRunnerName() -} - -func TestAuditEntry_GetRunNumber(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{RunNumber: &zeroValue} - a.GetRunNumber() - a = &AuditEntry{} - a.GetRunNumber() - a = nil - a.GetRunNumber() -} - -func TestAuditEntry_GetSourceVersion(tt *testing.T) { - var zeroValue string - a := &AuditEntry{SourceVersion: &zeroValue} - a.GetSourceVersion() - a = &AuditEntry{} - a.GetSourceVersion() - a = nil - a.GetSourceVersion() -} - -func TestAuditEntry_GetStartedAt(tt *testing.T) { - var zeroValue Timestamp - a := &AuditEntry{StartedAt: &zeroValue} - a.GetStartedAt() - a = &AuditEntry{} - a.GetStartedAt() - a = nil - a.GetStartedAt() -} - -func TestAuditEntry_GetTargetLogin(tt *testing.T) { - var zeroValue string - a := &AuditEntry{TargetLogin: &zeroValue} - a.GetTargetLogin() - a = &AuditEntry{} - a.GetTargetLogin() - a = nil - a.GetTargetLogin() -} - -func TestAuditEntry_GetTargetVersion(tt *testing.T) { - var zeroValue string - a := &AuditEntry{TargetVersion: &zeroValue} - a.GetTargetVersion() - a = &AuditEntry{} - a.GetTargetVersion() - a = nil - a.GetTargetVersion() -} - -func TestAuditEntry_GetTeam(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Team: &zeroValue} - a.GetTeam() - a = &AuditEntry{} - a.GetTeam() - a = nil - a.GetTeam() -} - func TestAuditEntry_GetTimestamp(tt *testing.T) { var zeroValue Timestamp a := &AuditEntry{Timestamp: &zeroValue} @@ -1911,46 +1410,6 @@ func TestAuditEntry_GetTokenScopes(tt *testing.T) { a.GetTokenScopes() } -func TestAuditEntry_GetTopic(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Topic: &zeroValue} - a.GetTopic() - a = &AuditEntry{} - a.GetTopic() - a = nil - a.GetTopic() -} - -func TestAuditEntry_GetTransportProtocol(tt *testing.T) { - var zeroValue int - a := &AuditEntry{TransportProtocol: &zeroValue} - a.GetTransportProtocol() - a = &AuditEntry{} - a.GetTransportProtocol() - a = nil - a.GetTransportProtocol() -} - -func TestAuditEntry_GetTransportProtocolName(tt *testing.T) { - var zeroValue string - a := &AuditEntry{TransportProtocolName: &zeroValue} - a.GetTransportProtocolName() - a = &AuditEntry{} - a.GetTransportProtocolName() - a = nil - a.GetTransportProtocolName() -} - -func TestAuditEntry_GetTriggerID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{TriggerID: &zeroValue} - a.GetTriggerID() - a = &AuditEntry{} - a.GetTriggerID() - a = nil - a.GetTriggerID() -} - func TestAuditEntry_GetUser(tt *testing.T) { var zeroValue string a := &AuditEntry{User: &zeroValue} @@ -1961,64 +1420,14 @@ func TestAuditEntry_GetUser(tt *testing.T) { a.GetUser() } -func TestAuditEntry_GetUserAgent(tt *testing.T) { - var zeroValue string - a := &AuditEntry{UserAgent: &zeroValue} - a.GetUserAgent() - a = &AuditEntry{} - a.GetUserAgent() - a = nil - a.GetUserAgent() -} - -func TestAuditEntry_GetVisibility(tt *testing.T) { - var zeroValue string - a := &AuditEntry{Visibility: &zeroValue} - a.GetVisibility() - a = &AuditEntry{} - a.GetVisibility() - a = nil - a.GetVisibility() -} - -func TestAuditEntry_GetWorkflowID(tt *testing.T) { +func TestAuditEntry_GetUserID(tt *testing.T) { var zeroValue int64 - a := &AuditEntry{WorkflowID: &zeroValue} - a.GetWorkflowID() + a := &AuditEntry{UserID: &zeroValue} + a.GetUserID() a = &AuditEntry{} - a.GetWorkflowID() + a.GetUserID() a = nil - a.GetWorkflowID() -} - -func TestAuditEntry_GetWorkflowRunID(tt *testing.T) { - var zeroValue int64 - a := &AuditEntry{WorkflowRunID: &zeroValue} - a.GetWorkflowRunID() - a = &AuditEntry{} - a.GetWorkflowRunID() - a = nil - a.GetWorkflowRunID() -} - -func TestAuditEntryData_GetOldLogin(tt *testing.T) { - var zeroValue string - a := &AuditEntryData{OldLogin: &zeroValue} - a.GetOldLogin() - a = &AuditEntryData{} - a.GetOldLogin() - a = nil - a.GetOldLogin() -} - -func TestAuditEntryData_GetOldName(tt *testing.T) { - var zeroValue string - a := &AuditEntryData{OldName: &zeroValue} - a.GetOldName() - a = &AuditEntryData{} - a.GetOldName() - a = nil - a.GetOldName() + a.GetUserID() } func TestAuthorization_GetApp(tt *testing.T) { @@ -17013,26 +16422,6 @@ func TestPlan_GetSpace(tt *testing.T) { p.GetSpace() } -func TestPolicyOverrideReason_GetCode(tt *testing.T) { - var zeroValue string - p := &PolicyOverrideReason{Code: &zeroValue} - p.GetCode() - p = &PolicyOverrideReason{} - p.GetCode() - p = nil - p.GetCode() -} - -func TestPolicyOverrideReason_GetMessage(tt *testing.T) { - var zeroValue string - p := &PolicyOverrideReason{Message: &zeroValue} - p.GetMessage() - p = &PolicyOverrideReason{} - p.GetMessage() - p = nil - p.GetMessage() -} - func TestPreReceiveHook_GetConfigURL(tt *testing.T) { var zeroValue string p := &PreReceiveHook{ConfigURL: &zeroValue} diff --git a/github/github_test.go b/github/github_test.go index 4d672f6096..45ac57c001 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -275,6 +275,13 @@ func testErrorResponseForStatusCode(t *testing.T, code int) { } } +func assertNoDiff(t *testing.T, want, got interface{}) { + t.Helper() + if diff := cmp.Diff(want, got); diff != "" { + t.Errorf("diff mismatch (-want +got):\n%v", diff) + } +} + func assertNilError(t *testing.T, err error) { t.Helper() if err != nil { diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index aa3591359e..28ac079bb3 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -7,6 +7,7 @@ package github import ( "context" + "encoding/json" "fmt" ) @@ -34,104 +35,94 @@ type ActorLocation struct { CountryCode *string `json:"country_code,omitempty"` } -// PolicyOverrideReason contains user-supplied information about why a policy was overridden. -type PolicyOverrideReason struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} - // AuditEntry describes the fields that may be represented by various audit-log "action" entries. +// There are many other fields that may be present depending on the action. You can access those +// in AdditionalFields. // For a list of actions see - https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions type AuditEntry struct { - ActorIP *string `json:"actor_ip,omitempty"` - Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. - Active *bool `json:"active,omitempty"` - ActiveWas *bool `json:"active_was,omitempty"` - Actor *string `json:"actor,omitempty"` // The actor who performed the action. - ActorLocation *ActorLocation `json:"actor_location,omitempty"` - BlockedUser *string `json:"blocked_user,omitempty"` - Business *string `json:"business,omitempty"` - CancelledAt *Timestamp `json:"cancelled_at,omitempty"` - CompletedAt *Timestamp `json:"completed_at,omitempty"` - Conclusion *string `json:"conclusion,omitempty"` - Config *HookConfig `json:"config,omitempty"` - ConfigWas *HookConfig `json:"config_was,omitempty"` - ContentType *string `json:"content_type,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - DeployKeyFingerprint *string `json:"deploy_key_fingerprint,omitempty"` - DocumentID *string `json:"_document_id,omitempty"` - Emoji *string `json:"emoji,omitempty"` - EnvironmentName *string `json:"environment_name,omitempty"` - Event *string `json:"event,omitempty"` - Events []string `json:"events,omitempty"` - EventsWere []string `json:"events_were,omitempty"` - Explanation *string `json:"explanation,omitempty"` - ExternalIdentityNameID *string `json:"external_identity_nameid,omitempty"` - ExternalIdentityUsername *string `json:"external_identity_username,omitempty"` - Fingerprint *string `json:"fingerprint,omitempty"` - HashedToken *string `json:"hashed_token,omitempty"` - HeadBranch *string `json:"head_branch,omitempty"` - HeadSHA *string `json:"head_sha,omitempty"` - HookID *int64 `json:"hook_id,omitempty"` - IsHostedRunner *bool `json:"is_hosted_runner,omitempty"` - JobName *string `json:"job_name,omitempty"` - JobWorkflowRef *string `json:"job_workflow_ref,omitempty"` - LimitedAvailability *bool `json:"limited_availability,omitempty"` - Message *string `json:"message,omitempty"` - Name *string `json:"name,omitempty"` - OAuthApplicationID *int64 `json:"oauth_application_id,omitempty"` - OldUser *string `json:"old_user,omitempty"` - OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. - OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"` - OperationType *string `json:"operation_type,omitempty"` - Org *string `json:"org,omitempty"` - OrgID *int64 `json:"org_id,omitempty"` - OverriddenCodes []string `json:"overridden_codes,omitempty"` - Permission *string `json:"permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`. - PreviousVisibility *string `json:"previous_visibility,omitempty"` - ProgrammaticAccessType *string `json:"programmatic_access_type,omitempty"` - PullRequestID *int64 `json:"pull_request_id,omitempty"` - PullRequestTitle *string `json:"pull_request_title,omitempty"` - PullRequestURL *string `json:"pull_request_url,omitempty"` - ReadOnly *string `json:"read_only,omitempty"` - Reasons []*PolicyOverrideReason `json:"reasons,omitempty"` - Referrer *string `json:"referrer,omitempty"` - Repo *string `json:"repo,omitempty"` - Repository *string `json:"repository,omitempty"` - RepositoryPublic *bool `json:"repository_public,omitempty"` - RunAttempt *int64 `json:"run_attempt,omitempty"` - RunnerGroupID *int64 `json:"runner_group_id,omitempty"` - RunnerGroupName *string `json:"runner_group_name,omitempty"` - RunnerID *int64 `json:"runner_id,omitempty"` - RunnerLabels []string `json:"runner_labels,omitempty"` - RunnerName *string `json:"runner_name,omitempty"` - RunNumber *int64 `json:"run_number,omitempty"` - SecretsPassed []string `json:"secrets_passed,omitempty"` - SourceVersion *string `json:"source_version,omitempty"` - StartedAt *Timestamp `json:"started_at,omitempty"` - TargetLogin *string `json:"target_login,omitempty"` - TargetVersion *string `json:"target_version,omitempty"` - Team *string `json:"team,omitempty"` - Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). - TokenID *int64 `json:"token_id,omitempty"` - TokenScopes *string `json:"token_scopes,omitempty"` - Topic *string `json:"topic,omitempty"` - TransportProtocolName *string `json:"transport_protocol_name,omitempty"` // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. - TransportProtocol *int `json:"transport_protocol,omitempty"` // The type of protocol (for example, HTTP=1 or SSH=2) used to transfer Git data. - TriggerID *int64 `json:"trigger_id,omitempty"` - User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). - UserAgent *string `json:"user_agent,omitempty"` - Visibility *string `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`. - WorkflowID *int64 `json:"workflow_id,omitempty"` - WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` - - Data *AuditEntryData `json:"data,omitempty"` + Action *string `json:"action,omitempty"` // The name of the action that was performed, for example `user.login` or `repo.create`. + Actor *string `json:"actor,omitempty"` // The actor who performed the action. + ActorID *int64 `json:"actor_id,omitempty"` + ActorLocation *ActorLocation `json:"actor_location,omitempty"` + Business *string `json:"business,omitempty"` + BusinessID *int64 `json:"business_id,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + DocumentID *string `json:"_document_id,omitempty"` + ExternalIdentityNameID *string `json:"external_identity_nameid,omitempty"` + ExternalIdentityUsername *string `json:"external_identity_username,omitempty"` + HashedToken *string `json:"hashed_token,omitempty"` + Org *string `json:"org,omitempty"` + OrgID *int64 `json:"org_id,omitempty"` + Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + TokenID *int64 `json:"token_id,omitempty"` + TokenScopes *string `json:"token_scopes,omitempty"` + User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). + UserID *int64 `json:"user_id,omitempty"` + + // Some events types have a data field that contains additional information about the event. + Data map[string]interface{} `json:"data,omitempty"` + + // All fields that are not explicitly defined in the struct are captured here. + AdditionalFields map[string]interface{} `json:"-"` +} + +func (a *AuditEntry) UnmarshalJSON(data []byte) error { + type entryAlias AuditEntry + var v entryAlias + if err := json.Unmarshal(data, &v); err != nil { + return err + } + + rawDefinedFields, err := json.Marshal(v) + if err != nil { + return err + } + definedFields := map[string]interface{}{} + if err := json.Unmarshal(rawDefinedFields, &definedFields); err != nil { + return err + } + + if err := json.Unmarshal(data, &v.AdditionalFields); err != nil { + return err + } + + for key, val := range v.AdditionalFields { + if _, ok := definedFields[key]; ok || val == nil { + delete(v.AdditionalFields, key) + } + } + + *a = AuditEntry(v) + if len(v.AdditionalFields) == 0 { + a.AdditionalFields = nil + } + return nil } -// AuditEntryData represents additional information stuffed into a `data` field. -type AuditEntryData struct { - OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change - OldLogin *string `json:"old_login,omitempty"` // The previous name of the organization, for a name change +func (a *AuditEntry) MarshalJSON() ([]byte, error) { + type entryAlias AuditEntry + v := entryAlias(*a) + defBytes, err := json.Marshal(v) + if err != nil { + return nil, err + } + if len(a.AdditionalFields) == 0 { + return defBytes, err + } + resMap := map[string]interface{}{} + if err := json.Unmarshal(defBytes, &resMap); err != nil { + return nil, err + } + for key, val := range a.AdditionalFields { + if val == nil { + continue + } + if _, ok := resMap[key]; ok { + return nil, fmt.Errorf("unexpected field in AdditionalFields: %v", key) + } + resMap[key] = val + } + return json.Marshal(resMap) } // GetAuditLog gets the audit-log entries for an organization. diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 1a82471fac..7c8de74c65 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -12,8 +12,6 @@ import ( "strings" "testing" "time" - - "github.com/google/go-cmp/cmp" ) func TestOrganizationService_GetAuditLog(t *testing.T) { @@ -24,46 +22,43 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { testMethod(t, r, "GET") fmt.Fprint(w, `[ - { + { + "@timestamp": 1615077308538, + "_document_id": "beeZYapIUe-wKg5-beadb33", + "action": "workflows.completed_workflow_run", + "active": true, + "actor": "testactor", "actor_ip": "10.0.0.1", "actor_location": { "country_code": "US" }, - "active": true, - "workflow_id": 123456, - "head_branch": "master", - "org": "o", - "trigger_id": null, - "repo": "o/blue-crayon-1", - "created_at": 1615077308538, + "cancelled_at": "2021-03-07T00:35:08.000Z", + "completed_at": "2021-03-07T00:35:08.000Z", + "conclusion": "success", + "config": { + "content_type": "json", + "insecure_ssl": "0", + "url": "https://example.com/deadbeef-new-hook" + }, + "created_at": 1615077308538, + "event": "schedule", + "events": ["code_scanning_alert"], "hashed_token": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", - "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", - "conclusion": "success", - "old_permission": "read", - "permission": "admin", - "actor": "testactor", - "completed_at": "2021-03-07T00:35:08.000Z", - "@timestamp": 1615077308538, - "name": "Code scanning - action", - "action": "workflows.completed_workflow_run", - "started_at": "2021-03-07T00:33:04.000Z", - "event": "schedule", - "workflow_run_id": 628312345, - "_document_id": "beeZYapIUe-wKg5-beadb33", - "run_attempt": 1, - "run_number": 1, - "token_id": 1, - "token_scopes": "gist,repo:read", - "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "head_branch": "master", + "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", "job_workflow_ref": "testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge", + "name": "Code scanning - action", "oauth_application_id": 1, + "old_permission": "read", + "org": "o", "org_id": 1, - "pull_request_id": 1, - "pull_request_title": "a pr title", - "pull_request_url": "https://github.com/testorg/testrepo/pull/1", "overridden_codes": [ "review_policy_not_satisfied" ], + "permission": "admin", + "pull_request_id": 1, + "pull_request_title": "a pr title", + "pull_request_url": "https://github.com/testorg/testrepo/pull/1", "reasons": [ { "code": "a code", @@ -71,14 +66,19 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { } ], "programmatic_access_type": "GitHub App server-to-server token", + "referrer": "a referrer", + "repo": "o/blue-crayon-1", + "run_attempt": 1, + "run_number": 1, + "started_at": "2021-03-07T00:33:04.000Z", + "token_id": 1, + "token_scopes": "gist,repo:read", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "trigger_id": null, "user_agent": "a user agent", - "config": { - "content_type": "json", - "insecure_ssl": "0", - "url": "https://example.com/deadbeef-new-hook" - }, - "events": ["code_scanning_alert"] - }]`) + "workflow_id": 123456, + "workflow_run_id": 628312345 + }]`) }) ctx := context.Background() getOpts := GetAuditLogOptions{ @@ -91,8 +91,6 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { if err != nil { t.Errorf("Organizations.GetAuditLog returned error: %v", err) } - startedAt, _ := time.Parse(time.RFC3339, "2021-03-07T00:33:04.000Z") - completedAt, _ := time.Parse(time.RFC3339, "2021-03-07T00:35:08.000Z") timestamp := time.Unix(0, 1615077308538*1e6) want := []*AuditEntry{ @@ -101,56 +99,58 @@ func TestOrganizationService_GetAuditLog(t *testing.T) { DocumentID: String("beeZYapIUe-wKg5-beadb33"), Action: String("workflows.completed_workflow_run"), Actor: String("testactor"), - ActorIP: String("10.0.0.1"), ActorLocation: &ActorLocation{ CountryCode: String("US"), }, - Active: Bool(true), - CompletedAt: &Timestamp{completedAt}, - Conclusion: String("success"), - CreatedAt: &Timestamp{timestamp}, - Event: String("schedule"), - HashedToken: String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="), - HeadBranch: String("master"), - HeadSHA: String("5acdeadbeef64d1a62388e901e5cdc9358644b37"), - JobWorkflowRef: String("testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge"), - Name: String("Code scanning - action"), - OAuthApplicationID: Int64(1), - OldPermission: String("read"), - Org: String("o"), - OrgID: Int64(1), - OverriddenCodes: []string{"review_policy_not_satisfied"}, - Permission: String("admin"), - ProgrammaticAccessType: String("GitHub App server-to-server token"), - PullRequestID: Int64(1), - PullRequestTitle: String("a pr title"), - PullRequestURL: String("https://github.com/testorg/testrepo/pull/1"), - Reasons: []*PolicyOverrideReason{{ - Code: String("a code"), - Message: String("a message"), - }}, - Repo: String("o/blue-crayon-1"), - RunAttempt: Int64(1), - RunNumber: Int64(1), - StartedAt: &Timestamp{startedAt}, - TokenID: Int64(1), - TokenScopes: String("gist,repo:read"), - Topic: String("cp1-iad.ingest.github.actions.v0.WorkflowUpdate"), - UserAgent: String("a user agent"), - WorkflowID: Int64(123456), - WorkflowRunID: Int64(628312345), - Events: []string{"code_scanning_alert"}, - Config: &HookConfig{ - ContentType: String("json"), - InsecureSSL: String("0"), - URL: String("https://example.com/deadbeef-new-hook"), + CreatedAt: &Timestamp{timestamp}, + HashedToken: String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="), + Org: String("o"), + OrgID: Int64(1), + TokenID: Int64(1), + TokenScopes: String("gist,repo:read"), + AdditionalFields: map[string]interface{}{ + "actor_ip": "10.0.0.1", + "active": true, + "cancelled_at": "2021-03-07T00:35:08.000Z", + "completed_at": "2021-03-07T00:35:08.000Z", + "conclusion": "success", + "event": "schedule", + "head_branch": "master", + "head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37", + "job_workflow_ref": "testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge", + "name": "Code scanning - action", + "oauth_application_id": float64(1), + "old_permission": "read", + "overridden_codes": []interface{}{"review_policy_not_satisfied"}, + "permission": "admin", + "programmatic_access_type": "GitHub App server-to-server token", + "pull_request_id": float64(1), + "pull_request_title": "a pr title", + "pull_request_url": "https://github.com/testorg/testrepo/pull/1", + "reasons": []interface{}{map[string]interface{}{ + "code": "a code", + "message": "a message", + }}, + "referrer": "a referrer", + "repo": "o/blue-crayon-1", + "run_attempt": float64(1), + "run_number": float64(1), + "started_at": "2021-03-07T00:33:04.000Z", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "user_agent": "a user agent", + "workflow_id": float64(123456), + "workflow_run_id": float64(628312345), + "events": []interface{}{"code_scanning_alert"}, + "config": map[string]interface{}{ + "content_type": "json", + "insecure_ssl": "0", + "url": "https://example.com/deadbeef-new-hook", + }, }, }, } - if !cmp.Equal(auditEntries, want) { - t.Errorf("Organizations.GetAuditLog return \ngot: %+v,\nwant:%+v", auditEntries, want) - } + assertNoDiff(t, want, auditEntries) // assert query string has lower case params requestedQuery := resp.Request.URL.RawQuery @@ -224,86 +224,95 @@ func TestAuditEntry_Marshal(t *testing.T) { u := &AuditEntry{ Action: String("a"), - Active: Bool(false), - ActiveWas: Bool(false), Actor: String("ac"), - ActorIP: String("aip"), ActorLocation: &ActorLocation{CountryCode: String("alcc")}, - BlockedUser: String("bu"), Business: String("b"), - CancelledAt: &Timestamp{referenceTime}, - CompletedAt: &Timestamp{referenceTime}, - Conclusion: String("c"), - Config: &HookConfig{URL: String("s")}, - ConfigWas: &HookConfig{URL: String("s")}, - ContentType: String("ct"), CreatedAt: &Timestamp{referenceTime}, - DeployKeyFingerprint: String("dkf"), DocumentID: String("did"), - Emoji: String("e"), - EnvironmentName: String("en"), - Event: String("e"), - Events: []string{"s"}, - EventsWere: []string{"s"}, - Explanation: String("e"), ExternalIdentityNameID: String("ein"), ExternalIdentityUsername: String("eiu"), - Fingerprint: String("f"), HashedToken: String("ht"), - HeadBranch: String("hb"), - HeadSHA: String("hsha"), - HookID: Int64(1), - IsHostedRunner: Bool(false), - JobName: String("jn"), - LimitedAvailability: Bool(false), - Message: String("m"), - Name: String("n"), - OldPermission: String("op"), - OldUser: String("ou"), - OpenSSHPublicKey: String("osshpk"), Org: String("o"), OrgID: Int64(1), - Permission: String("p"), - PreviousVisibility: String("pv"), - ProgrammaticAccessType: String("pat"), - PullRequestID: Int64(1), - PullRequestTitle: String("prt"), - PullRequestURL: String("pru"), - Reasons: []*PolicyOverrideReason{{ - Code: String("c"), - Message: String("m"), - }}, - ReadOnly: String("ro"), - Repo: String("r"), - Repository: String("repo"), - RepositoryPublic: Bool(false), - RunAttempt: Int64(1), - RunnerGroupID: Int64(1), - RunnerGroupName: String("rgn"), - RunnerID: Int64(1), - RunnerLabels: []string{"s"}, - RunnerName: String("rn"), - SecretsPassed: []string{"s"}, - SourceVersion: String("sv"), - StartedAt: &Timestamp{referenceTime}, - TargetLogin: String("tl"), - TargetVersion: String("tv"), - Team: String("t"), - Timestamp: &Timestamp{referenceTime}, - TokenID: Int64(1), - TokenScopes: String("ts"), - Topic: String("tp"), - TransportProtocolName: String("tpn"), - TransportProtocol: Int(1), - TriggerID: Int64(1), - User: String("u"), - UserAgent: String("ua"), - Visibility: String("v"), - WorkflowID: Int64(1), - WorkflowRunID: Int64(1), - Data: &AuditEntryData{ - OldName: String("on"), - OldLogin: String("ol"), + Timestamp: &Timestamp{referenceTime}, + TokenID: Int64(1), + TokenScopes: String("ts"), + User: String("u"), + Data: map[string]interface{}{ + "old_name": "on", + "old_login": "ol", + }, + AdditionalFields: map[string]interface{}{ + "active": false, + "active_was": false, + "actor_ip": "aip", + "blocked_user": "bu", + "cancelled_at": "2021-03-07T00:35:08.000Z", + "completed_at": "2021-03-07T00:35:08.000Z", + "conclusion": "c", + "config": map[string]interface{}{ + "url": "s", + }, + "config_was": map[string]interface{}{ + "url": "s", + }, + "content_type": "ct", + "deploy_key_fingerprint": "dkf", + "emoji": "e", + "environment_name": "en", + "event": "e", + "events": []interface{}{"s"}, + "events_were": []interface{}{"s"}, + "explanation": "e", + "fingerprint": "f", + "head_branch": "hb", + "head_sha": "hsha", + "hook_id": float64(1), + "is_hosted_runner": false, + "job_name": "jn", + "limited_availability": false, + "message": "m", + "name": "n", + "old_permission": "op", + "old_user": "ou", + "openssh_public_key": "osshpk", + "permission": "p", + "previous_visibility": "pv", + "programmatic_access_type": "pat", + "pull_request_id": float64(1), + "pull_request_title": "prt", + "pull_request_url": "pru", + "read_only": "ro", + "reasons": []interface{}{ + map[string]interface{}{ + "code": "c", + "message": "m", + }, + }, + "referrer": "a referrer", + "repo": "r", + "repository": "repo", + "repository_public": false, + "run_attempt": 1, + "runner_group_id": 1, + "runner_group_name": "rgn", + "runner_id": 1, + "runner_labels": []interface{}{"s"}, + "runner_name": "rn", + "secrets_passed": []interface{}{"s"}, + "source_version": "sv", + "started_at": "2006-01-02T15:04:05Z", + "target_login": "tl", + "target_version": "tv", + "team": "t", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", + "transport_protocol": 1, + "transport_protocol_name": "tpn", + "trigger_id": 1, + "user_agent": "ua", + "visibility": "v", + "workflow_id": 1, + "workflow_run_id": 1, }, } @@ -318,8 +327,8 @@ func TestAuditEntry_Marshal(t *testing.T) { }, "blocked_user": "bu", "business": "b", - "cancelled_at": ` + referenceTimeStr + `, - "completed_at": ` + referenceTimeStr + `, + "cancelled_at": "2021-03-07T00:35:08.000Z", + "completed_at": "2021-03-07T00:35:08.000Z", "conclusion": "c", "config": { "url": "s" @@ -368,6 +377,7 @@ func TestAuditEntry_Marshal(t *testing.T) { "code": "c", "message": "m" }], + "referrer": "a referrer", "read_only": "ro", "repo": "r", "repository": "repo", @@ -391,7 +401,7 @@ func TestAuditEntry_Marshal(t *testing.T) { "@timestamp": ` + referenceTimeStr + `, "token_id": 1, "token_scopes": "ts", - "topic": "tp", + "topic": "cp1-iad.ingest.github.actions.v0.WorkflowUpdate", "transport_protocol_name": "tpn", "transport_protocol": 1, "trigger_id": 1, diff --git a/test/integration/audit_log_test.go b/test/integration/audit_log_test.go index 7819f9292f..639ea7a678 100644 --- a/test/integration/audit_log_test.go +++ b/test/integration/audit_log_test.go @@ -28,6 +28,6 @@ func TestOrganizationAuditLog(t *testing.T) { } for _, e := range entries { - t.Log(e.GetAction(), e.GetActor(), e.GetTimestamp(), e.GetUser(), e.GetActive()) + t.Log(e.GetAction(), e.GetActor(), e.GetTimestamp(), e.GetUser()) } }